/*===- TableGen'erated file -------------------------------------*- C++ -*-===*\
|*                                                                            *|
|* Op Definitions                                                             *|
|*                                                                            *|
|* Automatically generated file, do not edit!                                 *|
|*                                                                            *|
\*===----------------------------------------------------------------------===*/

#ifdef GET_OP_LIST
#undef GET_OP_LIST

::mlir::TF::AbsOp,
::mlir::TF::AcosOp,
::mlir::TF::AcoshOp,
::mlir::TF::AddNOp,
::mlir::TF::AddOp,
::mlir::TF::AddV2Op,
::mlir::TF::AdjustContrastv2Op,
::mlir::TF::AdjustHueOp,
::mlir::TF::AdjustSaturationOp,
::mlir::TF::AllOp,
::mlir::TF::AllToAllOp,
::mlir::TF::AngleOp,
::mlir::TF::AnonymousIteratorOp,
::mlir::TF::AnonymousIteratorV2Op,
::mlir::TF::AnonymousIteratorV3Op,
::mlir::TF::AnonymousMemoryCacheOp,
::mlir::TF::AnonymousMultiDeviceIteratorOp,
::mlir::TF::AnonymousRandomSeedGeneratorOp,
::mlir::TF::AnonymousSeedGeneratorOp,
::mlir::TF::AnyOp,
::mlir::TF::ApproximateEqualOp,
::mlir::TF::ArgMaxOp,
::mlir::TF::ArgMinOp,
::mlir::TF::AsStringOp,
::mlir::TF::AsinOp,
::mlir::TF::AsinhOp,
::mlir::TF::AssertOp,
::mlir::TF::AssignAddVariableOp,
::mlir::TF::AssignOp,
::mlir::TF::AssignSubVariableOp,
::mlir::TF::AssignVariableOp,
::mlir::TF::Atan2Op,
::mlir::TF::AtanOp,
::mlir::TF::AtanhOp,
::mlir::TF::AvgPool3DGradOp,
::mlir::TF::AvgPool3DOp,
::mlir::TF::AvgPoolGradOp,
::mlir::TF::AvgPoolOp,
::mlir::TF::BatchDatasetV2Op,
::mlir::TF::BatchFunctionOp,
::mlir::TF::BatchMatMulOp,
::mlir::TF::BatchMatMulV2Op,
::mlir::TF::BatchMatMulV3Op,
::mlir::TF::BatchNormWithGlobalNormalizationOp,
::mlir::TF::BatchToSpaceNDOp,
::mlir::TF::BatchToSpaceOp,
::mlir::TF::BesselI0eOp,
::mlir::TF::BesselI1eOp,
::mlir::TF::BetaincOp,
::mlir::TF::BiasAddGradOp,
::mlir::TF::BiasAddOp,
::mlir::TF::BiasAddV1Op,
::mlir::TF::BincountOp,
::mlir::TF::BitcastOp,
::mlir::TF::BitwiseAndOp,
::mlir::TF::BitwiseOrOp,
::mlir::TF::BitwiseXorOp,
::mlir::TF::BoostedTreesBucketizeOp,
::mlir::TF::BroadcastArgsOp,
::mlir::TF::BroadcastGradientArgsOp,
::mlir::TF::BroadcastToOp,
::mlir::TF::BucketizeOp,
::mlir::TF::CacheDatasetV2Op,
::mlir::TF::CaseOp,
::mlir::TF::CaseRegionOp,
::mlir::TF::CastOp,
::mlir::TF::CeilOp,
::mlir::TF::CheckNumericsOp,
::mlir::TF::CholeskyOp,
::mlir::TF::ClipByValueOp,
::mlir::TF::CloseSummaryWriterOp,
::mlir::TF::CollectiveBcastRecvOp,
::mlir::TF::CollectiveBcastSendOp,
::mlir::TF::CollectiveGatherOp,
::mlir::TF::CollectivePermuteOp,
::mlir::TF::CollectiveReduceOp,
::mlir::TF::CollectiveReduceV2Op,
::mlir::TF::ComplexAbsOp,
::mlir::TF::ComplexOp,
::mlir::TF::ConcatOffsetOp,
::mlir::TF::ConcatOp,
::mlir::TF::ConcatV2Op,
::mlir::TF::ConfigureAndInitializeGlobalTPUOp,
::mlir::TF::ConfigureDistributedTPUOp,
::mlir::TF::ConfigureTPUEmbeddingOp,
::mlir::TF::ConjOp,
::mlir::TF::ConjugateTransposeOp,
::mlir::TF::ConstOp,
::mlir::TF::Conv2DBackpropFilterOp,
::mlir::TF::Conv2DBackpropInputOp,
::mlir::TF::Conv2DOp,
::mlir::TF::Conv3DBackpropFilterV2Op,
::mlir::TF::Conv3DBackpropInputV2Op,
::mlir::TF::Conv3DOp,
::mlir::TF::CosOp,
::mlir::TF::CoshOp,
::mlir::TF::CreateSummaryDbWriterOp,
::mlir::TF::CreateSummaryFileWriterOp,
::mlir::TF::CrossOp,
::mlir::TF::CrossReplicaSumOp,
::mlir::TF::CumprodOp,
::mlir::TF::CumsumOp,
::mlir::TF::DataFormatDimMapOp,
::mlir::TF::DataFormatVecPermuteOp,
::mlir::TF::DebugIdentityV2Op,
::mlir::TF::DecodeAndCropJpegOp,
::mlir::TF::DecodeGifOp,
::mlir::TF::DecodeJpegOp,
::mlir::TF::DecodePaddedRawOp,
::mlir::TF::DecodePngOp,
::mlir::TF::DeleteIteratorOp,
::mlir::TF::DeleteMemoryCacheOp,
::mlir::TF::DeleteMultiDeviceIteratorOp,
::mlir::TF::DeleteRandomSeedGeneratorOp,
::mlir::TF::DeleteSeedGeneratorOp,
::mlir::TF::DepthToSpaceOp,
::mlir::TF::DepthwiseConv2dNativeBackpropFilterOp,
::mlir::TF::DepthwiseConv2dNativeBackpropInputOp,
::mlir::TF::DepthwiseConv2dNativeOp,
::mlir::TF::DequantizeOp,
::mlir::TF::DeserializeIteratorOp,
::mlir::TF::DeserializeSparseOp,
::mlir::TF::DestroyResourceOp,
::mlir::TF::DeviceIndexOp,
::mlir::TF::DiagOp,
::mlir::TF::DiagPartOp,
::mlir::TF::DigammaOp,
::mlir::TF::DivNoNanOp,
::mlir::TF::DivOp,
::mlir::TF::DummyMemoryCacheOp,
::mlir::TF::DummySeedGeneratorOp,
::mlir::TF::DynamicStitchOp,
::mlir::TF::EinsumOp,
::mlir::TF::EluGradOp,
::mlir::TF::EluOp,
::mlir::TF::EmptyOp,
::mlir::TF::EmptyTensorListOp,
::mlir::TF::EnqueueTPUEmbeddingArbitraryTensorBatchOp,
::mlir::TF::EnqueueTPUEmbeddingBatchOp,
::mlir::TF::EnqueueTPUEmbeddingIntegerBatchOp,
::mlir::TF::EnqueueTPUEmbeddingRaggedTensorBatchOp,
::mlir::TF::EnqueueTPUEmbeddingSparseBatchOp,
::mlir::TF::EnqueueTPUEmbeddingSparseTensorBatchOp,
::mlir::TF::EnsureShapeOp,
::mlir::TF::EqualOp,
::mlir::TF::ErfOp,
::mlir::TF::ErfcOp,
::mlir::TF::ErfinvOp,
::mlir::TF::ExpOp,
::mlir::TF::ExpandDimsOp,
::mlir::TF::Expm1Op,
::mlir::TF::ExtractImagePatchesOp,
::mlir::TF::FFT2DOp,
::mlir::TF::FFT3DOp,
::mlir::TF::FFTOp,
::mlir::TF::FakeParamOp,
::mlir::TF::FakeQuantWithMinMaxArgsGradientOp,
::mlir::TF::FakeQuantWithMinMaxArgsOp,
::mlir::TF::FakeQuantWithMinMaxVarsGradientOp,
::mlir::TF::FakeQuantWithMinMaxVarsOp,
::mlir::TF::FakeQuantWithMinMaxVarsPerChannelGradientOp,
::mlir::TF::FakeQuantWithMinMaxVarsPerChannelOp,
::mlir::TF::FillOp,
::mlir::TF::FinalizeDatasetOp,
::mlir::TF::FlatMapDatasetOp,
::mlir::TF::FloorDivOp,
::mlir::TF::FloorModOp,
::mlir::TF::FloorOp,
::mlir::TF::FlushSummaryWriterOp,
::mlir::TF::FusedBatchNormGradOp,
::mlir::TF::FusedBatchNormGradV2Op,
::mlir::TF::FusedBatchNormGradV3Op,
::mlir::TF::FusedBatchNormOp,
::mlir::TF::FusedBatchNormV2Op,
::mlir::TF::FusedBatchNormV3Op,
::mlir::TF::GatherNdOp,
::mlir::TF::GatherOp,
::mlir::TF::GatherV2Op,
::mlir::TF::GeneratorDatasetOp,
::mlir::TF::GreaterEqualOp,
::mlir::TF::GreaterOp,
::mlir::TF::HSVToRGBOp,
::mlir::TF::HashTableOp,
::mlir::TF::HashTableV2Op,
::mlir::TF::IFFT2DOp,
::mlir::TF::IFFT3DOp,
::mlir::TF::IFFTOp,
::mlir::TF::IRFFT2DOp,
::mlir::TF::IRFFT3DOp,
::mlir::TF::IRFFTOp,
::mlir::TF::IdentityNOp,
::mlir::TF::IdentityOp,
::mlir::TF::IfOp,
::mlir::TF::IfRegionOp,
::mlir::TF::IgammaGradAOp,
::mlir::TF::IgammaOp,
::mlir::TF::IgammacOp,
::mlir::TF::ImagOp,
::mlir::TF::ImportEventOp,
::mlir::TF::InTopKV2Op,
::mlir::TF::InfeedDequeueOp,
::mlir::TF::InfeedDequeueTupleOp,
::mlir::TF::InfeedEnqueueTupleOp,
::mlir::TF::InitializeTableFromDatasetOp,
::mlir::TF::InitializeTableFromTextFileOp,
::mlir::TF::InitializeTableFromTextFileV2Op,
::mlir::TF::InitializeTableOp,
::mlir::TF::InitializeTableV2Op,
::mlir::TF::InplaceAddOp,
::mlir::TF::InplaceUpdateOp,
::mlir::TF::InvOp,
::mlir::TF::InvertOp,
::mlir::TF::InvertPermutationOp,
::mlir::TF::IsFiniteOp,
::mlir::TF::IsInfOp,
::mlir::TF::IsNanOp,
::mlir::TF::IteratorFromStringHandleOp,
::mlir::TF::IteratorFromStringHandleV2Op,
::mlir::TF::IteratorGetNextAsOptionalOp,
::mlir::TF::IteratorGetNextOp,
::mlir::TF::IteratorGetNextSyncOp,
::mlir::TF::IteratorOp,
::mlir::TF::IteratorToStringHandleOp,
::mlir::TF::IteratorV2Op,
::mlir::TF::KthOrderStatisticOp,
::mlir::TF::L2LossOp,
::mlir::TF::LRNGradOp,
::mlir::TF::LRNOp,
::mlir::TF::LeakyReluGradOp,
::mlir::TF::LeakyReluOp,
::mlir::TF::LeftShiftOp,
::mlir::TF::LegacyCallOp,
::mlir::TF::LessEqualOp,
::mlir::TF::LessOp,
::mlir::TF::LgammaOp,
::mlir::TF::LinSpaceOp,
::mlir::TF::ListDiffOp,
::mlir::TF::LoadTPUEmbeddingADAMParametersGradAccumDebugOp,
::mlir::TF::LoadTPUEmbeddingADAMParametersOp,
::mlir::TF::LoadTPUEmbeddingAdadeltaParametersGradAccumDebugOp,
::mlir::TF::LoadTPUEmbeddingAdadeltaParametersOp,
::mlir::TF::LoadTPUEmbeddingAdagradParametersGradAccumDebugOp,
::mlir::TF::LoadTPUEmbeddingAdagradParametersOp,
::mlir::TF::LoadTPUEmbeddingCenteredRMSPropParametersOp,
::mlir::TF::LoadTPUEmbeddingFTRLParametersGradAccumDebugOp,
::mlir::TF::LoadTPUEmbeddingFTRLParametersOp,
::mlir::TF::LoadTPUEmbeddingMDLAdagradLightParametersOp,
::mlir::TF::LoadTPUEmbeddingMomentumParametersGradAccumDebugOp,
::mlir::TF::LoadTPUEmbeddingMomentumParametersOp,
::mlir::TF::LoadTPUEmbeddingProximalAdagradParametersGradAccumDebugOp,
::mlir::TF::LoadTPUEmbeddingProximalAdagradParametersOp,
::mlir::TF::LoadTPUEmbeddingProximalYogiParametersGradAccumDebugOp,
::mlir::TF::LoadTPUEmbeddingProximalYogiParametersOp,
::mlir::TF::LoadTPUEmbeddingRMSPropParametersGradAccumDebugOp,
::mlir::TF::LoadTPUEmbeddingRMSPropParametersOp,
::mlir::TF::LoadTPUEmbeddingStochasticGradientDescentParametersGradAccumDebugOp,
::mlir::TF::LoadTPUEmbeddingStochasticGradientDescentParametersOp,
::mlir::TF::Log1pOp,
::mlir::TF::LogOp,
::mlir::TF::LogSoftmaxOp,
::mlir::TF::LogicalAndOp,
::mlir::TF::LogicalNotOp,
::mlir::TF::LogicalOrOp,
::mlir::TF::LookupTableExportV2Op,
::mlir::TF::LookupTableFindOp,
::mlir::TF::LookupTableFindV2Op,
::mlir::TF::LookupTableImportV2Op,
::mlir::TF::LookupTableInsertV2Op,
::mlir::TF::LookupTableRemoveV2Op,
::mlir::TF::LookupTableSizeOp,
::mlir::TF::LookupTableSizeV2Op,
::mlir::TF::LowerBoundOp,
::mlir::TF::MakeIteratorOp,
::mlir::TF::MakeUniqueOp,
::mlir::TF::MapAndBatchDatasetOp,
::mlir::TF::MapDatasetOp,
::mlir::TF::MatMulOp,
::mlir::TF::MatrixBandPartOp,
::mlir::TF::MatrixDiagOp,
::mlir::TF::MatrixDiagPartV3Op,
::mlir::TF::MatrixDiagV2Op,
::mlir::TF::MatrixDiagV3Op,
::mlir::TF::MatrixInverseOp,
::mlir::TF::MatrixSetDiagOp,
::mlir::TF::MatrixSetDiagV2Op,
::mlir::TF::MatrixSetDiagV3Op,
::mlir::TF::MatrixSolveOp,
::mlir::TF::MatrixTriangularSolveOp,
::mlir::TF::MaxOp,
::mlir::TF::MaxPool3DGradGradOp,
::mlir::TF::MaxPool3DGradOp,
::mlir::TF::MaxPool3DOp,
::mlir::TF::MaxPoolGradGradOp,
::mlir::TF::MaxPoolGradGradV2Op,
::mlir::TF::MaxPoolGradOp,
::mlir::TF::MaxPoolGradV2Op,
::mlir::TF::MaxPoolOp,
::mlir::TF::MaxPoolV2Op,
::mlir::TF::MaximumOp,
::mlir::TF::MeanOp,
::mlir::TF::MergeSummaryOp,
::mlir::TF::MergeV2CheckpointsOp,
::mlir::TF::MinOp,
::mlir::TF::MinimumOp,
::mlir::TF::MirrorPadGradOp,
::mlir::TF::MirrorPadOp,
::mlir::TF::MlirLocalVarOp,
::mlir::TF::MlirPassthroughOp,
::mlir::TF::ModOp,
::mlir::TF::ModelDatasetOp,
::mlir::TF::MulNoNanOp,
::mlir::TF::MulOp,
::mlir::TF::MultiDeviceIteratorFromStringHandleOp,
::mlir::TF::MultiDeviceIteratorGetNextFromShardOp,
::mlir::TF::MultiDeviceIteratorInitOp,
::mlir::TF::MultiDeviceIteratorOp,
::mlir::TF::MultiDeviceIteratorToStringHandleOp,
::mlir::TF::MultinomialOp,
::mlir::TF::MutableDenseHashTableV2Op,
::mlir::TF::MutableHashTableOfTensorsV2Op,
::mlir::TF::MutableHashTableV2Op,
::mlir::TF::NdtriOp,
::mlir::TF::NegOp,
::mlir::TF::NextAfterOp,
::mlir::TF::NoOp,
::mlir::TF::NonMaxSuppressionV3Op,
::mlir::TF::NonMaxSuppressionV4Op,
::mlir::TF::NonMaxSuppressionV5Op,
::mlir::TF::NotEqualOp,
::mlir::TF::OneHotOp,
::mlir::TF::OneShotIteratorOp,
::mlir::TF::OnesLikeOp,
::mlir::TF::OptimizeDatasetV2Op,
::mlir::TF::OptionalFromValueOp,
::mlir::TF::OptionalGetValueOp,
::mlir::TF::OptionalHasValueOp,
::mlir::TF::OptionalNoneOp,
::mlir::TF::OutfeedEnqueueTupleOp,
::mlir::TF::PackOp,
::mlir::TF::PadOp,
::mlir::TF::PadV2Op,
::mlir::TF::ParallelDynamicStitchOp,
::mlir::TF::ParallelMapDatasetOp,
::mlir::TF::ParallelMapDatasetV2Op,
::mlir::TF::ParameterizedTruncatedNormalOp,
::mlir::TF::ParseExampleOp,
::mlir::TF::ParseExampleV2Op,
::mlir::TF::PartitionedCallOp,
::mlir::TF::PlaceholderOp,
::mlir::TF::PlaceholderWithDefaultOp,
::mlir::TF::PolygammaOp,
::mlir::TF::PopulationCountOp,
::mlir::TF::PowOp,
::mlir::TF::PrefetchDatasetOp,
::mlir::TF::PreventGradientOp,
::mlir::TF::PrintOp,
::mlir::TF::PrintV2Op,
::mlir::TF::ProdOp,
::mlir::TF::QrOp,
::mlir::TF::QuantizeAndDequantizeOp,
::mlir::TF::QuantizeAndDequantizeV2Op,
::mlir::TF::QuantizeAndDequantizeV3Op,
::mlir::TF::QuantizeAndDequantizeV4Op,
::mlir::TF::QueueDequeueV2Op,
::mlir::TF::RFFT2DOp,
::mlir::TF::RFFT3DOp,
::mlir::TF::RFFTOp,
::mlir::TF::RGBToHSVOp,
::mlir::TF::RaggedGatherOp,
::mlir::TF::RaggedRangeOp,
::mlir::TF::RandomGammaGradOp,
::mlir::TF::RandomGammaOp,
::mlir::TF::RandomPoissonOp,
::mlir::TF::RandomPoissonV2Op,
::mlir::TF::RandomShuffleOp,
::mlir::TF::RandomStandardNormalOp,
::mlir::TF::RandomUniformIntOp,
::mlir::TF::RandomUniformOp,
::mlir::TF::RangeDatasetOp,
::mlir::TF::RangeOp,
::mlir::TF::RankOp,
::mlir::TF::ReadVariableOp,
::mlir::TF::RealDivOp,
::mlir::TF::RealOp,
::mlir::TF::ReciprocalGradOp,
::mlir::TF::ReciprocalOp,
::mlir::TF::RecvOp,
::mlir::TF::RecvTPUEmbeddingActivationsOp,
::mlir::TF::ReduceDatasetOp,
::mlir::TF::ReduceJoinOp,
::mlir::TF::Relu6GradOp,
::mlir::TF::Relu6Op,
::mlir::TF::ReluGradOp,
::mlir::TF::ReluOp,
::mlir::TF::RemoteCallOp,
::mlir::TF::RepeatDatasetOp,
::mlir::TF::ReshapeOp,
::mlir::TF::ResizeBilinearGradOp,
::mlir::TF::ResizeBilinearOp,
::mlir::TF::ResizeNearestNeighborGradOp,
::mlir::TF::ResizeNearestNeighborOp,
::mlir::TF::ResourceApplyAdaMaxOp,
::mlir::TF::ResourceApplyAdadeltaOp,
::mlir::TF::ResourceApplyAdagradDAOp,
::mlir::TF::ResourceApplyAdagradOp,
::mlir::TF::ResourceApplyAdagradV2Op,
::mlir::TF::ResourceApplyAdamOp,
::mlir::TF::ResourceApplyAddSignOp,
::mlir::TF::ResourceApplyCenteredRMSPropOp,
::mlir::TF::ResourceApplyFtrlOp,
::mlir::TF::ResourceApplyFtrlV2Op,
::mlir::TF::ResourceApplyGradientDescentOp,
::mlir::TF::ResourceApplyKerasMomentumOp,
::mlir::TF::ResourceApplyMomentumOp,
::mlir::TF::ResourceApplyPowerSignOp,
::mlir::TF::ResourceApplyProximalAdagradOp,
::mlir::TF::ResourceApplyProximalGradientDescentOp,
::mlir::TF::ResourceApplyRMSPropOp,
::mlir::TF::ResourceGatherOp,
::mlir::TF::ResourceScatterAddOp,
::mlir::TF::ResourceScatterDivOp,
::mlir::TF::ResourceScatterMaxOp,
::mlir::TF::ResourceScatterMinOp,
::mlir::TF::ResourceScatterMulOp,
::mlir::TF::ResourceScatterNdAddOp,
::mlir::TF::ResourceScatterNdSubOp,
::mlir::TF::ResourceScatterNdUpdateOp,
::mlir::TF::ResourceScatterSubOp,
::mlir::TF::ResourceScatterUpdateOp,
::mlir::TF::ResourceStridedSliceAssignOp,
::mlir::TF::RestoreOp,
::mlir::TF::RestoreV2Op,
::mlir::TF::RetrieveTPUEmbeddingADAMParametersGradAccumDebugOp,
::mlir::TF::RetrieveTPUEmbeddingADAMParametersOp,
::mlir::TF::RetrieveTPUEmbeddingAdadeltaParametersGradAccumDebugOp,
::mlir::TF::RetrieveTPUEmbeddingAdadeltaParametersOp,
::mlir::TF::RetrieveTPUEmbeddingAdagradParametersGradAccumDebugOp,
::mlir::TF::RetrieveTPUEmbeddingAdagradParametersOp,
::mlir::TF::RetrieveTPUEmbeddingCenteredRMSPropParametersOp,
::mlir::TF::RetrieveTPUEmbeddingFTRLParametersGradAccumDebugOp,
::mlir::TF::RetrieveTPUEmbeddingFTRLParametersOp,
::mlir::TF::RetrieveTPUEmbeddingMDLAdagradLightParametersOp,
::mlir::TF::RetrieveTPUEmbeddingMomentumParametersGradAccumDebugOp,
::mlir::TF::RetrieveTPUEmbeddingMomentumParametersOp,
::mlir::TF::RetrieveTPUEmbeddingProximalAdagradParametersGradAccumDebugOp,
::mlir::TF::RetrieveTPUEmbeddingProximalAdagradParametersOp,
::mlir::TF::RetrieveTPUEmbeddingProximalYogiParametersGradAccumDebugOp,
::mlir::TF::RetrieveTPUEmbeddingProximalYogiParametersOp,
::mlir::TF::RetrieveTPUEmbeddingRMSPropParametersGradAccumDebugOp,
::mlir::TF::RetrieveTPUEmbeddingRMSPropParametersOp,
::mlir::TF::RetrieveTPUEmbeddingStochasticGradientDescentParametersGradAccumDebugOp,
::mlir::TF::RetrieveTPUEmbeddingStochasticGradientDescentParametersOp,
::mlir::TF::ReverseOp,
::mlir::TF::ReverseSequenceOp,
::mlir::TF::ReverseV2Op,
::mlir::TF::RightShiftOp,
::mlir::TF::RintOp,
::mlir::TF::RiscAddOp,
::mlir::TF::RiscDotOp,
::mlir::TF::RngReadAndSkipOp,
::mlir::TF::RollOp,
::mlir::TF::RoundOp,
::mlir::TF::RsqrtGradOp,
::mlir::TF::RsqrtOp,
::mlir::TF::SaveOp,
::mlir::TF::SaveSlicesOp,
::mlir::TF::SaveV2Op,
::mlir::TF::ScatterNdOp,
::mlir::TF::SegmentMaxOp,
::mlir::TF::SegmentMeanOp,
::mlir::TF::SegmentMinOp,
::mlir::TF::SegmentProdOp,
::mlir::TF::SegmentSumOp,
::mlir::TF::SelectOp,
::mlir::TF::SelectV2Op,
::mlir::TF::SelfAdjointEigV2Op,
::mlir::TF::SeluGradOp,
::mlir::TF::SeluOp,
::mlir::TF::SendOp,
::mlir::TF::SendTPUEmbeddingGradientsOp,
::mlir::TF::SerializeIteratorOp,
::mlir::TF::SerializeSparseOp,
::mlir::TF::SetStaticDimensionBoundsOp,
::mlir::TF::ShapeNOp,
::mlir::TF::ShapeOp,
::mlir::TF::ShardedFilenameOp,
::mlir::TF::ShuffleAndRepeatDatasetV2Op,
::mlir::TF::ShuffleDatasetV2Op,
::mlir::TF::ShuffleDatasetV3Op,
::mlir::TF::ShutdownDistributedTPUOp,
::mlir::TF::ShutdownTPUSystemOp,
::mlir::TF::SigmoidGradOp,
::mlir::TF::SigmoidOp,
::mlir::TF::SignOp,
::mlir::TF::SinOp,
::mlir::TF::SinhOp,
::mlir::TF::SizeOp,
::mlir::TF::SliceOp,
::mlir::TF::SnapshotOp,
::mlir::TF::SoftmaxCrossEntropyWithLogitsOp,
::mlir::TF::SoftmaxOp,
::mlir::TF::SoftplusGradOp,
::mlir::TF::SoftplusOp,
::mlir::TF::SoftsignGradOp,
::mlir::TF::SoftsignOp,
::mlir::TF::SpaceToBatchNDOp,
::mlir::TF::SpaceToBatchOp,
::mlir::TF::SpaceToDepthOp,
::mlir::TF::SparseAddOp,
::mlir::TF::SparseFillEmptyRowsOp,
::mlir::TF::SparseMatMulOp,
::mlir::TF::SparseReduceSumOp,
::mlir::TF::SparseReshapeOp,
::mlir::TF::SparseSegmentMeanGradOp,
::mlir::TF::SparseSegmentMeanOp,
::mlir::TF::SparseSegmentMeanWithNumSegmentsOp,
::mlir::TF::SparseSegmentSqrtNGradOp,
::mlir::TF::SparseSegmentSqrtNOp,
::mlir::TF::SparseSegmentSqrtNWithNumSegmentsOp,
::mlir::TF::SparseSegmentSumOp,
::mlir::TF::SparseSoftmaxCrossEntropyWithLogitsOp,
::mlir::TF::SparseTensorDenseMatMulOp,
::mlir::TF::SparseToDenseOp,
::mlir::TF::SplitOp,
::mlir::TF::SplitVOp,
::mlir::TF::SqrtGradOp,
::mlir::TF::SqrtOp,
::mlir::TF::SquareOp,
::mlir::TF::SquaredDifferenceOp,
::mlir::TF::SqueezeOp,
::mlir::TF::StackCloseV2Op,
::mlir::TF::StackPopV2Op,
::mlir::TF::StackPushV2Op,
::mlir::TF::StackV2Op,
::mlir::TF::StatefulPartitionedCallOp,
::mlir::TF::StatefulStandardNormalV2Op,
::mlir::TF::StatefulTruncatedNormalOp,
::mlir::TF::StatefulUniformFullIntOp,
::mlir::TF::StatefulUniformIntOp,
::mlir::TF::StatefulUniformOp,
::mlir::TF::StatelessMultinomialOp,
::mlir::TF::StatelessParameterizedTruncatedNormalOp,
::mlir::TF::StatelessRandomBinomialOp,
::mlir::TF::StatelessRandomGammaV2Op,
::mlir::TF::StatelessRandomGetAlgOp,
::mlir::TF::StatelessRandomGetKeyCounterAlgOp,
::mlir::TF::StatelessRandomGetKeyCounterOp,
::mlir::TF::StatelessRandomNormalOp,
::mlir::TF::StatelessRandomNormalV2Op,
::mlir::TF::StatelessRandomPoissonOp,
::mlir::TF::StatelessRandomUniformFullIntOp,
::mlir::TF::StatelessRandomUniformFullIntV2Op,
::mlir::TF::StatelessRandomUniformIntOp,
::mlir::TF::StatelessRandomUniformIntV2Op,
::mlir::TF::StatelessRandomUniformOp,
::mlir::TF::StatelessRandomUniformV2Op,
::mlir::TF::StatelessTruncatedNormalOp,
::mlir::TF::StatelessTruncatedNormalV2Op,
::mlir::TF::StaticRegexFullMatchOp,
::mlir::TF::StopGradientOp,
::mlir::TF::StridedSliceGradOp,
::mlir::TF::StridedSliceOp,
::mlir::TF::StringFormatOp,
::mlir::TF::StringJoinOp,
::mlir::TF::StringStripOp,
::mlir::TF::StringToHashBucketFastOp,
::mlir::TF::SubOp,
::mlir::TF::SumOp,
::mlir::TF::SummaryWriterOp,
::mlir::TF::SvdOp,
::mlir::TF::SymbolicGradientOp,
::mlir::TF::TPUCompilationResultOp,
::mlir::TF::TPUCompileMlirAndExecuteOp,
::mlir::TF::TPUCompileSucceededAssertOp,
::mlir::TF::TPUCopyWithLayoutOp,
::mlir::TF::TPUEmbeddingActivationsOp,
::mlir::TF::TPUExecuteAndUpdateVariablesOp,
::mlir::TF::TPUExecuteOp,
::mlir::TF::TPUGetLayoutOp,
::mlir::TF::TPUOrdinalSelectorOp,
::mlir::TF::TPUPartitionedCallOp,
::mlir::TF::TPUPartitionedInputOp,
::mlir::TF::TPUPartitionedOutputOp,
::mlir::TF::TPUReplicateMetadataOp,
::mlir::TF::TPUReplicatedInputOp,
::mlir::TF::TPUReplicatedOutputOp,
::mlir::TF::TPUReshardVariablesOp,
::mlir::TF::TPURoundRobinOp,
::mlir::TF::TakeDatasetOp,
::mlir::TF::TakeWhileDatasetOp,
::mlir::TF::TanOp,
::mlir::TF::TanhGradOp,
::mlir::TF::TanhOp,
::mlir::TF::TensorArrayCloseV3Op,
::mlir::TF::TensorArrayConcatV3Op,
::mlir::TF::TensorArrayGatherV3Op,
::mlir::TF::TensorArrayGradV3Op,
::mlir::TF::TensorArrayReadV3Op,
::mlir::TF::TensorArrayScatterV3Op,
::mlir::TF::TensorArraySizeV3Op,
::mlir::TF::TensorArraySplitV3Op,
::mlir::TF::TensorArrayV3Op,
::mlir::TF::TensorArrayWriteV3Op,
::mlir::TF::TensorListConcatV2Op,
::mlir::TF::TensorListElementShapeOp,
::mlir::TF::TensorListFromTensorOp,
::mlir::TF::TensorListGatherOp,
::mlir::TF::TensorListGetItemOp,
::mlir::TF::TensorListLengthOp,
::mlir::TF::TensorListPopBackOp,
::mlir::TF::TensorListPushBackOp,
::mlir::TF::TensorListReserveOp,
::mlir::TF::TensorListResizeOp,
::mlir::TF::TensorListScatterIntoExistingListOp,
::mlir::TF::TensorListSetItemOp,
::mlir::TF::TensorListStackOp,
::mlir::TF::TensorScatterAddOp,
::mlir::TF::TensorScatterMaxOp,
::mlir::TF::TensorScatterMinOp,
::mlir::TF::TensorScatterSubOp,
::mlir::TF::TensorScatterUpdateOp,
::mlir::TF::TensorSliceDatasetOp,
::mlir::TF::TensorStridedSliceUpdateOp,
::mlir::TF::TileOp,
::mlir::TF::TimestampOp,
::mlir::TF::ToBoolOp,
::mlir::TF::TopKUniqueOp,
::mlir::TF::TopKV2Op,
::mlir::TF::TopKWithUniqueOp,
::mlir::TF::TransposeOp,
::mlir::TF::TridiagonalSolveOp,
::mlir::TF::TruncateDivOp,
::mlir::TF::TruncateModOp,
::mlir::TF::TruncatedNormalOp,
::mlir::TF::UncompressElementOp,
::mlir::TF::UniqueOp,
::mlir::TF::UnpackOp,
::mlir::TF::UnsortedSegmentMaxOp,
::mlir::TF::UnsortedSegmentMinOp,
::mlir::TF::UnsortedSegmentProdOp,
::mlir::TF::UnsortedSegmentSumOp,
::mlir::TF::UpperBoundOp,
::mlir::TF::VarHandleOp,
::mlir::TF::VarIsInitializedOp,
::mlir::TF::VariableOp,
::mlir::TF::VariableShapeOp,
::mlir::TF::VariableV2Op,
::mlir::TF::WhereOp,
::mlir::TF::WhileOp,
::mlir::TF::WhileRegionOp,
::mlir::TF::WriteAudioSummaryOp,
::mlir::TF::WriteGraphSummaryOp,
::mlir::TF::WriteHistogramSummaryOp,
::mlir::TF::WriteImageSummaryOp,
::mlir::TF::WriteRawProtoSummaryOp,
::mlir::TF::WriteScalarSummaryOp,
::mlir::TF::WriteSummaryOp,
::mlir::TF::XdivyOp,
::mlir::TF::XlaAllReduceOp,
::mlir::TF::XlaBroadcastHelperOp,
::mlir::TF::XlaClusterOutputOp,
::mlir::TF::XlaConvOp,
::mlir::TF::XlaConvV2Op,
::mlir::TF::XlaDotOp,
::mlir::TF::XlaDotV2Op,
::mlir::TF::XlaDynamicSliceOp,
::mlir::TF::XlaDynamicUpdateSliceOp,
::mlir::TF::XlaEinsumOp,
::mlir::TF::XlaGatherOp,
::mlir::TF::XlaHostComputeOp,
::mlir::TF::XlaKeyValueSortOp,
::mlir::TF::XlaPadOp,
::mlir::TF::XlaRecvFromHostOp,
::mlir::TF::XlaReduceOp,
::mlir::TF::XlaReduceScatterOp,
::mlir::TF::XlaReduceWindowOp,
::mlir::TF::XlaRemoveDynamicDimensionSizeOp,
::mlir::TF::XlaReplicaIdOp,
::mlir::TF::XlaRngBitGeneratorOp,
::mlir::TF::XlaScatterOp,
::mlir::TF::XlaSelectAndScatterOp,
::mlir::TF::XlaSelfAdjointEigOp,
::mlir::TF::XlaSendToHostOp,
::mlir::TF::XlaSetDynamicDimensionSizeOp,
::mlir::TF::XlaShardingOp,
::mlir::TF::XlaSortOp,
::mlir::TF::XlaSvdOp,
::mlir::TF::XlaVariadicReduceOp,
::mlir::TF::XlaVariadicReduceV2Op,
::mlir::TF::XlaVariadicSortOp,
::mlir::TF::Xlog1pyOp,
::mlir::TF::XlogyOp,
::mlir::TF::YieldOp,
::mlir::TF::ZerosLikeOp,
::mlir::TF::ZetaOp,
::mlir::TF::_ArrayToListOp,
::mlir::TF::_EagerConstOp,
::mlir::TF::_FusedBatchNormExOp,
::mlir::TF::_FusedConv2DOp,
::mlir::TF::_FusedMatMulOp,
::mlir::TF::_HostRecvOp,
::mlir::TF::_HostSendOp,
::mlir::TF::_InternalTestMustExecuteTrait_,
::mlir::TF::_InternalTestNonResourceValueSideEffects_,
::mlir::TF::_ListToArrayOp,
::mlir::TF::_RecvTPUEmbeddingActivationsOp,
::mlir::TF::_RecvTPUEmbeddingDeduplicationDataOp,
::mlir::TF::_SendTPUEmbeddingGradientsOp,
::mlir::TF::_TPUCompileMlirOp,
::mlir::TF::_TPUCompileMlirPlaceholderProgramKeyOp,
::mlir::TF::_TPUDeviceOrdinalPlaceholderOp,
::mlir::TF::_UnaryOpsCompositionOp,
::mlir::TF::_XlaHostComputeMlirOp,
::mlir::TF::_XlaRecvAtHostOp,
::mlir::TF::_XlaRecvAtHostV2Op,
::mlir::TF::_XlaSendFromHostOp,
::mlir::TF::_XlaSendFromHostV2Op
#endif  // GET_OP_LIST

#ifdef GET_OP_CLASSES
#undef GET_OP_CLASSES


//===----------------------------------------------------------------------===//
// Local Utility Method Definitions
//===----------------------------------------------------------------------===//

namespace mlir {
namespace TF {

static ::mlir::LogicalResult __mlir_ods_local_type_constraint_tf_ops0(
    ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
    unsigned valueIndex) {
  if (!(((type.isa<::mlir::TensorType>())) && ([](::mlir::Type elementType) { return (((elementType.isBF16())) || ((elementType.isa<mlir::TF::Bfloat16RefType>()))) || (((elementType.isF16())) || ((elementType.isa<mlir::TF::HalfRefType>()))) || (((elementType.isF32())) || ((elementType.isa<mlir::TF::FloatRefType>()))) || (((elementType.isF64())) || ((elementType.isa<mlir::TF::DoubleRefType>()))) || (((elementType.isSignlessInteger(16))) || ((elementType.isa<mlir::TF::Int16RefType>()))) || (((elementType.isSignlessInteger(32))) || ((elementType.isa<mlir::TF::Int32RefType>()))) || (((elementType.isSignlessInteger(64))) || ((elementType.isa<mlir::TF::Int64RefType>()))) || (((elementType.isSignlessInteger(8))) || ((elementType.isa<mlir::TF::Int8RefType>()))); }(type.cast<::mlir::ShapedType>().getElementType())))) {
    return op->emitOpError(valueKind) << " #" << valueIndex
        << " must be tensor of bfloat16 or 16-bit float or 32-bit float or 64-bit float or 16-bit integer or 32-bit integer or 64-bit integer or 8-bit integer values, but got " << type;
  }
  return ::mlir::success();
}

static ::mlir::LogicalResult __mlir_ods_local_type_constraint_tf_ops1(
    ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
    unsigned valueIndex) {
  if (!(((type.isa<::mlir::TensorType>())) && ([](::mlir::Type elementType) { return (((elementType.isBF16())) || ((elementType.isa<mlir::TF::Bfloat16RefType>()))) || ((((elementType.isa<::mlir::ComplexType>())) && ((elementType.cast<::mlir::ComplexType>().getElementType().isF64()))) || ((elementType.isa<mlir::TF::Complex128RefType>()))) || ((((elementType.isa<::mlir::ComplexType>())) && ((elementType.cast<::mlir::ComplexType>().getElementType().isF32()))) || ((elementType.isa<mlir::TF::Complex64RefType>()))) || (((elementType.isF16())) || ((elementType.isa<mlir::TF::HalfRefType>()))) || (((elementType.isF32())) || ((elementType.isa<mlir::TF::FloatRefType>()))) || (((elementType.isF64())) || ((elementType.isa<mlir::TF::DoubleRefType>()))) || (((elementType.isSignlessInteger(16))) || ((elementType.isa<mlir::TF::Int16RefType>()))) || (((elementType.isSignlessInteger(32))) || ((elementType.isa<mlir::TF::Int32RefType>()))) || (((elementType.isSignlessInteger(64))) || ((elementType.isa<mlir::TF::Int64RefType>()))) || (((elementType.isSignlessInteger(8))) || ((elementType.isa<mlir::TF::Int8RefType>()))); }(type.cast<::mlir::ShapedType>().getElementType())))) {
    return op->emitOpError(valueKind) << " #" << valueIndex
        << " must be tensor of bfloat16 or 128-bit complex or 64-bit complex or 16-bit float or 32-bit float or 64-bit float or 16-bit integer or 32-bit integer or 64-bit integer or 8-bit integer values, but got " << type;
  }
  return ::mlir::success();
}

static ::mlir::LogicalResult __mlir_ods_local_type_constraint_tf_ops2(
    ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
    unsigned valueIndex) {
  if (!(((type.isa<::mlir::TensorType>())) && ([](::mlir::Type elementType) { return ((((elementType.isF16())) || ((elementType.isa<mlir::TF::HalfRefType>()))) || (((elementType.isF32())) || ((elementType.isa<mlir::TF::FloatRefType>()))) || (((elementType.isF64())) || ((elementType.isa<mlir::TF::DoubleRefType>()))) || (((elementType.isBF16())) || ((elementType.isa<mlir::TF::Bfloat16RefType>())))) || (((((elementType.isa<::mlir::ComplexType>())) && ((elementType.cast<::mlir::ComplexType>().getElementType().isF32()))) || ((elementType.isa<mlir::TF::Complex64RefType>()))) || ((((elementType.isa<::mlir::ComplexType>())) && ((elementType.cast<::mlir::ComplexType>().getElementType().isF64()))) || ((elementType.isa<mlir::TF::Complex128RefType>())))); }(type.cast<::mlir::ShapedType>().getElementType())))) {
    return op->emitOpError(valueKind) << " #" << valueIndex
        << " must be tensor of floating-point or complex values, but got " << type;
  }
  return ::mlir::success();
}

static ::mlir::LogicalResult __mlir_ods_local_type_constraint_tf_ops3(
    ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
    unsigned valueIndex) {
  if (!(((type.isa<::mlir::TensorType>())) && ([](::mlir::Type elementType) { return (((elementType.isBF16())) || ((elementType.isa<mlir::TF::Bfloat16RefType>()))) || ((((elementType.isa<::mlir::ComplexType>())) && ((elementType.cast<::mlir::ComplexType>().getElementType().isF64()))) || ((elementType.isa<mlir::TF::Complex128RefType>()))) || ((((elementType.isa<::mlir::ComplexType>())) && ((elementType.cast<::mlir::ComplexType>().getElementType().isF32()))) || ((elementType.isa<mlir::TF::Complex64RefType>()))) || (((elementType.isF16())) || ((elementType.isa<mlir::TF::HalfRefType>()))) || (((elementType.isF32())) || ((elementType.isa<mlir::TF::FloatRefType>()))) || (((elementType.isF64())) || ((elementType.isa<mlir::TF::DoubleRefType>()))) || (((elementType.isSignlessInteger(16))) || ((elementType.isa<mlir::TF::Int16RefType>()))) || (((elementType.isSignlessInteger(32))) || ((elementType.isa<mlir::TF::Int32RefType>()))) || (((elementType.isSignlessInteger(64))) || ((elementType.isa<mlir::TF::Int64RefType>()))) || (((elementType.isSignlessInteger(8))) || ((elementType.isa<mlir::TF::Int8RefType>()))) || (((elementType.isa<mlir::TF::Qint32Type>())) || ((elementType.isa<mlir::TF::Qint32RefType>()))) || (((elementType.isa<mlir::TF::Qint8Type>())) || ((elementType.isa<mlir::TF::Qint8RefType>()))) || (((elementType.isa<mlir::TF::Quint8Type>())) || ((elementType.isa<mlir::TF::Quint8RefType>()))) || (((elementType.isUnsignedInteger(16))) || ((elementType.isa<mlir::TF::Uint16RefType>()))) || (((elementType.isUnsignedInteger(32))) || ((elementType.isa<mlir::TF::Uint32RefType>()))) || (((elementType.isUnsignedInteger(64))) || ((elementType.isa<mlir::TF::Uint64RefType>()))) || (((elementType.isUnsignedInteger(8))) || ((elementType.isa<mlir::TF::Uint8RefType>()))) || (((elementType.isa<mlir::TF::VariantType>())) || ((elementType.isa<mlir::TF::VariantRefType>()))); }(type.cast<::mlir::ShapedType>().getElementType())))) {
    return op->emitOpError(valueKind) << " #" << valueIndex
        << " must be tensor of bfloat16 or 128-bit complex or 64-bit complex or 16-bit float or 32-bit float or 64-bit float or 16-bit integer or 32-bit integer or 64-bit integer or 8-bit integer or 32-bit quantized integer or 8-bit quantized integer or 8-bit quantized unsigned integer or 16-bit unsigned integer or 32-bit unsigned integer or 64-bit unsigned integer or 8-bit unsigned integer or variant values, but got " << type;
  }
  return ::mlir::success();
}

static ::mlir::LogicalResult __mlir_ods_local_type_constraint_tf_ops4(
    ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
    unsigned valueIndex) {
  if (!(((type.isa<::mlir::TensorType>())) && ([](::mlir::Type elementType) { return ((((elementType.isF16())) || ((elementType.isa<mlir::TF::HalfRefType>()))) || (((elementType.isF32())) || ((elementType.isa<mlir::TF::FloatRefType>()))) || (((elementType.isF64())) || ((elementType.isa<mlir::TF::DoubleRefType>()))) || (((elementType.isBF16())) || ((elementType.isa<mlir::TF::Bfloat16RefType>())))) || ((((elementType.isSignlessInteger(8))) || ((elementType.isa<mlir::TF::Int8RefType>()))) || (((elementType.isSignlessInteger(16))) || ((elementType.isa<mlir::TF::Int16RefType>()))) || (((elementType.isSignlessInteger(32))) || ((elementType.isa<mlir::TF::Int32RefType>()))) || (((elementType.isSignlessInteger(64))) || ((elementType.isa<mlir::TF::Int64RefType>())))) || (((((elementType.isa<::mlir::ComplexType>())) && ((elementType.cast<::mlir::ComplexType>().getElementType().isF32()))) || ((elementType.isa<mlir::TF::Complex64RefType>()))) || ((((elementType.isa<::mlir::ComplexType>())) && ((elementType.cast<::mlir::ComplexType>().getElementType().isF64()))) || ((elementType.isa<mlir::TF::Complex128RefType>())))) || (((elementType.isUnsignedInteger(8))) || ((elementType.isa<mlir::TF::Uint8RefType>()))) || (((elementType.isa<mlir::TF::StringType>())) || ((elementType.isa<mlir::TF::StringRefType>()))); }(type.cast<::mlir::ShapedType>().getElementType())))) {
    return op->emitOpError(valueKind) << " #" << valueIndex
        << " must be tensor of floating-point or signed integer or complex or 8-bit unsigned integer or string values, but got " << type;
  }
  return ::mlir::success();
}

static ::mlir::LogicalResult __mlir_ods_local_type_constraint_tf_ops5(
    ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
    unsigned valueIndex) {
  if (!(((type.isa<::mlir::TensorType>())) && ([](::mlir::Type elementType) { return (((elementType.isBF16())) || ((elementType.isa<mlir::TF::Bfloat16RefType>()))) || ((((elementType.isa<::mlir::ComplexType>())) && ((elementType.cast<::mlir::ComplexType>().getElementType().isF64()))) || ((elementType.isa<mlir::TF::Complex128RefType>()))) || ((((elementType.isa<::mlir::ComplexType>())) && ((elementType.cast<::mlir::ComplexType>().getElementType().isF32()))) || ((elementType.isa<mlir::TF::Complex64RefType>()))) || (((elementType.isF16())) || ((elementType.isa<mlir::TF::HalfRefType>()))) || (((elementType.isF32())) || ((elementType.isa<mlir::TF::FloatRefType>()))) || (((elementType.isF64())) || ((elementType.isa<mlir::TF::DoubleRefType>()))) || (((elementType.isSignlessInteger(16))) || ((elementType.isa<mlir::TF::Int16RefType>()))) || (((elementType.isSignlessInteger(32))) || ((elementType.isa<mlir::TF::Int32RefType>()))) || (((elementType.isSignlessInteger(64))) || ((elementType.isa<mlir::TF::Int64RefType>()))) || (((elementType.isSignlessInteger(8))) || ((elementType.isa<mlir::TF::Int8RefType>()))) || (((elementType.isUnsignedInteger(16))) || ((elementType.isa<mlir::TF::Uint16RefType>()))) || (((elementType.isUnsignedInteger(32))) || ((elementType.isa<mlir::TF::Uint32RefType>()))) || (((elementType.isUnsignedInteger(64))) || ((elementType.isa<mlir::TF::Uint64RefType>()))) || (((elementType.isUnsignedInteger(8))) || ((elementType.isa<mlir::TF::Uint8RefType>()))); }(type.cast<::mlir::ShapedType>().getElementType())))) {
    return op->emitOpError(valueKind) << " #" << valueIndex
        << " must be tensor of bfloat16 or 128-bit complex or 64-bit complex or 16-bit float or 32-bit float or 64-bit float or 16-bit integer or 32-bit integer or 64-bit integer or 8-bit integer or 16-bit unsigned integer or 32-bit unsigned integer or 64-bit unsigned integer or 8-bit unsigned integer values, but got " << type;
  }
  return ::mlir::success();
}

static ::mlir::LogicalResult __mlir_ods_local_type_constraint_tf_ops6(
    ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
    unsigned valueIndex) {
  if (!(((type.isa<::mlir::TensorType>())) && ([](::mlir::Type elementType) { return (((elementType.isF16())) || ((elementType.isa<mlir::TF::HalfRefType>()))) || (((elementType.isF32())) || ((elementType.isa<mlir::TF::FloatRefType>()))); }(type.cast<::mlir::ShapedType>().getElementType())))) {
    return op->emitOpError(valueKind) << " #" << valueIndex
        << " must be tensor of 16-bit float or 32-bit float values, but got " << type;
  }
  return ::mlir::success();
}

static ::mlir::LogicalResult __mlir_ods_local_type_constraint_tf_ops7(
    ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
    unsigned valueIndex) {
  if (!(((type.isa<::mlir::TensorType>())) && ([](::mlir::Type elementType) { return ((elementType.isF32())) || ((elementType.isa<mlir::TF::FloatRefType>())); }(type.cast<::mlir::ShapedType>().getElementType())))) {
    return op->emitOpError(valueKind) << " #" << valueIndex
        << " must be tensor of 32-bit float values, but got " << type;
  }
  return ::mlir::success();
}

static ::mlir::LogicalResult __mlir_ods_local_type_constraint_tf_ops8(
    ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
    unsigned valueIndex) {
  if (!(((type.isa<::mlir::TensorType>())) && ([](::mlir::Type elementType) { return ((elementType.isSignlessInteger(1))) || ((elementType.isa<mlir::TF::BoolRefType>())); }(type.cast<::mlir::ShapedType>().getElementType())))) {
    return op->emitOpError(valueKind) << " #" << valueIndex
        << " must be tensor of bool values, but got " << type;
  }
  return ::mlir::success();
}

static ::mlir::LogicalResult __mlir_ods_local_type_constraint_tf_ops9(
    ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
    unsigned valueIndex) {
  if (!(((type.isa<::mlir::TensorType>())) && ([](::mlir::Type elementType) { return ((elementType.isSignlessInteger(32))) || ((elementType.isSignlessInteger(64))) || ((elementType.isa<mlir::TF::Int32RefType>())) || ((elementType.isa<mlir::TF::Int64RefType>())); }(type.cast<::mlir::ShapedType>().getElementType())))) {
    return op->emitOpError(valueKind) << " #" << valueIndex
        << " must be tensor of 32/64-bit signed integer values, but got " << type;
  }
  return ::mlir::success();
}

static ::mlir::LogicalResult __mlir_ods_local_type_constraint_tf_ops10(
    ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
    unsigned valueIndex) {
  if (!(((type.isa<::mlir::TensorType>())) && ([](::mlir::Type elementType) { return (((elementType.isBF16())) || ((elementType.isa<mlir::TF::Bfloat16RefType>()))) || (((elementType.isSignlessInteger(1))) || ((elementType.isa<mlir::TF::BoolRefType>()))) || ((((elementType.isa<::mlir::ComplexType>())) && ((elementType.cast<::mlir::ComplexType>().getElementType().isF64()))) || ((elementType.isa<mlir::TF::Complex128RefType>()))) || ((((elementType.isa<::mlir::ComplexType>())) && ((elementType.cast<::mlir::ComplexType>().getElementType().isF32()))) || ((elementType.isa<mlir::TF::Complex64RefType>()))) || (((elementType.isF16())) || ((elementType.isa<mlir::TF::HalfRefType>()))) || (((elementType.isF32())) || ((elementType.isa<mlir::TF::FloatRefType>()))) || (((elementType.isF64())) || ((elementType.isa<mlir::TF::DoubleRefType>()))) || (((elementType.isSignlessInteger(16))) || ((elementType.isa<mlir::TF::Int16RefType>()))) || (((elementType.isSignlessInteger(32))) || ((elementType.isa<mlir::TF::Int32RefType>()))) || (((elementType.isSignlessInteger(64))) || ((elementType.isa<mlir::TF::Int64RefType>()))) || (((elementType.isSignlessInteger(8))) || ((elementType.isa<mlir::TF::Int8RefType>()))) || (((elementType.isa<mlir::TF::Qint32Type>())) || ((elementType.isa<mlir::TF::Qint32RefType>()))) || (((elementType.isa<mlir::TF::Qint8Type>())) || ((elementType.isa<mlir::TF::Qint8RefType>()))) || (((elementType.isa<mlir::TF::Quint8Type>())) || ((elementType.isa<mlir::TF::Quint8RefType>()))) || (((elementType.isUnsignedInteger(16))) || ((elementType.isa<mlir::TF::Uint16RefType>()))) || (((elementType.isUnsignedInteger(32))) || ((elementType.isa<mlir::TF::Uint32RefType>()))) || (((elementType.isUnsignedInteger(64))) || ((elementType.isa<mlir::TF::Uint64RefType>()))) || (((elementType.isUnsignedInteger(8))) || ((elementType.isa<mlir::TF::Uint8RefType>()))); }(type.cast<::mlir::ShapedType>().getElementType())))) {
    return op->emitOpError(valueKind) << " #" << valueIndex
        << " must be tensor of bfloat16 or bool or 128-bit complex or 64-bit complex or 16-bit float or 32-bit float or 64-bit float or 16-bit integer or 32-bit integer or 64-bit integer or 8-bit integer or 32-bit quantized integer or 8-bit quantized integer or 8-bit quantized unsigned integer or 16-bit unsigned integer or 32-bit unsigned integer or 64-bit unsigned integer or 8-bit unsigned integer values, but got " << type;
  }
  return ::mlir::success();
}

static ::mlir::LogicalResult __mlir_ods_local_type_constraint_tf_ops11(
    ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
    unsigned valueIndex) {
  if (!(((type.isa<::mlir::TensorType>())) && ([](::mlir::Type elementType) { return ((elementType.isSignlessInteger(32))) || ((elementType.isa<mlir::TF::Int32RefType>())); }(type.cast<::mlir::ShapedType>().getElementType())))) {
    return op->emitOpError(valueKind) << " #" << valueIndex
        << " must be tensor of 32-bit integer values, but got " << type;
  }
  return ::mlir::success();
}

static ::mlir::LogicalResult __mlir_ods_local_type_constraint_tf_ops12(
    ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
    unsigned valueIndex) {
  if (!(((type.isa<::mlir::TensorType>())) && ([](::mlir::Type elementType) { return ((((elementType.isa<::mlir::ComplexType>())) && ((elementType.cast<::mlir::ComplexType>().getElementType().isF64()))) || ((elementType.isa<mlir::TF::Complex128RefType>()))) || ((((elementType.isa<::mlir::ComplexType>())) && ((elementType.cast<::mlir::ComplexType>().getElementType().isF32()))) || ((elementType.isa<mlir::TF::Complex64RefType>()))); }(type.cast<::mlir::ShapedType>().getElementType())))) {
    return op->emitOpError(valueKind) << " #" << valueIndex
        << " must be tensor of 128-bit complex or 64-bit complex values, but got " << type;
  }
  return ::mlir::success();
}

static ::mlir::LogicalResult __mlir_ods_local_type_constraint_tf_ops13(
    ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
    unsigned valueIndex) {
  if (!(((type.isa<::mlir::TensorType>())) && ([](::mlir::Type elementType) { return (((elementType.isF32())) || ((elementType.isa<mlir::TF::FloatRefType>()))) || (((elementType.isF64())) || ((elementType.isa<mlir::TF::DoubleRefType>()))); }(type.cast<::mlir::ShapedType>().getElementType())))) {
    return op->emitOpError(valueKind) << " #" << valueIndex
        << " must be tensor of 32/64-bit float values, but got " << type;
  }
  return ::mlir::success();
}

static ::mlir::LogicalResult __mlir_ods_local_type_constraint_tf_ops14(
    ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
    unsigned valueIndex) {
  if (!(((type.isa<::mlir::TensorType>())) && ([](::mlir::Type elementType) { return ((elementType.isa<mlir::TF::ResourceType>())) || ((elementType.isa<mlir::TF::ResourceRefType>())); }(type.cast<::mlir::ShapedType>().getElementType())))) {
    return op->emitOpError(valueKind) << " #" << valueIndex
        << " must be tensor of resource values, but got " << type;
  }
  return ::mlir::success();
}

static ::mlir::LogicalResult __mlir_ods_local_type_constraint_tf_ops15(
    ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
    unsigned valueIndex) {
  if (!(((type.isa<::mlir::TensorType>())) && ([](::mlir::Type elementType) { return ((elementType.isa<mlir::TF::VariantType>())) || ((elementType.isa<mlir::TF::VariantRefType>())); }(type.cast<::mlir::ShapedType>().getElementType())))) {
    return op->emitOpError(valueKind) << " #" << valueIndex
        << " must be tensor of variant values, but got " << type;
  }
  return ::mlir::success();
}

static ::mlir::LogicalResult __mlir_ods_local_type_constraint_tf_ops16(
    ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
    unsigned valueIndex) {
  if (!(((type.isa<::mlir::TensorType>())) && ([](::mlir::Type elementType) { return ((elementType.isSignlessInteger(64))) || ((elementType.isa<mlir::TF::Int64RefType>())); }(type.cast<::mlir::ShapedType>().getElementType())))) {
    return op->emitOpError(valueKind) << " #" << valueIndex
        << " must be tensor of 64-bit integer values, but got " << type;
  }
  return ::mlir::success();
}

static ::mlir::LogicalResult __mlir_ods_local_type_constraint_tf_ops17(
    ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
    unsigned valueIndex) {
  if (!(((type.isa<::mlir::TensorType>())) && ([](::mlir::Type elementType) { return (((elementType.isBF16())) || ((elementType.isa<mlir::TF::Bfloat16RefType>()))) || ((((elementType.isa<::mlir::ComplexType>())) && ((elementType.cast<::mlir::ComplexType>().getElementType().isF64()))) || ((elementType.isa<mlir::TF::Complex128RefType>()))) || ((((elementType.isa<::mlir::ComplexType>())) && ((elementType.cast<::mlir::ComplexType>().getElementType().isF32()))) || ((elementType.isa<mlir::TF::Complex64RefType>()))) || (((elementType.isF16())) || ((elementType.isa<mlir::TF::HalfRefType>()))) || (((elementType.isF32())) || ((elementType.isa<mlir::TF::FloatRefType>()))) || (((elementType.isF64())) || ((elementType.isa<mlir::TF::DoubleRefType>()))) || (((elementType.isSignlessInteger(16))) || ((elementType.isa<mlir::TF::Int16RefType>()))) || (((elementType.isSignlessInteger(32))) || ((elementType.isa<mlir::TF::Int32RefType>()))) || (((elementType.isSignlessInteger(64))) || ((elementType.isa<mlir::TF::Int64RefType>()))) || (((elementType.isSignlessInteger(8))) || ((elementType.isa<mlir::TF::Int8RefType>()))) || (((elementType.isa<mlir::TF::Qint32Type>())) || ((elementType.isa<mlir::TF::Qint32RefType>()))) || (((elementType.isa<mlir::TF::Qint8Type>())) || ((elementType.isa<mlir::TF::Qint8RefType>()))) || (((elementType.isa<mlir::TF::Quint8Type>())) || ((elementType.isa<mlir::TF::Quint8RefType>()))) || (((elementType.isUnsignedInteger(16))) || ((elementType.isa<mlir::TF::Uint16RefType>()))) || (((elementType.isUnsignedInteger(32))) || ((elementType.isa<mlir::TF::Uint32RefType>()))) || (((elementType.isUnsignedInteger(64))) || ((elementType.isa<mlir::TF::Uint64RefType>()))) || (((elementType.isUnsignedInteger(8))) || ((elementType.isa<mlir::TF::Uint8RefType>()))); }(type.cast<::mlir::ShapedType>().getElementType())))) {
    return op->emitOpError(valueKind) << " #" << valueIndex
        << " must be tensor of bfloat16 or 128-bit complex or 64-bit complex or 16-bit float or 32-bit float or 64-bit float or 16-bit integer or 32-bit integer or 64-bit integer or 8-bit integer or 32-bit quantized integer or 8-bit quantized integer or 8-bit quantized unsigned integer or 16-bit unsigned integer or 32-bit unsigned integer or 64-bit unsigned integer or 8-bit unsigned integer values, but got " << type;
  }
  return ::mlir::success();
}

static ::mlir::LogicalResult __mlir_ods_local_type_constraint_tf_ops18(
    ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
    unsigned valueIndex) {
  if (!(((type.isa<::mlir::TensorType>())) && ([](::mlir::Type elementType) { return (((elementType.isBF16())) || ((elementType.isa<mlir::TF::Bfloat16RefType>()))) || (((elementType.isSignlessInteger(1))) || ((elementType.isa<mlir::TF::BoolRefType>()))) || ((((elementType.isa<::mlir::ComplexType>())) && ((elementType.cast<::mlir::ComplexType>().getElementType().isF64()))) || ((elementType.isa<mlir::TF::Complex128RefType>()))) || ((((elementType.isa<::mlir::ComplexType>())) && ((elementType.cast<::mlir::ComplexType>().getElementType().isF32()))) || ((elementType.isa<mlir::TF::Complex64RefType>()))) || (((elementType.isF16())) || ((elementType.isa<mlir::TF::HalfRefType>()))) || (((elementType.isF32())) || ((elementType.isa<mlir::TF::FloatRefType>()))) || (((elementType.isF64())) || ((elementType.isa<mlir::TF::DoubleRefType>()))) || (((elementType.isSignlessInteger(16))) || ((elementType.isa<mlir::TF::Int16RefType>()))) || (((elementType.isSignlessInteger(32))) || ((elementType.isa<mlir::TF::Int32RefType>()))) || (((elementType.isSignlessInteger(64))) || ((elementType.isa<mlir::TF::Int64RefType>()))) || (((elementType.isSignlessInteger(8))) || ((elementType.isa<mlir::TF::Int8RefType>()))) || (((elementType.isUnsignedInteger(16))) || ((elementType.isa<mlir::TF::Uint16RefType>()))) || (((elementType.isUnsignedInteger(32))) || ((elementType.isa<mlir::TF::Uint32RefType>()))) || (((elementType.isUnsignedInteger(64))) || ((elementType.isa<mlir::TF::Uint64RefType>()))) || (((elementType.isUnsignedInteger(8))) || ((elementType.isa<mlir::TF::Uint8RefType>()))) || (((elementType.isa<mlir::TF::VariantType>())) || ((elementType.isa<mlir::TF::VariantRefType>()))); }(type.cast<::mlir::ShapedType>().getElementType())))) {
    return op->emitOpError(valueKind) << " #" << valueIndex
        << " must be tensor of bfloat16 or bool or 128-bit complex or 64-bit complex or 16-bit float or 32-bit float or 64-bit float or 16-bit integer or 32-bit integer or 64-bit integer or 8-bit integer or 16-bit unsigned integer or 32-bit unsigned integer or 64-bit unsigned integer or 8-bit unsigned integer or variant values, but got " << type;
  }
  return ::mlir::success();
}

static ::mlir::LogicalResult __mlir_ods_local_type_constraint_tf_ops19(
    ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
    unsigned valueIndex) {
  if (!(((type.isa<::mlir::TensorType>())) && ([](::mlir::Type elementType) { return ((elementType.isa<mlir::TF::StringType>())) || ((elementType.isa<mlir::TF::StringRefType>())); }(type.cast<::mlir::ShapedType>().getElementType())))) {
    return op->emitOpError(valueKind) << " #" << valueIndex
        << " must be tensor of string values, but got " << type;
  }
  return ::mlir::success();
}

static ::mlir::LogicalResult __mlir_ods_local_type_constraint_tf_ops20(
    ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
    unsigned valueIndex) {
  if (!(((type.isa<::mlir::TensorType>())) && ([](::mlir::Type elementType) { return ((((elementType.isF16())) || ((elementType.isa<mlir::TF::HalfRefType>()))) || (((elementType.isF32())) || ((elementType.isa<mlir::TF::FloatRefType>()))) || (((elementType.isF64())) || ((elementType.isa<mlir::TF::DoubleRefType>()))) || (((elementType.isBF16())) || ((elementType.isa<mlir::TF::Bfloat16RefType>())))) || (((((elementType.isa<::mlir::ComplexType>())) && ((elementType.cast<::mlir::ComplexType>().getElementType().isF32()))) || ((elementType.isa<mlir::TF::Complex64RefType>()))) || ((((elementType.isa<::mlir::ComplexType>())) && ((elementType.cast<::mlir::ComplexType>().getElementType().isF64()))) || ((elementType.isa<mlir::TF::Complex128RefType>())))) || (((((elementType.isSignlessInteger(8))) || ((elementType.isa<mlir::TF::Int8RefType>()))) || (((elementType.isSignlessInteger(16))) || ((elementType.isa<mlir::TF::Int16RefType>()))) || (((elementType.isSignlessInteger(32))) || ((elementType.isa<mlir::TF::Int32RefType>()))) || (((elementType.isSignlessInteger(64))) || ((elementType.isa<mlir::TF::Int64RefType>())))) || ((((elementType.isUnsignedInteger(8))) || ((elementType.isa<mlir::TF::Uint8RefType>()))) || (((elementType.isUnsignedInteger(16))) || ((elementType.isa<mlir::TF::Uint16RefType>()))) || (((elementType.isUnsignedInteger(32))) || ((elementType.isa<mlir::TF::Uint32RefType>()))) || (((elementType.isUnsignedInteger(64))) || ((elementType.isa<mlir::TF::Uint64RefType>()))))) || (((elementType.isSignlessInteger(1))) || ((elementType.isa<mlir::TF::BoolRefType>()))) || ((elementType.isa<mlir::TF::TensorFlowType>())); }(type.cast<::mlir::ShapedType>().getElementType())))) {
    return op->emitOpError(valueKind) << " #" << valueIndex
        << " must be tensor of tf.dtype values, but got " << type;
  }
  return ::mlir::success();
}

static ::mlir::LogicalResult __mlir_ods_local_type_constraint_tf_ops21(
    ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
    unsigned valueIndex) {
  if (!(((type.isa<::mlir::TensorType>())) && ([](::mlir::Type elementType) { return (((elementType.isF16())) || ((elementType.isa<mlir::TF::HalfRefType>()))) || (((elementType.isF32())) || ((elementType.isa<mlir::TF::FloatRefType>()))) || (((elementType.isF64())) || ((elementType.isa<mlir::TF::DoubleRefType>()))) || (((elementType.isBF16())) || ((elementType.isa<mlir::TF::Bfloat16RefType>()))); }(type.cast<::mlir::ShapedType>().getElementType())))) {
    return op->emitOpError(valueKind) << " #" << valueIndex
        << " must be tensor of floating-point values, but got " << type;
  }
  return ::mlir::success();
}

static ::mlir::LogicalResult __mlir_ods_local_type_constraint_tf_ops22(
    ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
    unsigned valueIndex) {
  if (!(((type.isa<::mlir::TensorType>())) && ([](::mlir::Type elementType) { return (((elementType.isBF16())) || ((elementType.isa<mlir::TF::Bfloat16RefType>()))) || ((((elementType.isa<::mlir::ComplexType>())) && ((elementType.cast<::mlir::ComplexType>().getElementType().isF64()))) || ((elementType.isa<mlir::TF::Complex128RefType>()))) || ((((elementType.isa<::mlir::ComplexType>())) && ((elementType.cast<::mlir::ComplexType>().getElementType().isF32()))) || ((elementType.isa<mlir::TF::Complex64RefType>()))) || (((elementType.isF16())) || ((elementType.isa<mlir::TF::HalfRefType>()))) || (((elementType.isF32())) || ((elementType.isa<mlir::TF::FloatRefType>()))) || (((elementType.isF64())) || ((elementType.isa<mlir::TF::DoubleRefType>()))) || (((elementType.isSignlessInteger(32))) || ((elementType.isa<mlir::TF::Int32RefType>()))) || (((elementType.isSignlessInteger(64))) || ((elementType.isa<mlir::TF::Int64RefType>()))); }(type.cast<::mlir::ShapedType>().getElementType())))) {
    return op->emitOpError(valueKind) << " #" << valueIndex
        << " must be tensor of bfloat16 or 128-bit complex or 64-bit complex or 16-bit float or 32-bit float or 64-bit float or 32-bit integer or 64-bit integer values, but got " << type;
  }
  return ::mlir::success();
}

static ::mlir::LogicalResult __mlir_ods_local_type_constraint_tf_ops23(
    ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
    unsigned valueIndex) {
  if (!(((type.isa<::mlir::TensorType>())) && ([](::mlir::Type elementType) { return (((elementType.isBF16())) || ((elementType.isa<mlir::TF::Bfloat16RefType>()))) || ((((elementType.isa<::mlir::ComplexType>())) && ((elementType.cast<::mlir::ComplexType>().getElementType().isF64()))) || ((elementType.isa<mlir::TF::Complex128RefType>()))) || ((((elementType.isa<::mlir::ComplexType>())) && ((elementType.cast<::mlir::ComplexType>().getElementType().isF32()))) || ((elementType.isa<mlir::TF::Complex64RefType>()))) || (((elementType.isF16())) || ((elementType.isa<mlir::TF::HalfRefType>()))) || (((elementType.isF32())) || ((elementType.isa<mlir::TF::FloatRefType>()))) || (((elementType.isF64())) || ((elementType.isa<mlir::TF::DoubleRefType>()))) || (((elementType.isSignlessInteger(16))) || ((elementType.isa<mlir::TF::Int16RefType>()))) || (((elementType.isSignlessInteger(32))) || ((elementType.isa<mlir::TF::Int32RefType>()))) || (((elementType.isSignlessInteger(64))) || ((elementType.isa<mlir::TF::Int64RefType>()))); }(type.cast<::mlir::ShapedType>().getElementType())))) {
    return op->emitOpError(valueKind) << " #" << valueIndex
        << " must be tensor of bfloat16 or 128-bit complex or 64-bit complex or 16-bit float or 32-bit float or 64-bit float or 16-bit integer or 32-bit integer or 64-bit integer values, but got " << type;
  }
  return ::mlir::success();
}

static ::mlir::LogicalResult __mlir_ods_local_type_constraint_tf_ops24(
    ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
    unsigned valueIndex) {
  if (!(((type.isa<::mlir::TensorType>())) && ([](::mlir::Type elementType) { return (((elementType.isBF16())) || ((elementType.isa<mlir::TF::Bfloat16RefType>()))) || ((((elementType.isa<::mlir::ComplexType>())) && ((elementType.cast<::mlir::ComplexType>().getElementType().isF64()))) || ((elementType.isa<mlir::TF::Complex128RefType>()))) || ((((elementType.isa<::mlir::ComplexType>())) && ((elementType.cast<::mlir::ComplexType>().getElementType().isF32()))) || ((elementType.isa<mlir::TF::Complex64RefType>()))) || (((elementType.isF16())) || ((elementType.isa<mlir::TF::HalfRefType>()))) || (((elementType.isF32())) || ((elementType.isa<mlir::TF::FloatRefType>()))) || (((elementType.isF64())) || ((elementType.isa<mlir::TF::DoubleRefType>()))) || (((elementType.isSignlessInteger(16))) || ((elementType.isa<mlir::TF::Int16RefType>()))) || (((elementType.isSignlessInteger(32))) || ((elementType.isa<mlir::TF::Int32RefType>()))) || (((elementType.isSignlessInteger(64))) || ((elementType.isa<mlir::TF::Int64RefType>()))) || (((elementType.isSignlessInteger(8))) || ((elementType.isa<mlir::TF::Int8RefType>()))) || (((elementType.isUnsignedInteger(8))) || ((elementType.isa<mlir::TF::Uint8RefType>()))); }(type.cast<::mlir::ShapedType>().getElementType())))) {
    return op->emitOpError(valueKind) << " #" << valueIndex
        << " must be tensor of bfloat16 or 128-bit complex or 64-bit complex or 16-bit float or 32-bit float or 64-bit float or 16-bit integer or 32-bit integer or 64-bit integer or 8-bit integer or 8-bit unsigned integer values, but got " << type;
  }
  return ::mlir::success();
}

static ::mlir::LogicalResult __mlir_ods_local_type_constraint_tf_ops25(
    ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
    unsigned valueIndex) {
  if (!(((type.isa<::mlir::TensorType>())) && ([](::mlir::Type elementType) { return (((elementType.isF32())) || ((elementType.isa<mlir::TF::FloatRefType>()))) || (((elementType.isF64())) || ((elementType.isa<mlir::TF::DoubleRefType>()))) || (((elementType.isSignlessInteger(32))) || ((elementType.isa<mlir::TF::Int32RefType>()))) || (((elementType.isSignlessInteger(64))) || ((elementType.isa<mlir::TF::Int64RefType>()))); }(type.cast<::mlir::ShapedType>().getElementType())))) {
    return op->emitOpError(valueKind) << " #" << valueIndex
        << " must be tensor of 32-bit float or 64-bit float or 32-bit integer or 64-bit integer values, but got " << type;
  }
  return ::mlir::success();
}

static ::mlir::LogicalResult __mlir_ods_local_type_constraint_tf_ops26(
    ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
    unsigned valueIndex) {
  if (!(((type.isa<::mlir::TensorType>())) && ([](::mlir::Type elementType) { return (((((elementType.isSignlessInteger(8))) || ((elementType.isa<mlir::TF::Int8RefType>()))) || (((elementType.isSignlessInteger(16))) || ((elementType.isa<mlir::TF::Int16RefType>()))) || (((elementType.isSignlessInteger(32))) || ((elementType.isa<mlir::TF::Int32RefType>()))) || (((elementType.isSignlessInteger(64))) || ((elementType.isa<mlir::TF::Int64RefType>())))) || ((((elementType.isUnsignedInteger(8))) || ((elementType.isa<mlir::TF::Uint8RefType>()))) || (((elementType.isUnsignedInteger(16))) || ((elementType.isa<mlir::TF::Uint16RefType>()))) || (((elementType.isUnsignedInteger(32))) || ((elementType.isa<mlir::TF::Uint32RefType>()))) || (((elementType.isUnsignedInteger(64))) || ((elementType.isa<mlir::TF::Uint64RefType>()))))) || ((((elementType.isF16())) || ((elementType.isa<mlir::TF::HalfRefType>()))) || (((elementType.isF32())) || ((elementType.isa<mlir::TF::FloatRefType>()))) || (((elementType.isF64())) || ((elementType.isa<mlir::TF::DoubleRefType>()))) || (((elementType.isBF16())) || ((elementType.isa<mlir::TF::Bfloat16RefType>())))) || ((((elementType.isa<mlir::TF::Qint8Type>())) || ((elementType.isa<mlir::TF::Qint8RefType>()))) || (((elementType.isa<mlir::TF::Qint16Type>())) || ((elementType.isa<mlir::TF::Qint16RefType>()))) || (((elementType.isa<mlir::TF::Qint32Type>())) || ((elementType.isa<mlir::TF::Qint32RefType>()))) || (((elementType.isa<mlir::TF::Quint8Type>())) || ((elementType.isa<mlir::TF::Quint8RefType>()))) || (((elementType.isa<mlir::TF::Quint16Type>())) || ((elementType.isa<mlir::TF::Quint16RefType>())))) || (((((elementType.isa<::mlir::ComplexType>())) && ((elementType.cast<::mlir::ComplexType>().getElementType().isF32()))) || ((elementType.isa<mlir::TF::Complex64RefType>()))) || ((((elementType.isa<::mlir::ComplexType>())) && ((elementType.cast<::mlir::ComplexType>().getElementType().isF64()))) || ((elementType.isa<mlir::TF::Complex128RefType>())))); }(type.cast<::mlir::ShapedType>().getElementType())))) {
    return op->emitOpError(valueKind) << " #" << valueIndex
        << " must be tensor of number values, but got " << type;
  }
  return ::mlir::success();
}

static ::mlir::LogicalResult __mlir_ods_local_type_constraint_tf_ops27(
    ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
    unsigned valueIndex) {
  if (!(((type.isa<::mlir::TensorType>())) && ([](::mlir::Type elementType) { return ((((elementType.isSignlessInteger(8))) || ((elementType.isa<mlir::TF::Int8RefType>()))) || (((elementType.isSignlessInteger(16))) || ((elementType.isa<mlir::TF::Int16RefType>()))) || (((elementType.isSignlessInteger(32))) || ((elementType.isa<mlir::TF::Int32RefType>()))) || (((elementType.isSignlessInteger(64))) || ((elementType.isa<mlir::TF::Int64RefType>())))) || ((((elementType.isUnsignedInteger(8))) || ((elementType.isa<mlir::TF::Uint8RefType>()))) || (((elementType.isUnsignedInteger(16))) || ((elementType.isa<mlir::TF::Uint16RefType>()))) || (((elementType.isUnsignedInteger(32))) || ((elementType.isa<mlir::TF::Uint32RefType>()))) || (((elementType.isUnsignedInteger(64))) || ((elementType.isa<mlir::TF::Uint64RefType>())))); }(type.cast<::mlir::ShapedType>().getElementType())))) {
    return op->emitOpError(valueKind) << " #" << valueIndex
        << " must be tensor of integer values, but got " << type;
  }
  return ::mlir::success();
}

static ::mlir::LogicalResult __mlir_ods_local_type_constraint_tf_ops28(
    ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
    unsigned valueIndex) {
  if (!(((type.isa<::mlir::TensorType>())) && ([](::mlir::Type elementType) { return (elementType.isSignlessInteger(32)); }(type.cast<::mlir::ShapedType>().getElementType())))) {
    return op->emitOpError(valueKind) << " #" << valueIndex
        << " must be tensor of 32-bit signless integer values, but got " << type;
  }
  return ::mlir::success();
}

static ::mlir::LogicalResult __mlir_ods_local_type_constraint_tf_ops29(
    ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
    unsigned valueIndex) {
  if (!(((type.isa<::mlir::TensorType>())) && ([](::mlir::Type elementType) { return ((((elementType.isa<::mlir::ComplexType>())) && ((elementType.cast<::mlir::ComplexType>().getElementType().isF64()))) || ((elementType.isa<mlir::TF::Complex128RefType>()))) || ((((elementType.isa<::mlir::ComplexType>())) && ((elementType.cast<::mlir::ComplexType>().getElementType().isF32()))) || ((elementType.isa<mlir::TF::Complex64RefType>()))) || (((elementType.isF16())) || ((elementType.isa<mlir::TF::HalfRefType>()))) || (((elementType.isF32())) || ((elementType.isa<mlir::TF::FloatRefType>()))) || (((elementType.isF64())) || ((elementType.isa<mlir::TF::DoubleRefType>()))); }(type.cast<::mlir::ShapedType>().getElementType())))) {
    return op->emitOpError(valueKind) << " #" << valueIndex
        << " must be tensor of 128-bit complex or 64-bit complex or 16-bit float or 32-bit float or 64-bit float values, but got " << type;
  }
  return ::mlir::success();
}

static ::mlir::LogicalResult __mlir_ods_local_type_constraint_tf_ops30(
    ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
    unsigned valueIndex) {
  if (!(((type.isa<::mlir::TensorType>())) && ([](::mlir::Type elementType) { return (((elementType.isSignlessInteger(1))) || ((elementType.isa<mlir::TF::BoolRefType>()))) || (((elementType.isF16())) || ((elementType.isa<mlir::TF::HalfRefType>()))) || (((elementType.isF32())) || ((elementType.isa<mlir::TF::FloatRefType>()))) || (((elementType.isF64())) || ((elementType.isa<mlir::TF::DoubleRefType>()))) || (((elementType.isSignlessInteger(32))) || ((elementType.isa<mlir::TF::Int32RefType>()))) || (((elementType.isSignlessInteger(64))) || ((elementType.isa<mlir::TF::Int64RefType>()))); }(type.cast<::mlir::ShapedType>().getElementType())))) {
    return op->emitOpError(valueKind) << " #" << valueIndex
        << " must be tensor of bool or 16-bit float or 32-bit float or 64-bit float or 32-bit integer or 64-bit integer values, but got " << type;
  }
  return ::mlir::success();
}

static ::mlir::LogicalResult __mlir_ods_local_type_constraint_tf_ops31(
    ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
    unsigned valueIndex) {
  if (!(((type.isa<::mlir::TensorType>())) && ([](::mlir::Type elementType) { return (((elementType.isF16())) || ((elementType.isa<mlir::TF::HalfRefType>()))) || (((elementType.isF32())) || ((elementType.isa<mlir::TF::FloatRefType>()))) || (((elementType.isF64())) || ((elementType.isa<mlir::TF::DoubleRefType>()))) || (((elementType.isSignlessInteger(32))) || ((elementType.isa<mlir::TF::Int32RefType>()))) || (((elementType.isSignlessInteger(64))) || ((elementType.isa<mlir::TF::Int64RefType>()))); }(type.cast<::mlir::ShapedType>().getElementType())))) {
    return op->emitOpError(valueKind) << " #" << valueIndex
        << " must be tensor of 16-bit float or 32-bit float or 64-bit float or 32-bit integer or 64-bit integer values, but got " << type;
  }
  return ::mlir::success();
}

static ::mlir::LogicalResult __mlir_ods_local_type_constraint_tf_ops32(
    ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
    unsigned valueIndex) {
  if (!(((type.isa<::mlir::TensorType>())) && ([](::mlir::Type elementType) { return ((((elementType.isF16())) || ((elementType.isa<mlir::TF::HalfRefType>()))) || (((elementType.isF32())) || ((elementType.isa<mlir::TF::FloatRefType>()))) || (((elementType.isF64())) || ((elementType.isa<mlir::TF::DoubleRefType>()))) || (((elementType.isBF16())) || ((elementType.isa<mlir::TF::Bfloat16RefType>())))) || (((elementType.isSignlessInteger(32))) || ((elementType.isSignlessInteger(64))) || ((elementType.isa<mlir::TF::Int32RefType>())) || ((elementType.isa<mlir::TF::Int64RefType>()))); }(type.cast<::mlir::ShapedType>().getElementType())))) {
    return op->emitOpError(valueKind) << " #" << valueIndex
        << " must be tensor of floating-point or 32/64-bit signed integer values, but got " << type;
  }
  return ::mlir::success();
}

static ::mlir::LogicalResult __mlir_ods_local_type_constraint_tf_ops33(
    ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
    unsigned valueIndex) {
  if (!(((type.isa<::mlir::TensorType>())) && ([](::mlir::Type elementType) { return ((((elementType.isa<::mlir::ComplexType>())) && ((elementType.cast<::mlir::ComplexType>().getElementType().isF64()))) || ((elementType.isa<mlir::TF::Complex128RefType>()))) || ((((elementType.isa<::mlir::ComplexType>())) && ((elementType.cast<::mlir::ComplexType>().getElementType().isF32()))) || ((elementType.isa<mlir::TF::Complex64RefType>()))) || (((elementType.isa<mlir::TF::VariantType>())) || ((elementType.isa<mlir::TF::VariantRefType>()))); }(type.cast<::mlir::ShapedType>().getElementType())))) {
    return op->emitOpError(valueKind) << " #" << valueIndex
        << " must be tensor of 128-bit complex or 64-bit complex or variant values, but got " << type;
  }
  return ::mlir::success();
}

static ::mlir::LogicalResult __mlir_ods_local_type_constraint_tf_ops34(
    ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
    unsigned valueIndex) {
  if (!(((type.isa<::mlir::TensorType>())) && ([](::mlir::Type elementType) { return (((elementType.isBF16())) || ((elementType.isa<mlir::TF::Bfloat16RefType>()))) || (((elementType.isF16())) || ((elementType.isa<mlir::TF::HalfRefType>()))) || (((elementType.isF32())) || ((elementType.isa<mlir::TF::FloatRefType>()))) || (((elementType.isF64())) || ((elementType.isa<mlir::TF::DoubleRefType>()))) || (((elementType.isSignlessInteger(32))) || ((elementType.isa<mlir::TF::Int32RefType>()))); }(type.cast<::mlir::ShapedType>().getElementType())))) {
    return op->emitOpError(valueKind) << " #" << valueIndex
        << " must be tensor of bfloat16 or 16-bit float or 32-bit float or 64-bit float or 32-bit integer values, but got " << type;
  }
  return ::mlir::success();
}

static ::mlir::LogicalResult __mlir_ods_local_type_constraint_tf_ops35(
    ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
    unsigned valueIndex) {
  if (!(((type.isa<::mlir::TensorType>())) && ([](::mlir::Type elementType) { return (((((elementType.isSignlessInteger(8))) || ((elementType.isa<mlir::TF::Int8RefType>()))) || (((elementType.isSignlessInteger(16))) || ((elementType.isa<mlir::TF::Int16RefType>()))) || (((elementType.isSignlessInteger(32))) || ((elementType.isa<mlir::TF::Int32RefType>()))) || (((elementType.isSignlessInteger(64))) || ((elementType.isa<mlir::TF::Int64RefType>())))) || ((((elementType.isUnsignedInteger(8))) || ((elementType.isa<mlir::TF::Uint8RefType>()))) || (((elementType.isUnsignedInteger(16))) || ((elementType.isa<mlir::TF::Uint16RefType>()))) || (((elementType.isUnsignedInteger(32))) || ((elementType.isa<mlir::TF::Uint32RefType>()))) || (((elementType.isUnsignedInteger(64))) || ((elementType.isa<mlir::TF::Uint64RefType>()))))) || ((((elementType.isF16())) || ((elementType.isa<mlir::TF::HalfRefType>()))) || (((elementType.isF32())) || ((elementType.isa<mlir::TF::FloatRefType>()))) || (((elementType.isF64())) || ((elementType.isa<mlir::TF::DoubleRefType>()))) || (((elementType.isBF16())) || ((elementType.isa<mlir::TF::Bfloat16RefType>())))); }(type.cast<::mlir::ShapedType>().getElementType())))) {
    return op->emitOpError(valueKind) << " #" << valueIndex
        << " must be tensor of integer or floating-point values, but got " << type;
  }
  return ::mlir::success();
}

static ::mlir::LogicalResult __mlir_ods_local_type_constraint_tf_ops36(
    ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
    unsigned valueIndex) {
  if (!(((type.isa<::mlir::TensorType>())) && ([](::mlir::Type elementType) { return (((elementType.isBF16())) || ((elementType.isa<mlir::TF::Bfloat16RefType>()))) || (((elementType.isF16())) || ((elementType.isa<mlir::TF::HalfRefType>()))) || (((elementType.isF32())) || ((elementType.isa<mlir::TF::FloatRefType>()))) || (((elementType.isF64())) || ((elementType.isa<mlir::TF::DoubleRefType>()))) || (((elementType.isSignlessInteger(32))) || ((elementType.isa<mlir::TF::Int32RefType>()))) || (((elementType.isUnsignedInteger(32))) || ((elementType.isa<mlir::TF::Uint32RefType>()))); }(type.cast<::mlir::ShapedType>().getElementType())))) {
    return op->emitOpError(valueKind) << " #" << valueIndex
        << " must be tensor of bfloat16 or 16-bit float or 32-bit float or 64-bit float or 32-bit integer or 32-bit unsigned integer values, but got " << type;
  }
  return ::mlir::success();
}

static ::mlir::LogicalResult __mlir_ods_local_type_constraint_tf_ops37(
    ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
    unsigned valueIndex) {
  if (!(((type.isa<::mlir::TensorType>())) && ([](::mlir::Type elementType) { return ((elementType.isUnsignedInteger(8))) || ((elementType.isa<mlir::TF::Uint8RefType>())); }(type.cast<::mlir::ShapedType>().getElementType())))) {
    return op->emitOpError(valueKind) << " #" << valueIndex
        << " must be tensor of 8-bit unsigned integer values, but got " << type;
  }
  return ::mlir::success();
}

static ::mlir::LogicalResult __mlir_ods_local_type_constraint_tf_ops38(
    ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
    unsigned valueIndex) {
  if (!(((type.isa<::mlir::TensorType>())) && ([](::mlir::Type elementType) { return (((elementType.isBF16())) || ((elementType.isa<mlir::TF::Bfloat16RefType>()))) || (((elementType.isF16())) || ((elementType.isa<mlir::TF::HalfRefType>()))) || (((elementType.isF32())) || ((elementType.isa<mlir::TF::FloatRefType>()))) || (((elementType.isF64())) || ((elementType.isa<mlir::TF::DoubleRefType>()))) || (((elementType.isSignlessInteger(16))) || ((elementType.isa<mlir::TF::Int16RefType>()))) || (((elementType.isSignlessInteger(32))) || ((elementType.isa<mlir::TF::Int32RefType>()))) || (((elementType.isSignlessInteger(64))) || ((elementType.isa<mlir::TF::Int64RefType>()))) || (((elementType.isSignlessInteger(8))) || ((elementType.isa<mlir::TF::Int8RefType>()))) || (((elementType.isUnsignedInteger(16))) || ((elementType.isa<mlir::TF::Uint16RefType>()))) || (((elementType.isUnsignedInteger(8))) || ((elementType.isa<mlir::TF::Uint8RefType>()))); }(type.cast<::mlir::ShapedType>().getElementType())))) {
    return op->emitOpError(valueKind) << " #" << valueIndex
        << " must be tensor of bfloat16 or 16-bit float or 32-bit float or 64-bit float or 16-bit integer or 32-bit integer or 64-bit integer or 8-bit integer or 16-bit unsigned integer or 8-bit unsigned integer values, but got " << type;
  }
  return ::mlir::success();
}

static ::mlir::LogicalResult __mlir_ods_local_type_constraint_tf_ops39(
    ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
    unsigned valueIndex) {
  if (!(((type.isa<::mlir::TensorType>())) && ([](::mlir::Type elementType) { return (((elementType.isUnsignedInteger(16))) || ((elementType.isa<mlir::TF::Uint16RefType>()))) || (((elementType.isUnsignedInteger(8))) || ((elementType.isa<mlir::TF::Uint8RefType>()))); }(type.cast<::mlir::ShapedType>().getElementType())))) {
    return op->emitOpError(valueKind) << " #" << valueIndex
        << " must be tensor of 16-bit unsigned integer or 8-bit unsigned integer values, but got " << type;
  }
  return ::mlir::success();
}

static ::mlir::LogicalResult __mlir_ods_local_type_constraint_tf_ops40(
    ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
    unsigned valueIndex) {
  if (!(((type.isa<::mlir::TensorType>())) && ([](::mlir::Type elementType) { return (((elementType.isa<mlir::TF::Qint16Type>())) || ((elementType.isa<mlir::TF::Qint16RefType>()))) || (((elementType.isa<mlir::TF::Qint32Type>())) || ((elementType.isa<mlir::TF::Qint32RefType>()))) || (((elementType.isa<mlir::TF::Qint8Type>())) || ((elementType.isa<mlir::TF::Qint8RefType>()))) || (((elementType.isa<mlir::TF::Quint16Type>())) || ((elementType.isa<mlir::TF::Quint16RefType>()))) || (((elementType.isa<mlir::TF::Quint8Type>())) || ((elementType.isa<mlir::TF::Quint8RefType>()))); }(type.cast<::mlir::ShapedType>().getElementType())))) {
    return op->emitOpError(valueKind) << " #" << valueIndex
        << " must be tensor of 16-bit quantized integer or 32-bit quantized integer or 8-bit quantized integer or 16-bit quantized unsigned integer or 8-bit quantized unsigned integer values, but got " << type;
  }
  return ::mlir::success();
}

static ::mlir::LogicalResult __mlir_ods_local_type_constraint_tf_ops41(
    ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
    unsigned valueIndex) {
  if (!(((type.isa<::mlir::TensorType>())) && ([](::mlir::Type elementType) { return (((elementType.isBF16())) || ((elementType.isa<mlir::TF::Bfloat16RefType>()))) || (((elementType.isF32())) || ((elementType.isa<mlir::TF::FloatRefType>()))); }(type.cast<::mlir::ShapedType>().getElementType())))) {
    return op->emitOpError(valueKind) << " #" << valueIndex
        << " must be tensor of bfloat16 or 32-bit float values, but got " << type;
  }
  return ::mlir::success();
}

static ::mlir::LogicalResult __mlir_ods_local_type_constraint_tf_ops42(
    ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
    unsigned valueIndex) {
  if (!(((type.isa<::mlir::TensorType>())) && ([](::mlir::Type elementType) { return (((elementType.isa<mlir::TF::StringType>())) || ((elementType.isa<mlir::TF::StringRefType>()))) || (((elementType.isa<mlir::TF::VariantType>())) || ((elementType.isa<mlir::TF::VariantRefType>()))); }(type.cast<::mlir::ShapedType>().getElementType())))) {
    return op->emitOpError(valueKind) << " #" << valueIndex
        << " must be tensor of string or variant values, but got " << type;
  }
  return ::mlir::success();
}

static ::mlir::LogicalResult __mlir_ods_local_type_constraint_tf_ops43(
    ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
    unsigned valueIndex) {
  if (!(((type.isa<::mlir::TensorType>())) && ([](::mlir::Type elementType) { return (((elementType.isBF16())) || ((elementType.isa<mlir::TF::Bfloat16RefType>()))) || (((elementType.isSignlessInteger(1))) || ((elementType.isa<mlir::TF::BoolRefType>()))) || ((((elementType.isa<::mlir::ComplexType>())) && ((elementType.cast<::mlir::ComplexType>().getElementType().isF64()))) || ((elementType.isa<mlir::TF::Complex128RefType>()))) || ((((elementType.isa<::mlir::ComplexType>())) && ((elementType.cast<::mlir::ComplexType>().getElementType().isF32()))) || ((elementType.isa<mlir::TF::Complex64RefType>()))) || (((elementType.isF16())) || ((elementType.isa<mlir::TF::HalfRefType>()))) || (((elementType.isF32())) || ((elementType.isa<mlir::TF::FloatRefType>()))) || (((elementType.isF64())) || ((elementType.isa<mlir::TF::DoubleRefType>()))) || (((elementType.isSignlessInteger(16))) || ((elementType.isa<mlir::TF::Int16RefType>()))) || (((elementType.isSignlessInteger(32))) || ((elementType.isa<mlir::TF::Int32RefType>()))) || (((elementType.isSignlessInteger(64))) || ((elementType.isa<mlir::TF::Int64RefType>()))) || (((elementType.isSignlessInteger(8))) || ((elementType.isa<mlir::TF::Int8RefType>()))) || (((elementType.isUnsignedInteger(16))) || ((elementType.isa<mlir::TF::Uint16RefType>()))) || (((elementType.isUnsignedInteger(32))) || ((elementType.isa<mlir::TF::Uint32RefType>()))) || (((elementType.isUnsignedInteger(64))) || ((elementType.isa<mlir::TF::Uint64RefType>()))) || (((elementType.isUnsignedInteger(8))) || ((elementType.isa<mlir::TF::Uint8RefType>()))); }(type.cast<::mlir::ShapedType>().getElementType())))) {
    return op->emitOpError(valueKind) << " #" << valueIndex
        << " must be tensor of bfloat16 or bool or 128-bit complex or 64-bit complex or 16-bit float or 32-bit float or 64-bit float or 16-bit integer or 32-bit integer or 64-bit integer or 8-bit integer or 16-bit unsigned integer or 32-bit unsigned integer or 64-bit unsigned integer or 8-bit unsigned integer values, but got " << type;
  }
  return ::mlir::success();
}

static ::mlir::LogicalResult __mlir_ods_local_type_constraint_tf_ops44(
    ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
    unsigned valueIndex) {
  if (!(((type.isa<::mlir::TensorType>())) && ([](::mlir::Type elementType) { return (((elementType.isBF16())) || ((elementType.isa<mlir::TF::Bfloat16RefType>()))) || (((elementType.isF16())) || ((elementType.isa<mlir::TF::HalfRefType>()))) || (((elementType.isF32())) || ((elementType.isa<mlir::TF::FloatRefType>()))); }(type.cast<::mlir::ShapedType>().getElementType())))) {
    return op->emitOpError(valueKind) << " #" << valueIndex
        << " must be tensor of bfloat16 or 16-bit float or 32-bit float values, but got " << type;
  }
  return ::mlir::success();
}

static ::mlir::LogicalResult __mlir_ods_local_type_constraint_tf_ops45(
    ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
    unsigned valueIndex) {
  if (!((((type.isa<::mlir::TensorType>())) && ([](::mlir::Type elementType) { return (elementType.isSignlessInteger(1)); }(type.cast<::mlir::ShapedType>().getElementType()))) && (((type.cast<::mlir::ShapedType>().hasRank())) && ((type.cast<::mlir::ShapedType>().getRank()
                         == 0))))) {
    return op->emitOpError(valueKind) << " #" << valueIndex
        << " must be 0D tensor of 1-bit signless integer values, but got " << type;
  }
  return ::mlir::success();
}

static ::mlir::LogicalResult __mlir_ods_local_type_constraint_tf_ops46(
    ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
    unsigned valueIndex) {
  if (!(((type.isa<::mlir::TensorType>())) && ([](::mlir::Type elementType) { return (((elementType.isBF16())) || ((elementType.isa<mlir::TF::Bfloat16RefType>()))) || (((elementType.isF16())) || ((elementType.isa<mlir::TF::HalfRefType>()))) || (((elementType.isF32())) || ((elementType.isa<mlir::TF::FloatRefType>()))) || (((elementType.isF64())) || ((elementType.isa<mlir::TF::DoubleRefType>()))) || (((elementType.isSignlessInteger(16))) || ((elementType.isa<mlir::TF::Int16RefType>()))) || (((elementType.isSignlessInteger(32))) || ((elementType.isa<mlir::TF::Int32RefType>()))) || (((elementType.isSignlessInteger(64))) || ((elementType.isa<mlir::TF::Int64RefType>()))) || (((elementType.isSignlessInteger(8))) || ((elementType.isa<mlir::TF::Int8RefType>()))) || (((elementType.isa<mlir::TF::Qint16Type>())) || ((elementType.isa<mlir::TF::Qint16RefType>()))) || (((elementType.isa<mlir::TF::Qint32Type>())) || ((elementType.isa<mlir::TF::Qint32RefType>()))) || (((elementType.isa<mlir::TF::Qint8Type>())) || ((elementType.isa<mlir::TF::Qint8RefType>()))) || (((elementType.isa<mlir::TF::Quint16Type>())) || ((elementType.isa<mlir::TF::Quint16RefType>()))) || (((elementType.isa<mlir::TF::Quint8Type>())) || ((elementType.isa<mlir::TF::Quint8RefType>()))) || (((elementType.isUnsignedInteger(16))) || ((elementType.isa<mlir::TF::Uint16RefType>()))) || (((elementType.isUnsignedInteger(32))) || ((elementType.isa<mlir::TF::Uint32RefType>()))) || (((elementType.isUnsignedInteger(64))) || ((elementType.isa<mlir::TF::Uint64RefType>()))) || (((elementType.isUnsignedInteger(8))) || ((elementType.isa<mlir::TF::Uint8RefType>()))); }(type.cast<::mlir::ShapedType>().getElementType())))) {
    return op->emitOpError(valueKind) << " #" << valueIndex
        << " must be tensor of bfloat16 or 16-bit float or 32-bit float or 64-bit float or 16-bit integer or 32-bit integer or 64-bit integer or 8-bit integer or 16-bit quantized integer or 32-bit quantized integer or 8-bit quantized integer or 16-bit quantized unsigned integer or 8-bit quantized unsigned integer or 16-bit unsigned integer or 32-bit unsigned integer or 64-bit unsigned integer or 8-bit unsigned integer values, but got " << type;
  }
  return ::mlir::success();
}

static ::mlir::LogicalResult __mlir_ods_local_type_constraint_tf_ops47(
    ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
    unsigned valueIndex) {
  if (!(((type.isa<::mlir::TensorType>())) && ([](::mlir::Type elementType) { return (((elementType.isBF16())) || ((elementType.isa<mlir::TF::Bfloat16RefType>()))) || (((elementType.isF16())) || ((elementType.isa<mlir::TF::HalfRefType>()))) || (((elementType.isF32())) || ((elementType.isa<mlir::TF::FloatRefType>()))) || (((elementType.isF64())) || ((elementType.isa<mlir::TF::DoubleRefType>()))) || (((elementType.isSignlessInteger(16))) || ((elementType.isa<mlir::TF::Int16RefType>()))) || (((elementType.isSignlessInteger(32))) || ((elementType.isa<mlir::TF::Int32RefType>()))) || (((elementType.isSignlessInteger(64))) || ((elementType.isa<mlir::TF::Int64RefType>()))) || (((elementType.isSignlessInteger(8))) || ((elementType.isa<mlir::TF::Int8RefType>()))) || (((elementType.isa<mlir::TF::Qint8Type>())) || ((elementType.isa<mlir::TF::Qint8RefType>()))) || (((elementType.isUnsignedInteger(16))) || ((elementType.isa<mlir::TF::Uint16RefType>()))) || (((elementType.isUnsignedInteger(8))) || ((elementType.isa<mlir::TF::Uint8RefType>()))); }(type.cast<::mlir::ShapedType>().getElementType())))) {
    return op->emitOpError(valueKind) << " #" << valueIndex
        << " must be tensor of bfloat16 or 16-bit float or 32-bit float or 64-bit float or 16-bit integer or 32-bit integer or 64-bit integer or 8-bit integer or 8-bit quantized integer or 16-bit unsigned integer or 8-bit unsigned integer values, but got " << type;
  }
  return ::mlir::success();
}

static ::mlir::LogicalResult __mlir_ods_local_type_constraint_tf_ops48(
    ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
    unsigned valueIndex) {
  if (!(((type.isa<::mlir::TensorType>())) && ([](::mlir::Type elementType) { return (((elementType.isSignlessInteger(32))) || ((elementType.isa<mlir::TF::Int32RefType>()))) || (((elementType.isSignlessInteger(64))) || ((elementType.isa<mlir::TF::Int64RefType>()))) || (((elementType.isUnsignedInteger(8))) || ((elementType.isa<mlir::TF::Uint8RefType>()))); }(type.cast<::mlir::ShapedType>().getElementType())))) {
    return op->emitOpError(valueKind) << " #" << valueIndex
        << " must be tensor of 32-bit integer or 64-bit integer or 8-bit unsigned integer values, but got " << type;
  }
  return ::mlir::success();
}

static ::mlir::LogicalResult __mlir_ods_local_type_constraint_tf_ops49(
    ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
    unsigned valueIndex) {
  if (!(((type.isa<::mlir::TensorType>())) && ([](::mlir::Type elementType) { return (((elementType.isF32())) || ((elementType.isa<mlir::TF::FloatRefType>()))) || (((elementType.isSignlessInteger(64))) || ((elementType.isa<mlir::TF::Int64RefType>()))) || (((elementType.isa<mlir::TF::StringType>())) || ((elementType.isa<mlir::TF::StringRefType>()))); }(type.cast<::mlir::ShapedType>().getElementType())))) {
    return op->emitOpError(valueKind) << " #" << valueIndex
        << " must be tensor of 32-bit float or 64-bit integer or string values, but got " << type;
  }
  return ::mlir::success();
}

static ::mlir::LogicalResult __mlir_ods_local_type_constraint_tf_ops50(
    ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
    unsigned valueIndex) {
  if (!(((type.isa<::mlir::TensorType>())) && ([](::mlir::Type elementType) { return (((elementType.isSignlessInteger(32))) || ((elementType.isa<mlir::TF::Int32RefType>()))) || (((elementType.isSignlessInteger(64))) || ((elementType.isa<mlir::TF::Int64RefType>()))); }(type.cast<::mlir::ShapedType>().getElementType())))) {
    return op->emitOpError(valueKind) << " #" << valueIndex
        << " must be tensor of 32-bit integer or 64-bit integer values, but got " << type;
  }
  return ::mlir::success();
}

static ::mlir::LogicalResult __mlir_ods_local_type_constraint_tf_ops51(
    ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
    unsigned valueIndex) {
  if (!(((type.isa<::mlir::TensorType>())) && ([](::mlir::Type elementType) { return (((elementType.isBF16())) || ((elementType.isa<mlir::TF::Bfloat16RefType>()))) || (((elementType.isF32())) || ((elementType.isa<mlir::TF::FloatRefType>()))) || (((elementType.isF64())) || ((elementType.isa<mlir::TF::DoubleRefType>()))) || (((elementType.isSignlessInteger(32))) || ((elementType.isa<mlir::TF::Int32RefType>()))) || (((elementType.isSignlessInteger(64))) || ((elementType.isa<mlir::TF::Int64RefType>()))); }(type.cast<::mlir::ShapedType>().getElementType())))) {
    return op->emitOpError(valueKind) << " #" << valueIndex
        << " must be tensor of bfloat16 or 32-bit float or 64-bit float or 32-bit integer or 64-bit integer values, but got " << type;
  }
  return ::mlir::success();
}

static ::mlir::LogicalResult __mlir_ods_local_type_constraint_tf_ops52(
    ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
    unsigned valueIndex) {
  if (!(((type.isa<::mlir::TensorType>())) && ([](::mlir::Type elementType) { return (((elementType.isF16())) || ((elementType.isa<mlir::TF::HalfRefType>()))) || (((elementType.isF32())) || ((elementType.isa<mlir::TF::FloatRefType>()))) || (((elementType.isF64())) || ((elementType.isa<mlir::TF::DoubleRefType>()))); }(type.cast<::mlir::ShapedType>().getElementType())))) {
    return op->emitOpError(valueKind) << " #" << valueIndex
        << " must be tensor of 16-bit float or 32-bit float or 64-bit float values, but got " << type;
  }
  return ::mlir::success();
}

static ::mlir::LogicalResult __mlir_ods_local_type_constraint_tf_ops53(
    ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
    unsigned valueIndex) {
  if (!(((type.isa<::mlir::TensorType>())) && ([](::mlir::Type elementType) { return (((elementType.isBF16())) || ((elementType.isa<mlir::TF::Bfloat16RefType>()))) || (((elementType.isF16())) || ((elementType.isa<mlir::TF::HalfRefType>()))) || (((elementType.isF32())) || ((elementType.isa<mlir::TF::FloatRefType>()))) || (((elementType.isF64())) || ((elementType.isa<mlir::TF::DoubleRefType>()))) || (((elementType.isSignlessInteger(16))) || ((elementType.isa<mlir::TF::Int16RefType>()))) || (((elementType.isSignlessInteger(32))) || ((elementType.isa<mlir::TF::Int32RefType>()))) || (((elementType.isSignlessInteger(64))) || ((elementType.isa<mlir::TF::Int64RefType>()))) || (((elementType.isSignlessInteger(8))) || ((elementType.isa<mlir::TF::Int8RefType>()))) || (((elementType.isUnsignedInteger(32))) || ((elementType.isa<mlir::TF::Uint32RefType>()))); }(type.cast<::mlir::ShapedType>().getElementType())))) {
    return op->emitOpError(valueKind) << " #" << valueIndex
        << " must be tensor of bfloat16 or 16-bit float or 32-bit float or 64-bit float or 16-bit integer or 32-bit integer or 64-bit integer or 8-bit integer or 32-bit unsigned integer values, but got " << type;
  }
  return ::mlir::success();
}

static ::mlir::LogicalResult __mlir_ods_local_type_constraint_tf_ops54(
    ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
    unsigned valueIndex) {
  if (!(((type.isa<::mlir::TensorType>())) && ([](::mlir::Type elementType) { return (((elementType.isBF16())) || ((elementType.isa<mlir::TF::Bfloat16RefType>()))) || (((elementType.isF16())) || ((elementType.isa<mlir::TF::HalfRefType>()))) || (((elementType.isF32())) || ((elementType.isa<mlir::TF::FloatRefType>()))) || (((elementType.isF64())) || ((elementType.isa<mlir::TF::DoubleRefType>()))) || (((elementType.isSignlessInteger(16))) || ((elementType.isa<mlir::TF::Int16RefType>()))) || (((elementType.isSignlessInteger(32))) || ((elementType.isa<mlir::TF::Int32RefType>()))) || (((elementType.isSignlessInteger(64))) || ((elementType.isa<mlir::TF::Int64RefType>()))) || (((elementType.isSignlessInteger(8))) || ((elementType.isa<mlir::TF::Int8RefType>()))) || (((elementType.isa<mlir::TF::Qint8Type>())) || ((elementType.isa<mlir::TF::Qint8RefType>()))) || (((elementType.isUnsignedInteger(16))) || ((elementType.isa<mlir::TF::Uint16RefType>()))) || (((elementType.isUnsignedInteger(32))) || ((elementType.isa<mlir::TF::Uint32RefType>()))) || (((elementType.isUnsignedInteger(64))) || ((elementType.isa<mlir::TF::Uint64RefType>()))) || (((elementType.isUnsignedInteger(8))) || ((elementType.isa<mlir::TF::Uint8RefType>()))); }(type.cast<::mlir::ShapedType>().getElementType())))) {
    return op->emitOpError(valueKind) << " #" << valueIndex
        << " must be tensor of bfloat16 or 16-bit float or 32-bit float or 64-bit float or 16-bit integer or 32-bit integer or 64-bit integer or 8-bit integer or 8-bit quantized integer or 16-bit unsigned integer or 32-bit unsigned integer or 64-bit unsigned integer or 8-bit unsigned integer values, but got " << type;
  }
  return ::mlir::success();
}

static ::mlir::LogicalResult __mlir_ods_local_type_constraint_tf_ops55(
    ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
    unsigned valueIndex) {
  if (!(((type.isa<::mlir::TensorType>())) && ([](::mlir::Type elementType) { return (((elementType.isBF16())) || ((elementType.isa<mlir::TF::Bfloat16RefType>()))) || (((elementType.isF16())) || ((elementType.isa<mlir::TF::HalfRefType>()))) || (((elementType.isF32())) || ((elementType.isa<mlir::TF::FloatRefType>()))) || (((elementType.isF64())) || ((elementType.isa<mlir::TF::DoubleRefType>()))) || (((elementType.isSignlessInteger(32))) || ((elementType.isa<mlir::TF::Int32RefType>()))) || (((elementType.isSignlessInteger(8))) || ((elementType.isa<mlir::TF::Int8RefType>()))) || (((elementType.isUnsignedInteger(8))) || ((elementType.isa<mlir::TF::Uint8RefType>()))); }(type.cast<::mlir::ShapedType>().getElementType())))) {
    return op->emitOpError(valueKind) << " #" << valueIndex
        << " must be tensor of bfloat16 or 16-bit float or 32-bit float or 64-bit float or 32-bit integer or 8-bit integer or 8-bit unsigned integer values, but got " << type;
  }
  return ::mlir::success();
}

static ::mlir::LogicalResult __mlir_ods_local_type_constraint_tf_ops56(
    ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
    unsigned valueIndex) {
  if (!(((type.isa<::mlir::TensorType>())) && ([](::mlir::Type elementType) { return (((elementType.isBF16())) || ((elementType.isa<mlir::TF::Bfloat16RefType>()))) || (((elementType.isSignlessInteger(1))) || ((elementType.isa<mlir::TF::BoolRefType>()))) || ((((elementType.isa<::mlir::ComplexType>())) && ((elementType.cast<::mlir::ComplexType>().getElementType().isF64()))) || ((elementType.isa<mlir::TF::Complex128RefType>()))) || ((((elementType.isa<::mlir::ComplexType>())) && ((elementType.cast<::mlir::ComplexType>().getElementType().isF32()))) || ((elementType.isa<mlir::TF::Complex64RefType>()))) || (((elementType.isF16())) || ((elementType.isa<mlir::TF::HalfRefType>()))) || (((elementType.isF32())) || ((elementType.isa<mlir::TF::FloatRefType>()))) || (((elementType.isF64())) || ((elementType.isa<mlir::TF::DoubleRefType>()))) || (((elementType.isSignlessInteger(16))) || ((elementType.isa<mlir::TF::Int16RefType>()))) || (((elementType.isSignlessInteger(32))) || ((elementType.isa<mlir::TF::Int32RefType>()))) || (((elementType.isSignlessInteger(64))) || ((elementType.isa<mlir::TF::Int64RefType>()))) || (((elementType.isSignlessInteger(8))) || ((elementType.isa<mlir::TF::Int8RefType>()))) || (((elementType.isa<mlir::TF::StringType>())) || ((elementType.isa<mlir::TF::StringRefType>()))) || (((elementType.isUnsignedInteger(16))) || ((elementType.isa<mlir::TF::Uint16RefType>()))) || (((elementType.isUnsignedInteger(32))) || ((elementType.isa<mlir::TF::Uint32RefType>()))) || (((elementType.isUnsignedInteger(64))) || ((elementType.isa<mlir::TF::Uint64RefType>()))) || (((elementType.isUnsignedInteger(8))) || ((elementType.isa<mlir::TF::Uint8RefType>()))); }(type.cast<::mlir::ShapedType>().getElementType())))) {
    return op->emitOpError(valueKind) << " #" << valueIndex
        << " must be tensor of bfloat16 or bool or 128-bit complex or 64-bit complex or 16-bit float or 32-bit float or 64-bit float or 16-bit integer or 32-bit integer or 64-bit integer or 8-bit integer or string or 16-bit unsigned integer or 32-bit unsigned integer or 64-bit unsigned integer or 8-bit unsigned integer values, but got " << type;
  }
  return ::mlir::success();
}

static ::mlir::LogicalResult __mlir_ods_local_type_constraint_tf_ops57(
    ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
    unsigned valueIndex) {
  if (!(((type.isa<::mlir::TensorType>())) && ([](::mlir::Type elementType) { return ((elementType.isUnsignedInteger(64))) || ((elementType.isa<mlir::TF::Uint64RefType>())); }(type.cast<::mlir::ShapedType>().getElementType())))) {
    return op->emitOpError(valueKind) << " #" << valueIndex
        << " must be tensor of 64-bit unsigned integer values, but got " << type;
  }
  return ::mlir::success();
}

static ::mlir::LogicalResult __mlir_ods_local_type_constraint_tf_ops58(
    ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
    unsigned valueIndex) {
  if (!(((type.isa<::mlir::TensorType>())) && ([](::mlir::Type elementType) { return (((elementType.isSignlessInteger(32))) || ((elementType.isa<mlir::TF::Int32RefType>()))) || (((elementType.isSignlessInteger(64))) || ((elementType.isa<mlir::TF::Int64RefType>()))) || (((elementType.isUnsignedInteger(32))) || ((elementType.isa<mlir::TF::Uint32RefType>()))) || (((elementType.isUnsignedInteger(64))) || ((elementType.isa<mlir::TF::Uint64RefType>()))); }(type.cast<::mlir::ShapedType>().getElementType())))) {
    return op->emitOpError(valueKind) << " #" << valueIndex
        << " must be tensor of 32-bit integer or 64-bit integer or 32-bit unsigned integer or 64-bit unsigned integer values, but got " << type;
  }
  return ::mlir::success();
}

static ::mlir::LogicalResult __mlir_ods_local_type_constraint_tf_ops59(
    ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
    unsigned valueIndex) {
  if (!(((type.isa<::mlir::TensorType>())) && ([](::mlir::Type elementType) { return ((elementType.isF64())) || ((elementType.isa<mlir::TF::DoubleRefType>())); }(type.cast<::mlir::ShapedType>().getElementType())))) {
    return op->emitOpError(valueKind) << " #" << valueIndex
        << " must be tensor of 64-bit float values, but got " << type;
  }
  return ::mlir::success();
}

static ::mlir::LogicalResult __mlir_ods_local_type_constraint_tf_ops60(
    ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
    unsigned valueIndex) {
  if (!(((type.isa<::mlir::TensorType>())) && ([](::mlir::Type elementType) { return (elementType.isSignlessInteger(1)); }(type.cast<::mlir::ShapedType>().getElementType())))) {
    return op->emitOpError(valueKind) << " #" << valueIndex
        << " must be tensor of 1-bit signless integer values, but got " << type;
  }
  return ::mlir::success();
}

static ::mlir::LogicalResult __mlir_ods_local_type_constraint_tf_ops61(
    ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
    unsigned valueIndex) {
  if (!(((type.isa<::mlir::TensorType>())) && ([](::mlir::Type elementType) { return ((((elementType.isa<::mlir::ComplexType>())) && ((elementType.cast<::mlir::ComplexType>().getElementType().isF64()))) || ((elementType.isa<mlir::TF::Complex128RefType>()))) || ((((elementType.isa<::mlir::ComplexType>())) && ((elementType.cast<::mlir::ComplexType>().getElementType().isF32()))) || ((elementType.isa<mlir::TF::Complex64RefType>()))) || (((elementType.isF32())) || ((elementType.isa<mlir::TF::FloatRefType>()))) || (((elementType.isF64())) || ((elementType.isa<mlir::TF::DoubleRefType>()))); }(type.cast<::mlir::ShapedType>().getElementType())))) {
    return op->emitOpError(valueKind) << " #" << valueIndex
        << " must be tensor of 128-bit complex or 64-bit complex or 32-bit float or 64-bit float values, but got " << type;
  }
  return ::mlir::success();
}

static ::mlir::LogicalResult __mlir_ods_local_type_constraint_tf_ops62(
    ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
    unsigned valueIndex) {
  if (!(((type.isa<::mlir::TensorType>())) && ([](::mlir::Type elementType) { return (true); }(type.cast<::mlir::ShapedType>().getElementType())))) {
    return op->emitOpError(valueKind) << " #" << valueIndex
        << " must be tensor of any type values, but got " << type;
  }
  return ::mlir::success();
}

static ::mlir::LogicalResult __mlir_ods_local_type_constraint_tf_ops63(
    ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
    unsigned valueIndex) {
  if (!(((type.isa<::mlir::TensorType>())) && ([](::mlir::Type elementType) { return (((elementType.isF16())) || ((elementType.isa<mlir::TF::HalfRefType>()))) || (((elementType.isF32())) || ((elementType.isa<mlir::TF::FloatRefType>()))) || (((elementType.isUnsignedInteger(8))) || ((elementType.isa<mlir::TF::Uint8RefType>()))); }(type.cast<::mlir::ShapedType>().getElementType())))) {
    return op->emitOpError(valueKind) << " #" << valueIndex
        << " must be tensor of 16-bit float or 32-bit float or 8-bit unsigned integer values, but got " << type;
  }
  return ::mlir::success();
}

static ::mlir::LogicalResult __mlir_ods_local_type_constraint_tf_ops64(
    ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
    unsigned valueIndex) {
  if (!(((type.isa<::mlir::TensorType>())) && ([](::mlir::Type elementType) { return (((elementType.isBF16())) || ((elementType.isa<mlir::TF::Bfloat16RefType>()))) || (((elementType.isF16())) || ((elementType.isa<mlir::TF::HalfRefType>()))) || (((elementType.isF32())) || ((elementType.isa<mlir::TF::FloatRefType>()))) || (((elementType.isSignlessInteger(32))) || ((elementType.isa<mlir::TF::Int32RefType>()))) || (((elementType.isUnsignedInteger(32))) || ((elementType.isa<mlir::TF::Uint32RefType>()))); }(type.cast<::mlir::ShapedType>().getElementType())))) {
    return op->emitOpError(valueKind) << " #" << valueIndex
        << " must be tensor of bfloat16 or 16-bit float or 32-bit float or 32-bit integer or 32-bit unsigned integer values, but got " << type;
  }
  return ::mlir::success();
}

static ::mlir::LogicalResult __mlir_ods_local_type_constraint_tf_ops65(
    ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
    unsigned valueIndex) {
  if (!(((type.isa<::mlir::TensorType>())) && ([](::mlir::Type elementType) { return (((elementType.isBF16())) || ((elementType.isa<mlir::TF::Bfloat16RefType>()))) || ((((elementType.isa<::mlir::ComplexType>())) && ((elementType.cast<::mlir::ComplexType>().getElementType().isF32()))) || ((elementType.isa<mlir::TF::Complex64RefType>()))) || (((elementType.isF32())) || ((elementType.isa<mlir::TF::FloatRefType>()))); }(type.cast<::mlir::ShapedType>().getElementType())))) {
    return op->emitOpError(valueKind) << " #" << valueIndex
        << " must be tensor of bfloat16 or 64-bit complex or 32-bit float values, but got " << type;
  }
  return ::mlir::success();
}

static ::mlir::LogicalResult __mlir_ods_local_type_constraint_tf_ops66(
    ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
    unsigned valueIndex) {
  if (!((true))) {
    return op->emitOpError(valueKind) << " #" << valueIndex
        << " must be any type, but got " << type;
  }
  return ::mlir::success();
}

static ::mlir::LogicalResult __mlir_ods_local_attr_constraint_tf_ops0(
    ::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) {
  if (attr && !((attr.isa<::mlir::BoolAttr>()))) {
    return op->emitOpError("attribute '") << attrName
        << "' failed to satisfy constraint: bool attribute";
  }
  return ::mlir::success();
}

static ::mlir::LogicalResult __mlir_ods_local_attr_constraint_tf_ops1(
    ::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) {
  if (attr && !(((attr.isa<::mlir::IntegerAttr>())) && ((attr.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64))))) {
    return op->emitOpError("attribute '") << attrName
        << "' failed to satisfy constraint: 64-bit signless integer attribute";
  }
  return ::mlir::success();
}

static ::mlir::LogicalResult __mlir_ods_local_attr_constraint_tf_ops2(
    ::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) {
  if (attr && !((((attr.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(attr.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return ((attr.isa<::mlir::TypeAttr>())) && ((attr.cast<::mlir::TypeAttr>().getValue().isa<::mlir::Type>())); }))) && ((attr.cast<::mlir::ArrayAttr>().size() >= 1)))) {
    return op->emitOpError("attribute '") << attrName
        << "' failed to satisfy constraint: type array attribute with at least 1 elements";
  }
  return ::mlir::success();
}

static ::mlir::LogicalResult __mlir_ods_local_attr_constraint_tf_ops3(
    ::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) {
  if (attr && !((((attr.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(attr.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return (attr.isa<mlir::TF::ShapeAttr>()); }))) && ((attr.cast<::mlir::ArrayAttr>().size() >= 1)))) {
    return op->emitOpError("attribute '") << attrName
        << "' failed to satisfy constraint: tensorflow shape attribute array with at least 1 elements";
  }
  return ::mlir::success();
}

static ::mlir::LogicalResult __mlir_ods_local_attr_constraint_tf_ops4(
    ::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) {
  if (attr && !((((attr.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(attr.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return (attr.isa<::mlir::StringAttr>()); }))) && ((attr.cast<::mlir::ArrayAttr>().size() >= 1)))) {
    return op->emitOpError("attribute '") << attrName
        << "' failed to satisfy constraint: string array attribute with at least 1 elements";
  }
  return ::mlir::success();
}

static ::mlir::LogicalResult __mlir_ods_local_attr_constraint_tf_ops5(
    ::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) {
  if (attr && !(((attr.isa<::mlir::FloatAttr>())) && ((attr.cast<::mlir::FloatAttr>().getType().isF32())))) {
    return op->emitOpError("attribute '") << attrName
        << "' failed to satisfy constraint: 32-bit float attribute";
  }
  return ::mlir::success();
}

static ::mlir::LogicalResult __mlir_ods_local_attr_constraint_tf_ops6(
    ::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) {
  if (attr && !((attr.isa<::mlir::StringAttr>()))) {
    return op->emitOpError("attribute '") << attrName
        << "' failed to satisfy constraint: string attribute";
  }
  return ::mlir::success();
}

static ::mlir::LogicalResult __mlir_ods_local_attr_constraint_tf_ops7(
    ::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) {
  if (attr && !((((attr.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(attr.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return ((attr.isa<::mlir::IntegerAttr>())) && ((attr.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64))); }))) && ((attr.cast<::mlir::ArrayAttr>().size() >= 5)))) {
    return op->emitOpError("attribute '") << attrName
        << "' failed to satisfy constraint: 64-bit integer array attribute with at least 5 elements";
  }
  return ::mlir::success();
}

static ::mlir::LogicalResult __mlir_ods_local_attr_constraint_tf_ops8(
    ::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) {
  if (attr && !((attr.cast<StringAttr>().getValue() == "SAME" || attr.cast<StringAttr>().getValue() == "VALID"))) {
    return op->emitOpError("attribute '") << attrName
        << "' failed to satisfy constraint: string attribute whose value is SAME, or VALID";
  }
  return ::mlir::success();
}

static ::mlir::LogicalResult __mlir_ods_local_attr_constraint_tf_ops9(
    ::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) {
  if (attr && !((attr.cast<StringAttr>().getValue() == "NDHWC" || attr.cast<StringAttr>().getValue() == "NCDHW"))) {
    return op->emitOpError("attribute '") << attrName
        << "' failed to satisfy constraint: string attribute whose value is NDHWC, or NCDHW";
  }
  return ::mlir::success();
}

static ::mlir::LogicalResult __mlir_ods_local_attr_constraint_tf_ops10(
    ::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) {
  if (attr && !((((attr.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(attr.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return ((attr.isa<::mlir::IntegerAttr>())) && ((attr.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64))); }))) && ((attr.cast<::mlir::ArrayAttr>().size() >= 4)))) {
    return op->emitOpError("attribute '") << attrName
        << "' failed to satisfy constraint: 64-bit integer array attribute with at least 4 elements";
  }
  return ::mlir::success();
}

static ::mlir::LogicalResult __mlir_ods_local_attr_constraint_tf_ops11(
    ::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) {
  if (attr && !((attr.cast<StringAttr>().getValue() == "NHWC" || attr.cast<StringAttr>().getValue() == "NCHW"))) {
    return op->emitOpError("attribute '") << attrName
        << "' failed to satisfy constraint: 'NHWC' or 'NCHW' convnet data format";
  }
  return ::mlir::success();
}

static ::mlir::LogicalResult __mlir_ods_local_attr_constraint_tf_ops12(
    ::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) {
  if (attr && !((attr.isa<::mlir::SymbolRefAttr>()))) {
    return op->emitOpError("attribute '") << attrName
        << "' failed to satisfy constraint: symbol reference attribute";
  }
  return ::mlir::success();
}

static ::mlir::LogicalResult __mlir_ods_local_attr_constraint_tf_ops13(
    ::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) {
  if (attr && !(((attr.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(attr.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return ((attr.isa<::mlir::IntegerAttr>())) && ((attr.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64))); })))) {
    return op->emitOpError("attribute '") << attrName
        << "' failed to satisfy constraint: 64-bit integer array attribute";
  }
  return ::mlir::success();
}

static ::mlir::LogicalResult __mlir_ods_local_attr_constraint_tf_ops14(
    ::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) {
  if (attr && !((((attr.isa<::mlir::IntegerAttr>())) && ((attr.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))) && ((attr.cast<::mlir::IntegerAttr>().getInt() >= 2)))) {
    return op->emitOpError("attribute '") << attrName
        << "' failed to satisfy constraint: 64-bit signless integer attribute whose minimum value is 2";
  }
  return ::mlir::success();
}

static ::mlir::LogicalResult __mlir_ods_local_attr_constraint_tf_ops15(
    ::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) {
  if (attr && !(((attr.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(attr.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return ((attr.isa<::mlir::FloatAttr>())) && ((attr.cast<::mlir::FloatAttr>().getType().isF32())); })))) {
    return op->emitOpError("attribute '") << attrName
        << "' failed to satisfy constraint: 32-bit float array attribute";
  }
  return ::mlir::success();
}

static ::mlir::LogicalResult __mlir_ods_local_attr_constraint_tf_ops16(
    ::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) {
  if (attr && !((((attr.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(attr.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return (attr.isa<::mlir::SymbolRefAttr>()); }))) && ((attr.cast<::mlir::ArrayAttr>().size() >= 1)))) {
    return op->emitOpError("attribute '") << attrName
        << "' failed to satisfy constraint: symbol ref array attribute with at least 1 elements";
  }
  return ::mlir::success();
}

static ::mlir::LogicalResult __mlir_ods_local_attr_constraint_tf_ops17(
    ::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) {
  if (attr && !((attr.isa<mlir::TF::ShapeAttr>()))) {
    return op->emitOpError("attribute '") << attrName
        << "' failed to satisfy constraint: TensorFlow shape attribute";
  }
  return ::mlir::success();
}

static ::mlir::LogicalResult __mlir_ods_local_attr_constraint_tf_ops18(
    ::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) {
  if (attr && !((attr.cast<StringAttr>().getValue() == "Min" || attr.cast<StringAttr>().getValue() == "Max" || attr.cast<StringAttr>().getValue() == "Mul" || attr.cast<StringAttr>().getValue() == "Add"))) {
    return op->emitOpError("attribute '") << attrName
        << "' failed to satisfy constraint: string attribute whose value is Min, or Max, or Mul, or Add";
  }
  return ::mlir::success();
}

static ::mlir::LogicalResult __mlir_ods_local_attr_constraint_tf_ops19(
    ::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) {
  if (attr && !((attr.cast<StringAttr>().getValue() == "Id" || attr.cast<StringAttr>().getValue() == "Div"))) {
    return op->emitOpError("attribute '") << attrName
        << "' failed to satisfy constraint: string attribute whose value is Id, or Div";
  }
  return ::mlir::success();
}

static ::mlir::LogicalResult __mlir_ods_local_attr_constraint_tf_ops20(
    ::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) {
  if (attr && !((attr.isa<::mlir::ElementsAttr>()))) {
    return op->emitOpError("attribute '") << attrName
        << "' failed to satisfy constraint: constant vector/tensor attribute";
  }
  return ::mlir::success();
}

static ::mlir::LogicalResult __mlir_ods_local_attr_constraint_tf_ops21(
    ::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) {
  if (attr && !((attr.cast<StringAttr>().getValue() == "SAME" || attr.cast<StringAttr>().getValue() == "VALID" || attr.cast<StringAttr>().getValue() == "EXPLICIT"))) {
    return op->emitOpError("attribute '") << attrName
        << "' failed to satisfy constraint: string attribute whose value is SAME, or VALID, or EXPLICIT";
  }
  return ::mlir::success();
}

static ::mlir::LogicalResult __mlir_ods_local_attr_constraint_tf_ops22(
    ::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) {
  if (attr && !(((attr.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(attr.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return (attr.isa<::mlir::StringAttr>()); })))) {
    return op->emitOpError("attribute '") << attrName
        << "' failed to satisfy constraint: string array attribute";
  }
  return ::mlir::success();
}

static ::mlir::LogicalResult __mlir_ods_local_attr_constraint_tf_ops23(
    ::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) {
  if (attr && !((attr.cast<StringAttr>().getValue() == "NHWC" || attr.cast<StringAttr>().getValue() == "NCHW" || attr.cast<StringAttr>().getValue() == "NCHW_VECT_C"))) {
    return op->emitOpError("attribute '") << attrName
        << "' failed to satisfy constraint: string attribute whose value is NHWC, or NCHW, or NCHW_VECT_C";
  }
  return ::mlir::success();
}

static ::mlir::LogicalResult __mlir_ods_local_attr_constraint_tf_ops24(
    ::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) {
  if (attr && !((attr.cast<StringAttr>().getValue() == "MIN_COMBINED" || attr.cast<StringAttr>().getValue() == "MIN_FIRST" || attr.cast<StringAttr>().getValue() == "SCALED"))) {
    return op->emitOpError("attribute '") << attrName
        << "' failed to satisfy constraint: string attribute whose value is MIN_COMBINED, or MIN_FIRST, or SCALED";
  }
  return ::mlir::success();
}

static ::mlir::LogicalResult __mlir_ods_local_attr_constraint_tf_ops25(
    ::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) {
  if (attr && !((attr.cast<StringAttr>().getValue() == "NHWC" || attr.cast<StringAttr>().getValue() == "NCHW" || attr.cast<StringAttr>().getValue() == "NDHWC" || attr.cast<StringAttr>().getValue() == "NCDHW"))) {
    return op->emitOpError("attribute '") << attrName
        << "' failed to satisfy constraint: string attribute whose value is NHWC, or NCHW, or NDHWC, or NCDHW";
  }
  return ::mlir::success();
}

static ::mlir::LogicalResult __mlir_ods_local_attr_constraint_tf_ops26(
    ::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) {
  if (attr && !(((attr.isa<::mlir::TypeAttr>())) && ((attr.cast<::mlir::TypeAttr>().getValue().isa<::mlir::Type>())))) {
    return op->emitOpError("attribute '") << attrName
        << "' failed to satisfy constraint: any type attribute";
  }
  return ::mlir::success();
}

static ::mlir::LogicalResult __mlir_ods_local_attr_constraint_tf_ops27(
    ::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) {
  if (attr && !((attr.isa<::mlir::FlatSymbolRefAttr>()))) {
    return op->emitOpError("attribute '") << attrName
        << "' failed to satisfy constraint: flat symbol reference attribute";
  }
  return ::mlir::success();
}

static ::mlir::LogicalResult __mlir_ods_local_attr_constraint_tf_ops28(
    ::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) {
  if (attr && !(((attr.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(attr.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return (attr.isa<mlir::TF::ShapeAttr>()); })))) {
    return op->emitOpError("attribute '") << attrName
        << "' failed to satisfy constraint: tensorflow shape attribute array";
  }
  return ::mlir::success();
}

static ::mlir::LogicalResult __mlir_ods_local_attr_constraint_tf_ops29(
    ::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) {
  if (attr && !((((attr.isa<::mlir::IntegerAttr>())) && ((attr.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))) && ((attr.cast<::mlir::IntegerAttr>().getInt() >= -2)))) {
    return op->emitOpError("attribute '") << attrName
        << "' failed to satisfy constraint: 64-bit signless integer attribute whose minimum value is -2";
  }
  return ::mlir::success();
}

static ::mlir::LogicalResult __mlir_ods_local_attr_constraint_tf_ops30(
    ::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) {
  if (attr && !((((attr.isa<::mlir::IntegerAttr>())) && ((attr.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))) && ((attr.cast<::mlir::IntegerAttr>().getInt() >= -1)))) {
    return op->emitOpError("attribute '") << attrName
        << "' failed to satisfy constraint: 64-bit signless integer attribute whose minimum value is -1";
  }
  return ::mlir::success();
}

static ::mlir::LogicalResult __mlir_ods_local_attr_constraint_tf_ops31(
    ::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) {
  if (attr && !(((attr.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(attr.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return ((attr.isa<::mlir::TypeAttr>())) && ((attr.cast<::mlir::TypeAttr>().getValue().isa<::mlir::Type>())); })))) {
    return op->emitOpError("attribute '") << attrName
        << "' failed to satisfy constraint: type array attribute";
  }
  return ::mlir::success();
}

static ::mlir::LogicalResult __mlir_ods_local_attr_constraint_tf_ops32(
    ::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) {
  if (attr && !((attr.cast<StringAttr>().getValue() == "LEFT_RIGHT" || attr.cast<StringAttr>().getValue() == "RIGHT_LEFT" || attr.cast<StringAttr>().getValue() == "LEFT_LEFT" || attr.cast<StringAttr>().getValue() == "RIGHT_RIGHT"))) {
    return op->emitOpError("attribute '") << attrName
        << "' failed to satisfy constraint: string attribute whose value is LEFT_RIGHT, or RIGHT_LEFT, or LEFT_LEFT, or RIGHT_RIGHT";
  }
  return ::mlir::success();
}

static ::mlir::LogicalResult __mlir_ods_local_attr_constraint_tf_ops33(
    ::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) {
  if (attr && !((attr.cast<StringAttr>().getValue() == "REFLECT" || attr.cast<StringAttr>().getValue() == "SYMMETRIC"))) {
    return op->emitOpError("attribute '") << attrName
        << "' failed to satisfy constraint: string attribute whose value is REFLECT, or SYMMETRIC";
  }
  return ::mlir::success();
}

static ::mlir::LogicalResult __mlir_ods_local_attr_constraint_tf_ops34(
    ::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) {
  if (attr && !(((attr.isa<::mlir::DenseIntElementsAttr>())) && ((attr.cast<::mlir::DenseIntElementsAttr>().getType().getElementType().isSignlessInteger(32))))) {
    return op->emitOpError("attribute '") << attrName
        << "' failed to satisfy constraint: 32-bit signless integer elements attribute";
  }
  return ::mlir::success();
}

static ::mlir::LogicalResult __mlir_ods_local_attr_constraint_tf_ops35(
    ::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) {
  if (attr && !((((attr.isa<::mlir::IntegerAttr>())) && ((attr.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))) && ((attr.cast<::mlir::IntegerAttr>().getInt() >= 0)))) {
    return op->emitOpError("attribute '") << attrName
        << "' failed to satisfy constraint: 64-bit signless integer attribute whose minimum value is 0";
  }
  return ::mlir::success();
}

static ::mlir::LogicalResult __mlir_ods_local_attr_constraint_tf_ops36(
    ::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) {
  if (attr && !((attr.cast<StringAttr>().getValue() == "HALF_TO_EVEN" || attr.cast<StringAttr>().getValue() == "HALF_UP"))) {
    return op->emitOpError("attribute '") << attrName
        << "' failed to satisfy constraint: string attribute whose value is HALF_TO_EVEN, or HALF_UP";
  }
  return ::mlir::success();
}

static ::mlir::LogicalResult __mlir_ods_local_attr_constraint_tf_ops37(
    ::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) {
  if (attr && !((((attr.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(attr.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return ((attr.isa<::mlir::TypeAttr>())) && ((attr.cast<::mlir::TypeAttr>().getValue().isa<::mlir::Type>())); }))) && ((attr.cast<::mlir::ArrayAttr>().size() >= 0)))) {
    return op->emitOpError("attribute '") << attrName
        << "' failed to satisfy constraint: type array attribute with at least 0 elements";
  }
  return ::mlir::success();
}

static ::mlir::LogicalResult __mlir_ods_local_attr_constraint_tf_ops38(
    ::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) {
  if (attr && !((((attr.isa<::mlir::IntegerAttr>())) && ((attr.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))) && ((attr.cast<::mlir::IntegerAttr>().getInt() >= 1)))) {
    return op->emitOpError("attribute '") << attrName
        << "' failed to satisfy constraint: 64-bit signless integer attribute whose minimum value is 1";
  }
  return ::mlir::success();
}

static ::mlir::LogicalResult __mlir_ods_local_attr_constraint_tf_ops39(
    ::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) {
  if (attr && !(((attr.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(attr.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return ((attr.isa<::mlir::IntegerAttr>())) && ((attr.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(32))); })))) {
    return op->emitOpError("attribute '") << attrName
        << "' failed to satisfy constraint: 32-bit integer array attribute";
  }
  return ::mlir::success();
}

static ::mlir::LogicalResult __mlir_ods_local_attr_constraint_tf_ops40(
    ::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) {
  if (attr && !((attr.isa<::mlir::UnitAttr>()))) {
    return op->emitOpError("attribute '") << attrName
        << "' failed to satisfy constraint: unit attribute";
  }
  return ::mlir::success();
}

static ::mlir::LogicalResult __mlir_ods_local_attr_constraint_tf_ops41(
    ::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) {
  if (attr && !((attr.cast<StringAttr>().getValue() == "Min" || attr.cast<StringAttr>().getValue() == "Max" || attr.cast<StringAttr>().getValue() == "Mul" || attr.cast<StringAttr>().getValue() == "Add" || attr.cast<StringAttr>().getValue() == "Mean"))) {
    return op->emitOpError("attribute '") << attrName
        << "' failed to satisfy constraint: string attribute whose value is Min, or Max, or Mul, or Add, or Mean";
  }
  return ::mlir::success();
}

static ::mlir::LogicalResult __mlir_ods_local_attr_constraint_tf_ops42(
    ::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) {
  if (attr && !((attr.cast<StringAttr>().getValue() == "CrossReplica" || attr.cast<StringAttr>().getValue() == "CrossReplicaAndPartition"))) {
    return op->emitOpError("attribute '") << attrName
        << "' failed to satisfy constraint: string attribute whose value is CrossReplica, or CrossReplicaAndPartition";
  }
  return ::mlir::success();
}

static ::mlir::LogicalResult __mlir_ods_local_region_constraint_tf_ops0(
    ::mlir::Operation *op, ::mlir::Region &region, ::llvm::StringRef regionName,
    unsigned regionIndex) {
  if (!((::llvm::hasNItems(region, 1)))) {
    return op->emitOpError("region #") << regionIndex
        << (regionName.empty() ? " " : " ('" + regionName + "') ")
        << "failed to verify constraint: region with 1 blocks";
  }
  return ::mlir::success();
}
} // namespace TF
} // namespace mlir
namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::AbsOp definitions
//===----------------------------------------------------------------------===//

AbsOpAdaptor::AbsOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

AbsOpAdaptor::AbsOpAdaptor(AbsOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange AbsOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> AbsOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange AbsOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value AbsOpAdaptor::x() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr AbsOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult AbsOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> AbsOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range AbsOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value AbsOp::x() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange AbsOp::xMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> AbsOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range AbsOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value AbsOp::y() {
  return *getODSResults(0).begin();
}

::mlir::Type AbsOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool AbsOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr AbsOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void AbsOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type y, ::mlir::Value x) {
  odsState.addOperands(x);
  odsState.addTypes(y);
}

void AbsOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value x) {
  odsState.addOperands(x);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void AbsOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

void AbsOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value x) {
  odsState.addOperands(x);
  odsState.addTypes({x.getType()});

}

void AbsOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  odsState.addTypes({operands[0].getType()});

}

::mlir::LogicalResult AbsOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops0(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops0(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void AbsOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::AbsOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::AcosOp definitions
//===----------------------------------------------------------------------===//

AcosOpAdaptor::AcosOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

AcosOpAdaptor::AcosOpAdaptor(AcosOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange AcosOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> AcosOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange AcosOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value AcosOpAdaptor::x() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr AcosOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult AcosOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> AcosOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range AcosOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value AcosOp::x() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange AcosOp::xMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> AcosOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range AcosOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value AcosOp::y() {
  return *getODSResults(0).begin();
}

::mlir::Type AcosOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool AcosOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr AcosOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void AcosOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type y, ::mlir::Value x) {
  odsState.addOperands(x);
  odsState.addTypes(y);
}

void AcosOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value x) {
  odsState.addOperands(x);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void AcosOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult AcosOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops1(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops1(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void AcosOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::AcosOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::AcoshOp definitions
//===----------------------------------------------------------------------===//

AcoshOpAdaptor::AcoshOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

AcoshOpAdaptor::AcoshOpAdaptor(AcoshOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange AcoshOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> AcoshOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange AcoshOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value AcoshOpAdaptor::x() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr AcoshOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult AcoshOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> AcoshOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range AcoshOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value AcoshOp::x() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange AcoshOp::xMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> AcoshOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range AcoshOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value AcoshOp::y() {
  return *getODSResults(0).begin();
}

::mlir::Type AcoshOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool AcoshOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr AcoshOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void AcoshOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type y, ::mlir::Value x) {
  odsState.addOperands(x);
  odsState.addTypes(y);
}

void AcoshOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value x) {
  odsState.addOperands(x);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void AcoshOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult AcoshOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops2(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops2(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void AcoshOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::AcoshOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::AddNOp definitions
//===----------------------------------------------------------------------===//

AddNOpAdaptor::AddNOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

AddNOpAdaptor::AddNOpAdaptor(AddNOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange AddNOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> AddNOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  bool isVariadic[] = {true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (odsOperands.size() - 0) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::ValueRange AddNOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::ValueRange AddNOpAdaptor::inputs() {
  return getODSOperands(0);
}

::mlir::DictionaryAttr AddNOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult AddNOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> AddNOp::getODSOperandIndexAndLength(unsigned index) {
  bool isVariadic[] = {true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (getOperation()->getNumOperands() - 0) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::Operation::operand_range AddNOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Operation::operand_range AddNOp::inputs() {
  return getODSOperands(0);
}

::mlir::MutableOperandRange AddNOp::inputsMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> AddNOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range AddNOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value AddNOp::sum() {
  return *getODSResults(0).begin();
}

size_t AddNOp::N() {
  auto range = getODSOperands(0);
return std::distance(range.begin(), range.end());
}

::mlir::Type AddNOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool AddNOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "N") return true;
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr AddNOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {NAttrName(),
odsBuilder.getI64IntegerAttr(N())},
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void AddNOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type sum, ::mlir::ValueRange inputs) {
  odsState.addOperands(inputs);
  odsState.addTypes(sum);
}

void AddNOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult AddNOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops3(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops3(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void AddNOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::AddNOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::AddOp definitions
//===----------------------------------------------------------------------===//

AddOpAdaptor::AddOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

AddOpAdaptor::AddOpAdaptor(AddOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange AddOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> AddOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange AddOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value AddOpAdaptor::x() {
  return *getODSOperands(0).begin();
}

::mlir::Value AddOpAdaptor::y() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr AddOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult AddOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> AddOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range AddOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value AddOp::x() {
  return *getODSOperands(0).begin();
}

::mlir::Value AddOp::y() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange AddOp::xMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange AddOp::yMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> AddOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range AddOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value AddOp::z() {
  return *getODSResults(0).begin();
}

::mlir::Type AddOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool AddOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr AddOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void AddOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, Value x, Value y) {
  auto resultType =
      OpTrait::util::getBroadcastedType(x.getType(), y.getType());
  if (!resultType)
    mlir::emitError(odsState.location, "non-broadcastable operands");
  return build(odsBuilder, odsState, resultType, x, y);
}

void AddOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type z, ::mlir::Value x, ::mlir::Value y) {
  odsState.addOperands(x);
  odsState.addOperands(y);
  odsState.addTypes(z);
}

void AddOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value x, ::mlir::Value y) {
  odsState.addOperands(x);
  odsState.addOperands(y);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void AddOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult AddOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops4(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops4(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops4(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void AddOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::AddOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::AddV2Op definitions
//===----------------------------------------------------------------------===//

AddV2OpAdaptor::AddV2OpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

AddV2OpAdaptor::AddV2OpAdaptor(AddV2Op &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange AddV2OpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> AddV2OpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange AddV2OpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value AddV2OpAdaptor::x() {
  return *getODSOperands(0).begin();
}

::mlir::Value AddV2OpAdaptor::y() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr AddV2OpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult AddV2OpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> AddV2Op::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range AddV2Op::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value AddV2Op::x() {
  return *getODSOperands(0).begin();
}

::mlir::Value AddV2Op::y() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange AddV2Op::xMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange AddV2Op::yMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> AddV2Op::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range AddV2Op::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value AddV2Op::z() {
  return *getODSResults(0).begin();
}

::mlir::Type AddV2Op::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool AddV2Op::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr AddV2Op::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void AddV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, Value x, Value y) {
  auto resultType =
      OpTrait::util::getBroadcastedType(x.getType(), y.getType());
  if (!resultType)
    mlir::emitError(odsState.location, "non-broadcastable operands");
  return build(odsBuilder, odsState, resultType, x, y);
}

void AddV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type z, ::mlir::Value x, ::mlir::Value y) {
  odsState.addOperands(x);
  odsState.addOperands(y);
  odsState.addTypes(z);
}

void AddV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value x, ::mlir::Value y) {
  odsState.addOperands(x);
  odsState.addOperands(y);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void AddV2Op::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult AddV2Op::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops5(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops5(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops5(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void AddV2Op::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::AddV2Op)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::AdjustContrastv2Op definitions
//===----------------------------------------------------------------------===//

AdjustContrastv2OpAdaptor::AdjustContrastv2OpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

AdjustContrastv2OpAdaptor::AdjustContrastv2OpAdaptor(AdjustContrastv2Op &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange AdjustContrastv2OpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> AdjustContrastv2OpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange AdjustContrastv2OpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value AdjustContrastv2OpAdaptor::images() {
  return *getODSOperands(0).begin();
}

::mlir::Value AdjustContrastv2OpAdaptor::contrast_factor() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr AdjustContrastv2OpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult AdjustContrastv2OpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> AdjustContrastv2Op::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range AdjustContrastv2Op::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value AdjustContrastv2Op::images() {
  return *getODSOperands(0).begin();
}

::mlir::Value AdjustContrastv2Op::contrast_factor() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange AdjustContrastv2Op::imagesMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange AdjustContrastv2Op::contrast_factorMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> AdjustContrastv2Op::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range AdjustContrastv2Op::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value AdjustContrastv2Op::output() {
  return *getODSResults(0).begin();
}

::mlir::Type AdjustContrastv2Op::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool AdjustContrastv2Op::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr AdjustContrastv2Op::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void AdjustContrastv2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value images, ::mlir::Value contrast_factor) {
  odsState.addOperands(images);
  odsState.addOperands(contrast_factor);
  odsState.addTypes(output);
}

void AdjustContrastv2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value images, ::mlir::Value contrast_factor) {
  odsState.addOperands(images);
  odsState.addOperands(contrast_factor);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void AdjustContrastv2Op::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult AdjustContrastv2Op::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops6(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops6(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void AdjustContrastv2Op::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::AdjustContrastv2Op)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::AdjustHueOp definitions
//===----------------------------------------------------------------------===//

AdjustHueOpAdaptor::AdjustHueOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

AdjustHueOpAdaptor::AdjustHueOpAdaptor(AdjustHueOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange AdjustHueOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> AdjustHueOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange AdjustHueOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value AdjustHueOpAdaptor::images() {
  return *getODSOperands(0).begin();
}

::mlir::Value AdjustHueOpAdaptor::delta() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr AdjustHueOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult AdjustHueOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> AdjustHueOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range AdjustHueOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value AdjustHueOp::images() {
  return *getODSOperands(0).begin();
}

::mlir::Value AdjustHueOp::delta() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange AdjustHueOp::imagesMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange AdjustHueOp::deltaMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> AdjustHueOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range AdjustHueOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value AdjustHueOp::output() {
  return *getODSResults(0).begin();
}

::mlir::Type AdjustHueOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool AdjustHueOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr AdjustHueOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void AdjustHueOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value images, ::mlir::Value delta) {
  odsState.addOperands(images);
  odsState.addOperands(delta);
  odsState.addTypes(output);
}

void AdjustHueOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value images, ::mlir::Value delta) {
  odsState.addOperands(images);
  odsState.addOperands(delta);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void AdjustHueOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult AdjustHueOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops6(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops6(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void AdjustHueOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::AdjustHueOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::AdjustSaturationOp definitions
//===----------------------------------------------------------------------===//

AdjustSaturationOpAdaptor::AdjustSaturationOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

AdjustSaturationOpAdaptor::AdjustSaturationOpAdaptor(AdjustSaturationOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange AdjustSaturationOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> AdjustSaturationOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange AdjustSaturationOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value AdjustSaturationOpAdaptor::images() {
  return *getODSOperands(0).begin();
}

::mlir::Value AdjustSaturationOpAdaptor::scale() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr AdjustSaturationOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult AdjustSaturationOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> AdjustSaturationOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range AdjustSaturationOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value AdjustSaturationOp::images() {
  return *getODSOperands(0).begin();
}

::mlir::Value AdjustSaturationOp::scale() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange AdjustSaturationOp::imagesMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange AdjustSaturationOp::scaleMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> AdjustSaturationOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range AdjustSaturationOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value AdjustSaturationOp::output() {
  return *getODSResults(0).begin();
}

::mlir::Type AdjustSaturationOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool AdjustSaturationOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr AdjustSaturationOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void AdjustSaturationOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value images, ::mlir::Value scale) {
  odsState.addOperands(images);
  odsState.addOperands(scale);
  odsState.addTypes(output);
}

void AdjustSaturationOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value images, ::mlir::Value scale) {
  odsState.addOperands(images);
  odsState.addOperands(scale);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void AdjustSaturationOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult AdjustSaturationOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops6(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops6(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void AdjustSaturationOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::AdjustSaturationOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::AllOp definitions
//===----------------------------------------------------------------------===//

AllOpAdaptor::AllOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

AllOpAdaptor::AllOpAdaptor(AllOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange AllOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> AllOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange AllOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value AllOpAdaptor::input() {
  return *getODSOperands(0).begin();
}

::mlir::Value AllOpAdaptor::reduction_indices() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr AllOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::BoolAttr AllOpAdaptor::keep_dims() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("keep_dims").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(false);
  return attr;
}

::mlir::LogicalResult AllOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_keep_dims = odsAttrs.get("keep_dims");
    if (tblgen_keep_dims && !((tblgen_keep_dims.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.All' op ""attribute 'keep_dims' failed to satisfy constraint: bool attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> AllOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range AllOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value AllOp::input() {
  return *getODSOperands(0).begin();
}

::mlir::Value AllOp::reduction_indices() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange AllOp::inputMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange AllOp::reduction_indicesMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> AllOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range AllOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value AllOp::output() {
  return *getODSResults(0).begin();
}

::mlir::BoolAttr AllOp::keep_dimsAttr() {
  return (*this)->getAttr(keep_dimsAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool AllOp::keep_dims() {
  auto attr = keep_dimsAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(false).getValue();
  return attr.getValue();
}

::mlir::Type AllOp::Tidx() {
  return mlir::getElementTypeOrSelf(*getODSOperands(1).begin());
}

bool AllOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "Tidx") return true;
 return false;
}

::mlir::DictionaryAttr AllOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TidxAttrName(),
::mlir::TypeAttr::get(Tidx())}});
}

void AllOp::keep_dimsAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(keep_dimsAttrName(), attr);
}

void AllOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input, ::mlir::Value reduction_indices, ::mlir::BoolAttr keep_dims) {
  odsState.addOperands(input);
  odsState.addOperands(reduction_indices);
  odsState.addAttribute(keep_dimsAttrName(odsState.name), keep_dims);
  odsState.addTypes(output);
}

void AllOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::Value reduction_indices, ::mlir::BoolAttr keep_dims) {
  odsState.addOperands(input);
  odsState.addOperands(reduction_indices);
  odsState.addAttribute(keep_dimsAttrName(odsState.name), keep_dims);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void AllOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input, ::mlir::Value reduction_indices, bool keep_dims) {
  odsState.addOperands(input);
  odsState.addOperands(reduction_indices);
  odsState.addAttribute(keep_dimsAttrName(odsState.name), odsBuilder.getBoolAttr(keep_dims));
  odsState.addTypes(output);
}

void AllOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::Value reduction_indices, bool keep_dims) {
  odsState.addOperands(input);
  odsState.addOperands(reduction_indices);
  odsState.addAttribute(keep_dimsAttrName(odsState.name), odsBuilder.getBoolAttr(keep_dims));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void AllOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult AllOp::verify() {
  {
    auto tblgen_keep_dims = (*this)->getAttr(keep_dimsAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_keep_dims, "keep_dims")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops8(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops8(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return Verify(*this);
}

void AllOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::AllOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::AllToAllOp definitions
//===----------------------------------------------------------------------===//

AllToAllOpAdaptor::AllToAllOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

AllToAllOpAdaptor::AllToAllOpAdaptor(AllToAllOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange AllToAllOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> AllToAllOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange AllToAllOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value AllToAllOpAdaptor::input() {
  return *getODSOperands(0).begin();
}

::mlir::Value AllToAllOpAdaptor::group_assignment() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr AllToAllOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::IntegerAttr AllToAllOpAdaptor::concat_dimension() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("concat_dimension").cast<::mlir::IntegerAttr>();
  return attr;
}

::mlir::IntegerAttr AllToAllOpAdaptor::split_dimension() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("split_dimension").cast<::mlir::IntegerAttr>();
  return attr;
}

::mlir::IntegerAttr AllToAllOpAdaptor::split_count() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("split_count").cast<::mlir::IntegerAttr>();
  return attr;
}

::mlir::LogicalResult AllToAllOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_concat_dimension = odsAttrs.get("concat_dimension");
    if (!tblgen_concat_dimension)
      return emitError(loc, "'tf.AllToAll' op ""requires attribute 'concat_dimension'");

    if (tblgen_concat_dimension && !(((tblgen_concat_dimension.isa<::mlir::IntegerAttr>())) && ((tblgen_concat_dimension.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.AllToAll' op ""attribute 'concat_dimension' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_split_dimension = odsAttrs.get("split_dimension");
    if (!tblgen_split_dimension)
      return emitError(loc, "'tf.AllToAll' op ""requires attribute 'split_dimension'");

    if (tblgen_split_dimension && !(((tblgen_split_dimension.isa<::mlir::IntegerAttr>())) && ((tblgen_split_dimension.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.AllToAll' op ""attribute 'split_dimension' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_split_count = odsAttrs.get("split_count");
    if (!tblgen_split_count)
      return emitError(loc, "'tf.AllToAll' op ""requires attribute 'split_count'");

    if (tblgen_split_count && !(((tblgen_split_count.isa<::mlir::IntegerAttr>())) && ((tblgen_split_count.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.AllToAll' op ""attribute 'split_count' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> AllToAllOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range AllToAllOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value AllToAllOp::input() {
  return *getODSOperands(0).begin();
}

::mlir::Value AllToAllOp::group_assignment() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange AllToAllOp::inputMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange AllToAllOp::group_assignmentMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> AllToAllOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range AllToAllOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value AllToAllOp::output() {
  return *getODSResults(0).begin();
}

::mlir::IntegerAttr AllToAllOp::concat_dimensionAttr() {
  return (*this)->getAttr(concat_dimensionAttrName()).cast<::mlir::IntegerAttr>();
}

uint64_t AllToAllOp::concat_dimension() {
  auto attr = concat_dimensionAttr();
  return attr.getValue().getZExtValue();
}

::mlir::IntegerAttr AllToAllOp::split_dimensionAttr() {
  return (*this)->getAttr(split_dimensionAttrName()).cast<::mlir::IntegerAttr>();
}

uint64_t AllToAllOp::split_dimension() {
  auto attr = split_dimensionAttr();
  return attr.getValue().getZExtValue();
}

::mlir::IntegerAttr AllToAllOp::split_countAttr() {
  return (*this)->getAttr(split_countAttrName()).cast<::mlir::IntegerAttr>();
}

uint64_t AllToAllOp::split_count() {
  auto attr = split_countAttr();
  return attr.getValue().getZExtValue();
}

::mlir::Type AllToAllOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool AllToAllOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr AllToAllOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void AllToAllOp::concat_dimensionAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(concat_dimensionAttrName(), attr);
}

void AllToAllOp::split_dimensionAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(split_dimensionAttrName(), attr);
}

void AllToAllOp::split_countAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(split_countAttrName(), attr);
}

void AllToAllOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input, ::mlir::Value group_assignment, ::mlir::IntegerAttr concat_dimension, ::mlir::IntegerAttr split_dimension, ::mlir::IntegerAttr split_count) {
  odsState.addOperands(input);
  odsState.addOperands(group_assignment);
  odsState.addAttribute(concat_dimensionAttrName(odsState.name), concat_dimension);
  odsState.addAttribute(split_dimensionAttrName(odsState.name), split_dimension);
  odsState.addAttribute(split_countAttrName(odsState.name), split_count);
  odsState.addTypes(output);
}

void AllToAllOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::Value group_assignment, ::mlir::IntegerAttr concat_dimension, ::mlir::IntegerAttr split_dimension, ::mlir::IntegerAttr split_count) {
  odsState.addOperands(input);
  odsState.addOperands(group_assignment);
  odsState.addAttribute(concat_dimensionAttrName(odsState.name), concat_dimension);
  odsState.addAttribute(split_dimensionAttrName(odsState.name), split_dimension);
  odsState.addAttribute(split_countAttrName(odsState.name), split_count);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void AllToAllOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input, ::mlir::Value group_assignment, uint64_t concat_dimension, uint64_t split_dimension, uint64_t split_count) {
  odsState.addOperands(input);
  odsState.addOperands(group_assignment);
  odsState.addAttribute(concat_dimensionAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), concat_dimension));
  odsState.addAttribute(split_dimensionAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), split_dimension));
  odsState.addAttribute(split_countAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), split_count));
  odsState.addTypes(output);
}

void AllToAllOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::Value group_assignment, uint64_t concat_dimension, uint64_t split_dimension, uint64_t split_count) {
  odsState.addOperands(input);
  odsState.addOperands(group_assignment);
  odsState.addAttribute(concat_dimensionAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), concat_dimension));
  odsState.addAttribute(split_dimensionAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), split_dimension));
  odsState.addAttribute(split_countAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), split_count));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void AllToAllOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult AllToAllOp::verify() {
  {
    auto tblgen_concat_dimension = (*this)->getAttr(concat_dimensionAttrName());
    if (!tblgen_concat_dimension)
      return emitOpError("requires attribute 'concat_dimension'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_concat_dimension, "concat_dimension")))
      return ::mlir::failure();
  }
  {
    auto tblgen_split_dimension = (*this)->getAttr(split_dimensionAttrName());
    if (!tblgen_split_dimension)
      return emitOpError("requires attribute 'split_dimension'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_split_dimension, "split_dimension")))
      return ::mlir::failure();
  }
  {
    auto tblgen_split_count = (*this)->getAttr(split_countAttrName());
    if (!tblgen_split_count)
      return emitOpError("requires attribute 'split_count'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_split_count, "split_count")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops10(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops11(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops10(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void AllToAllOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::AllToAllOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::AngleOp definitions
//===----------------------------------------------------------------------===//

AngleOpAdaptor::AngleOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

AngleOpAdaptor::AngleOpAdaptor(AngleOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange AngleOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> AngleOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange AngleOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value AngleOpAdaptor::input() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr AngleOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult AngleOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> AngleOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range AngleOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value AngleOp::input() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange AngleOp::inputMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> AngleOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range AngleOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value AngleOp::output() {
  return *getODSResults(0).begin();
}

::mlir::Type AngleOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

::mlir::Type AngleOp::Tout() {
  return mlir::getElementTypeOrSelf(*getODSResults(0).begin());
}

bool AngleOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
  if (name == "Tout") return true;
 return false;
}

::mlir::DictionaryAttr AngleOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())},
    {ToutAttrName(),
::mlir::TypeAttr::get(Tout())}});
}

void AngleOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input) {
  odsState.addOperands(input);
  odsState.addTypes(output);
}

void AngleOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input) {
  odsState.addOperands(input);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void AngleOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult AngleOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops12(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops13(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void AngleOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::AngleOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::AnonymousIteratorOp definitions
//===----------------------------------------------------------------------===//

AnonymousIteratorOpAdaptor::AnonymousIteratorOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

AnonymousIteratorOpAdaptor::AnonymousIteratorOpAdaptor(AnonymousIteratorOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange AnonymousIteratorOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> AnonymousIteratorOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange AnonymousIteratorOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::DictionaryAttr AnonymousIteratorOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::ArrayAttr AnonymousIteratorOpAdaptor::output_types() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("output_types").cast<::mlir::ArrayAttr>();
  return attr;
}

::mlir::ArrayAttr AnonymousIteratorOpAdaptor::output_shapes() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("output_shapes").cast<::mlir::ArrayAttr>();
  return attr;
}

::mlir::LogicalResult AnonymousIteratorOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_output_types = odsAttrs.get("output_types");
    if (!tblgen_output_types)
      return emitError(loc, "'tf.AnonymousIterator' op ""requires attribute 'output_types'");

    if (tblgen_output_types && !((((tblgen_output_types.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_output_types.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return ((attr.isa<::mlir::TypeAttr>())) && ((attr.cast<::mlir::TypeAttr>().getValue().isa<::mlir::Type>())); }))) && ((tblgen_output_types.cast<::mlir::ArrayAttr>().size() >= 1))))
      return emitError(loc, "'tf.AnonymousIterator' op ""attribute 'output_types' failed to satisfy constraint: type array attribute with at least 1 elements");
  }
  {
    auto tblgen_output_shapes = odsAttrs.get("output_shapes");
    if (!tblgen_output_shapes)
      return emitError(loc, "'tf.AnonymousIterator' op ""requires attribute 'output_shapes'");

    if (tblgen_output_shapes && !((((tblgen_output_shapes.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_output_shapes.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return (attr.isa<mlir::TF::ShapeAttr>()); }))) && ((tblgen_output_shapes.cast<::mlir::ArrayAttr>().size() >= 1))))
      return emitError(loc, "'tf.AnonymousIterator' op ""attribute 'output_shapes' failed to satisfy constraint: tensorflow shape attribute array with at least 1 elements");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> AnonymousIteratorOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range AnonymousIteratorOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

std::pair<unsigned, unsigned> AnonymousIteratorOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range AnonymousIteratorOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value AnonymousIteratorOp::handle() {
  return *getODSResults(0).begin();
}

::mlir::ArrayAttr AnonymousIteratorOp::output_typesAttr() {
  return (*this)->getAttr(output_typesAttrName()).cast<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr AnonymousIteratorOp::output_types() {
  auto attr = output_typesAttr();
  return attr;
}

::mlir::ArrayAttr AnonymousIteratorOp::output_shapesAttr() {
  return (*this)->getAttr(output_shapesAttrName()).cast<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr AnonymousIteratorOp::output_shapes() {
  auto attr = output_shapesAttr();
  return attr;
}

void AnonymousIteratorOp::output_typesAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(output_typesAttrName(), attr);
}

void AnonymousIteratorOp::output_shapesAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(output_shapesAttrName(), attr);
}

void AnonymousIteratorOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type handle, ::mlir::ArrayAttr output_types, ::mlir::ArrayAttr output_shapes) {
  odsState.addAttribute(output_typesAttrName(odsState.name), output_types);
  odsState.addAttribute(output_shapesAttrName(odsState.name), output_shapes);
  odsState.addTypes(handle);
}

void AnonymousIteratorOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ArrayAttr output_types, ::mlir::ArrayAttr output_shapes) {
  odsState.addAttribute(output_typesAttrName(odsState.name), output_types);
  odsState.addAttribute(output_shapesAttrName(odsState.name), output_shapes);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void AnonymousIteratorOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 0u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult AnonymousIteratorOp::verify() {
  {
    auto tblgen_output_types = (*this)->getAttr(output_typesAttrName());
    if (!tblgen_output_types)
      return emitOpError("requires attribute 'output_types'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops2(*this, tblgen_output_types, "output_types")))
      return ::mlir::failure();
  }
  {
    auto tblgen_output_shapes = (*this)->getAttr(output_shapesAttrName());
    if (!tblgen_output_shapes)
      return emitOpError("requires attribute 'output_shapes'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops3(*this, tblgen_output_shapes, "output_shapes")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void AnonymousIteratorOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  for (::mlir::Value value : getODSResults(0))
    effects.emplace_back(::mlir::MemoryEffects::Allocate::get(), value, ::mlir::TF::ResourceEffects::DatasetIterator::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::AnonymousIteratorOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::AnonymousIteratorV2Op definitions
//===----------------------------------------------------------------------===//

AnonymousIteratorV2OpAdaptor::AnonymousIteratorV2OpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

AnonymousIteratorV2OpAdaptor::AnonymousIteratorV2OpAdaptor(AnonymousIteratorV2Op &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange AnonymousIteratorV2OpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> AnonymousIteratorV2OpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange AnonymousIteratorV2OpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::DictionaryAttr AnonymousIteratorV2OpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::ArrayAttr AnonymousIteratorV2OpAdaptor::output_types() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("output_types").cast<::mlir::ArrayAttr>();
  return attr;
}

::mlir::ArrayAttr AnonymousIteratorV2OpAdaptor::output_shapes() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("output_shapes").cast<::mlir::ArrayAttr>();
  return attr;
}

::mlir::LogicalResult AnonymousIteratorV2OpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_output_types = odsAttrs.get("output_types");
    if (!tblgen_output_types)
      return emitError(loc, "'tf.AnonymousIteratorV2' op ""requires attribute 'output_types'");

    if (tblgen_output_types && !((((tblgen_output_types.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_output_types.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return ((attr.isa<::mlir::TypeAttr>())) && ((attr.cast<::mlir::TypeAttr>().getValue().isa<::mlir::Type>())); }))) && ((tblgen_output_types.cast<::mlir::ArrayAttr>().size() >= 1))))
      return emitError(loc, "'tf.AnonymousIteratorV2' op ""attribute 'output_types' failed to satisfy constraint: type array attribute with at least 1 elements");
  }
  {
    auto tblgen_output_shapes = odsAttrs.get("output_shapes");
    if (!tblgen_output_shapes)
      return emitError(loc, "'tf.AnonymousIteratorV2' op ""requires attribute 'output_shapes'");

    if (tblgen_output_shapes && !((((tblgen_output_shapes.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_output_shapes.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return (attr.isa<mlir::TF::ShapeAttr>()); }))) && ((tblgen_output_shapes.cast<::mlir::ArrayAttr>().size() >= 1))))
      return emitError(loc, "'tf.AnonymousIteratorV2' op ""attribute 'output_shapes' failed to satisfy constraint: tensorflow shape attribute array with at least 1 elements");
  }
  return ::mlir::success();
}

void AnonymousIteratorV2Op::getAsmResultNames(::mlir::OpAsmSetValueNameFn setNameFn) {
  auto resultGroup0 = getODSResults(0);
  if (!llvm::empty(resultGroup0))
    setNameFn(*resultGroup0.begin(), "handle");
  auto resultGroup1 = getODSResults(1);
  if (!llvm::empty(resultGroup1))
    setNameFn(*resultGroup1.begin(), "deleter");
}

std::pair<unsigned, unsigned> AnonymousIteratorV2Op::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range AnonymousIteratorV2Op::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

std::pair<unsigned, unsigned> AnonymousIteratorV2Op::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range AnonymousIteratorV2Op::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value AnonymousIteratorV2Op::handle() {
  return *getODSResults(0).begin();
}

::mlir::Value AnonymousIteratorV2Op::deleter() {
  return *getODSResults(1).begin();
}

::mlir::ArrayAttr AnonymousIteratorV2Op::output_typesAttr() {
  return (*this)->getAttr(output_typesAttrName()).cast<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr AnonymousIteratorV2Op::output_types() {
  auto attr = output_typesAttr();
  return attr;
}

::mlir::ArrayAttr AnonymousIteratorV2Op::output_shapesAttr() {
  return (*this)->getAttr(output_shapesAttrName()).cast<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr AnonymousIteratorV2Op::output_shapes() {
  auto attr = output_shapesAttr();
  return attr;
}

void AnonymousIteratorV2Op::output_typesAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(output_typesAttrName(), attr);
}

void AnonymousIteratorV2Op::output_shapesAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(output_shapesAttrName(), attr);
}

void AnonymousIteratorV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type handle, ::mlir::Type deleter, ::mlir::ArrayAttr output_types, ::mlir::ArrayAttr output_shapes) {
  odsState.addAttribute(output_typesAttrName(odsState.name), output_types);
  odsState.addAttribute(output_shapesAttrName(odsState.name), output_shapes);
  odsState.addTypes(handle);
  odsState.addTypes(deleter);
}

void AnonymousIteratorV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ArrayAttr output_types, ::mlir::ArrayAttr output_shapes) {
  odsState.addAttribute(output_typesAttrName(odsState.name), output_types);
  odsState.addAttribute(output_shapesAttrName(odsState.name), output_shapes);
  assert(resultTypes.size() == 2u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void AnonymousIteratorV2Op::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 0u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 2u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult AnonymousIteratorV2Op::verify() {
  {
    auto tblgen_output_types = (*this)->getAttr(output_typesAttrName());
    if (!tblgen_output_types)
      return emitOpError("requires attribute 'output_types'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops2(*this, tblgen_output_types, "output_types")))
      return ::mlir::failure();
  }
  {
    auto tblgen_output_shapes = (*this)->getAttr(output_shapesAttrName());
    if (!tblgen_output_shapes)
      return emitOpError("requires attribute 'output_shapes'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops3(*this, tblgen_output_shapes, "output_shapes")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSResults(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops15(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void AnonymousIteratorV2Op::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  for (::mlir::Value value : getODSResults(0))
    effects.emplace_back(::mlir::MemoryEffects::Allocate::get(), value, ::mlir::TF::ResourceEffects::DatasetIterator::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::AnonymousIteratorV2Op)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::AnonymousIteratorV3Op definitions
//===----------------------------------------------------------------------===//

AnonymousIteratorV3OpAdaptor::AnonymousIteratorV3OpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

AnonymousIteratorV3OpAdaptor::AnonymousIteratorV3OpAdaptor(AnonymousIteratorV3Op &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange AnonymousIteratorV3OpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> AnonymousIteratorV3OpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange AnonymousIteratorV3OpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::DictionaryAttr AnonymousIteratorV3OpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::ArrayAttr AnonymousIteratorV3OpAdaptor::output_types() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("output_types").cast<::mlir::ArrayAttr>();
  return attr;
}

::mlir::ArrayAttr AnonymousIteratorV3OpAdaptor::output_shapes() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("output_shapes").cast<::mlir::ArrayAttr>();
  return attr;
}

::mlir::LogicalResult AnonymousIteratorV3OpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_output_types = odsAttrs.get("output_types");
    if (!tblgen_output_types)
      return emitError(loc, "'tf.AnonymousIteratorV3' op ""requires attribute 'output_types'");

    if (tblgen_output_types && !((((tblgen_output_types.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_output_types.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return ((attr.isa<::mlir::TypeAttr>())) && ((attr.cast<::mlir::TypeAttr>().getValue().isa<::mlir::Type>())); }))) && ((tblgen_output_types.cast<::mlir::ArrayAttr>().size() >= 1))))
      return emitError(loc, "'tf.AnonymousIteratorV3' op ""attribute 'output_types' failed to satisfy constraint: type array attribute with at least 1 elements");
  }
  {
    auto tblgen_output_shapes = odsAttrs.get("output_shapes");
    if (!tblgen_output_shapes)
      return emitError(loc, "'tf.AnonymousIteratorV3' op ""requires attribute 'output_shapes'");

    if (tblgen_output_shapes && !((((tblgen_output_shapes.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_output_shapes.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return (attr.isa<mlir::TF::ShapeAttr>()); }))) && ((tblgen_output_shapes.cast<::mlir::ArrayAttr>().size() >= 1))))
      return emitError(loc, "'tf.AnonymousIteratorV3' op ""attribute 'output_shapes' failed to satisfy constraint: tensorflow shape attribute array with at least 1 elements");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> AnonymousIteratorV3Op::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range AnonymousIteratorV3Op::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

std::pair<unsigned, unsigned> AnonymousIteratorV3Op::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range AnonymousIteratorV3Op::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value AnonymousIteratorV3Op::handle() {
  return *getODSResults(0).begin();
}

::mlir::ArrayAttr AnonymousIteratorV3Op::output_typesAttr() {
  return (*this)->getAttr(output_typesAttrName()).cast<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr AnonymousIteratorV3Op::output_types() {
  auto attr = output_typesAttr();
  return attr;
}

::mlir::ArrayAttr AnonymousIteratorV3Op::output_shapesAttr() {
  return (*this)->getAttr(output_shapesAttrName()).cast<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr AnonymousIteratorV3Op::output_shapes() {
  auto attr = output_shapesAttr();
  return attr;
}

void AnonymousIteratorV3Op::output_typesAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(output_typesAttrName(), attr);
}

void AnonymousIteratorV3Op::output_shapesAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(output_shapesAttrName(), attr);
}

void AnonymousIteratorV3Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type handle, ::mlir::ArrayAttr output_types, ::mlir::ArrayAttr output_shapes) {
  odsState.addAttribute(output_typesAttrName(odsState.name), output_types);
  odsState.addAttribute(output_shapesAttrName(odsState.name), output_shapes);
  odsState.addTypes(handle);
}

void AnonymousIteratorV3Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ArrayAttr output_types, ::mlir::ArrayAttr output_shapes) {
  odsState.addAttribute(output_typesAttrName(odsState.name), output_types);
  odsState.addAttribute(output_shapesAttrName(odsState.name), output_shapes);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void AnonymousIteratorV3Op::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 0u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult AnonymousIteratorV3Op::verify() {
  {
    auto tblgen_output_types = (*this)->getAttr(output_typesAttrName());
    if (!tblgen_output_types)
      return emitOpError("requires attribute 'output_types'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops2(*this, tblgen_output_types, "output_types")))
      return ::mlir::failure();
  }
  {
    auto tblgen_output_shapes = (*this)->getAttr(output_shapesAttrName());
    if (!tblgen_output_shapes)
      return emitOpError("requires attribute 'output_shapes'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops3(*this, tblgen_output_shapes, "output_shapes")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void AnonymousIteratorV3Op::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  for (::mlir::Value value : getODSResults(0))
    effects.emplace_back(::mlir::MemoryEffects::Allocate::get(), value, ::mlir::TF::ResourceEffects::DatasetIterator::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::AnonymousIteratorV3Op)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::AnonymousMemoryCacheOp definitions
//===----------------------------------------------------------------------===//

AnonymousMemoryCacheOpAdaptor::AnonymousMemoryCacheOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

AnonymousMemoryCacheOpAdaptor::AnonymousMemoryCacheOpAdaptor(AnonymousMemoryCacheOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange AnonymousMemoryCacheOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> AnonymousMemoryCacheOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange AnonymousMemoryCacheOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::DictionaryAttr AnonymousMemoryCacheOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult AnonymousMemoryCacheOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

void AnonymousMemoryCacheOp::getAsmResultNames(::mlir::OpAsmSetValueNameFn setNameFn) {
  auto resultGroup0 = getODSResults(0);
  if (!llvm::empty(resultGroup0))
    setNameFn(*resultGroup0.begin(), "handle");
  auto resultGroup1 = getODSResults(1);
  if (!llvm::empty(resultGroup1))
    setNameFn(*resultGroup1.begin(), "deleter");
}

std::pair<unsigned, unsigned> AnonymousMemoryCacheOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range AnonymousMemoryCacheOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

std::pair<unsigned, unsigned> AnonymousMemoryCacheOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range AnonymousMemoryCacheOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value AnonymousMemoryCacheOp::handle() {
  return *getODSResults(0).begin();
}

::mlir::Value AnonymousMemoryCacheOp::deleter() {
  return *getODSResults(1).begin();
}

void AnonymousMemoryCacheOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type handle, ::mlir::Type deleter) {
  odsState.addTypes(handle);
  odsState.addTypes(deleter);
}

void AnonymousMemoryCacheOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes) {
  assert(resultTypes.size() == 2u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void AnonymousMemoryCacheOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 0u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 2u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult AnonymousMemoryCacheOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSResults(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops15(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void AnonymousMemoryCacheOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  for (::mlir::Value value : getODSResults(0))
    effects.emplace_back(::mlir::MemoryEffects::Allocate::get(), value, ::mlir::TF::ResourceEffects::DatasetMemoryCache::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::AnonymousMemoryCacheOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::AnonymousMultiDeviceIteratorOp definitions
//===----------------------------------------------------------------------===//

AnonymousMultiDeviceIteratorOpAdaptor::AnonymousMultiDeviceIteratorOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

AnonymousMultiDeviceIteratorOpAdaptor::AnonymousMultiDeviceIteratorOpAdaptor(AnonymousMultiDeviceIteratorOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange AnonymousMultiDeviceIteratorOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> AnonymousMultiDeviceIteratorOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange AnonymousMultiDeviceIteratorOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::DictionaryAttr AnonymousMultiDeviceIteratorOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::ArrayAttr AnonymousMultiDeviceIteratorOpAdaptor::devices() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("devices").cast<::mlir::ArrayAttr>();
  return attr;
}

::mlir::ArrayAttr AnonymousMultiDeviceIteratorOpAdaptor::output_types() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("output_types").cast<::mlir::ArrayAttr>();
  return attr;
}

::mlir::ArrayAttr AnonymousMultiDeviceIteratorOpAdaptor::output_shapes() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("output_shapes").cast<::mlir::ArrayAttr>();
  return attr;
}

::mlir::LogicalResult AnonymousMultiDeviceIteratorOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_devices = odsAttrs.get("devices");
    if (!tblgen_devices)
      return emitError(loc, "'tf.AnonymousMultiDeviceIterator' op ""requires attribute 'devices'");

    if (tblgen_devices && !((((tblgen_devices.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_devices.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return (attr.isa<::mlir::StringAttr>()); }))) && ((tblgen_devices.cast<::mlir::ArrayAttr>().size() >= 1))))
      return emitError(loc, "'tf.AnonymousMultiDeviceIterator' op ""attribute 'devices' failed to satisfy constraint: string array attribute with at least 1 elements");
  }
  {
    auto tblgen_output_types = odsAttrs.get("output_types");
    if (!tblgen_output_types)
      return emitError(loc, "'tf.AnonymousMultiDeviceIterator' op ""requires attribute 'output_types'");

    if (tblgen_output_types && !((((tblgen_output_types.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_output_types.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return ((attr.isa<::mlir::TypeAttr>())) && ((attr.cast<::mlir::TypeAttr>().getValue().isa<::mlir::Type>())); }))) && ((tblgen_output_types.cast<::mlir::ArrayAttr>().size() >= 1))))
      return emitError(loc, "'tf.AnonymousMultiDeviceIterator' op ""attribute 'output_types' failed to satisfy constraint: type array attribute with at least 1 elements");
  }
  {
    auto tblgen_output_shapes = odsAttrs.get("output_shapes");
    if (!tblgen_output_shapes)
      return emitError(loc, "'tf.AnonymousMultiDeviceIterator' op ""requires attribute 'output_shapes'");

    if (tblgen_output_shapes && !((((tblgen_output_shapes.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_output_shapes.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return (attr.isa<mlir::TF::ShapeAttr>()); }))) && ((tblgen_output_shapes.cast<::mlir::ArrayAttr>().size() >= 1))))
      return emitError(loc, "'tf.AnonymousMultiDeviceIterator' op ""attribute 'output_shapes' failed to satisfy constraint: tensorflow shape attribute array with at least 1 elements");
  }
  return ::mlir::success();
}

void AnonymousMultiDeviceIteratorOp::getAsmResultNames(::mlir::OpAsmSetValueNameFn setNameFn) {
  auto resultGroup0 = getODSResults(0);
  if (!llvm::empty(resultGroup0))
    setNameFn(*resultGroup0.begin(), "handle");
  auto resultGroup1 = getODSResults(1);
  if (!llvm::empty(resultGroup1))
    setNameFn(*resultGroup1.begin(), "deleter");
}

std::pair<unsigned, unsigned> AnonymousMultiDeviceIteratorOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range AnonymousMultiDeviceIteratorOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

std::pair<unsigned, unsigned> AnonymousMultiDeviceIteratorOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range AnonymousMultiDeviceIteratorOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value AnonymousMultiDeviceIteratorOp::handle() {
  return *getODSResults(0).begin();
}

::mlir::Value AnonymousMultiDeviceIteratorOp::deleter() {
  return *getODSResults(1).begin();
}

::mlir::ArrayAttr AnonymousMultiDeviceIteratorOp::devicesAttr() {
  return (*this)->getAttr(devicesAttrName()).cast<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr AnonymousMultiDeviceIteratorOp::devices() {
  auto attr = devicesAttr();
  return attr;
}

::mlir::ArrayAttr AnonymousMultiDeviceIteratorOp::output_typesAttr() {
  return (*this)->getAttr(output_typesAttrName()).cast<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr AnonymousMultiDeviceIteratorOp::output_types() {
  auto attr = output_typesAttr();
  return attr;
}

::mlir::ArrayAttr AnonymousMultiDeviceIteratorOp::output_shapesAttr() {
  return (*this)->getAttr(output_shapesAttrName()).cast<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr AnonymousMultiDeviceIteratorOp::output_shapes() {
  auto attr = output_shapesAttr();
  return attr;
}

void AnonymousMultiDeviceIteratorOp::devicesAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(devicesAttrName(), attr);
}

void AnonymousMultiDeviceIteratorOp::output_typesAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(output_typesAttrName(), attr);
}

void AnonymousMultiDeviceIteratorOp::output_shapesAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(output_shapesAttrName(), attr);
}

void AnonymousMultiDeviceIteratorOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type handle, ::mlir::Type deleter, ::mlir::ArrayAttr devices, ::mlir::ArrayAttr output_types, ::mlir::ArrayAttr output_shapes) {
  odsState.addAttribute(devicesAttrName(odsState.name), devices);
  odsState.addAttribute(output_typesAttrName(odsState.name), output_types);
  odsState.addAttribute(output_shapesAttrName(odsState.name), output_shapes);
  odsState.addTypes(handle);
  odsState.addTypes(deleter);
}

void AnonymousMultiDeviceIteratorOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ArrayAttr devices, ::mlir::ArrayAttr output_types, ::mlir::ArrayAttr output_shapes) {
  odsState.addAttribute(devicesAttrName(odsState.name), devices);
  odsState.addAttribute(output_typesAttrName(odsState.name), output_types);
  odsState.addAttribute(output_shapesAttrName(odsState.name), output_shapes);
  assert(resultTypes.size() == 2u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void AnonymousMultiDeviceIteratorOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 0u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 2u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult AnonymousMultiDeviceIteratorOp::verify() {
  {
    auto tblgen_devices = (*this)->getAttr(devicesAttrName());
    if (!tblgen_devices)
      return emitOpError("requires attribute 'devices'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops4(*this, tblgen_devices, "devices")))
      return ::mlir::failure();
  }
  {
    auto tblgen_output_types = (*this)->getAttr(output_typesAttrName());
    if (!tblgen_output_types)
      return emitOpError("requires attribute 'output_types'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops2(*this, tblgen_output_types, "output_types")))
      return ::mlir::failure();
  }
  {
    auto tblgen_output_shapes = (*this)->getAttr(output_shapesAttrName());
    if (!tblgen_output_shapes)
      return emitOpError("requires attribute 'output_shapes'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops3(*this, tblgen_output_shapes, "output_shapes")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSResults(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops15(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void AnonymousMultiDeviceIteratorOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  for (::mlir::Value value : getODSResults(0))
    effects.emplace_back(::mlir::MemoryEffects::Allocate::get(), value, ::mlir::TF::ResourceEffects::DatasetIterator::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::AnonymousMultiDeviceIteratorOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::AnonymousRandomSeedGeneratorOp definitions
//===----------------------------------------------------------------------===//

AnonymousRandomSeedGeneratorOpAdaptor::AnonymousRandomSeedGeneratorOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

AnonymousRandomSeedGeneratorOpAdaptor::AnonymousRandomSeedGeneratorOpAdaptor(AnonymousRandomSeedGeneratorOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange AnonymousRandomSeedGeneratorOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> AnonymousRandomSeedGeneratorOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange AnonymousRandomSeedGeneratorOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value AnonymousRandomSeedGeneratorOpAdaptor::seed() {
  return *getODSOperands(0).begin();
}

::mlir::Value AnonymousRandomSeedGeneratorOpAdaptor::seed2() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr AnonymousRandomSeedGeneratorOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult AnonymousRandomSeedGeneratorOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

void AnonymousRandomSeedGeneratorOp::getAsmResultNames(::mlir::OpAsmSetValueNameFn setNameFn) {
  auto resultGroup0 = getODSResults(0);
  if (!llvm::empty(resultGroup0))
    setNameFn(*resultGroup0.begin(), "handle");
  auto resultGroup1 = getODSResults(1);
  if (!llvm::empty(resultGroup1))
    setNameFn(*resultGroup1.begin(), "deleter");
}

std::pair<unsigned, unsigned> AnonymousRandomSeedGeneratorOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range AnonymousRandomSeedGeneratorOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value AnonymousRandomSeedGeneratorOp::seed() {
  return *getODSOperands(0).begin();
}

::mlir::Value AnonymousRandomSeedGeneratorOp::seed2() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange AnonymousRandomSeedGeneratorOp::seedMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange AnonymousRandomSeedGeneratorOp::seed2Mutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> AnonymousRandomSeedGeneratorOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range AnonymousRandomSeedGeneratorOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value AnonymousRandomSeedGeneratorOp::handle() {
  return *getODSResults(0).begin();
}

::mlir::Value AnonymousRandomSeedGeneratorOp::deleter() {
  return *getODSResults(1).begin();
}

void AnonymousRandomSeedGeneratorOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type handle, ::mlir::Type deleter, ::mlir::Value seed, ::mlir::Value seed2) {
  odsState.addOperands(seed);
  odsState.addOperands(seed2);
  odsState.addTypes(handle);
  odsState.addTypes(deleter);
}

void AnonymousRandomSeedGeneratorOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value seed, ::mlir::Value seed2) {
  odsState.addOperands(seed);
  odsState.addOperands(seed2);
  assert(resultTypes.size() == 2u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void AnonymousRandomSeedGeneratorOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 2u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult AnonymousRandomSeedGeneratorOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops16(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops16(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSResults(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops15(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void AnonymousRandomSeedGeneratorOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  for (::mlir::Value value : getODSResults(0))
    effects.emplace_back(::mlir::MemoryEffects::Allocate::get(), value, ::mlir::TF::ResourceEffects::DatasetSeedGenerator::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::AnonymousRandomSeedGeneratorOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::AnonymousSeedGeneratorOp definitions
//===----------------------------------------------------------------------===//

AnonymousSeedGeneratorOpAdaptor::AnonymousSeedGeneratorOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

AnonymousSeedGeneratorOpAdaptor::AnonymousSeedGeneratorOpAdaptor(AnonymousSeedGeneratorOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange AnonymousSeedGeneratorOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> AnonymousSeedGeneratorOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange AnonymousSeedGeneratorOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value AnonymousSeedGeneratorOpAdaptor::seed() {
  return *getODSOperands(0).begin();
}

::mlir::Value AnonymousSeedGeneratorOpAdaptor::seed2() {
  return *getODSOperands(1).begin();
}

::mlir::Value AnonymousSeedGeneratorOpAdaptor::reshuffle() {
  return *getODSOperands(2).begin();
}

::mlir::DictionaryAttr AnonymousSeedGeneratorOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult AnonymousSeedGeneratorOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

void AnonymousSeedGeneratorOp::getAsmResultNames(::mlir::OpAsmSetValueNameFn setNameFn) {
  auto resultGroup0 = getODSResults(0);
  if (!llvm::empty(resultGroup0))
    setNameFn(*resultGroup0.begin(), "handle");
  auto resultGroup1 = getODSResults(1);
  if (!llvm::empty(resultGroup1))
    setNameFn(*resultGroup1.begin(), "deleter");
}

std::pair<unsigned, unsigned> AnonymousSeedGeneratorOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range AnonymousSeedGeneratorOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value AnonymousSeedGeneratorOp::seed() {
  return *getODSOperands(0).begin();
}

::mlir::Value AnonymousSeedGeneratorOp::seed2() {
  return *getODSOperands(1).begin();
}

::mlir::Value AnonymousSeedGeneratorOp::reshuffle() {
  return *getODSOperands(2).begin();
}

::mlir::MutableOperandRange AnonymousSeedGeneratorOp::seedMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange AnonymousSeedGeneratorOp::seed2Mutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange AnonymousSeedGeneratorOp::reshuffleMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> AnonymousSeedGeneratorOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range AnonymousSeedGeneratorOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value AnonymousSeedGeneratorOp::handle() {
  return *getODSResults(0).begin();
}

::mlir::Value AnonymousSeedGeneratorOp::deleter() {
  return *getODSResults(1).begin();
}

void AnonymousSeedGeneratorOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type handle, ::mlir::Type deleter, ::mlir::Value seed, ::mlir::Value seed2, ::mlir::Value reshuffle) {
  odsState.addOperands(seed);
  odsState.addOperands(seed2);
  odsState.addOperands(reshuffle);
  odsState.addTypes(handle);
  odsState.addTypes(deleter);
}

void AnonymousSeedGeneratorOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value seed, ::mlir::Value seed2, ::mlir::Value reshuffle) {
  odsState.addOperands(seed);
  odsState.addOperands(seed2);
  odsState.addOperands(reshuffle);
  assert(resultTypes.size() == 2u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void AnonymousSeedGeneratorOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 3u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 2u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult AnonymousSeedGeneratorOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops16(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops16(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops8(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSResults(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops15(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void AnonymousSeedGeneratorOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  for (::mlir::Value value : getODSResults(0))
    effects.emplace_back(::mlir::MemoryEffects::Allocate::get(), value, ::mlir::TF::ResourceEffects::DatasetSeedGenerator::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::AnonymousSeedGeneratorOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::AnyOp definitions
//===----------------------------------------------------------------------===//

AnyOpAdaptor::AnyOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

AnyOpAdaptor::AnyOpAdaptor(AnyOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange AnyOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> AnyOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange AnyOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value AnyOpAdaptor::input() {
  return *getODSOperands(0).begin();
}

::mlir::Value AnyOpAdaptor::reduction_indices() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr AnyOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::BoolAttr AnyOpAdaptor::keep_dims() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("keep_dims").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(false);
  return attr;
}

::mlir::LogicalResult AnyOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_keep_dims = odsAttrs.get("keep_dims");
    if (tblgen_keep_dims && !((tblgen_keep_dims.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.Any' op ""attribute 'keep_dims' failed to satisfy constraint: bool attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> AnyOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range AnyOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value AnyOp::input() {
  return *getODSOperands(0).begin();
}

::mlir::Value AnyOp::reduction_indices() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange AnyOp::inputMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange AnyOp::reduction_indicesMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> AnyOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range AnyOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value AnyOp::output() {
  return *getODSResults(0).begin();
}

::mlir::BoolAttr AnyOp::keep_dimsAttr() {
  return (*this)->getAttr(keep_dimsAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool AnyOp::keep_dims() {
  auto attr = keep_dimsAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(false).getValue();
  return attr.getValue();
}

::mlir::Type AnyOp::Tidx() {
  return mlir::getElementTypeOrSelf(*getODSOperands(1).begin());
}

bool AnyOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "Tidx") return true;
 return false;
}

::mlir::DictionaryAttr AnyOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TidxAttrName(),
::mlir::TypeAttr::get(Tidx())}});
}

void AnyOp::keep_dimsAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(keep_dimsAttrName(), attr);
}

void AnyOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input, ::mlir::Value reduction_indices, ::mlir::BoolAttr keep_dims) {
  odsState.addOperands(input);
  odsState.addOperands(reduction_indices);
  odsState.addAttribute(keep_dimsAttrName(odsState.name), keep_dims);
  odsState.addTypes(output);
}

void AnyOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::Value reduction_indices, ::mlir::BoolAttr keep_dims) {
  odsState.addOperands(input);
  odsState.addOperands(reduction_indices);
  odsState.addAttribute(keep_dimsAttrName(odsState.name), keep_dims);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void AnyOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input, ::mlir::Value reduction_indices, bool keep_dims) {
  odsState.addOperands(input);
  odsState.addOperands(reduction_indices);
  odsState.addAttribute(keep_dimsAttrName(odsState.name), odsBuilder.getBoolAttr(keep_dims));
  odsState.addTypes(output);
}

void AnyOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::Value reduction_indices, bool keep_dims) {
  odsState.addOperands(input);
  odsState.addOperands(reduction_indices);
  odsState.addAttribute(keep_dimsAttrName(odsState.name), odsBuilder.getBoolAttr(keep_dims));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void AnyOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult AnyOp::verify() {
  {
    auto tblgen_keep_dims = (*this)->getAttr(keep_dimsAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_keep_dims, "keep_dims")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops8(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops8(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return Verify(*this);
}

void AnyOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::AnyOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::ApproximateEqualOp definitions
//===----------------------------------------------------------------------===//

ApproximateEqualOpAdaptor::ApproximateEqualOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

ApproximateEqualOpAdaptor::ApproximateEqualOpAdaptor(ApproximateEqualOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange ApproximateEqualOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> ApproximateEqualOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange ApproximateEqualOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ApproximateEqualOpAdaptor::x() {
  return *getODSOperands(0).begin();
}

::mlir::Value ApproximateEqualOpAdaptor::y() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr ApproximateEqualOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::FloatAttr ApproximateEqualOpAdaptor::tolerance() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::FloatAttr attr = odsAttrs.get("tolerance").dyn_cast_or_null<::mlir::FloatAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getFloatAttr(::mlir::Builder(odsAttrs.getContext()).getF32Type(), 1e-05f);
  return attr;
}

::mlir::LogicalResult ApproximateEqualOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_tolerance = odsAttrs.get("tolerance");
    if (tblgen_tolerance && !(((tblgen_tolerance.isa<::mlir::FloatAttr>())) && ((tblgen_tolerance.cast<::mlir::FloatAttr>().getType().isF32()))))
      return emitError(loc, "'tf.ApproximateEqual' op ""attribute 'tolerance' failed to satisfy constraint: 32-bit float attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> ApproximateEqualOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range ApproximateEqualOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ApproximateEqualOp::x() {
  return *getODSOperands(0).begin();
}

::mlir::Value ApproximateEqualOp::y() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange ApproximateEqualOp::xMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ApproximateEqualOp::yMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> ApproximateEqualOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range ApproximateEqualOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ApproximateEqualOp::z() {
  return *getODSResults(0).begin();
}

::mlir::FloatAttr ApproximateEqualOp::toleranceAttr() {
  return (*this)->getAttr(toleranceAttrName()).dyn_cast_or_null<::mlir::FloatAttr>();
}

::llvm::APFloat ApproximateEqualOp::tolerance() {
  auto attr = toleranceAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getFloatAttr(::mlir::Builder((*this)->getContext()).getF32Type(), 1e-05f).getValue();
  return attr.getValue();
}

::mlir::Type ApproximateEqualOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool ApproximateEqualOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr ApproximateEqualOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void ApproximateEqualOp::toleranceAttr(::mlir::FloatAttr attr) {
  (*this)->setAttr(toleranceAttrName(), attr);
}

void ApproximateEqualOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type z, ::mlir::Value x, ::mlir::Value y, ::mlir::FloatAttr tolerance) {
  odsState.addOperands(x);
  odsState.addOperands(y);
  odsState.addAttribute(toleranceAttrName(odsState.name), tolerance);
  odsState.addTypes(z);
}

void ApproximateEqualOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value x, ::mlir::Value y, ::mlir::FloatAttr tolerance) {
  odsState.addOperands(x);
  odsState.addOperands(y);
  odsState.addAttribute(toleranceAttrName(odsState.name), tolerance);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void ApproximateEqualOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type z, ::mlir::Value x, ::mlir::Value y, ::llvm::APFloat tolerance) {
  odsState.addOperands(x);
  odsState.addOperands(y);
  odsState.addAttribute(toleranceAttrName(odsState.name), odsBuilder.getFloatAttr(odsBuilder.getF32Type(), tolerance));
  odsState.addTypes(z);
}

void ApproximateEqualOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value x, ::mlir::Value y, ::llvm::APFloat tolerance) {
  odsState.addOperands(x);
  odsState.addOperands(y);
  odsState.addAttribute(toleranceAttrName(odsState.name), odsBuilder.getFloatAttr(odsBuilder.getF32Type(), tolerance));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void ApproximateEqualOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult ApproximateEqualOp::verify() {
  {
    auto tblgen_tolerance = (*this)->getAttr(toleranceAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops5(*this, tblgen_tolerance, "tolerance")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops8(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void ApproximateEqualOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::ApproximateEqualOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::ArgMaxOp definitions
//===----------------------------------------------------------------------===//

ArgMaxOpAdaptor::ArgMaxOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

ArgMaxOpAdaptor::ArgMaxOpAdaptor(ArgMaxOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange ArgMaxOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> ArgMaxOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange ArgMaxOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ArgMaxOpAdaptor::input() {
  return *getODSOperands(0).begin();
}

::mlir::Value ArgMaxOpAdaptor::dimension() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr ArgMaxOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult ArgMaxOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> ArgMaxOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range ArgMaxOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ArgMaxOp::input() {
  return *getODSOperands(0).begin();
}

::mlir::Value ArgMaxOp::dimension() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange ArgMaxOp::inputMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ArgMaxOp::dimensionMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> ArgMaxOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range ArgMaxOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ArgMaxOp::output() {
  return *getODSResults(0).begin();
}

::mlir::Type ArgMaxOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

::mlir::Type ArgMaxOp::Tidx() {
  return mlir::getElementTypeOrSelf(*getODSOperands(1).begin());
}

::mlir::Type ArgMaxOp::output_type() {
  return mlir::getElementTypeOrSelf(*getODSResults(0).begin());
}

bool ArgMaxOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
  if (name == "Tidx") return true;
  if (name == "output_type") return true;
 return false;
}

::mlir::DictionaryAttr ArgMaxOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())},
    {TidxAttrName(),
::mlir::TypeAttr::get(Tidx())},
    {output_typeAttrName(),
::mlir::TypeAttr::get(output_type())}});
}

void ArgMaxOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input, ::mlir::Value dimension) {
  odsState.addOperands(input);
  odsState.addOperands(dimension);
  odsState.addTypes(output);
}

void ArgMaxOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::Value dimension) {
  odsState.addOperands(input);
  odsState.addOperands(dimension);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void ArgMaxOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult ArgMaxOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops10(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void ArgMaxOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::ArgMaxOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::ArgMinOp definitions
//===----------------------------------------------------------------------===//

ArgMinOpAdaptor::ArgMinOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

ArgMinOpAdaptor::ArgMinOpAdaptor(ArgMinOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange ArgMinOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> ArgMinOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange ArgMinOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ArgMinOpAdaptor::input() {
  return *getODSOperands(0).begin();
}

::mlir::Value ArgMinOpAdaptor::dimension() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr ArgMinOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult ArgMinOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> ArgMinOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range ArgMinOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ArgMinOp::input() {
  return *getODSOperands(0).begin();
}

::mlir::Value ArgMinOp::dimension() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange ArgMinOp::inputMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ArgMinOp::dimensionMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> ArgMinOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range ArgMinOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ArgMinOp::output() {
  return *getODSResults(0).begin();
}

::mlir::Type ArgMinOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

::mlir::Type ArgMinOp::Tidx() {
  return mlir::getElementTypeOrSelf(*getODSOperands(1).begin());
}

::mlir::Type ArgMinOp::output_type() {
  return mlir::getElementTypeOrSelf(*getODSResults(0).begin());
}

bool ArgMinOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
  if (name == "Tidx") return true;
  if (name == "output_type") return true;
 return false;
}

::mlir::DictionaryAttr ArgMinOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())},
    {TidxAttrName(),
::mlir::TypeAttr::get(Tidx())},
    {output_typeAttrName(),
::mlir::TypeAttr::get(output_type())}});
}

void ArgMinOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input, ::mlir::Value dimension) {
  odsState.addOperands(input);
  odsState.addOperands(dimension);
  odsState.addTypes(output);
}

void ArgMinOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::Value dimension) {
  odsState.addOperands(input);
  odsState.addOperands(dimension);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void ArgMinOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult ArgMinOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops10(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void ArgMinOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::ArgMinOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::AsStringOp definitions
//===----------------------------------------------------------------------===//

AsStringOpAdaptor::AsStringOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

AsStringOpAdaptor::AsStringOpAdaptor(AsStringOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange AsStringOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> AsStringOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange AsStringOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value AsStringOpAdaptor::input() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr AsStringOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::IntegerAttr AsStringOpAdaptor::precision() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("precision").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), -1);
  return attr;
}

::mlir::BoolAttr AsStringOpAdaptor::scientific() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("scientific").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(false);
  return attr;
}

::mlir::BoolAttr AsStringOpAdaptor::shortest() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("shortest").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(false);
  return attr;
}

::mlir::IntegerAttr AsStringOpAdaptor::width() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("width").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), -1);
  return attr;
}

::mlir::StringAttr AsStringOpAdaptor::fill() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("fill").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("");
  return attr;
}

::mlir::LogicalResult AsStringOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_precision = odsAttrs.get("precision");
    if (tblgen_precision && !(((tblgen_precision.isa<::mlir::IntegerAttr>())) && ((tblgen_precision.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.AsString' op ""attribute 'precision' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_scientific = odsAttrs.get("scientific");
    if (tblgen_scientific && !((tblgen_scientific.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.AsString' op ""attribute 'scientific' failed to satisfy constraint: bool attribute");
  }
  {
    auto tblgen_shortest = odsAttrs.get("shortest");
    if (tblgen_shortest && !((tblgen_shortest.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.AsString' op ""attribute 'shortest' failed to satisfy constraint: bool attribute");
  }
  {
    auto tblgen_width = odsAttrs.get("width");
    if (tblgen_width && !(((tblgen_width.isa<::mlir::IntegerAttr>())) && ((tblgen_width.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.AsString' op ""attribute 'width' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_fill = odsAttrs.get("fill");
    if (tblgen_fill && !((tblgen_fill.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.AsString' op ""attribute 'fill' failed to satisfy constraint: string attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> AsStringOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range AsStringOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value AsStringOp::input() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange AsStringOp::inputMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> AsStringOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range AsStringOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value AsStringOp::output() {
  return *getODSResults(0).begin();
}

::mlir::IntegerAttr AsStringOp::precisionAttr() {
  return (*this)->getAttr(precisionAttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t AsStringOp::precision() {
  auto attr = precisionAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), -1).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

::mlir::BoolAttr AsStringOp::scientificAttr() {
  return (*this)->getAttr(scientificAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool AsStringOp::scientific() {
  auto attr = scientificAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(false).getValue();
  return attr.getValue();
}

::mlir::BoolAttr AsStringOp::shortestAttr() {
  return (*this)->getAttr(shortestAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool AsStringOp::shortest() {
  auto attr = shortestAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(false).getValue();
  return attr.getValue();
}

::mlir::IntegerAttr AsStringOp::widthAttr() {
  return (*this)->getAttr(widthAttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t AsStringOp::width() {
  auto attr = widthAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), -1).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

::mlir::StringAttr AsStringOp::fillAttr() {
  return (*this)->getAttr(fillAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef AsStringOp::fill() {
  auto attr = fillAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("").getValue();
  return attr.getValue();
}

::mlir::Type AsStringOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool AsStringOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr AsStringOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void AsStringOp::precisionAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(precisionAttrName(), attr);
}

void AsStringOp::scientificAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(scientificAttrName(), attr);
}

void AsStringOp::shortestAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(shortestAttrName(), attr);
}

void AsStringOp::widthAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(widthAttrName(), attr);
}

void AsStringOp::fillAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(fillAttrName(), attr);
}

void AsStringOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input, ::mlir::IntegerAttr precision, ::mlir::BoolAttr scientific, ::mlir::BoolAttr shortest, ::mlir::IntegerAttr width, ::mlir::StringAttr fill) {
  odsState.addOperands(input);
  odsState.addAttribute(precisionAttrName(odsState.name), precision);
  odsState.addAttribute(scientificAttrName(odsState.name), scientific);
  odsState.addAttribute(shortestAttrName(odsState.name), shortest);
  odsState.addAttribute(widthAttrName(odsState.name), width);
  odsState.addAttribute(fillAttrName(odsState.name), fill);
  odsState.addTypes(output);
}

void AsStringOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::IntegerAttr precision, ::mlir::BoolAttr scientific, ::mlir::BoolAttr shortest, ::mlir::IntegerAttr width, ::mlir::StringAttr fill) {
  odsState.addOperands(input);
  odsState.addAttribute(precisionAttrName(odsState.name), precision);
  odsState.addAttribute(scientificAttrName(odsState.name), scientific);
  odsState.addAttribute(shortestAttrName(odsState.name), shortest);
  odsState.addAttribute(widthAttrName(odsState.name), width);
  odsState.addAttribute(fillAttrName(odsState.name), fill);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void AsStringOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input, uint64_t precision, bool scientific, bool shortest, uint64_t width, ::llvm::StringRef fill) {
  odsState.addOperands(input);
  odsState.addAttribute(precisionAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), precision));
  odsState.addAttribute(scientificAttrName(odsState.name), odsBuilder.getBoolAttr(scientific));
  odsState.addAttribute(shortestAttrName(odsState.name), odsBuilder.getBoolAttr(shortest));
  odsState.addAttribute(widthAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), width));
  odsState.addAttribute(fillAttrName(odsState.name), odsBuilder.getStringAttr(fill));
  odsState.addTypes(output);
}

void AsStringOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, uint64_t precision, bool scientific, bool shortest, uint64_t width, ::llvm::StringRef fill) {
  odsState.addOperands(input);
  odsState.addAttribute(precisionAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), precision));
  odsState.addAttribute(scientificAttrName(odsState.name), odsBuilder.getBoolAttr(scientific));
  odsState.addAttribute(shortestAttrName(odsState.name), odsBuilder.getBoolAttr(shortest));
  odsState.addAttribute(widthAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), width));
  odsState.addAttribute(fillAttrName(odsState.name), odsBuilder.getStringAttr(fill));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void AsStringOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult AsStringOp::verify() {
  {
    auto tblgen_precision = (*this)->getAttr(precisionAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_precision, "precision")))
      return ::mlir::failure();
  }
  {
    auto tblgen_scientific = (*this)->getAttr(scientificAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_scientific, "scientific")))
      return ::mlir::failure();
  }
  {
    auto tblgen_shortest = (*this)->getAttr(shortestAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_shortest, "shortest")))
      return ::mlir::failure();
  }
  {
    auto tblgen_width = (*this)->getAttr(widthAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_width, "width")))
      return ::mlir::failure();
  }
  {
    auto tblgen_fill = (*this)->getAttr(fillAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_fill, "fill")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops18(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops19(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void AsStringOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::AsStringOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::AsinOp definitions
//===----------------------------------------------------------------------===//

AsinOpAdaptor::AsinOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

AsinOpAdaptor::AsinOpAdaptor(AsinOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange AsinOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> AsinOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange AsinOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value AsinOpAdaptor::x() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr AsinOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult AsinOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> AsinOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range AsinOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value AsinOp::x() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange AsinOp::xMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> AsinOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range AsinOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value AsinOp::y() {
  return *getODSResults(0).begin();
}

::mlir::Type AsinOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool AsinOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr AsinOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void AsinOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type y, ::mlir::Value x) {
  odsState.addOperands(x);
  odsState.addTypes(y);
}

void AsinOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value x) {
  odsState.addOperands(x);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void AsinOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult AsinOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops1(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops1(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void AsinOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::AsinOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::AsinhOp definitions
//===----------------------------------------------------------------------===//

AsinhOpAdaptor::AsinhOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

AsinhOpAdaptor::AsinhOpAdaptor(AsinhOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange AsinhOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> AsinhOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange AsinhOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value AsinhOpAdaptor::x() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr AsinhOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult AsinhOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> AsinhOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range AsinhOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value AsinhOp::x() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange AsinhOp::xMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> AsinhOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range AsinhOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value AsinhOp::y() {
  return *getODSResults(0).begin();
}

::mlir::Type AsinhOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool AsinhOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr AsinhOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void AsinhOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type y, ::mlir::Value x) {
  odsState.addOperands(x);
  odsState.addTypes(y);
}

void AsinhOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value x) {
  odsState.addOperands(x);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void AsinhOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult AsinhOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops2(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops2(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void AsinhOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::AsinhOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::AssertOp definitions
//===----------------------------------------------------------------------===//

AssertOpAdaptor::AssertOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

AssertOpAdaptor::AssertOpAdaptor(AssertOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange AssertOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> AssertOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  bool isVariadic[] = {false, true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (odsOperands.size() - 1) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::ValueRange AssertOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value AssertOpAdaptor::condition() {
  return *getODSOperands(0).begin();
}

::mlir::ValueRange AssertOpAdaptor::data() {
  return getODSOperands(1);
}

::mlir::DictionaryAttr AssertOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::IntegerAttr AssertOpAdaptor::summarize() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("summarize").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), 3);
  return attr;
}

::mlir::LogicalResult AssertOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_summarize = odsAttrs.get("summarize");
    if (tblgen_summarize && !(((tblgen_summarize.isa<::mlir::IntegerAttr>())) && ((tblgen_summarize.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.Assert' op ""attribute 'summarize' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> AssertOp::getODSOperandIndexAndLength(unsigned index) {
  bool isVariadic[] = {false, true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (getOperation()->getNumOperands() - 1) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::Operation::operand_range AssertOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value AssertOp::condition() {
  return *getODSOperands(0).begin();
}

::mlir::Operation::operand_range AssertOp::data() {
  return getODSOperands(1);
}

::mlir::MutableOperandRange AssertOp::conditionMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange AssertOp::dataMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> AssertOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range AssertOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::IntegerAttr AssertOp::summarizeAttr() {
  return (*this)->getAttr(summarizeAttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t AssertOp::summarize() {
  auto attr = summarizeAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), 3).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

mlir::OperandElementTypeRange AssertOp::T() {
  auto values = getODSOperands(1);
return {mlir::OperandElementTypeIterator(values.begin()), mlir::OperandElementTypeIterator(values.end())};
}

bool AssertOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr AssertOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
ArrayAttr::get(ctx, 
    [&]() {
      llvm::SmallVector<Attribute, 4> ret;
      for (auto t : T())
        ret.push_back(TypeAttr::get(t));
      return ret;
    }())}});
}

void AssertOp::summarizeAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(summarizeAttrName(), attr);
}

void AssertOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value condition, ::mlir::ValueRange data, ::mlir::IntegerAttr summarize) {
  odsState.addOperands(condition);
  odsState.addOperands(data);
  odsState.addAttribute(summarizeAttrName(odsState.name), summarize);
}

void AssertOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value condition, ::mlir::ValueRange data, ::mlir::IntegerAttr summarize) {
  odsState.addOperands(condition);
  odsState.addOperands(data);
  odsState.addAttribute(summarizeAttrName(odsState.name), summarize);
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void AssertOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value condition, ::mlir::ValueRange data, uint64_t summarize) {
  odsState.addOperands(condition);
  odsState.addOperands(data);
  odsState.addAttribute(summarizeAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), summarize));
}

void AssertOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value condition, ::mlir::ValueRange data, uint64_t summarize) {
  odsState.addOperands(condition);
  odsState.addOperands(data);
  odsState.addAttribute(summarizeAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), summarize));
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void AssertOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() >= 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 0u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult AssertOp::verify() {
  {
    auto tblgen_summarize = (*this)->getAttr(summarizeAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_summarize, "summarize")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops8(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::AssertOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::AssignAddVariableOp definitions
//===----------------------------------------------------------------------===//

AssignAddVariableOpAdaptor::AssignAddVariableOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

AssignAddVariableOpAdaptor::AssignAddVariableOpAdaptor(AssignAddVariableOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange AssignAddVariableOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> AssignAddVariableOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange AssignAddVariableOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value AssignAddVariableOpAdaptor::resource() {
  return *getODSOperands(0).begin();
}

::mlir::Value AssignAddVariableOpAdaptor::value() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr AssignAddVariableOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult AssignAddVariableOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> AssignAddVariableOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range AssignAddVariableOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value AssignAddVariableOp::resource() {
  return *getODSOperands(0).begin();
}

::mlir::Value AssignAddVariableOp::value() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange AssignAddVariableOp::resourceMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange AssignAddVariableOp::valueMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> AssignAddVariableOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range AssignAddVariableOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Type AssignAddVariableOp::dtype() {
  return mlir::getElementTypeOrSelf(*getODSOperands(1).begin());
}

bool AssignAddVariableOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "dtype") return true;
 return false;
}

::mlir::DictionaryAttr AssignAddVariableOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {dtypeAttrName(),
::mlir::TypeAttr::get(dtype())}});
}

void AssignAddVariableOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value resource, ::mlir::Value value) {
  odsState.addOperands(resource);
  odsState.addOperands(value);
}

void AssignAddVariableOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value resource, ::mlir::Value value) {
  odsState.addOperands(resource);
  odsState.addOperands(value);
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void AssignAddVariableOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 0u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult AssignAddVariableOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void AssignAddVariableOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  for (::mlir::Value value : getODSOperands(0))
    effects.emplace_back(::mlir::MemoryEffects::Read::get(), value, ::mlir::TF::ResourceEffects::Variable::get());
  for (::mlir::Value value : getODSOperands(0))
    effects.emplace_back(::mlir::MemoryEffects::Write::get(), value, ::mlir::TF::ResourceEffects::Variable::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::AssignAddVariableOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::AssignOp definitions
//===----------------------------------------------------------------------===//

AssignOpAdaptor::AssignOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

AssignOpAdaptor::AssignOpAdaptor(AssignOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange AssignOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> AssignOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange AssignOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value AssignOpAdaptor::ref() {
  return *getODSOperands(0).begin();
}

::mlir::Value AssignOpAdaptor::value() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr AssignOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::BoolAttr AssignOpAdaptor::validate_shape() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("validate_shape").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(true);
  return attr;
}

::mlir::BoolAttr AssignOpAdaptor::use_locking() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("use_locking").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(true);
  return attr;
}

::mlir::LogicalResult AssignOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_validate_shape = odsAttrs.get("validate_shape");
    if (tblgen_validate_shape && !((tblgen_validate_shape.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.Assign' op ""attribute 'validate_shape' failed to satisfy constraint: bool attribute");
  }
  {
    auto tblgen_use_locking = odsAttrs.get("use_locking");
    if (tblgen_use_locking && !((tblgen_use_locking.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.Assign' op ""attribute 'use_locking' failed to satisfy constraint: bool attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> AssignOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range AssignOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value AssignOp::ref() {
  return *getODSOperands(0).begin();
}

::mlir::Value AssignOp::value() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange AssignOp::refMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange AssignOp::valueMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> AssignOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range AssignOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value AssignOp::output_ref() {
  return *getODSResults(0).begin();
}

::mlir::BoolAttr AssignOp::validate_shapeAttr() {
  return (*this)->getAttr(validate_shapeAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool AssignOp::validate_shape() {
  auto attr = validate_shapeAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(true).getValue();
  return attr.getValue();
}

::mlir::BoolAttr AssignOp::use_lockingAttr() {
  return (*this)->getAttr(use_lockingAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool AssignOp::use_locking() {
  auto attr = use_lockingAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(true).getValue();
  return attr.getValue();
}

::mlir::Type AssignOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool AssignOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr AssignOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void AssignOp::validate_shapeAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(validate_shapeAttrName(), attr);
}

void AssignOp::use_lockingAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(use_lockingAttrName(), attr);
}

void AssignOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output_ref, ::mlir::Value ref, ::mlir::Value value, ::mlir::BoolAttr validate_shape, ::mlir::BoolAttr use_locking) {
  odsState.addOperands(ref);
  odsState.addOperands(value);
  odsState.addAttribute(validate_shapeAttrName(odsState.name), validate_shape);
  odsState.addAttribute(use_lockingAttrName(odsState.name), use_locking);
  odsState.addTypes(output_ref);
}

void AssignOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value ref, ::mlir::Value value, ::mlir::BoolAttr validate_shape, ::mlir::BoolAttr use_locking) {
  odsState.addOperands(ref);
  odsState.addOperands(value);
  odsState.addAttribute(validate_shapeAttrName(odsState.name), validate_shape);
  odsState.addAttribute(use_lockingAttrName(odsState.name), use_locking);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void AssignOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output_ref, ::mlir::Value ref, ::mlir::Value value, bool validate_shape, bool use_locking) {
  odsState.addOperands(ref);
  odsState.addOperands(value);
  odsState.addAttribute(validate_shapeAttrName(odsState.name), odsBuilder.getBoolAttr(validate_shape));
  odsState.addAttribute(use_lockingAttrName(odsState.name), odsBuilder.getBoolAttr(use_locking));
  odsState.addTypes(output_ref);
}

void AssignOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value ref, ::mlir::Value value, bool validate_shape, bool use_locking) {
  odsState.addOperands(ref);
  odsState.addOperands(value);
  odsState.addAttribute(validate_shapeAttrName(odsState.name), odsBuilder.getBoolAttr(validate_shape));
  odsState.addAttribute(use_lockingAttrName(odsState.name), odsBuilder.getBoolAttr(use_locking));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void AssignOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult AssignOp::verify() {
  {
    auto tblgen_validate_shape = (*this)->getAttr(validate_shapeAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_validate_shape, "validate_shape")))
      return ::mlir::failure();
  }
  {
    auto tblgen_use_locking = (*this)->getAttr(use_lockingAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_use_locking, "use_locking")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::AssignOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::AssignSubVariableOp definitions
//===----------------------------------------------------------------------===//

AssignSubVariableOpAdaptor::AssignSubVariableOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

AssignSubVariableOpAdaptor::AssignSubVariableOpAdaptor(AssignSubVariableOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange AssignSubVariableOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> AssignSubVariableOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange AssignSubVariableOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value AssignSubVariableOpAdaptor::resource() {
  return *getODSOperands(0).begin();
}

::mlir::Value AssignSubVariableOpAdaptor::value() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr AssignSubVariableOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult AssignSubVariableOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> AssignSubVariableOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range AssignSubVariableOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value AssignSubVariableOp::resource() {
  return *getODSOperands(0).begin();
}

::mlir::Value AssignSubVariableOp::value() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange AssignSubVariableOp::resourceMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange AssignSubVariableOp::valueMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> AssignSubVariableOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range AssignSubVariableOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Type AssignSubVariableOp::dtype() {
  return mlir::getElementTypeOrSelf(*getODSOperands(1).begin());
}

bool AssignSubVariableOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "dtype") return true;
 return false;
}

::mlir::DictionaryAttr AssignSubVariableOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {dtypeAttrName(),
::mlir::TypeAttr::get(dtype())}});
}

void AssignSubVariableOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value resource, ::mlir::Value value) {
  odsState.addOperands(resource);
  odsState.addOperands(value);
}

void AssignSubVariableOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value resource, ::mlir::Value value) {
  odsState.addOperands(resource);
  odsState.addOperands(value);
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void AssignSubVariableOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 0u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult AssignSubVariableOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void AssignSubVariableOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  for (::mlir::Value value : getODSOperands(0))
    effects.emplace_back(::mlir::MemoryEffects::Read::get(), value, ::mlir::TF::ResourceEffects::Variable::get());
  for (::mlir::Value value : getODSOperands(0))
    effects.emplace_back(::mlir::MemoryEffects::Write::get(), value, ::mlir::TF::ResourceEffects::Variable::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::AssignSubVariableOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::AssignVariableOp definitions
//===----------------------------------------------------------------------===//

AssignVariableOpAdaptor::AssignVariableOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

AssignVariableOpAdaptor::AssignVariableOpAdaptor(AssignVariableOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange AssignVariableOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> AssignVariableOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange AssignVariableOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value AssignVariableOpAdaptor::resource() {
  return *getODSOperands(0).begin();
}

::mlir::Value AssignVariableOpAdaptor::value() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr AssignVariableOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::BoolAttr AssignVariableOpAdaptor::validate_shape() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("validate_shape").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(false);
  return attr;
}

::mlir::LogicalResult AssignVariableOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_validate_shape = odsAttrs.get("validate_shape");
    if (tblgen_validate_shape && !((tblgen_validate_shape.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.AssignVariableOp' op ""attribute 'validate_shape' failed to satisfy constraint: bool attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> AssignVariableOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range AssignVariableOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value AssignVariableOp::resource() {
  return *getODSOperands(0).begin();
}

::mlir::Value AssignVariableOp::value() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange AssignVariableOp::resourceMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange AssignVariableOp::valueMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> AssignVariableOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range AssignVariableOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::BoolAttr AssignVariableOp::validate_shapeAttr() {
  return (*this)->getAttr(validate_shapeAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool AssignVariableOp::validate_shape() {
  auto attr = validate_shapeAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(false).getValue();
  return attr.getValue();
}

::mlir::Type AssignVariableOp::dtype() {
  return mlir::getElementTypeOrSelf(*getODSOperands(1).begin());
}

bool AssignVariableOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "dtype") return true;
 return false;
}

::mlir::DictionaryAttr AssignVariableOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {dtypeAttrName(),
::mlir::TypeAttr::get(dtype())}});
}

void AssignVariableOp::validate_shapeAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(validate_shapeAttrName(), attr);
}

void AssignVariableOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value resource, ::mlir::Value value, ::mlir::BoolAttr validate_shape) {
  odsState.addOperands(resource);
  odsState.addOperands(value);
  odsState.addAttribute(validate_shapeAttrName(odsState.name), validate_shape);
}

void AssignVariableOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value resource, ::mlir::Value value, ::mlir::BoolAttr validate_shape) {
  odsState.addOperands(resource);
  odsState.addOperands(value);
  odsState.addAttribute(validate_shapeAttrName(odsState.name), validate_shape);
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void AssignVariableOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value resource, ::mlir::Value value, bool validate_shape) {
  odsState.addOperands(resource);
  odsState.addOperands(value);
  odsState.addAttribute(validate_shapeAttrName(odsState.name), odsBuilder.getBoolAttr(validate_shape));
}

void AssignVariableOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value resource, ::mlir::Value value, bool validate_shape) {
  odsState.addOperands(resource);
  odsState.addOperands(value);
  odsState.addAttribute(validate_shapeAttrName(odsState.name), odsBuilder.getBoolAttr(validate_shape));
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void AssignVariableOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 0u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult AssignVariableOp::verify() {
  {
    auto tblgen_validate_shape = (*this)->getAttr(validate_shapeAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_validate_shape, "validate_shape")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void AssignVariableOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  for (::mlir::Value value : getODSOperands(0))
    effects.emplace_back(::mlir::MemoryEffects::Write::get(), value, ::mlir::TF::ResourceEffects::Variable::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::AssignVariableOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::Atan2Op definitions
//===----------------------------------------------------------------------===//

Atan2OpAdaptor::Atan2OpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

Atan2OpAdaptor::Atan2OpAdaptor(Atan2Op &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange Atan2OpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> Atan2OpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange Atan2OpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value Atan2OpAdaptor::y() {
  return *getODSOperands(0).begin();
}

::mlir::Value Atan2OpAdaptor::x() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr Atan2OpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult Atan2OpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> Atan2Op::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range Atan2Op::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value Atan2Op::y() {
  return *getODSOperands(0).begin();
}

::mlir::Value Atan2Op::x() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange Atan2Op::yMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange Atan2Op::xMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> Atan2Op::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range Atan2Op::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value Atan2Op::z() {
  return *getODSResults(0).begin();
}

::mlir::Type Atan2Op::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool Atan2Op::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr Atan2Op::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void Atan2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, Value x, Value y) {
  auto resultType =
      OpTrait::util::getBroadcastedType(x.getType(), y.getType());
  if (!resultType)
    mlir::emitError(odsState.location, "non-broadcastable operands");
  return build(odsBuilder, odsState, resultType, x, y);
}

void Atan2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type z, ::mlir::Value y, ::mlir::Value x) {
  odsState.addOperands(y);
  odsState.addOperands(x);
  odsState.addTypes(z);
}

void Atan2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value y, ::mlir::Value x) {
  odsState.addOperands(y);
  odsState.addOperands(x);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void Atan2Op::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult Atan2Op::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void Atan2Op::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::Atan2Op)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::AtanOp definitions
//===----------------------------------------------------------------------===//

AtanOpAdaptor::AtanOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

AtanOpAdaptor::AtanOpAdaptor(AtanOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange AtanOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> AtanOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange AtanOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value AtanOpAdaptor::x() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr AtanOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult AtanOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> AtanOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range AtanOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value AtanOp::x() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange AtanOp::xMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> AtanOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range AtanOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value AtanOp::y() {
  return *getODSResults(0).begin();
}

::mlir::Type AtanOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool AtanOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr AtanOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void AtanOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type y, ::mlir::Value x) {
  odsState.addOperands(x);
  odsState.addTypes(y);
}

void AtanOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value x) {
  odsState.addOperands(x);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void AtanOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

void AtanOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value x) {
  odsState.addOperands(x);
  odsState.addTypes({x.getType()});

}

void AtanOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  odsState.addTypes({operands[0].getType()});

}

::mlir::LogicalResult AtanOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops1(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops1(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void AtanOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::AtanOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::AtanhOp definitions
//===----------------------------------------------------------------------===//

AtanhOpAdaptor::AtanhOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

AtanhOpAdaptor::AtanhOpAdaptor(AtanhOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange AtanhOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> AtanhOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange AtanhOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value AtanhOpAdaptor::x() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr AtanhOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult AtanhOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> AtanhOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range AtanhOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value AtanhOp::x() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange AtanhOp::xMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> AtanhOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range AtanhOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value AtanhOp::y() {
  return *getODSResults(0).begin();
}

::mlir::Type AtanhOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool AtanhOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr AtanhOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void AtanhOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type y, ::mlir::Value x) {
  odsState.addOperands(x);
  odsState.addTypes(y);
}

void AtanhOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value x) {
  odsState.addOperands(x);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void AtanhOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult AtanhOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops2(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops2(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void AtanhOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::AtanhOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::AvgPool3DGradOp definitions
//===----------------------------------------------------------------------===//

AvgPool3DGradOpAdaptor::AvgPool3DGradOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

AvgPool3DGradOpAdaptor::AvgPool3DGradOpAdaptor(AvgPool3DGradOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange AvgPool3DGradOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> AvgPool3DGradOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange AvgPool3DGradOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value AvgPool3DGradOpAdaptor::orig_input_shape() {
  return *getODSOperands(0).begin();
}

::mlir::Value AvgPool3DGradOpAdaptor::grad() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr AvgPool3DGradOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::ArrayAttr AvgPool3DGradOpAdaptor::ksize() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("ksize").cast<::mlir::ArrayAttr>();
  return attr;
}

::mlir::ArrayAttr AvgPool3DGradOpAdaptor::strides() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("strides").cast<::mlir::ArrayAttr>();
  return attr;
}

::mlir::StringAttr AvgPool3DGradOpAdaptor::padding() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("padding").cast<::mlir::StringAttr>();
  return attr;
}

::mlir::StringAttr AvgPool3DGradOpAdaptor::data_format() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("data_format").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("NDHWC");
  return attr;
}

::mlir::LogicalResult AvgPool3DGradOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_ksize = odsAttrs.get("ksize");
    if (!tblgen_ksize)
      return emitError(loc, "'tf.AvgPool3DGrad' op ""requires attribute 'ksize'");

    if (tblgen_ksize && !((((tblgen_ksize.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_ksize.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return ((attr.isa<::mlir::IntegerAttr>())) && ((attr.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64))); }))) && ((tblgen_ksize.cast<::mlir::ArrayAttr>().size() >= 5))))
      return emitError(loc, "'tf.AvgPool3DGrad' op ""attribute 'ksize' failed to satisfy constraint: 64-bit integer array attribute with at least 5 elements");
  }
  {
    auto tblgen_strides = odsAttrs.get("strides");
    if (!tblgen_strides)
      return emitError(loc, "'tf.AvgPool3DGrad' op ""requires attribute 'strides'");

    if (tblgen_strides && !((((tblgen_strides.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_strides.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return ((attr.isa<::mlir::IntegerAttr>())) && ((attr.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64))); }))) && ((tblgen_strides.cast<::mlir::ArrayAttr>().size() >= 5))))
      return emitError(loc, "'tf.AvgPool3DGrad' op ""attribute 'strides' failed to satisfy constraint: 64-bit integer array attribute with at least 5 elements");
  }
  {
    auto tblgen_padding = odsAttrs.get("padding");
    if (!tblgen_padding)
      return emitError(loc, "'tf.AvgPool3DGrad' op ""requires attribute 'padding'");

    if (tblgen_padding && !((tblgen_padding.cast<StringAttr>().getValue() == "SAME" || tblgen_padding.cast<StringAttr>().getValue() == "VALID")))
      return emitError(loc, "'tf.AvgPool3DGrad' op ""attribute 'padding' failed to satisfy constraint: string attribute whose value is SAME, or VALID");
  }
  {
    auto tblgen_data_format = odsAttrs.get("data_format");
    if (tblgen_data_format && !((tblgen_data_format.cast<StringAttr>().getValue() == "NDHWC" || tblgen_data_format.cast<StringAttr>().getValue() == "NCDHW")))
      return emitError(loc, "'tf.AvgPool3DGrad' op ""attribute 'data_format' failed to satisfy constraint: string attribute whose value is NDHWC, or NCDHW");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> AvgPool3DGradOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range AvgPool3DGradOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value AvgPool3DGradOp::orig_input_shape() {
  return *getODSOperands(0).begin();
}

::mlir::Value AvgPool3DGradOp::grad() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange AvgPool3DGradOp::orig_input_shapeMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange AvgPool3DGradOp::gradMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> AvgPool3DGradOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range AvgPool3DGradOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value AvgPool3DGradOp::output() {
  return *getODSResults(0).begin();
}

::mlir::ArrayAttr AvgPool3DGradOp::ksizeAttr() {
  return (*this)->getAttr(ksizeAttrName()).cast<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr AvgPool3DGradOp::ksize() {
  auto attr = ksizeAttr();
  return attr;
}

::mlir::ArrayAttr AvgPool3DGradOp::stridesAttr() {
  return (*this)->getAttr(stridesAttrName()).cast<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr AvgPool3DGradOp::strides() {
  auto attr = stridesAttr();
  return attr;
}

::mlir::StringAttr AvgPool3DGradOp::paddingAttr() {
  return (*this)->getAttr(paddingAttrName()).cast<::mlir::StringAttr>();
}

::llvm::StringRef AvgPool3DGradOp::padding() {
  auto attr = paddingAttr();
  return attr.getValue();
}

::mlir::StringAttr AvgPool3DGradOp::data_formatAttr() {
  return (*this)->getAttr(data_formatAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef AvgPool3DGradOp::data_format() {
  auto attr = data_formatAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("NDHWC").getValue();
  return attr.getValue();
}

::mlir::Type AvgPool3DGradOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(1).begin());
}

bool AvgPool3DGradOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr AvgPool3DGradOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void AvgPool3DGradOp::ksizeAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(ksizeAttrName(), attr);
}

void AvgPool3DGradOp::stridesAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(stridesAttrName(), attr);
}

void AvgPool3DGradOp::paddingAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(paddingAttrName(), attr);
}

void AvgPool3DGradOp::data_formatAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(data_formatAttrName(), attr);
}

void AvgPool3DGradOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value orig_input_shape, ::mlir::Value grad, ::mlir::ArrayAttr ksize, ::mlir::ArrayAttr strides, ::mlir::StringAttr padding, ::mlir::StringAttr data_format) {
  odsState.addOperands(orig_input_shape);
  odsState.addOperands(grad);
  odsState.addAttribute(ksizeAttrName(odsState.name), ksize);
  odsState.addAttribute(stridesAttrName(odsState.name), strides);
  odsState.addAttribute(paddingAttrName(odsState.name), padding);
  odsState.addAttribute(data_formatAttrName(odsState.name), data_format);
  odsState.addTypes(output);
}

void AvgPool3DGradOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value orig_input_shape, ::mlir::Value grad, ::mlir::ArrayAttr ksize, ::mlir::ArrayAttr strides, ::mlir::StringAttr padding, ::mlir::StringAttr data_format) {
  odsState.addOperands(orig_input_shape);
  odsState.addOperands(grad);
  odsState.addAttribute(ksizeAttrName(odsState.name), ksize);
  odsState.addAttribute(stridesAttrName(odsState.name), strides);
  odsState.addAttribute(paddingAttrName(odsState.name), padding);
  odsState.addAttribute(data_formatAttrName(odsState.name), data_format);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void AvgPool3DGradOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value orig_input_shape, ::mlir::Value grad, ::mlir::ArrayAttr ksize, ::mlir::ArrayAttr strides, ::llvm::StringRef padding, ::llvm::StringRef data_format) {
  odsState.addOperands(orig_input_shape);
  odsState.addOperands(grad);
  odsState.addAttribute(ksizeAttrName(odsState.name), ksize);
  odsState.addAttribute(stridesAttrName(odsState.name), strides);
  odsState.addAttribute(paddingAttrName(odsState.name), odsBuilder.getStringAttr(padding));
  odsState.addAttribute(data_formatAttrName(odsState.name), odsBuilder.getStringAttr(data_format));
  odsState.addTypes(output);
}

void AvgPool3DGradOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value orig_input_shape, ::mlir::Value grad, ::mlir::ArrayAttr ksize, ::mlir::ArrayAttr strides, ::llvm::StringRef padding, ::llvm::StringRef data_format) {
  odsState.addOperands(orig_input_shape);
  odsState.addOperands(grad);
  odsState.addAttribute(ksizeAttrName(odsState.name), ksize);
  odsState.addAttribute(stridesAttrName(odsState.name), strides);
  odsState.addAttribute(paddingAttrName(odsState.name), odsBuilder.getStringAttr(padding));
  odsState.addAttribute(data_formatAttrName(odsState.name), odsBuilder.getStringAttr(data_format));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void AvgPool3DGradOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult AvgPool3DGradOp::verify() {
  {
    auto tblgen_ksize = (*this)->getAttr(ksizeAttrName());
    if (!tblgen_ksize)
      return emitOpError("requires attribute 'ksize'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops7(*this, tblgen_ksize, "ksize")))
      return ::mlir::failure();
  }
  {
    auto tblgen_strides = (*this)->getAttr(stridesAttrName());
    if (!tblgen_strides)
      return emitOpError("requires attribute 'strides'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops7(*this, tblgen_strides, "strides")))
      return ::mlir::failure();
  }
  {
    auto tblgen_padding = (*this)->getAttr(paddingAttrName());
    if (!tblgen_padding)
      return emitOpError("requires attribute 'padding'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops8(*this, tblgen_padding, "padding")))
      return ::mlir::failure();
  }
  {
    auto tblgen_data_format = (*this)->getAttr(data_formatAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops9(*this, tblgen_data_format, "data_format")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops11(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void AvgPool3DGradOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::AvgPool3DGradOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::AvgPool3DOp definitions
//===----------------------------------------------------------------------===//

AvgPool3DOpAdaptor::AvgPool3DOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

AvgPool3DOpAdaptor::AvgPool3DOpAdaptor(AvgPool3DOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange AvgPool3DOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> AvgPool3DOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange AvgPool3DOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value AvgPool3DOpAdaptor::input() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr AvgPool3DOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::ArrayAttr AvgPool3DOpAdaptor::ksize() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("ksize").cast<::mlir::ArrayAttr>();
  return attr;
}

::mlir::ArrayAttr AvgPool3DOpAdaptor::strides() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("strides").cast<::mlir::ArrayAttr>();
  return attr;
}

::mlir::StringAttr AvgPool3DOpAdaptor::padding() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("padding").cast<::mlir::StringAttr>();
  return attr;
}

::mlir::StringAttr AvgPool3DOpAdaptor::data_format() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("data_format").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("NDHWC");
  return attr;
}

::mlir::LogicalResult AvgPool3DOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_ksize = odsAttrs.get("ksize");
    if (!tblgen_ksize)
      return emitError(loc, "'tf.AvgPool3D' op ""requires attribute 'ksize'");

    if (tblgen_ksize && !((((tblgen_ksize.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_ksize.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return ((attr.isa<::mlir::IntegerAttr>())) && ((attr.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64))); }))) && ((tblgen_ksize.cast<::mlir::ArrayAttr>().size() >= 5))))
      return emitError(loc, "'tf.AvgPool3D' op ""attribute 'ksize' failed to satisfy constraint: 64-bit integer array attribute with at least 5 elements");
  }
  {
    auto tblgen_strides = odsAttrs.get("strides");
    if (!tblgen_strides)
      return emitError(loc, "'tf.AvgPool3D' op ""requires attribute 'strides'");

    if (tblgen_strides && !((((tblgen_strides.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_strides.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return ((attr.isa<::mlir::IntegerAttr>())) && ((attr.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64))); }))) && ((tblgen_strides.cast<::mlir::ArrayAttr>().size() >= 5))))
      return emitError(loc, "'tf.AvgPool3D' op ""attribute 'strides' failed to satisfy constraint: 64-bit integer array attribute with at least 5 elements");
  }
  {
    auto tblgen_padding = odsAttrs.get("padding");
    if (!tblgen_padding)
      return emitError(loc, "'tf.AvgPool3D' op ""requires attribute 'padding'");

    if (tblgen_padding && !((tblgen_padding.cast<StringAttr>().getValue() == "SAME" || tblgen_padding.cast<StringAttr>().getValue() == "VALID")))
      return emitError(loc, "'tf.AvgPool3D' op ""attribute 'padding' failed to satisfy constraint: string attribute whose value is SAME, or VALID");
  }
  {
    auto tblgen_data_format = odsAttrs.get("data_format");
    if (tblgen_data_format && !((tblgen_data_format.cast<StringAttr>().getValue() == "NDHWC" || tblgen_data_format.cast<StringAttr>().getValue() == "NCDHW")))
      return emitError(loc, "'tf.AvgPool3D' op ""attribute 'data_format' failed to satisfy constraint: string attribute whose value is NDHWC, or NCDHW");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> AvgPool3DOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range AvgPool3DOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value AvgPool3DOp::input() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange AvgPool3DOp::inputMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> AvgPool3DOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range AvgPool3DOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value AvgPool3DOp::output() {
  return *getODSResults(0).begin();
}

::mlir::ArrayAttr AvgPool3DOp::ksizeAttr() {
  return (*this)->getAttr(ksizeAttrName()).cast<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr AvgPool3DOp::ksize() {
  auto attr = ksizeAttr();
  return attr;
}

::mlir::ArrayAttr AvgPool3DOp::stridesAttr() {
  return (*this)->getAttr(stridesAttrName()).cast<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr AvgPool3DOp::strides() {
  auto attr = stridesAttr();
  return attr;
}

::mlir::StringAttr AvgPool3DOp::paddingAttr() {
  return (*this)->getAttr(paddingAttrName()).cast<::mlir::StringAttr>();
}

::llvm::StringRef AvgPool3DOp::padding() {
  auto attr = paddingAttr();
  return attr.getValue();
}

::mlir::StringAttr AvgPool3DOp::data_formatAttr() {
  return (*this)->getAttr(data_formatAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef AvgPool3DOp::data_format() {
  auto attr = data_formatAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("NDHWC").getValue();
  return attr.getValue();
}

::mlir::Type AvgPool3DOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool AvgPool3DOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr AvgPool3DOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void AvgPool3DOp::ksizeAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(ksizeAttrName(), attr);
}

void AvgPool3DOp::stridesAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(stridesAttrName(), attr);
}

void AvgPool3DOp::paddingAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(paddingAttrName(), attr);
}

void AvgPool3DOp::data_formatAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(data_formatAttrName(), attr);
}

void AvgPool3DOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input, ::mlir::ArrayAttr ksize, ::mlir::ArrayAttr strides, ::mlir::StringAttr padding, ::mlir::StringAttr data_format) {
  odsState.addOperands(input);
  odsState.addAttribute(ksizeAttrName(odsState.name), ksize);
  odsState.addAttribute(stridesAttrName(odsState.name), strides);
  odsState.addAttribute(paddingAttrName(odsState.name), padding);
  odsState.addAttribute(data_formatAttrName(odsState.name), data_format);
  odsState.addTypes(output);
}

void AvgPool3DOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::ArrayAttr ksize, ::mlir::ArrayAttr strides, ::mlir::StringAttr padding, ::mlir::StringAttr data_format) {
  odsState.addOperands(input);
  odsState.addAttribute(ksizeAttrName(odsState.name), ksize);
  odsState.addAttribute(stridesAttrName(odsState.name), strides);
  odsState.addAttribute(paddingAttrName(odsState.name), padding);
  odsState.addAttribute(data_formatAttrName(odsState.name), data_format);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void AvgPool3DOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input, ::mlir::ArrayAttr ksize, ::mlir::ArrayAttr strides, ::llvm::StringRef padding, ::llvm::StringRef data_format) {
  odsState.addOperands(input);
  odsState.addAttribute(ksizeAttrName(odsState.name), ksize);
  odsState.addAttribute(stridesAttrName(odsState.name), strides);
  odsState.addAttribute(paddingAttrName(odsState.name), odsBuilder.getStringAttr(padding));
  odsState.addAttribute(data_formatAttrName(odsState.name), odsBuilder.getStringAttr(data_format));
  odsState.addTypes(output);
}

void AvgPool3DOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::ArrayAttr ksize, ::mlir::ArrayAttr strides, ::llvm::StringRef padding, ::llvm::StringRef data_format) {
  odsState.addOperands(input);
  odsState.addAttribute(ksizeAttrName(odsState.name), ksize);
  odsState.addAttribute(stridesAttrName(odsState.name), strides);
  odsState.addAttribute(paddingAttrName(odsState.name), odsBuilder.getStringAttr(padding));
  odsState.addAttribute(data_formatAttrName(odsState.name), odsBuilder.getStringAttr(data_format));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void AvgPool3DOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult AvgPool3DOp::verify() {
  {
    auto tblgen_ksize = (*this)->getAttr(ksizeAttrName());
    if (!tblgen_ksize)
      return emitOpError("requires attribute 'ksize'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops7(*this, tblgen_ksize, "ksize")))
      return ::mlir::failure();
  }
  {
    auto tblgen_strides = (*this)->getAttr(stridesAttrName());
    if (!tblgen_strides)
      return emitOpError("requires attribute 'strides'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops7(*this, tblgen_strides, "strides")))
      return ::mlir::failure();
  }
  {
    auto tblgen_padding = (*this)->getAttr(paddingAttrName());
    if (!tblgen_padding)
      return emitOpError("requires attribute 'padding'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops8(*this, tblgen_padding, "padding")))
      return ::mlir::failure();
  }
  {
    auto tblgen_data_format = (*this)->getAttr(data_formatAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops9(*this, tblgen_data_format, "data_format")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void AvgPool3DOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::AvgPool3DOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::AvgPoolGradOp definitions
//===----------------------------------------------------------------------===//

AvgPoolGradOpAdaptor::AvgPoolGradOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

AvgPoolGradOpAdaptor::AvgPoolGradOpAdaptor(AvgPoolGradOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange AvgPoolGradOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> AvgPoolGradOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange AvgPoolGradOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value AvgPoolGradOpAdaptor::orig_input_shape() {
  return *getODSOperands(0).begin();
}

::mlir::Value AvgPoolGradOpAdaptor::grad() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr AvgPoolGradOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::ArrayAttr AvgPoolGradOpAdaptor::ksize() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("ksize").cast<::mlir::ArrayAttr>();
  return attr;
}

::mlir::ArrayAttr AvgPoolGradOpAdaptor::strides() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("strides").cast<::mlir::ArrayAttr>();
  return attr;
}

::mlir::StringAttr AvgPoolGradOpAdaptor::padding() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("padding").cast<::mlir::StringAttr>();
  return attr;
}

::mlir::StringAttr AvgPoolGradOpAdaptor::data_format() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("data_format").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("NHWC");
  return attr;
}

::mlir::LogicalResult AvgPoolGradOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_ksize = odsAttrs.get("ksize");
    if (!tblgen_ksize)
      return emitError(loc, "'tf.AvgPoolGrad' op ""requires attribute 'ksize'");

    if (tblgen_ksize && !((((tblgen_ksize.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_ksize.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return ((attr.isa<::mlir::IntegerAttr>())) && ((attr.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64))); }))) && ((tblgen_ksize.cast<::mlir::ArrayAttr>().size() >= 4))))
      return emitError(loc, "'tf.AvgPoolGrad' op ""attribute 'ksize' failed to satisfy constraint: 64-bit integer array attribute with at least 4 elements");
  }
  {
    auto tblgen_strides = odsAttrs.get("strides");
    if (!tblgen_strides)
      return emitError(loc, "'tf.AvgPoolGrad' op ""requires attribute 'strides'");

    if (tblgen_strides && !((((tblgen_strides.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_strides.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return ((attr.isa<::mlir::IntegerAttr>())) && ((attr.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64))); }))) && ((tblgen_strides.cast<::mlir::ArrayAttr>().size() >= 4))))
      return emitError(loc, "'tf.AvgPoolGrad' op ""attribute 'strides' failed to satisfy constraint: 64-bit integer array attribute with at least 4 elements");
  }
  {
    auto tblgen_padding = odsAttrs.get("padding");
    if (!tblgen_padding)
      return emitError(loc, "'tf.AvgPoolGrad' op ""requires attribute 'padding'");

    if (tblgen_padding && !((tblgen_padding.cast<StringAttr>().getValue() == "SAME" || tblgen_padding.cast<StringAttr>().getValue() == "VALID")))
      return emitError(loc, "'tf.AvgPoolGrad' op ""attribute 'padding' failed to satisfy constraint: string attribute whose value is SAME, or VALID");
  }
  {
    auto tblgen_data_format = odsAttrs.get("data_format");
    if (tblgen_data_format && !((tblgen_data_format.cast<StringAttr>().getValue() == "NHWC" || tblgen_data_format.cast<StringAttr>().getValue() == "NCHW")))
      return emitError(loc, "'tf.AvgPoolGrad' op ""attribute 'data_format' failed to satisfy constraint: 'NHWC' or 'NCHW' convnet data format");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> AvgPoolGradOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range AvgPoolGradOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value AvgPoolGradOp::orig_input_shape() {
  return *getODSOperands(0).begin();
}

::mlir::Value AvgPoolGradOp::grad() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange AvgPoolGradOp::orig_input_shapeMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange AvgPoolGradOp::gradMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> AvgPoolGradOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range AvgPoolGradOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value AvgPoolGradOp::output() {
  return *getODSResults(0).begin();
}

::mlir::ArrayAttr AvgPoolGradOp::ksizeAttr() {
  return (*this)->getAttr(ksizeAttrName()).cast<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr AvgPoolGradOp::ksize() {
  auto attr = ksizeAttr();
  return attr;
}

::mlir::ArrayAttr AvgPoolGradOp::stridesAttr() {
  return (*this)->getAttr(stridesAttrName()).cast<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr AvgPoolGradOp::strides() {
  auto attr = stridesAttr();
  return attr;
}

::mlir::StringAttr AvgPoolGradOp::paddingAttr() {
  return (*this)->getAttr(paddingAttrName()).cast<::mlir::StringAttr>();
}

::llvm::StringRef AvgPoolGradOp::padding() {
  auto attr = paddingAttr();
  return attr.getValue();
}

::mlir::StringAttr AvgPoolGradOp::data_formatAttr() {
  return (*this)->getAttr(data_formatAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef AvgPoolGradOp::data_format() {
  auto attr = data_formatAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("NHWC").getValue();
  return attr.getValue();
}

::mlir::Type AvgPoolGradOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(1).begin());
}

bool AvgPoolGradOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr AvgPoolGradOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void AvgPoolGradOp::ksizeAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(ksizeAttrName(), attr);
}

void AvgPoolGradOp::stridesAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(stridesAttrName(), attr);
}

void AvgPoolGradOp::paddingAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(paddingAttrName(), attr);
}

void AvgPoolGradOp::data_formatAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(data_formatAttrName(), attr);
}

void AvgPoolGradOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value orig_input_shape, ::mlir::Value grad, ::mlir::ArrayAttr ksize, ::mlir::ArrayAttr strides, ::mlir::StringAttr padding, ::mlir::StringAttr data_format) {
  odsState.addOperands(orig_input_shape);
  odsState.addOperands(grad);
  odsState.addAttribute(ksizeAttrName(odsState.name), ksize);
  odsState.addAttribute(stridesAttrName(odsState.name), strides);
  odsState.addAttribute(paddingAttrName(odsState.name), padding);
  odsState.addAttribute(data_formatAttrName(odsState.name), data_format);
  odsState.addTypes(output);
}

void AvgPoolGradOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value orig_input_shape, ::mlir::Value grad, ::mlir::ArrayAttr ksize, ::mlir::ArrayAttr strides, ::mlir::StringAttr padding, ::mlir::StringAttr data_format) {
  odsState.addOperands(orig_input_shape);
  odsState.addOperands(grad);
  odsState.addAttribute(ksizeAttrName(odsState.name), ksize);
  odsState.addAttribute(stridesAttrName(odsState.name), strides);
  odsState.addAttribute(paddingAttrName(odsState.name), padding);
  odsState.addAttribute(data_formatAttrName(odsState.name), data_format);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void AvgPoolGradOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value orig_input_shape, ::mlir::Value grad, ::mlir::ArrayAttr ksize, ::mlir::ArrayAttr strides, ::llvm::StringRef padding, ::llvm::StringRef data_format) {
  odsState.addOperands(orig_input_shape);
  odsState.addOperands(grad);
  odsState.addAttribute(ksizeAttrName(odsState.name), ksize);
  odsState.addAttribute(stridesAttrName(odsState.name), strides);
  odsState.addAttribute(paddingAttrName(odsState.name), odsBuilder.getStringAttr(padding));
  odsState.addAttribute(data_formatAttrName(odsState.name), odsBuilder.getStringAttr(data_format));
  odsState.addTypes(output);
}

void AvgPoolGradOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value orig_input_shape, ::mlir::Value grad, ::mlir::ArrayAttr ksize, ::mlir::ArrayAttr strides, ::llvm::StringRef padding, ::llvm::StringRef data_format) {
  odsState.addOperands(orig_input_shape);
  odsState.addOperands(grad);
  odsState.addAttribute(ksizeAttrName(odsState.name), ksize);
  odsState.addAttribute(stridesAttrName(odsState.name), strides);
  odsState.addAttribute(paddingAttrName(odsState.name), odsBuilder.getStringAttr(padding));
  odsState.addAttribute(data_formatAttrName(odsState.name), odsBuilder.getStringAttr(data_format));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void AvgPoolGradOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult AvgPoolGradOp::verify() {
  {
    auto tblgen_ksize = (*this)->getAttr(ksizeAttrName());
    if (!tblgen_ksize)
      return emitOpError("requires attribute 'ksize'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops10(*this, tblgen_ksize, "ksize")))
      return ::mlir::failure();
  }
  {
    auto tblgen_strides = (*this)->getAttr(stridesAttrName());
    if (!tblgen_strides)
      return emitOpError("requires attribute 'strides'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops10(*this, tblgen_strides, "strides")))
      return ::mlir::failure();
  }
  {
    auto tblgen_padding = (*this)->getAttr(paddingAttrName());
    if (!tblgen_padding)
      return emitOpError("requires attribute 'padding'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops8(*this, tblgen_padding, "padding")))
      return ::mlir::failure();
  }
  {
    auto tblgen_data_format = (*this)->getAttr(data_formatAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops11(*this, tblgen_data_format, "data_format")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops11(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void AvgPoolGradOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::AvgPoolGradOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::AvgPoolOp definitions
//===----------------------------------------------------------------------===//

AvgPoolOpAdaptor::AvgPoolOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

AvgPoolOpAdaptor::AvgPoolOpAdaptor(AvgPoolOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange AvgPoolOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> AvgPoolOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange AvgPoolOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value AvgPoolOpAdaptor::value() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr AvgPoolOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::ArrayAttr AvgPoolOpAdaptor::ksize() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("ksize").cast<::mlir::ArrayAttr>();
  return attr;
}

::mlir::ArrayAttr AvgPoolOpAdaptor::strides() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("strides").cast<::mlir::ArrayAttr>();
  return attr;
}

::mlir::StringAttr AvgPoolOpAdaptor::padding() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("padding").cast<::mlir::StringAttr>();
  return attr;
}

::mlir::StringAttr AvgPoolOpAdaptor::data_format() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("data_format").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("NHWC");
  return attr;
}

::mlir::LogicalResult AvgPoolOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_ksize = odsAttrs.get("ksize");
    if (!tblgen_ksize)
      return emitError(loc, "'tf.AvgPool' op ""requires attribute 'ksize'");

    if (tblgen_ksize && !((((tblgen_ksize.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_ksize.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return ((attr.isa<::mlir::IntegerAttr>())) && ((attr.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64))); }))) && ((tblgen_ksize.cast<::mlir::ArrayAttr>().size() >= 4))))
      return emitError(loc, "'tf.AvgPool' op ""attribute 'ksize' failed to satisfy constraint: 64-bit integer array attribute with at least 4 elements");
  }
  {
    auto tblgen_strides = odsAttrs.get("strides");
    if (!tblgen_strides)
      return emitError(loc, "'tf.AvgPool' op ""requires attribute 'strides'");

    if (tblgen_strides && !((((tblgen_strides.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_strides.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return ((attr.isa<::mlir::IntegerAttr>())) && ((attr.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64))); }))) && ((tblgen_strides.cast<::mlir::ArrayAttr>().size() >= 4))))
      return emitError(loc, "'tf.AvgPool' op ""attribute 'strides' failed to satisfy constraint: 64-bit integer array attribute with at least 4 elements");
  }
  {
    auto tblgen_padding = odsAttrs.get("padding");
    if (!tblgen_padding)
      return emitError(loc, "'tf.AvgPool' op ""requires attribute 'padding'");

    if (tblgen_padding && !((tblgen_padding.cast<StringAttr>().getValue() == "SAME" || tblgen_padding.cast<StringAttr>().getValue() == "VALID")))
      return emitError(loc, "'tf.AvgPool' op ""attribute 'padding' failed to satisfy constraint: string attribute whose value is SAME, or VALID");
  }
  {
    auto tblgen_data_format = odsAttrs.get("data_format");
    if (tblgen_data_format && !((tblgen_data_format.cast<StringAttr>().getValue() == "NHWC" || tblgen_data_format.cast<StringAttr>().getValue() == "NCHW")))
      return emitError(loc, "'tf.AvgPool' op ""attribute 'data_format' failed to satisfy constraint: 'NHWC' or 'NCHW' convnet data format");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> AvgPoolOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range AvgPoolOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value AvgPoolOp::value() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange AvgPoolOp::valueMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> AvgPoolOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range AvgPoolOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value AvgPoolOp::output() {
  return *getODSResults(0).begin();
}

::mlir::ArrayAttr AvgPoolOp::ksizeAttr() {
  return (*this)->getAttr(ksizeAttrName()).cast<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr AvgPoolOp::ksize() {
  auto attr = ksizeAttr();
  return attr;
}

::mlir::ArrayAttr AvgPoolOp::stridesAttr() {
  return (*this)->getAttr(stridesAttrName()).cast<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr AvgPoolOp::strides() {
  auto attr = stridesAttr();
  return attr;
}

::mlir::StringAttr AvgPoolOp::paddingAttr() {
  return (*this)->getAttr(paddingAttrName()).cast<::mlir::StringAttr>();
}

::llvm::StringRef AvgPoolOp::padding() {
  auto attr = paddingAttr();
  return attr.getValue();
}

::mlir::StringAttr AvgPoolOp::data_formatAttr() {
  return (*this)->getAttr(data_formatAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef AvgPoolOp::data_format() {
  auto attr = data_formatAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("NHWC").getValue();
  return attr.getValue();
}

::mlir::Type AvgPoolOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool AvgPoolOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr AvgPoolOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void AvgPoolOp::ksizeAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(ksizeAttrName(), attr);
}

void AvgPoolOp::stridesAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(stridesAttrName(), attr);
}

void AvgPoolOp::paddingAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(paddingAttrName(), attr);
}

void AvgPoolOp::data_formatAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(data_formatAttrName(), attr);
}

void AvgPoolOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value value, ::mlir::ArrayAttr ksize, ::mlir::ArrayAttr strides, ::mlir::StringAttr padding, ::mlir::StringAttr data_format) {
  odsState.addOperands(value);
  odsState.addAttribute(ksizeAttrName(odsState.name), ksize);
  odsState.addAttribute(stridesAttrName(odsState.name), strides);
  odsState.addAttribute(paddingAttrName(odsState.name), padding);
  odsState.addAttribute(data_formatAttrName(odsState.name), data_format);
  odsState.addTypes(output);
}

void AvgPoolOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value value, ::mlir::ArrayAttr ksize, ::mlir::ArrayAttr strides, ::mlir::StringAttr padding, ::mlir::StringAttr data_format) {
  odsState.addOperands(value);
  odsState.addAttribute(ksizeAttrName(odsState.name), ksize);
  odsState.addAttribute(stridesAttrName(odsState.name), strides);
  odsState.addAttribute(paddingAttrName(odsState.name), padding);
  odsState.addAttribute(data_formatAttrName(odsState.name), data_format);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void AvgPoolOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value value, ::mlir::ArrayAttr ksize, ::mlir::ArrayAttr strides, ::llvm::StringRef padding, ::llvm::StringRef data_format) {
  odsState.addOperands(value);
  odsState.addAttribute(ksizeAttrName(odsState.name), ksize);
  odsState.addAttribute(stridesAttrName(odsState.name), strides);
  odsState.addAttribute(paddingAttrName(odsState.name), odsBuilder.getStringAttr(padding));
  odsState.addAttribute(data_formatAttrName(odsState.name), odsBuilder.getStringAttr(data_format));
  odsState.addTypes(output);
}

void AvgPoolOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value value, ::mlir::ArrayAttr ksize, ::mlir::ArrayAttr strides, ::llvm::StringRef padding, ::llvm::StringRef data_format) {
  odsState.addOperands(value);
  odsState.addAttribute(ksizeAttrName(odsState.name), ksize);
  odsState.addAttribute(stridesAttrName(odsState.name), strides);
  odsState.addAttribute(paddingAttrName(odsState.name), odsBuilder.getStringAttr(padding));
  odsState.addAttribute(data_formatAttrName(odsState.name), odsBuilder.getStringAttr(data_format));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void AvgPoolOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult AvgPoolOp::verify() {
  {
    auto tblgen_ksize = (*this)->getAttr(ksizeAttrName());
    if (!tblgen_ksize)
      return emitOpError("requires attribute 'ksize'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops10(*this, tblgen_ksize, "ksize")))
      return ::mlir::failure();
  }
  {
    auto tblgen_strides = (*this)->getAttr(stridesAttrName());
    if (!tblgen_strides)
      return emitOpError("requires attribute 'strides'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops10(*this, tblgen_strides, "strides")))
      return ::mlir::failure();
  }
  {
    auto tblgen_padding = (*this)->getAttr(paddingAttrName());
    if (!tblgen_padding)
      return emitOpError("requires attribute 'padding'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops8(*this, tblgen_padding, "padding")))
      return ::mlir::failure();
  }
  {
    auto tblgen_data_format = (*this)->getAttr(data_formatAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops11(*this, tblgen_data_format, "data_format")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void AvgPoolOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::AvgPoolOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::BatchDatasetV2Op definitions
//===----------------------------------------------------------------------===//

BatchDatasetV2OpAdaptor::BatchDatasetV2OpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

BatchDatasetV2OpAdaptor::BatchDatasetV2OpAdaptor(BatchDatasetV2Op &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange BatchDatasetV2OpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> BatchDatasetV2OpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange BatchDatasetV2OpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value BatchDatasetV2OpAdaptor::input_dataset() {
  return *getODSOperands(0).begin();
}

::mlir::Value BatchDatasetV2OpAdaptor::batch_size() {
  return *getODSOperands(1).begin();
}

::mlir::Value BatchDatasetV2OpAdaptor::drop_remainder() {
  return *getODSOperands(2).begin();
}

::mlir::DictionaryAttr BatchDatasetV2OpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::BoolAttr BatchDatasetV2OpAdaptor::parallel_copy() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("parallel_copy").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(false);
  return attr;
}

::mlir::ArrayAttr BatchDatasetV2OpAdaptor::output_types() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("output_types").cast<::mlir::ArrayAttr>();
  return attr;
}

::mlir::ArrayAttr BatchDatasetV2OpAdaptor::output_shapes() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("output_shapes").cast<::mlir::ArrayAttr>();
  return attr;
}

::mlir::StringAttr BatchDatasetV2OpAdaptor::metadata() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("metadata").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("");
  return attr;
}

::mlir::LogicalResult BatchDatasetV2OpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_parallel_copy = odsAttrs.get("parallel_copy");
    if (tblgen_parallel_copy && !((tblgen_parallel_copy.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.BatchDatasetV2' op ""attribute 'parallel_copy' failed to satisfy constraint: bool attribute");
  }
  {
    auto tblgen_output_types = odsAttrs.get("output_types");
    if (!tblgen_output_types)
      return emitError(loc, "'tf.BatchDatasetV2' op ""requires attribute 'output_types'");

    if (tblgen_output_types && !((((tblgen_output_types.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_output_types.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return ((attr.isa<::mlir::TypeAttr>())) && ((attr.cast<::mlir::TypeAttr>().getValue().isa<::mlir::Type>())); }))) && ((tblgen_output_types.cast<::mlir::ArrayAttr>().size() >= 1))))
      return emitError(loc, "'tf.BatchDatasetV2' op ""attribute 'output_types' failed to satisfy constraint: type array attribute with at least 1 elements");
  }
  {
    auto tblgen_output_shapes = odsAttrs.get("output_shapes");
    if (!tblgen_output_shapes)
      return emitError(loc, "'tf.BatchDatasetV2' op ""requires attribute 'output_shapes'");

    if (tblgen_output_shapes && !((((tblgen_output_shapes.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_output_shapes.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return (attr.isa<mlir::TF::ShapeAttr>()); }))) && ((tblgen_output_shapes.cast<::mlir::ArrayAttr>().size() >= 1))))
      return emitError(loc, "'tf.BatchDatasetV2' op ""attribute 'output_shapes' failed to satisfy constraint: tensorflow shape attribute array with at least 1 elements");
  }
  {
    auto tblgen_metadata = odsAttrs.get("metadata");
    if (tblgen_metadata && !((tblgen_metadata.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.BatchDatasetV2' op ""attribute 'metadata' failed to satisfy constraint: string attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> BatchDatasetV2Op::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range BatchDatasetV2Op::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value BatchDatasetV2Op::input_dataset() {
  return *getODSOperands(0).begin();
}

::mlir::Value BatchDatasetV2Op::batch_size() {
  return *getODSOperands(1).begin();
}

::mlir::Value BatchDatasetV2Op::drop_remainder() {
  return *getODSOperands(2).begin();
}

::mlir::MutableOperandRange BatchDatasetV2Op::input_datasetMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange BatchDatasetV2Op::batch_sizeMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange BatchDatasetV2Op::drop_remainderMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> BatchDatasetV2Op::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range BatchDatasetV2Op::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value BatchDatasetV2Op::handle() {
  return *getODSResults(0).begin();
}

::mlir::BoolAttr BatchDatasetV2Op::parallel_copyAttr() {
  return (*this)->getAttr(parallel_copyAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool BatchDatasetV2Op::parallel_copy() {
  auto attr = parallel_copyAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(false).getValue();
  return attr.getValue();
}

::mlir::ArrayAttr BatchDatasetV2Op::output_typesAttr() {
  return (*this)->getAttr(output_typesAttrName()).cast<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr BatchDatasetV2Op::output_types() {
  auto attr = output_typesAttr();
  return attr;
}

::mlir::ArrayAttr BatchDatasetV2Op::output_shapesAttr() {
  return (*this)->getAttr(output_shapesAttrName()).cast<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr BatchDatasetV2Op::output_shapes() {
  auto attr = output_shapesAttr();
  return attr;
}

::mlir::StringAttr BatchDatasetV2Op::metadataAttr() {
  return (*this)->getAttr(metadataAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef BatchDatasetV2Op::metadata() {
  auto attr = metadataAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("").getValue();
  return attr.getValue();
}

void BatchDatasetV2Op::parallel_copyAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(parallel_copyAttrName(), attr);
}

void BatchDatasetV2Op::output_typesAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(output_typesAttrName(), attr);
}

void BatchDatasetV2Op::output_shapesAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(output_shapesAttrName(), attr);
}

void BatchDatasetV2Op::metadataAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(metadataAttrName(), attr);
}

void BatchDatasetV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type handle, ::mlir::Value input_dataset, ::mlir::Value batch_size, ::mlir::Value drop_remainder, ::mlir::BoolAttr parallel_copy, ::mlir::ArrayAttr output_types, ::mlir::ArrayAttr output_shapes, ::mlir::StringAttr metadata) {
  odsState.addOperands(input_dataset);
  odsState.addOperands(batch_size);
  odsState.addOperands(drop_remainder);
  odsState.addAttribute(parallel_copyAttrName(odsState.name), parallel_copy);
  odsState.addAttribute(output_typesAttrName(odsState.name), output_types);
  odsState.addAttribute(output_shapesAttrName(odsState.name), output_shapes);
  odsState.addAttribute(metadataAttrName(odsState.name), metadata);
  odsState.addTypes(handle);
}

void BatchDatasetV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input_dataset, ::mlir::Value batch_size, ::mlir::Value drop_remainder, ::mlir::BoolAttr parallel_copy, ::mlir::ArrayAttr output_types, ::mlir::ArrayAttr output_shapes, ::mlir::StringAttr metadata) {
  odsState.addOperands(input_dataset);
  odsState.addOperands(batch_size);
  odsState.addOperands(drop_remainder);
  odsState.addAttribute(parallel_copyAttrName(odsState.name), parallel_copy);
  odsState.addAttribute(output_typesAttrName(odsState.name), output_types);
  odsState.addAttribute(output_shapesAttrName(odsState.name), output_shapes);
  odsState.addAttribute(metadataAttrName(odsState.name), metadata);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void BatchDatasetV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type handle, ::mlir::Value input_dataset, ::mlir::Value batch_size, ::mlir::Value drop_remainder, bool parallel_copy, ::mlir::ArrayAttr output_types, ::mlir::ArrayAttr output_shapes, ::llvm::StringRef metadata) {
  odsState.addOperands(input_dataset);
  odsState.addOperands(batch_size);
  odsState.addOperands(drop_remainder);
  odsState.addAttribute(parallel_copyAttrName(odsState.name), odsBuilder.getBoolAttr(parallel_copy));
  odsState.addAttribute(output_typesAttrName(odsState.name), output_types);
  odsState.addAttribute(output_shapesAttrName(odsState.name), output_shapes);
  odsState.addAttribute(metadataAttrName(odsState.name), odsBuilder.getStringAttr(metadata));
  odsState.addTypes(handle);
}

void BatchDatasetV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input_dataset, ::mlir::Value batch_size, ::mlir::Value drop_remainder, bool parallel_copy, ::mlir::ArrayAttr output_types, ::mlir::ArrayAttr output_shapes, ::llvm::StringRef metadata) {
  odsState.addOperands(input_dataset);
  odsState.addOperands(batch_size);
  odsState.addOperands(drop_remainder);
  odsState.addAttribute(parallel_copyAttrName(odsState.name), odsBuilder.getBoolAttr(parallel_copy));
  odsState.addAttribute(output_typesAttrName(odsState.name), output_types);
  odsState.addAttribute(output_shapesAttrName(odsState.name), output_shapes);
  odsState.addAttribute(metadataAttrName(odsState.name), odsBuilder.getStringAttr(metadata));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void BatchDatasetV2Op::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 3u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult BatchDatasetV2Op::verify() {
  {
    auto tblgen_parallel_copy = (*this)->getAttr(parallel_copyAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_parallel_copy, "parallel_copy")))
      return ::mlir::failure();
  }
  {
    auto tblgen_output_types = (*this)->getAttr(output_typesAttrName());
    if (!tblgen_output_types)
      return emitOpError("requires attribute 'output_types'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops2(*this, tblgen_output_types, "output_types")))
      return ::mlir::failure();
  }
  {
    auto tblgen_output_shapes = (*this)->getAttr(output_shapesAttrName());
    if (!tblgen_output_shapes)
      return emitOpError("requires attribute 'output_shapes'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops3(*this, tblgen_output_shapes, "output_shapes")))
      return ::mlir::failure();
  }
  {
    auto tblgen_metadata = (*this)->getAttr(metadataAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_metadata, "metadata")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops15(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops16(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops8(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops15(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void BatchDatasetV2Op::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::BatchDatasetV2Op)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::BatchFunctionOp definitions
//===----------------------------------------------------------------------===//

BatchFunctionOpAdaptor::BatchFunctionOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

BatchFunctionOpAdaptor::BatchFunctionOpAdaptor(BatchFunctionOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange BatchFunctionOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> BatchFunctionOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  assert(odsAttrs && "missing segment size attribute for op");
  auto sizeAttr = odsAttrs.get("operand_segment_sizes").cast<::mlir::DenseIntElementsAttr>();

  const uint32_t *sizeAttrValueIt = &*sizeAttr.value_begin<uint32_t>();
  if (sizeAttr.isSplat())
    return {*sizeAttrValueIt * index, *sizeAttrValueIt};

  unsigned start = 0;
  for (unsigned i = 0; i < index; ++i)
    start += sizeAttrValueIt[i];
  return {start, sizeAttrValueIt[index]};
}

::mlir::ValueRange BatchFunctionOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::ValueRange BatchFunctionOpAdaptor::in_tensors() {
  return getODSOperands(0);
}

::mlir::ValueRange BatchFunctionOpAdaptor::captured_tensors() {
  return getODSOperands(1);
}

::mlir::DictionaryAttr BatchFunctionOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::SymbolRefAttr BatchFunctionOpAdaptor::f() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::SymbolRefAttr attr = odsAttrs.get("f").cast<::mlir::SymbolRefAttr>();
  return attr;
}

::mlir::IntegerAttr BatchFunctionOpAdaptor::num_batch_threads() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("num_batch_threads").cast<::mlir::IntegerAttr>();
  return attr;
}

::mlir::IntegerAttr BatchFunctionOpAdaptor::max_batch_size() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("max_batch_size").cast<::mlir::IntegerAttr>();
  return attr;
}

::mlir::IntegerAttr BatchFunctionOpAdaptor::batch_timeout_micros() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("batch_timeout_micros").cast<::mlir::IntegerAttr>();
  return attr;
}

::mlir::IntegerAttr BatchFunctionOpAdaptor::max_enqueued_batches() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("max_enqueued_batches").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), 10);
  return attr;
}

::mlir::ArrayAttr BatchFunctionOpAdaptor::allowed_batch_sizes() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("allowed_batch_sizes").dyn_cast_or_null<::mlir::ArrayAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getI64ArrayAttr({});
  return attr;
}

::mlir::StringAttr BatchFunctionOpAdaptor::container() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("container").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("");
  return attr;
}

::mlir::StringAttr BatchFunctionOpAdaptor::shared_name() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("shared_name").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("");
  return attr;
}

::mlir::StringAttr BatchFunctionOpAdaptor::batching_queue() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("batching_queue").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("");
  return attr;
}

::mlir::BoolAttr BatchFunctionOpAdaptor::enable_large_batch_splitting() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("enable_large_batch_splitting").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(false);
  return attr;
}

::mlir::LogicalResult BatchFunctionOpAdaptor::verify(::mlir::Location loc) {
  {
    auto sizeAttr = odsAttrs.get("operand_segment_sizes").dyn_cast<::mlir::DenseIntElementsAttr>();
    if (!sizeAttr)
      return emitError(loc, "'tf.BatchFunction' op ""missing segment sizes attribute 'operand_segment_sizes'");
    auto numElements =
        sizeAttr.getType().cast<::mlir::ShapedType>().getNumElements();
    if (numElements != 2)
      return emitError(loc, "'tf.BatchFunction' op ""'operand_segment_sizes' attribute for specifying operand segments must have 2 "
                "elements, but got ") << numElements;
  }
    {
    auto tblgen_f = odsAttrs.get("f");
    if (!tblgen_f)
      return emitError(loc, "'tf.BatchFunction' op ""requires attribute 'f'");

    if (tblgen_f && !((tblgen_f.isa<::mlir::SymbolRefAttr>())))
      return emitError(loc, "'tf.BatchFunction' op ""attribute 'f' failed to satisfy constraint: symbol reference attribute");
  }
  {
    auto tblgen_num_batch_threads = odsAttrs.get("num_batch_threads");
    if (!tblgen_num_batch_threads)
      return emitError(loc, "'tf.BatchFunction' op ""requires attribute 'num_batch_threads'");

    if (tblgen_num_batch_threads && !(((tblgen_num_batch_threads.isa<::mlir::IntegerAttr>())) && ((tblgen_num_batch_threads.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.BatchFunction' op ""attribute 'num_batch_threads' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_max_batch_size = odsAttrs.get("max_batch_size");
    if (!tblgen_max_batch_size)
      return emitError(loc, "'tf.BatchFunction' op ""requires attribute 'max_batch_size'");

    if (tblgen_max_batch_size && !(((tblgen_max_batch_size.isa<::mlir::IntegerAttr>())) && ((tblgen_max_batch_size.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.BatchFunction' op ""attribute 'max_batch_size' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_batch_timeout_micros = odsAttrs.get("batch_timeout_micros");
    if (!tblgen_batch_timeout_micros)
      return emitError(loc, "'tf.BatchFunction' op ""requires attribute 'batch_timeout_micros'");

    if (tblgen_batch_timeout_micros && !(((tblgen_batch_timeout_micros.isa<::mlir::IntegerAttr>())) && ((tblgen_batch_timeout_micros.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.BatchFunction' op ""attribute 'batch_timeout_micros' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_max_enqueued_batches = odsAttrs.get("max_enqueued_batches");
    if (tblgen_max_enqueued_batches && !(((tblgen_max_enqueued_batches.isa<::mlir::IntegerAttr>())) && ((tblgen_max_enqueued_batches.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.BatchFunction' op ""attribute 'max_enqueued_batches' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_allowed_batch_sizes = odsAttrs.get("allowed_batch_sizes");
    if (tblgen_allowed_batch_sizes && !(((tblgen_allowed_batch_sizes.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_allowed_batch_sizes.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return ((attr.isa<::mlir::IntegerAttr>())) && ((attr.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64))); }))))
      return emitError(loc, "'tf.BatchFunction' op ""attribute 'allowed_batch_sizes' failed to satisfy constraint: 64-bit integer array attribute");
  }
  {
    auto tblgen_container = odsAttrs.get("container");
    if (tblgen_container && !((tblgen_container.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.BatchFunction' op ""attribute 'container' failed to satisfy constraint: string attribute");
  }
  {
    auto tblgen_shared_name = odsAttrs.get("shared_name");
    if (tblgen_shared_name && !((tblgen_shared_name.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.BatchFunction' op ""attribute 'shared_name' failed to satisfy constraint: string attribute");
  }
  {
    auto tblgen_batching_queue = odsAttrs.get("batching_queue");
    if (tblgen_batching_queue && !((tblgen_batching_queue.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.BatchFunction' op ""attribute 'batching_queue' failed to satisfy constraint: string attribute");
  }
  {
    auto tblgen_enable_large_batch_splitting = odsAttrs.get("enable_large_batch_splitting");
    if (tblgen_enable_large_batch_splitting && !((tblgen_enable_large_batch_splitting.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.BatchFunction' op ""attribute 'enable_large_batch_splitting' failed to satisfy constraint: bool attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> BatchFunctionOp::getODSOperandIndexAndLength(unsigned index) {
  auto sizeAttr =
      (*this)->getAttr(operand_segment_sizesAttrName()).cast<::mlir::DenseIntElementsAttr>();

  const uint32_t *sizeAttrValueIt = &*sizeAttr.value_begin<uint32_t>();
  if (sizeAttr.isSplat())
    return {*sizeAttrValueIt * index, *sizeAttrValueIt};

  unsigned start = 0;
  for (unsigned i = 0; i < index; ++i)
    start += sizeAttrValueIt[i];
  return {start, sizeAttrValueIt[index]};
}

::mlir::Operation::operand_range BatchFunctionOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Operation::operand_range BatchFunctionOp::in_tensors() {
  return getODSOperands(0);
}

::mlir::Operation::operand_range BatchFunctionOp::captured_tensors() {
  return getODSOperands(1);
}

::mlir::MutableOperandRange BatchFunctionOp::in_tensorsMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second, ::mlir::MutableOperandRange::OperandSegment(0u, *getOperation()->getAttrDictionary().getNamed(operand_segment_sizesAttrName())));
  return mutableRange;
}

::mlir::MutableOperandRange BatchFunctionOp::captured_tensorsMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second, ::mlir::MutableOperandRange::OperandSegment(1u, *getOperation()->getAttrDictionary().getNamed(operand_segment_sizesAttrName())));
  return mutableRange;
}

std::pair<unsigned, unsigned> BatchFunctionOp::getODSResultIndexAndLength(unsigned index) {
  bool isVariadic[] = {true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (getOperation()->getNumResults() - 0) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::Operation::result_range BatchFunctionOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Operation::result_range BatchFunctionOp::out_tensors() {
  return getODSResults(0);
}

::mlir::SymbolRefAttr BatchFunctionOp::fAttr() {
  return (*this)->getAttr(fAttrName()).cast<::mlir::SymbolRefAttr>();
}

::mlir::SymbolRefAttr BatchFunctionOp::f() {
  auto attr = fAttr();
  return attr;
}

::mlir::IntegerAttr BatchFunctionOp::num_batch_threadsAttr() {
  return (*this)->getAttr(num_batch_threadsAttrName()).cast<::mlir::IntegerAttr>();
}

uint64_t BatchFunctionOp::num_batch_threads() {
  auto attr = num_batch_threadsAttr();
  return attr.getValue().getZExtValue();
}

::mlir::IntegerAttr BatchFunctionOp::max_batch_sizeAttr() {
  return (*this)->getAttr(max_batch_sizeAttrName()).cast<::mlir::IntegerAttr>();
}

uint64_t BatchFunctionOp::max_batch_size() {
  auto attr = max_batch_sizeAttr();
  return attr.getValue().getZExtValue();
}

::mlir::IntegerAttr BatchFunctionOp::batch_timeout_microsAttr() {
  return (*this)->getAttr(batch_timeout_microsAttrName()).cast<::mlir::IntegerAttr>();
}

uint64_t BatchFunctionOp::batch_timeout_micros() {
  auto attr = batch_timeout_microsAttr();
  return attr.getValue().getZExtValue();
}

::mlir::IntegerAttr BatchFunctionOp::max_enqueued_batchesAttr() {
  return (*this)->getAttr(max_enqueued_batchesAttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t BatchFunctionOp::max_enqueued_batches() {
  auto attr = max_enqueued_batchesAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), 10).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

::mlir::ArrayAttr BatchFunctionOp::allowed_batch_sizesAttr() {
  return (*this)->getAttr(allowed_batch_sizesAttrName()).dyn_cast_or_null<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr BatchFunctionOp::allowed_batch_sizes() {
  auto attr = allowed_batch_sizesAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getI64ArrayAttr({});
  return attr;
}

::mlir::StringAttr BatchFunctionOp::containerAttr() {
  return (*this)->getAttr(containerAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef BatchFunctionOp::container() {
  auto attr = containerAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("").getValue();
  return attr.getValue();
}

::mlir::StringAttr BatchFunctionOp::shared_nameAttr() {
  return (*this)->getAttr(shared_nameAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef BatchFunctionOp::shared_name() {
  auto attr = shared_nameAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("").getValue();
  return attr.getValue();
}

::mlir::StringAttr BatchFunctionOp::batching_queueAttr() {
  return (*this)->getAttr(batching_queueAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef BatchFunctionOp::batching_queue() {
  auto attr = batching_queueAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("").getValue();
  return attr.getValue();
}

::mlir::BoolAttr BatchFunctionOp::enable_large_batch_splittingAttr() {
  return (*this)->getAttr(enable_large_batch_splittingAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool BatchFunctionOp::enable_large_batch_splitting() {
  auto attr = enable_large_batch_splittingAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(false).getValue();
  return attr.getValue();
}

mlir::OperandElementTypeRange BatchFunctionOp::Tcaptured() {
  auto values = getODSOperands(1);
return {mlir::OperandElementTypeIterator(values.begin()), mlir::OperandElementTypeIterator(values.end())};
}

mlir::OperandElementTypeRange BatchFunctionOp::Tin() {
  auto values = getODSOperands(0);
return {mlir::OperandElementTypeIterator(values.begin()), mlir::OperandElementTypeIterator(values.end())};
}

mlir::ResultElementTypeRange BatchFunctionOp::Tout() {
  auto values = getODSResults(0);
return {mlir::ResultElementTypeIterator(values.begin()), mlir::ResultElementTypeIterator(values.end())};
}

bool BatchFunctionOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "Tcaptured") return true;
  if (name == "Tin") return true;
  if (name == "Tout") return true;
 return false;
}

::mlir::DictionaryAttr BatchFunctionOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TcapturedAttrName(),
ArrayAttr::get(ctx, 
    [&]() {
      llvm::SmallVector<Attribute, 4> ret;
      for (auto t : Tcaptured())
        ret.push_back(TypeAttr::get(t));
      return ret;
    }())},
    {TinAttrName(),
ArrayAttr::get(ctx, 
    [&]() {
      llvm::SmallVector<Attribute, 4> ret;
      for (auto t : Tin())
        ret.push_back(TypeAttr::get(t));
      return ret;
    }())},
    {ToutAttrName(),
ArrayAttr::get(ctx, 
    [&]() {
      llvm::SmallVector<Attribute, 4> ret;
      for (auto t : Tout())
        ret.push_back(TypeAttr::get(t));
      return ret;
    }())}});
}

void BatchFunctionOp::fAttr(::mlir::SymbolRefAttr attr) {
  (*this)->setAttr(fAttrName(), attr);
}

void BatchFunctionOp::num_batch_threadsAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(num_batch_threadsAttrName(), attr);
}

void BatchFunctionOp::max_batch_sizeAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(max_batch_sizeAttrName(), attr);
}

void BatchFunctionOp::batch_timeout_microsAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(batch_timeout_microsAttrName(), attr);
}

void BatchFunctionOp::max_enqueued_batchesAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(max_enqueued_batchesAttrName(), attr);
}

void BatchFunctionOp::allowed_batch_sizesAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(allowed_batch_sizesAttrName(), attr);
}

void BatchFunctionOp::containerAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(containerAttrName(), attr);
}

void BatchFunctionOp::shared_nameAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(shared_nameAttrName(), attr);
}

void BatchFunctionOp::batching_queueAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(batching_queueAttrName(), attr);
}

void BatchFunctionOp::enable_large_batch_splittingAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(enable_large_batch_splittingAttrName(), attr);
}

void BatchFunctionOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange out_tensors, ::mlir::ValueRange in_tensors, ::mlir::ValueRange captured_tensors, ::mlir::SymbolRefAttr f, ::mlir::IntegerAttr num_batch_threads, ::mlir::IntegerAttr max_batch_size, ::mlir::IntegerAttr batch_timeout_micros, ::mlir::IntegerAttr max_enqueued_batches, ::mlir::ArrayAttr allowed_batch_sizes, ::mlir::StringAttr container, ::mlir::StringAttr shared_name, ::mlir::StringAttr batching_queue, ::mlir::BoolAttr enable_large_batch_splitting) {
  odsState.addOperands(in_tensors);
  odsState.addOperands(captured_tensors);
  odsState.addAttribute(operand_segment_sizesAttrName(odsState.name), odsBuilder.getI32VectorAttr({static_cast<int32_t>(in_tensors.size()), static_cast<int32_t>(captured_tensors.size())}));
  odsState.addAttribute(fAttrName(odsState.name), f);
  odsState.addAttribute(num_batch_threadsAttrName(odsState.name), num_batch_threads);
  odsState.addAttribute(max_batch_sizeAttrName(odsState.name), max_batch_size);
  odsState.addAttribute(batch_timeout_microsAttrName(odsState.name), batch_timeout_micros);
  odsState.addAttribute(max_enqueued_batchesAttrName(odsState.name), max_enqueued_batches);
  odsState.addAttribute(allowed_batch_sizesAttrName(odsState.name), allowed_batch_sizes);
  odsState.addAttribute(containerAttrName(odsState.name), container);
  odsState.addAttribute(shared_nameAttrName(odsState.name), shared_name);
  odsState.addAttribute(batching_queueAttrName(odsState.name), batching_queue);
  odsState.addAttribute(enable_large_batch_splittingAttrName(odsState.name), enable_large_batch_splitting);
  odsState.addTypes(out_tensors);
}

void BatchFunctionOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange out_tensors, ::mlir::ValueRange in_tensors, ::mlir::ValueRange captured_tensors, ::mlir::SymbolRefAttr f, uint64_t num_batch_threads, uint64_t max_batch_size, uint64_t batch_timeout_micros, uint64_t max_enqueued_batches, ::mlir::ArrayAttr allowed_batch_sizes, ::llvm::StringRef container, ::llvm::StringRef shared_name, ::llvm::StringRef batching_queue, bool enable_large_batch_splitting) {
  odsState.addOperands(in_tensors);
  odsState.addOperands(captured_tensors);
  odsState.addAttribute(operand_segment_sizesAttrName(odsState.name), odsBuilder.getI32VectorAttr({static_cast<int32_t>(in_tensors.size()), static_cast<int32_t>(captured_tensors.size())}));
  odsState.addAttribute(fAttrName(odsState.name), f);
  odsState.addAttribute(num_batch_threadsAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), num_batch_threads));
  odsState.addAttribute(max_batch_sizeAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), max_batch_size));
  odsState.addAttribute(batch_timeout_microsAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), batch_timeout_micros));
  odsState.addAttribute(max_enqueued_batchesAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), max_enqueued_batches));
  odsState.addAttribute(allowed_batch_sizesAttrName(odsState.name), allowed_batch_sizes);
  odsState.addAttribute(containerAttrName(odsState.name), odsBuilder.getStringAttr(container));
  odsState.addAttribute(shared_nameAttrName(odsState.name), odsBuilder.getStringAttr(shared_name));
  odsState.addAttribute(batching_queueAttrName(odsState.name), odsBuilder.getStringAttr(batching_queue));
  odsState.addAttribute(enable_large_batch_splittingAttrName(odsState.name), odsBuilder.getBoolAttr(enable_large_batch_splitting));
  odsState.addTypes(out_tensors);
}

void BatchFunctionOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult BatchFunctionOp::verify() {
  {
    auto sizeAttr = (*this)->getAttr(operand_segment_sizesAttrName()).dyn_cast<::mlir::DenseIntElementsAttr>();
    if (!sizeAttr)
      return emitOpError("missing segment sizes attribute 'operand_segment_sizes'");
    auto numElements =
        sizeAttr.getType().cast<::mlir::ShapedType>().getNumElements();
    if (numElements != 2)
      return emitOpError("'operand_segment_sizes' attribute for specifying operand segments must have 2 "
                "elements, but got ") << numElements;
  }
    {
    auto tblgen_f = (*this)->getAttr(fAttrName());
    if (!tblgen_f)
      return emitOpError("requires attribute 'f'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops12(*this, tblgen_f, "f")))
      return ::mlir::failure();
  }
  {
    auto tblgen_num_batch_threads = (*this)->getAttr(num_batch_threadsAttrName());
    if (!tblgen_num_batch_threads)
      return emitOpError("requires attribute 'num_batch_threads'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_num_batch_threads, "num_batch_threads")))
      return ::mlir::failure();
  }
  {
    auto tblgen_max_batch_size = (*this)->getAttr(max_batch_sizeAttrName());
    if (!tblgen_max_batch_size)
      return emitOpError("requires attribute 'max_batch_size'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_max_batch_size, "max_batch_size")))
      return ::mlir::failure();
  }
  {
    auto tblgen_batch_timeout_micros = (*this)->getAttr(batch_timeout_microsAttrName());
    if (!tblgen_batch_timeout_micros)
      return emitOpError("requires attribute 'batch_timeout_micros'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_batch_timeout_micros, "batch_timeout_micros")))
      return ::mlir::failure();
  }
  {
    auto tblgen_max_enqueued_batches = (*this)->getAttr(max_enqueued_batchesAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_max_enqueued_batches, "max_enqueued_batches")))
      return ::mlir::failure();
  }
  {
    auto tblgen_allowed_batch_sizes = (*this)->getAttr(allowed_batch_sizesAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops13(*this, tblgen_allowed_batch_sizes, "allowed_batch_sizes")))
      return ::mlir::failure();
  }
  {
    auto tblgen_container = (*this)->getAttr(containerAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_container, "container")))
      return ::mlir::failure();
  }
  {
    auto tblgen_shared_name = (*this)->getAttr(shared_nameAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_shared_name, "shared_name")))
      return ::mlir::failure();
  }
  {
    auto tblgen_batching_queue = (*this)->getAttr(batching_queueAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_batching_queue, "batching_queue")))
      return ::mlir::failure();
  }
  {
    auto tblgen_enable_large_batch_splitting = (*this)->getAttr(enable_large_batch_splittingAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_enable_large_batch_splitting, "enable_large_batch_splitting")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void BatchFunctionOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::BatchFunctionOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::BatchMatMulOp definitions
//===----------------------------------------------------------------------===//

BatchMatMulOpAdaptor::BatchMatMulOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

BatchMatMulOpAdaptor::BatchMatMulOpAdaptor(BatchMatMulOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange BatchMatMulOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> BatchMatMulOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange BatchMatMulOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value BatchMatMulOpAdaptor::x() {
  return *getODSOperands(0).begin();
}

::mlir::Value BatchMatMulOpAdaptor::y() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr BatchMatMulOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::BoolAttr BatchMatMulOpAdaptor::adj_x() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("adj_x").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(false);
  return attr;
}

::mlir::BoolAttr BatchMatMulOpAdaptor::adj_y() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("adj_y").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(false);
  return attr;
}

::mlir::LogicalResult BatchMatMulOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_adj_x = odsAttrs.get("adj_x");
    if (tblgen_adj_x && !((tblgen_adj_x.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.BatchMatMul' op ""attribute 'adj_x' failed to satisfy constraint: bool attribute");
  }
  {
    auto tblgen_adj_y = odsAttrs.get("adj_y");
    if (tblgen_adj_y && !((tblgen_adj_y.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.BatchMatMul' op ""attribute 'adj_y' failed to satisfy constraint: bool attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> BatchMatMulOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range BatchMatMulOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value BatchMatMulOp::x() {
  return *getODSOperands(0).begin();
}

::mlir::Value BatchMatMulOp::y() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange BatchMatMulOp::xMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange BatchMatMulOp::yMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> BatchMatMulOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range BatchMatMulOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value BatchMatMulOp::output() {
  return *getODSResults(0).begin();
}

::mlir::BoolAttr BatchMatMulOp::adj_xAttr() {
  return (*this)->getAttr(adj_xAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool BatchMatMulOp::adj_x() {
  auto attr = adj_xAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(false).getValue();
  return attr.getValue();
}

::mlir::BoolAttr BatchMatMulOp::adj_yAttr() {
  return (*this)->getAttr(adj_yAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool BatchMatMulOp::adj_y() {
  auto attr = adj_yAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(false).getValue();
  return attr.getValue();
}

::mlir::Type BatchMatMulOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool BatchMatMulOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr BatchMatMulOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void BatchMatMulOp::adj_xAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(adj_xAttrName(), attr);
}

void BatchMatMulOp::adj_yAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(adj_yAttrName(), attr);
}

void BatchMatMulOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value x, ::mlir::Value y, ::mlir::BoolAttr adj_x, ::mlir::BoolAttr adj_y) {
  odsState.addOperands(x);
  odsState.addOperands(y);
  odsState.addAttribute(adj_xAttrName(odsState.name), adj_x);
  odsState.addAttribute(adj_yAttrName(odsState.name), adj_y);
  odsState.addTypes(output);
}

void BatchMatMulOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value x, ::mlir::Value y, ::mlir::BoolAttr adj_x, ::mlir::BoolAttr adj_y) {
  odsState.addOperands(x);
  odsState.addOperands(y);
  odsState.addAttribute(adj_xAttrName(odsState.name), adj_x);
  odsState.addAttribute(adj_yAttrName(odsState.name), adj_y);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void BatchMatMulOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value x, ::mlir::Value y, bool adj_x, bool adj_y) {
  odsState.addOperands(x);
  odsState.addOperands(y);
  odsState.addAttribute(adj_xAttrName(odsState.name), odsBuilder.getBoolAttr(adj_x));
  odsState.addAttribute(adj_yAttrName(odsState.name), odsBuilder.getBoolAttr(adj_y));
  odsState.addTypes(output);
}

void BatchMatMulOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value x, ::mlir::Value y, bool adj_x, bool adj_y) {
  odsState.addOperands(x);
  odsState.addOperands(y);
  odsState.addAttribute(adj_xAttrName(odsState.name), odsBuilder.getBoolAttr(adj_x));
  odsState.addAttribute(adj_yAttrName(odsState.name), odsBuilder.getBoolAttr(adj_y));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void BatchMatMulOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult BatchMatMulOp::verify() {
  {
    auto tblgen_adj_x = (*this)->getAttr(adj_xAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_adj_x, "adj_x")))
      return ::mlir::failure();
  }
  {
    auto tblgen_adj_y = (*this)->getAttr(adj_yAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_adj_y, "adj_y")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops22(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops22(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops22(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return Verify(*this);
}

void BatchMatMulOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::BatchMatMulOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::BatchMatMulV2Op definitions
//===----------------------------------------------------------------------===//

BatchMatMulV2OpAdaptor::BatchMatMulV2OpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

BatchMatMulV2OpAdaptor::BatchMatMulV2OpAdaptor(BatchMatMulV2Op &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange BatchMatMulV2OpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> BatchMatMulV2OpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange BatchMatMulV2OpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value BatchMatMulV2OpAdaptor::x() {
  return *getODSOperands(0).begin();
}

::mlir::Value BatchMatMulV2OpAdaptor::y() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr BatchMatMulV2OpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::BoolAttr BatchMatMulV2OpAdaptor::adj_x() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("adj_x").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(false);
  return attr;
}

::mlir::BoolAttr BatchMatMulV2OpAdaptor::adj_y() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("adj_y").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(false);
  return attr;
}

::mlir::LogicalResult BatchMatMulV2OpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_adj_x = odsAttrs.get("adj_x");
    if (tblgen_adj_x && !((tblgen_adj_x.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.BatchMatMulV2' op ""attribute 'adj_x' failed to satisfy constraint: bool attribute");
  }
  {
    auto tblgen_adj_y = odsAttrs.get("adj_y");
    if (tblgen_adj_y && !((tblgen_adj_y.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.BatchMatMulV2' op ""attribute 'adj_y' failed to satisfy constraint: bool attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> BatchMatMulV2Op::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range BatchMatMulV2Op::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value BatchMatMulV2Op::x() {
  return *getODSOperands(0).begin();
}

::mlir::Value BatchMatMulV2Op::y() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange BatchMatMulV2Op::xMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange BatchMatMulV2Op::yMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> BatchMatMulV2Op::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range BatchMatMulV2Op::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value BatchMatMulV2Op::output() {
  return *getODSResults(0).begin();
}

::mlir::BoolAttr BatchMatMulV2Op::adj_xAttr() {
  return (*this)->getAttr(adj_xAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool BatchMatMulV2Op::adj_x() {
  auto attr = adj_xAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(false).getValue();
  return attr.getValue();
}

::mlir::BoolAttr BatchMatMulV2Op::adj_yAttr() {
  return (*this)->getAttr(adj_yAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool BatchMatMulV2Op::adj_y() {
  auto attr = adj_yAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(false).getValue();
  return attr.getValue();
}

::mlir::Type BatchMatMulV2Op::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool BatchMatMulV2Op::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr BatchMatMulV2Op::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void BatchMatMulV2Op::adj_xAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(adj_xAttrName(), attr);
}

void BatchMatMulV2Op::adj_yAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(adj_yAttrName(), attr);
}

void BatchMatMulV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value x, ::mlir::Value y, ::mlir::BoolAttr adj_x, ::mlir::BoolAttr adj_y) {
  odsState.addOperands(x);
  odsState.addOperands(y);
  odsState.addAttribute(adj_xAttrName(odsState.name), adj_x);
  odsState.addAttribute(adj_yAttrName(odsState.name), adj_y);
  odsState.addTypes(output);
}

void BatchMatMulV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value x, ::mlir::Value y, ::mlir::BoolAttr adj_x, ::mlir::BoolAttr adj_y) {
  odsState.addOperands(x);
  odsState.addOperands(y);
  odsState.addAttribute(adj_xAttrName(odsState.name), adj_x);
  odsState.addAttribute(adj_yAttrName(odsState.name), adj_y);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void BatchMatMulV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value x, ::mlir::Value y, bool adj_x, bool adj_y) {
  odsState.addOperands(x);
  odsState.addOperands(y);
  odsState.addAttribute(adj_xAttrName(odsState.name), odsBuilder.getBoolAttr(adj_x));
  odsState.addAttribute(adj_yAttrName(odsState.name), odsBuilder.getBoolAttr(adj_y));
  odsState.addTypes(output);
}

void BatchMatMulV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value x, ::mlir::Value y, bool adj_x, bool adj_y) {
  odsState.addOperands(x);
  odsState.addOperands(y);
  odsState.addAttribute(adj_xAttrName(odsState.name), odsBuilder.getBoolAttr(adj_x));
  odsState.addAttribute(adj_yAttrName(odsState.name), odsBuilder.getBoolAttr(adj_y));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void BatchMatMulV2Op::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult BatchMatMulV2Op::verify() {
  {
    auto tblgen_adj_x = (*this)->getAttr(adj_xAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_adj_x, "adj_x")))
      return ::mlir::failure();
  }
  {
    auto tblgen_adj_y = (*this)->getAttr(adj_yAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_adj_y, "adj_y")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops23(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops23(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops23(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return Verify(*this);
}

void BatchMatMulV2Op::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::BatchMatMulV2Op)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::BatchMatMulV3Op definitions
//===----------------------------------------------------------------------===//

BatchMatMulV3OpAdaptor::BatchMatMulV3OpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

BatchMatMulV3OpAdaptor::BatchMatMulV3OpAdaptor(BatchMatMulV3Op &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange BatchMatMulV3OpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> BatchMatMulV3OpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange BatchMatMulV3OpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value BatchMatMulV3OpAdaptor::x() {
  return *getODSOperands(0).begin();
}

::mlir::Value BatchMatMulV3OpAdaptor::y() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr BatchMatMulV3OpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::BoolAttr BatchMatMulV3OpAdaptor::adj_x() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("adj_x").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(false);
  return attr;
}

::mlir::BoolAttr BatchMatMulV3OpAdaptor::adj_y() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("adj_y").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(false);
  return attr;
}

::mlir::LogicalResult BatchMatMulV3OpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_adj_x = odsAttrs.get("adj_x");
    if (tblgen_adj_x && !((tblgen_adj_x.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.BatchMatMulV3' op ""attribute 'adj_x' failed to satisfy constraint: bool attribute");
  }
  {
    auto tblgen_adj_y = odsAttrs.get("adj_y");
    if (tblgen_adj_y && !((tblgen_adj_y.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.BatchMatMulV3' op ""attribute 'adj_y' failed to satisfy constraint: bool attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> BatchMatMulV3Op::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range BatchMatMulV3Op::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value BatchMatMulV3Op::x() {
  return *getODSOperands(0).begin();
}

::mlir::Value BatchMatMulV3Op::y() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange BatchMatMulV3Op::xMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange BatchMatMulV3Op::yMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> BatchMatMulV3Op::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range BatchMatMulV3Op::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value BatchMatMulV3Op::output() {
  return *getODSResults(0).begin();
}

::mlir::BoolAttr BatchMatMulV3Op::adj_xAttr() {
  return (*this)->getAttr(adj_xAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool BatchMatMulV3Op::adj_x() {
  auto attr = adj_xAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(false).getValue();
  return attr.getValue();
}

::mlir::BoolAttr BatchMatMulV3Op::adj_yAttr() {
  return (*this)->getAttr(adj_yAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool BatchMatMulV3Op::adj_y() {
  auto attr = adj_yAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(false).getValue();
  return attr.getValue();
}

::mlir::Type BatchMatMulV3Op::Ta() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

::mlir::Type BatchMatMulV3Op::Tb() {
  return mlir::getElementTypeOrSelf(*getODSOperands(1).begin());
}

::mlir::Type BatchMatMulV3Op::Tout() {
  return mlir::getElementTypeOrSelf(*getODSResults(0).begin());
}

bool BatchMatMulV3Op::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "Ta") return true;
  if (name == "Tb") return true;
  if (name == "Tout") return true;
 return false;
}

::mlir::DictionaryAttr BatchMatMulV3Op::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TaAttrName(),
::mlir::TypeAttr::get(Ta())},
    {TbAttrName(),
::mlir::TypeAttr::get(Tb())},
    {ToutAttrName(),
::mlir::TypeAttr::get(Tout())}});
}

void BatchMatMulV3Op::adj_xAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(adj_xAttrName(), attr);
}

void BatchMatMulV3Op::adj_yAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(adj_yAttrName(), attr);
}

void BatchMatMulV3Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value x, ::mlir::Value y, ::mlir::BoolAttr adj_x, ::mlir::BoolAttr adj_y) {
  odsState.addOperands(x);
  odsState.addOperands(y);
  odsState.addAttribute(adj_xAttrName(odsState.name), adj_x);
  odsState.addAttribute(adj_yAttrName(odsState.name), adj_y);
  odsState.addTypes(output);
}

void BatchMatMulV3Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value x, ::mlir::Value y, ::mlir::BoolAttr adj_x, ::mlir::BoolAttr adj_y) {
  odsState.addOperands(x);
  odsState.addOperands(y);
  odsState.addAttribute(adj_xAttrName(odsState.name), adj_x);
  odsState.addAttribute(adj_yAttrName(odsState.name), adj_y);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void BatchMatMulV3Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value x, ::mlir::Value y, bool adj_x, bool adj_y) {
  odsState.addOperands(x);
  odsState.addOperands(y);
  odsState.addAttribute(adj_xAttrName(odsState.name), odsBuilder.getBoolAttr(adj_x));
  odsState.addAttribute(adj_yAttrName(odsState.name), odsBuilder.getBoolAttr(adj_y));
  odsState.addTypes(output);
}

void BatchMatMulV3Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value x, ::mlir::Value y, bool adj_x, bool adj_y) {
  odsState.addOperands(x);
  odsState.addOperands(y);
  odsState.addAttribute(adj_xAttrName(odsState.name), odsBuilder.getBoolAttr(adj_x));
  odsState.addAttribute(adj_yAttrName(odsState.name), odsBuilder.getBoolAttr(adj_y));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void BatchMatMulV3Op::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult BatchMatMulV3Op::verify() {
  {
    auto tblgen_adj_x = (*this)->getAttr(adj_xAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_adj_x, "adj_x")))
      return ::mlir::failure();
  }
  {
    auto tblgen_adj_y = (*this)->getAttr(adj_yAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_adj_y, "adj_y")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops24(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops24(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops23(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void BatchMatMulV3Op::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::BatchMatMulV3Op)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::BatchNormWithGlobalNormalizationOp definitions
//===----------------------------------------------------------------------===//

BatchNormWithGlobalNormalizationOpAdaptor::BatchNormWithGlobalNormalizationOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

BatchNormWithGlobalNormalizationOpAdaptor::BatchNormWithGlobalNormalizationOpAdaptor(BatchNormWithGlobalNormalizationOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange BatchNormWithGlobalNormalizationOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> BatchNormWithGlobalNormalizationOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange BatchNormWithGlobalNormalizationOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value BatchNormWithGlobalNormalizationOpAdaptor::t() {
  return *getODSOperands(0).begin();
}

::mlir::Value BatchNormWithGlobalNormalizationOpAdaptor::m() {
  return *getODSOperands(1).begin();
}

::mlir::Value BatchNormWithGlobalNormalizationOpAdaptor::v() {
  return *getODSOperands(2).begin();
}

::mlir::Value BatchNormWithGlobalNormalizationOpAdaptor::beta() {
  return *getODSOperands(3).begin();
}

::mlir::Value BatchNormWithGlobalNormalizationOpAdaptor::gamma() {
  return *getODSOperands(4).begin();
}

::mlir::DictionaryAttr BatchNormWithGlobalNormalizationOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::FloatAttr BatchNormWithGlobalNormalizationOpAdaptor::variance_epsilon() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::FloatAttr attr = odsAttrs.get("variance_epsilon").cast<::mlir::FloatAttr>();
  return attr;
}

::mlir::BoolAttr BatchNormWithGlobalNormalizationOpAdaptor::scale_after_normalization() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("scale_after_normalization").cast<::mlir::BoolAttr>();
  return attr;
}

::mlir::LogicalResult BatchNormWithGlobalNormalizationOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_variance_epsilon = odsAttrs.get("variance_epsilon");
    if (!tblgen_variance_epsilon)
      return emitError(loc, "'tf.BatchNormWithGlobalNormalization' op ""requires attribute 'variance_epsilon'");

    if (tblgen_variance_epsilon && !(((tblgen_variance_epsilon.isa<::mlir::FloatAttr>())) && ((tblgen_variance_epsilon.cast<::mlir::FloatAttr>().getType().isF32()))))
      return emitError(loc, "'tf.BatchNormWithGlobalNormalization' op ""attribute 'variance_epsilon' failed to satisfy constraint: 32-bit float attribute");
  }
  {
    auto tblgen_scale_after_normalization = odsAttrs.get("scale_after_normalization");
    if (!tblgen_scale_after_normalization)
      return emitError(loc, "'tf.BatchNormWithGlobalNormalization' op ""requires attribute 'scale_after_normalization'");

    if (tblgen_scale_after_normalization && !((tblgen_scale_after_normalization.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.BatchNormWithGlobalNormalization' op ""attribute 'scale_after_normalization' failed to satisfy constraint: bool attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> BatchNormWithGlobalNormalizationOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range BatchNormWithGlobalNormalizationOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value BatchNormWithGlobalNormalizationOp::t() {
  return *getODSOperands(0).begin();
}

::mlir::Value BatchNormWithGlobalNormalizationOp::m() {
  return *getODSOperands(1).begin();
}

::mlir::Value BatchNormWithGlobalNormalizationOp::v() {
  return *getODSOperands(2).begin();
}

::mlir::Value BatchNormWithGlobalNormalizationOp::beta() {
  return *getODSOperands(3).begin();
}

::mlir::Value BatchNormWithGlobalNormalizationOp::gamma() {
  return *getODSOperands(4).begin();
}

::mlir::MutableOperandRange BatchNormWithGlobalNormalizationOp::tMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange BatchNormWithGlobalNormalizationOp::mMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange BatchNormWithGlobalNormalizationOp::vMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange BatchNormWithGlobalNormalizationOp::betaMutable() {
  auto range = getODSOperandIndexAndLength(3);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange BatchNormWithGlobalNormalizationOp::gammaMutable() {
  auto range = getODSOperandIndexAndLength(4);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> BatchNormWithGlobalNormalizationOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range BatchNormWithGlobalNormalizationOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value BatchNormWithGlobalNormalizationOp::result() {
  return *getODSResults(0).begin();
}

::mlir::FloatAttr BatchNormWithGlobalNormalizationOp::variance_epsilonAttr() {
  return (*this)->getAttr(variance_epsilonAttrName()).cast<::mlir::FloatAttr>();
}

::llvm::APFloat BatchNormWithGlobalNormalizationOp::variance_epsilon() {
  auto attr = variance_epsilonAttr();
  return attr.getValue();
}

::mlir::BoolAttr BatchNormWithGlobalNormalizationOp::scale_after_normalizationAttr() {
  return (*this)->getAttr(scale_after_normalizationAttrName()).cast<::mlir::BoolAttr>();
}

bool BatchNormWithGlobalNormalizationOp::scale_after_normalization() {
  auto attr = scale_after_normalizationAttr();
  return attr.getValue();
}

::mlir::Type BatchNormWithGlobalNormalizationOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool BatchNormWithGlobalNormalizationOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr BatchNormWithGlobalNormalizationOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void BatchNormWithGlobalNormalizationOp::variance_epsilonAttr(::mlir::FloatAttr attr) {
  (*this)->setAttr(variance_epsilonAttrName(), attr);
}

void BatchNormWithGlobalNormalizationOp::scale_after_normalizationAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(scale_after_normalizationAttrName(), attr);
}

void BatchNormWithGlobalNormalizationOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value t, ::mlir::Value m, ::mlir::Value v, ::mlir::Value beta, ::mlir::Value gamma, ::mlir::FloatAttr variance_epsilon, ::mlir::BoolAttr scale_after_normalization) {
  odsState.addOperands(t);
  odsState.addOperands(m);
  odsState.addOperands(v);
  odsState.addOperands(beta);
  odsState.addOperands(gamma);
  odsState.addAttribute(variance_epsilonAttrName(odsState.name), variance_epsilon);
  odsState.addAttribute(scale_after_normalizationAttrName(odsState.name), scale_after_normalization);
  odsState.addTypes(result);
}

void BatchNormWithGlobalNormalizationOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value t, ::mlir::Value m, ::mlir::Value v, ::mlir::Value beta, ::mlir::Value gamma, ::mlir::FloatAttr variance_epsilon, ::mlir::BoolAttr scale_after_normalization) {
  odsState.addOperands(t);
  odsState.addOperands(m);
  odsState.addOperands(v);
  odsState.addOperands(beta);
  odsState.addOperands(gamma);
  odsState.addAttribute(variance_epsilonAttrName(odsState.name), variance_epsilon);
  odsState.addAttribute(scale_after_normalizationAttrName(odsState.name), scale_after_normalization);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void BatchNormWithGlobalNormalizationOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value t, ::mlir::Value m, ::mlir::Value v, ::mlir::Value beta, ::mlir::Value gamma, ::llvm::APFloat variance_epsilon, bool scale_after_normalization) {
  odsState.addOperands(t);
  odsState.addOperands(m);
  odsState.addOperands(v);
  odsState.addOperands(beta);
  odsState.addOperands(gamma);
  odsState.addAttribute(variance_epsilonAttrName(odsState.name), odsBuilder.getFloatAttr(odsBuilder.getF32Type(), variance_epsilon));
  odsState.addAttribute(scale_after_normalizationAttrName(odsState.name), odsBuilder.getBoolAttr(scale_after_normalization));
  odsState.addTypes(result);
}

void BatchNormWithGlobalNormalizationOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value t, ::mlir::Value m, ::mlir::Value v, ::mlir::Value beta, ::mlir::Value gamma, ::llvm::APFloat variance_epsilon, bool scale_after_normalization) {
  odsState.addOperands(t);
  odsState.addOperands(m);
  odsState.addOperands(v);
  odsState.addOperands(beta);
  odsState.addOperands(gamma);
  odsState.addAttribute(variance_epsilonAttrName(odsState.name), odsBuilder.getFloatAttr(odsBuilder.getF32Type(), variance_epsilon));
  odsState.addAttribute(scale_after_normalizationAttrName(odsState.name), odsBuilder.getBoolAttr(scale_after_normalization));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void BatchNormWithGlobalNormalizationOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 5u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult BatchNormWithGlobalNormalizationOp::verify() {
  {
    auto tblgen_variance_epsilon = (*this)->getAttr(variance_epsilonAttrName());
    if (!tblgen_variance_epsilon)
      return emitOpError("requires attribute 'variance_epsilon'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops5(*this, tblgen_variance_epsilon, "variance_epsilon")))
      return ::mlir::failure();
  }
  {
    auto tblgen_scale_after_normalization = (*this)->getAttr(scale_after_normalizationAttrName());
    if (!tblgen_scale_after_normalization)
      return emitOpError("requires attribute 'scale_after_normalization'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_scale_after_normalization, "scale_after_normalization")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup3 = getODSOperands(3);

    for (auto v : valueGroup3) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup4 = getODSOperands(4);

    for (auto v : valueGroup4) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void BatchNormWithGlobalNormalizationOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::BatchNormWithGlobalNormalizationOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::BatchToSpaceNDOp definitions
//===----------------------------------------------------------------------===//

BatchToSpaceNDOpAdaptor::BatchToSpaceNDOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

BatchToSpaceNDOpAdaptor::BatchToSpaceNDOpAdaptor(BatchToSpaceNDOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange BatchToSpaceNDOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> BatchToSpaceNDOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange BatchToSpaceNDOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value BatchToSpaceNDOpAdaptor::input() {
  return *getODSOperands(0).begin();
}

::mlir::Value BatchToSpaceNDOpAdaptor::block_shape() {
  return *getODSOperands(1).begin();
}

::mlir::Value BatchToSpaceNDOpAdaptor::crops() {
  return *getODSOperands(2).begin();
}

::mlir::DictionaryAttr BatchToSpaceNDOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult BatchToSpaceNDOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> BatchToSpaceNDOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range BatchToSpaceNDOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value BatchToSpaceNDOp::input() {
  return *getODSOperands(0).begin();
}

::mlir::Value BatchToSpaceNDOp::block_shape() {
  return *getODSOperands(1).begin();
}

::mlir::Value BatchToSpaceNDOp::crops() {
  return *getODSOperands(2).begin();
}

::mlir::MutableOperandRange BatchToSpaceNDOp::inputMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange BatchToSpaceNDOp::block_shapeMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange BatchToSpaceNDOp::cropsMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> BatchToSpaceNDOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range BatchToSpaceNDOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value BatchToSpaceNDOp::output() {
  return *getODSResults(0).begin();
}

::mlir::Type BatchToSpaceNDOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

::mlir::Type BatchToSpaceNDOp::Tblock_shape() {
  return mlir::getElementTypeOrSelf(*getODSOperands(1).begin());
}

::mlir::Type BatchToSpaceNDOp::Tcrops() {
  return mlir::getElementTypeOrSelf(*getODSOperands(2).begin());
}

bool BatchToSpaceNDOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
  if (name == "Tblock_shape") return true;
  if (name == "Tcrops") return true;
 return false;
}

::mlir::DictionaryAttr BatchToSpaceNDOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())},
    {Tblock_shapeAttrName(),
::mlir::TypeAttr::get(Tblock_shape())},
    {TcropsAttrName(),
::mlir::TypeAttr::get(Tcrops())}});
}

void BatchToSpaceNDOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input, ::mlir::Value block_shape, ::mlir::Value crops) {
  odsState.addOperands(input);
  odsState.addOperands(block_shape);
  odsState.addOperands(crops);
  odsState.addTypes(output);
}

void BatchToSpaceNDOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::Value block_shape, ::mlir::Value crops) {
  odsState.addOperands(input);
  odsState.addOperands(block_shape);
  odsState.addOperands(crops);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void BatchToSpaceNDOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 3u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult BatchToSpaceNDOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return Verify(*this);
}

void BatchToSpaceNDOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::BatchToSpaceNDOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::BatchToSpaceOp definitions
//===----------------------------------------------------------------------===//

BatchToSpaceOpAdaptor::BatchToSpaceOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

BatchToSpaceOpAdaptor::BatchToSpaceOpAdaptor(BatchToSpaceOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange BatchToSpaceOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> BatchToSpaceOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange BatchToSpaceOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value BatchToSpaceOpAdaptor::input() {
  return *getODSOperands(0).begin();
}

::mlir::Value BatchToSpaceOpAdaptor::crops() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr BatchToSpaceOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::IntegerAttr BatchToSpaceOpAdaptor::block_size() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("block_size").cast<::mlir::IntegerAttr>();
  return attr;
}

::mlir::LogicalResult BatchToSpaceOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_block_size = odsAttrs.get("block_size");
    if (!tblgen_block_size)
      return emitError(loc, "'tf.BatchToSpace' op ""requires attribute 'block_size'");

    if (tblgen_block_size && !((((tblgen_block_size.isa<::mlir::IntegerAttr>())) && ((tblgen_block_size.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))) && ((tblgen_block_size.cast<::mlir::IntegerAttr>().getInt() >= 2))))
      return emitError(loc, "'tf.BatchToSpace' op ""attribute 'block_size' failed to satisfy constraint: 64-bit signless integer attribute whose minimum value is 2");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> BatchToSpaceOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range BatchToSpaceOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value BatchToSpaceOp::input() {
  return *getODSOperands(0).begin();
}

::mlir::Value BatchToSpaceOp::crops() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange BatchToSpaceOp::inputMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange BatchToSpaceOp::cropsMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> BatchToSpaceOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range BatchToSpaceOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value BatchToSpaceOp::output() {
  return *getODSResults(0).begin();
}

::mlir::IntegerAttr BatchToSpaceOp::block_sizeAttr() {
  return (*this)->getAttr(block_sizeAttrName()).cast<::mlir::IntegerAttr>();
}

uint64_t BatchToSpaceOp::block_size() {
  auto attr = block_sizeAttr();
  return attr.getValue().getZExtValue();
}

::mlir::Type BatchToSpaceOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

::mlir::Type BatchToSpaceOp::Tidx() {
  return mlir::getElementTypeOrSelf(*getODSOperands(1).begin());
}

bool BatchToSpaceOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
  if (name == "Tidx") return true;
 return false;
}

::mlir::DictionaryAttr BatchToSpaceOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())},
    {TidxAttrName(),
::mlir::TypeAttr::get(Tidx())}});
}

void BatchToSpaceOp::block_sizeAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(block_sizeAttrName(), attr);
}

void BatchToSpaceOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input, ::mlir::Value crops, ::mlir::IntegerAttr block_size) {
  odsState.addOperands(input);
  odsState.addOperands(crops);
  odsState.addAttribute(block_sizeAttrName(odsState.name), block_size);
  odsState.addTypes(output);
}

void BatchToSpaceOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::Value crops, ::mlir::IntegerAttr block_size) {
  odsState.addOperands(input);
  odsState.addOperands(crops);
  odsState.addAttribute(block_sizeAttrName(odsState.name), block_size);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void BatchToSpaceOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input, ::mlir::Value crops, uint64_t block_size) {
  odsState.addOperands(input);
  odsState.addOperands(crops);
  odsState.addAttribute(block_sizeAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), block_size));
  odsState.addTypes(output);
}

void BatchToSpaceOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::Value crops, uint64_t block_size) {
  odsState.addOperands(input);
  odsState.addOperands(crops);
  odsState.addAttribute(block_sizeAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), block_size));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void BatchToSpaceOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult BatchToSpaceOp::verify() {
  {
    auto tblgen_block_size = (*this)->getAttr(block_sizeAttrName());
    if (!tblgen_block_size)
      return emitOpError("requires attribute 'block_size'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops14(*this, tblgen_block_size, "block_size")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return Verify(*this);
}

void BatchToSpaceOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::BatchToSpaceOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::BesselI0eOp definitions
//===----------------------------------------------------------------------===//

BesselI0eOpAdaptor::BesselI0eOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

BesselI0eOpAdaptor::BesselI0eOpAdaptor(BesselI0eOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange BesselI0eOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> BesselI0eOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange BesselI0eOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value BesselI0eOpAdaptor::x() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr BesselI0eOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult BesselI0eOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> BesselI0eOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range BesselI0eOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value BesselI0eOp::x() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange BesselI0eOp::xMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> BesselI0eOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range BesselI0eOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value BesselI0eOp::y() {
  return *getODSResults(0).begin();
}

::mlir::Type BesselI0eOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool BesselI0eOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr BesselI0eOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void BesselI0eOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type y, ::mlir::Value x) {
  odsState.addOperands(x);
  odsState.addTypes(y);
}

void BesselI0eOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value x) {
  odsState.addOperands(x);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void BesselI0eOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

void BesselI0eOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value x) {
  odsState.addOperands(x);
  odsState.addTypes({x.getType()});

}

void BesselI0eOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  odsState.addTypes({operands[0].getType()});

}

::mlir::LogicalResult BesselI0eOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void BesselI0eOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::BesselI0eOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::BesselI1eOp definitions
//===----------------------------------------------------------------------===//

BesselI1eOpAdaptor::BesselI1eOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

BesselI1eOpAdaptor::BesselI1eOpAdaptor(BesselI1eOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange BesselI1eOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> BesselI1eOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange BesselI1eOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value BesselI1eOpAdaptor::x() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr BesselI1eOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult BesselI1eOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> BesselI1eOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range BesselI1eOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value BesselI1eOp::x() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange BesselI1eOp::xMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> BesselI1eOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range BesselI1eOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value BesselI1eOp::y() {
  return *getODSResults(0).begin();
}

::mlir::Type BesselI1eOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool BesselI1eOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr BesselI1eOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void BesselI1eOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type y, ::mlir::Value x) {
  odsState.addOperands(x);
  odsState.addTypes(y);
}

void BesselI1eOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value x) {
  odsState.addOperands(x);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void BesselI1eOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

void BesselI1eOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value x) {
  odsState.addOperands(x);
  odsState.addTypes({x.getType()});

}

void BesselI1eOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  odsState.addTypes({operands[0].getType()});

}

::mlir::LogicalResult BesselI1eOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void BesselI1eOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::BesselI1eOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::BetaincOp definitions
//===----------------------------------------------------------------------===//

BetaincOpAdaptor::BetaincOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

BetaincOpAdaptor::BetaincOpAdaptor(BetaincOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange BetaincOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> BetaincOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange BetaincOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value BetaincOpAdaptor::a() {
  return *getODSOperands(0).begin();
}

::mlir::Value BetaincOpAdaptor::b() {
  return *getODSOperands(1).begin();
}

::mlir::Value BetaincOpAdaptor::x() {
  return *getODSOperands(2).begin();
}

::mlir::DictionaryAttr BetaincOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult BetaincOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> BetaincOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range BetaincOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value BetaincOp::a() {
  return *getODSOperands(0).begin();
}

::mlir::Value BetaincOp::b() {
  return *getODSOperands(1).begin();
}

::mlir::Value BetaincOp::x() {
  return *getODSOperands(2).begin();
}

::mlir::MutableOperandRange BetaincOp::aMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange BetaincOp::bMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange BetaincOp::xMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> BetaincOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range BetaincOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value BetaincOp::z() {
  return *getODSResults(0).begin();
}

::mlir::Type BetaincOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool BetaincOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr BetaincOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void BetaincOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type z, ::mlir::Value a, ::mlir::Value b, ::mlir::Value x) {
  odsState.addOperands(a);
  odsState.addOperands(b);
  odsState.addOperands(x);
  odsState.addTypes(z);
}

void BetaincOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value a, ::mlir::Value b, ::mlir::Value x) {
  odsState.addOperands(a);
  odsState.addOperands(b);
  odsState.addOperands(x);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void BetaincOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 3u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult BetaincOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops13(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops13(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops13(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops13(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void BetaincOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::BetaincOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::BiasAddGradOp definitions
//===----------------------------------------------------------------------===//

BiasAddGradOpAdaptor::BiasAddGradOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

BiasAddGradOpAdaptor::BiasAddGradOpAdaptor(BiasAddGradOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange BiasAddGradOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> BiasAddGradOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange BiasAddGradOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value BiasAddGradOpAdaptor::out_backprop() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr BiasAddGradOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::StringAttr BiasAddGradOpAdaptor::data_format() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("data_format").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("NHWC");
  return attr;
}

::mlir::LogicalResult BiasAddGradOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_data_format = odsAttrs.get("data_format");
    if (tblgen_data_format && !((tblgen_data_format.cast<StringAttr>().getValue() == "NHWC" || tblgen_data_format.cast<StringAttr>().getValue() == "NCHW")))
      return emitError(loc, "'tf.BiasAddGrad' op ""attribute 'data_format' failed to satisfy constraint: 'NHWC' or 'NCHW' convnet data format");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> BiasAddGradOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range BiasAddGradOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value BiasAddGradOp::out_backprop() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange BiasAddGradOp::out_backpropMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> BiasAddGradOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range BiasAddGradOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value BiasAddGradOp::output() {
  return *getODSResults(0).begin();
}

::mlir::StringAttr BiasAddGradOp::data_formatAttr() {
  return (*this)->getAttr(data_formatAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef BiasAddGradOp::data_format() {
  auto attr = data_formatAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("NHWC").getValue();
  return attr.getValue();
}

::mlir::Type BiasAddGradOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool BiasAddGradOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr BiasAddGradOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void BiasAddGradOp::data_formatAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(data_formatAttrName(), attr);
}

void BiasAddGradOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value out_backprop, ::mlir::StringAttr data_format) {
  odsState.addOperands(out_backprop);
  odsState.addAttribute(data_formatAttrName(odsState.name), data_format);
  odsState.addTypes(output);
}

void BiasAddGradOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value out_backprop, ::mlir::StringAttr data_format) {
  odsState.addOperands(out_backprop);
  odsState.addAttribute(data_formatAttrName(odsState.name), data_format);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void BiasAddGradOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value out_backprop, ::llvm::StringRef data_format) {
  odsState.addOperands(out_backprop);
  odsState.addAttribute(data_formatAttrName(odsState.name), odsBuilder.getStringAttr(data_format));
  odsState.addTypes(output);
}

void BiasAddGradOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value out_backprop, ::llvm::StringRef data_format) {
  odsState.addOperands(out_backprop);
  odsState.addAttribute(data_formatAttrName(odsState.name), odsBuilder.getStringAttr(data_format));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void BiasAddGradOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult BiasAddGradOp::verify() {
  {
    auto tblgen_data_format = (*this)->getAttr(data_formatAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops11(*this, tblgen_data_format, "data_format")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return Verify(*this);
}

void BiasAddGradOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::BiasAddGradOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::BiasAddOp definitions
//===----------------------------------------------------------------------===//

BiasAddOpAdaptor::BiasAddOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

BiasAddOpAdaptor::BiasAddOpAdaptor(BiasAddOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange BiasAddOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> BiasAddOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange BiasAddOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value BiasAddOpAdaptor::value() {
  return *getODSOperands(0).begin();
}

::mlir::Value BiasAddOpAdaptor::bias() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr BiasAddOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::StringAttr BiasAddOpAdaptor::data_format() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("data_format").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("NHWC");
  return attr;
}

::mlir::LogicalResult BiasAddOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_data_format = odsAttrs.get("data_format");
    if (tblgen_data_format && !((tblgen_data_format.cast<StringAttr>().getValue() == "NHWC" || tblgen_data_format.cast<StringAttr>().getValue() == "NCHW")))
      return emitError(loc, "'tf.BiasAdd' op ""attribute 'data_format' failed to satisfy constraint: 'NHWC' or 'NCHW' convnet data format");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> BiasAddOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range BiasAddOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value BiasAddOp::value() {
  return *getODSOperands(0).begin();
}

::mlir::Value BiasAddOp::bias() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange BiasAddOp::valueMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange BiasAddOp::biasMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> BiasAddOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range BiasAddOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value BiasAddOp::output() {
  return *getODSResults(0).begin();
}

::mlir::StringAttr BiasAddOp::data_formatAttr() {
  return (*this)->getAttr(data_formatAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef BiasAddOp::data_format() {
  auto attr = data_formatAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("NHWC").getValue();
  return attr.getValue();
}

::mlir::Type BiasAddOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool BiasAddOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr BiasAddOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void BiasAddOp::data_formatAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(data_formatAttrName(), attr);
}

void BiasAddOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value value, ::mlir::Value bias, ::mlir::StringAttr data_format) {
  odsState.addOperands(value);
  odsState.addOperands(bias);
  odsState.addAttribute(data_formatAttrName(odsState.name), data_format);
  odsState.addTypes(output);
}

void BiasAddOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value value, ::mlir::Value bias, ::mlir::StringAttr data_format) {
  odsState.addOperands(value);
  odsState.addOperands(bias);
  odsState.addAttribute(data_formatAttrName(odsState.name), data_format);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void BiasAddOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value value, ::mlir::Value bias, ::llvm::StringRef data_format) {
  odsState.addOperands(value);
  odsState.addOperands(bias);
  odsState.addAttribute(data_formatAttrName(odsState.name), odsBuilder.getStringAttr(data_format));
  odsState.addTypes(output);
}

void BiasAddOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value value, ::mlir::Value bias, ::llvm::StringRef data_format) {
  odsState.addOperands(value);
  odsState.addOperands(bias);
  odsState.addAttribute(data_formatAttrName(odsState.name), odsBuilder.getStringAttr(data_format));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void BiasAddOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult BiasAddOp::verify() {
  {
    auto tblgen_data_format = (*this)->getAttr(data_formatAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops11(*this, tblgen_data_format, "data_format")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return Verify(*this);
}

void BiasAddOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::BiasAddOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::BiasAddV1Op definitions
//===----------------------------------------------------------------------===//

BiasAddV1OpAdaptor::BiasAddV1OpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

BiasAddV1OpAdaptor::BiasAddV1OpAdaptor(BiasAddV1Op &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange BiasAddV1OpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> BiasAddV1OpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange BiasAddV1OpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value BiasAddV1OpAdaptor::value() {
  return *getODSOperands(0).begin();
}

::mlir::Value BiasAddV1OpAdaptor::bias() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr BiasAddV1OpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult BiasAddV1OpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> BiasAddV1Op::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range BiasAddV1Op::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value BiasAddV1Op::value() {
  return *getODSOperands(0).begin();
}

::mlir::Value BiasAddV1Op::bias() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange BiasAddV1Op::valueMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange BiasAddV1Op::biasMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> BiasAddV1Op::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range BiasAddV1Op::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value BiasAddV1Op::output() {
  return *getODSResults(0).begin();
}

::mlir::Type BiasAddV1Op::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool BiasAddV1Op::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr BiasAddV1Op::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void BiasAddV1Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value value, ::mlir::Value bias) {
  odsState.addOperands(value);
  odsState.addOperands(bias);
  odsState.addTypes(output);
}

void BiasAddV1Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value value, ::mlir::Value bias) {
  odsState.addOperands(value);
  odsState.addOperands(bias);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void BiasAddV1Op::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult BiasAddV1Op::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void BiasAddV1Op::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::BiasAddV1Op)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::BincountOp definitions
//===----------------------------------------------------------------------===//

BincountOpAdaptor::BincountOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

BincountOpAdaptor::BincountOpAdaptor(BincountOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange BincountOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> BincountOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange BincountOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value BincountOpAdaptor::arr() {
  return *getODSOperands(0).begin();
}

::mlir::Value BincountOpAdaptor::size() {
  return *getODSOperands(1).begin();
}

::mlir::Value BincountOpAdaptor::weights() {
  return *getODSOperands(2).begin();
}

::mlir::DictionaryAttr BincountOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult BincountOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> BincountOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range BincountOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value BincountOp::arr() {
  return *getODSOperands(0).begin();
}

::mlir::Value BincountOp::size() {
  return *getODSOperands(1).begin();
}

::mlir::Value BincountOp::weights() {
  return *getODSOperands(2).begin();
}

::mlir::MutableOperandRange BincountOp::arrMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange BincountOp::sizeMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange BincountOp::weightsMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> BincountOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range BincountOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value BincountOp::bins() {
  return *getODSResults(0).begin();
}

::mlir::Type BincountOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(2).begin());
}

bool BincountOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr BincountOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void BincountOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type bins, ::mlir::Value arr, ::mlir::Value size, ::mlir::Value weights) {
  odsState.addOperands(arr);
  odsState.addOperands(size);
  odsState.addOperands(weights);
  odsState.addTypes(bins);
}

void BincountOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value arr, ::mlir::Value size, ::mlir::Value weights) {
  odsState.addOperands(arr);
  odsState.addOperands(size);
  odsState.addOperands(weights);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void BincountOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 3u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult BincountOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops11(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops11(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops25(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops25(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void BincountOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::BincountOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::BitcastOp definitions
//===----------------------------------------------------------------------===//

BitcastOpAdaptor::BitcastOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

BitcastOpAdaptor::BitcastOpAdaptor(BitcastOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange BitcastOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> BitcastOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange BitcastOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value BitcastOpAdaptor::input() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr BitcastOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult BitcastOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> BitcastOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range BitcastOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value BitcastOp::input() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange BitcastOp::inputMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> BitcastOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range BitcastOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value BitcastOp::output() {
  return *getODSResults(0).begin();
}

::mlir::Type BitcastOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

::mlir::Type BitcastOp::type() {
  return mlir::getElementTypeOrSelf(*getODSResults(0).begin());
}

bool BitcastOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
  if (name == "type") return true;
 return false;
}

::mlir::DictionaryAttr BitcastOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())},
    {typeAttrName(),
::mlir::TypeAttr::get(type())}});
}

void BitcastOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input) {
  odsState.addOperands(input);
  odsState.addTypes(output);
}

void BitcastOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input) {
  odsState.addOperands(input);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void BitcastOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult BitcastOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops26(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops26(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void BitcastOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::BitcastOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::BitwiseAndOp definitions
//===----------------------------------------------------------------------===//

BitwiseAndOpAdaptor::BitwiseAndOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

BitwiseAndOpAdaptor::BitwiseAndOpAdaptor(BitwiseAndOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange BitwiseAndOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> BitwiseAndOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange BitwiseAndOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value BitwiseAndOpAdaptor::x() {
  return *getODSOperands(0).begin();
}

::mlir::Value BitwiseAndOpAdaptor::y() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr BitwiseAndOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult BitwiseAndOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> BitwiseAndOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range BitwiseAndOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value BitwiseAndOp::x() {
  return *getODSOperands(0).begin();
}

::mlir::Value BitwiseAndOp::y() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange BitwiseAndOp::xMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange BitwiseAndOp::yMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> BitwiseAndOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range BitwiseAndOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value BitwiseAndOp::z() {
  return *getODSResults(0).begin();
}

::mlir::Type BitwiseAndOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool BitwiseAndOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr BitwiseAndOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void BitwiseAndOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, Value x, Value y) {
  auto resultType =
      OpTrait::util::getBroadcastedType(x.getType(), y.getType());
  if (!resultType)
    mlir::emitError(odsState.location, "non-broadcastable operands");
  return build(odsBuilder, odsState, resultType, x, y);
}

void BitwiseAndOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type z, ::mlir::Value x, ::mlir::Value y) {
  odsState.addOperands(x);
  odsState.addOperands(y);
  odsState.addTypes(z);
}

void BitwiseAndOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value x, ::mlir::Value y) {
  odsState.addOperands(x);
  odsState.addOperands(y);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void BitwiseAndOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult BitwiseAndOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops27(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops27(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops27(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void BitwiseAndOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::BitwiseAndOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::BitwiseOrOp definitions
//===----------------------------------------------------------------------===//

BitwiseOrOpAdaptor::BitwiseOrOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

BitwiseOrOpAdaptor::BitwiseOrOpAdaptor(BitwiseOrOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange BitwiseOrOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> BitwiseOrOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange BitwiseOrOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value BitwiseOrOpAdaptor::x() {
  return *getODSOperands(0).begin();
}

::mlir::Value BitwiseOrOpAdaptor::y() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr BitwiseOrOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult BitwiseOrOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> BitwiseOrOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range BitwiseOrOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value BitwiseOrOp::x() {
  return *getODSOperands(0).begin();
}

::mlir::Value BitwiseOrOp::y() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange BitwiseOrOp::xMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange BitwiseOrOp::yMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> BitwiseOrOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range BitwiseOrOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value BitwiseOrOp::z() {
  return *getODSResults(0).begin();
}

::mlir::Type BitwiseOrOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool BitwiseOrOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr BitwiseOrOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void BitwiseOrOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, Value x, Value y) {
  auto resultType =
      OpTrait::util::getBroadcastedType(x.getType(), y.getType());
  if (!resultType)
    mlir::emitError(odsState.location, "non-broadcastable operands");
  return build(odsBuilder, odsState, resultType, x, y);
}

void BitwiseOrOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type z, ::mlir::Value x, ::mlir::Value y) {
  odsState.addOperands(x);
  odsState.addOperands(y);
  odsState.addTypes(z);
}

void BitwiseOrOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value x, ::mlir::Value y) {
  odsState.addOperands(x);
  odsState.addOperands(y);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void BitwiseOrOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult BitwiseOrOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops27(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops27(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops27(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void BitwiseOrOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::BitwiseOrOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::BitwiseXorOp definitions
//===----------------------------------------------------------------------===//

BitwiseXorOpAdaptor::BitwiseXorOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

BitwiseXorOpAdaptor::BitwiseXorOpAdaptor(BitwiseXorOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange BitwiseXorOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> BitwiseXorOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange BitwiseXorOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value BitwiseXorOpAdaptor::x() {
  return *getODSOperands(0).begin();
}

::mlir::Value BitwiseXorOpAdaptor::y() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr BitwiseXorOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult BitwiseXorOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> BitwiseXorOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range BitwiseXorOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value BitwiseXorOp::x() {
  return *getODSOperands(0).begin();
}

::mlir::Value BitwiseXorOp::y() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange BitwiseXorOp::xMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange BitwiseXorOp::yMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> BitwiseXorOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range BitwiseXorOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value BitwiseXorOp::z() {
  return *getODSResults(0).begin();
}

::mlir::Type BitwiseXorOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool BitwiseXorOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr BitwiseXorOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void BitwiseXorOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, Value x, Value y) {
  auto resultType =
      OpTrait::util::getBroadcastedType(x.getType(), y.getType());
  if (!resultType)
    mlir::emitError(odsState.location, "non-broadcastable operands");
  return build(odsBuilder, odsState, resultType, x, y);
}

void BitwiseXorOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type z, ::mlir::Value x, ::mlir::Value y) {
  odsState.addOperands(x);
  odsState.addOperands(y);
  odsState.addTypes(z);
}

void BitwiseXorOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value x, ::mlir::Value y) {
  odsState.addOperands(x);
  odsState.addOperands(y);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void BitwiseXorOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult BitwiseXorOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops27(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops27(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops27(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void BitwiseXorOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::BitwiseXorOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::BoostedTreesBucketizeOp definitions
//===----------------------------------------------------------------------===//

BoostedTreesBucketizeOpAdaptor::BoostedTreesBucketizeOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

BoostedTreesBucketizeOpAdaptor::BoostedTreesBucketizeOpAdaptor(BoostedTreesBucketizeOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange BoostedTreesBucketizeOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> BoostedTreesBucketizeOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  bool isVariadic[] = {true, true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (odsOperands.size() - 0) / 2;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::ValueRange BoostedTreesBucketizeOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::ValueRange BoostedTreesBucketizeOpAdaptor::float_values() {
  return getODSOperands(0);
}

::mlir::ValueRange BoostedTreesBucketizeOpAdaptor::bucket_boundaries() {
  return getODSOperands(1);
}

::mlir::DictionaryAttr BoostedTreesBucketizeOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult BoostedTreesBucketizeOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> BoostedTreesBucketizeOp::getODSOperandIndexAndLength(unsigned index) {
  bool isVariadic[] = {true, true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (getOperation()->getNumOperands() - 0) / 2;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::Operation::operand_range BoostedTreesBucketizeOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Operation::operand_range BoostedTreesBucketizeOp::float_values() {
  return getODSOperands(0);
}

::mlir::Operation::operand_range BoostedTreesBucketizeOp::bucket_boundaries() {
  return getODSOperands(1);
}

::mlir::MutableOperandRange BoostedTreesBucketizeOp::float_valuesMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange BoostedTreesBucketizeOp::bucket_boundariesMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> BoostedTreesBucketizeOp::getODSResultIndexAndLength(unsigned index) {
  bool isVariadic[] = {true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (getOperation()->getNumResults() - 0) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::Operation::result_range BoostedTreesBucketizeOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Operation::result_range BoostedTreesBucketizeOp::buckets() {
  return getODSResults(0);
}

size_t BoostedTreesBucketizeOp::num_features() {
  auto range = getODSOperands(0);
return std::distance(range.begin(), range.end());
}

bool BoostedTreesBucketizeOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "num_features") return true;
 return false;
}

::mlir::DictionaryAttr BoostedTreesBucketizeOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {num_featuresAttrName(),
odsBuilder.getI64IntegerAttr(num_features())}});
}

void BoostedTreesBucketizeOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange buckets, ::mlir::ValueRange float_values, ::mlir::ValueRange bucket_boundaries) {
  odsState.addOperands(float_values);
  odsState.addOperands(bucket_boundaries);
  odsState.addTypes(buckets);
}

void BoostedTreesBucketizeOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult BoostedTreesBucketizeOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops11(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void BoostedTreesBucketizeOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::BoostedTreesBucketizeOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::BroadcastArgsOp definitions
//===----------------------------------------------------------------------===//

BroadcastArgsOpAdaptor::BroadcastArgsOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

BroadcastArgsOpAdaptor::BroadcastArgsOpAdaptor(BroadcastArgsOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange BroadcastArgsOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> BroadcastArgsOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange BroadcastArgsOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value BroadcastArgsOpAdaptor::s0() {
  return *getODSOperands(0).begin();
}

::mlir::Value BroadcastArgsOpAdaptor::s1() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr BroadcastArgsOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult BroadcastArgsOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> BroadcastArgsOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range BroadcastArgsOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value BroadcastArgsOp::s0() {
  return *getODSOperands(0).begin();
}

::mlir::Value BroadcastArgsOp::s1() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange BroadcastArgsOp::s0Mutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange BroadcastArgsOp::s1Mutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> BroadcastArgsOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range BroadcastArgsOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value BroadcastArgsOp::r0() {
  return *getODSResults(0).begin();
}

::mlir::Type BroadcastArgsOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool BroadcastArgsOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr BroadcastArgsOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void BroadcastArgsOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type r0, ::mlir::Value s0, ::mlir::Value s1) {
  odsState.addOperands(s0);
  odsState.addOperands(s1);
  odsState.addTypes(r0);
}

void BroadcastArgsOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value s0, ::mlir::Value s1) {
  odsState.addOperands(s0);
  odsState.addOperands(s1);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void BroadcastArgsOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult BroadcastArgsOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void BroadcastArgsOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::BroadcastArgsOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::BroadcastGradientArgsOp definitions
//===----------------------------------------------------------------------===//

BroadcastGradientArgsOpAdaptor::BroadcastGradientArgsOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

BroadcastGradientArgsOpAdaptor::BroadcastGradientArgsOpAdaptor(BroadcastGradientArgsOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange BroadcastGradientArgsOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> BroadcastGradientArgsOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange BroadcastGradientArgsOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value BroadcastGradientArgsOpAdaptor::s0() {
  return *getODSOperands(0).begin();
}

::mlir::Value BroadcastGradientArgsOpAdaptor::s1() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr BroadcastGradientArgsOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult BroadcastGradientArgsOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

void BroadcastGradientArgsOp::getAsmResultNames(::mlir::OpAsmSetValueNameFn setNameFn) {
  auto resultGroup0 = getODSResults(0);
  if (!llvm::empty(resultGroup0))
    setNameFn(*resultGroup0.begin(), "r0");
  auto resultGroup1 = getODSResults(1);
  if (!llvm::empty(resultGroup1))
    setNameFn(*resultGroup1.begin(), "r1");
}

std::pair<unsigned, unsigned> BroadcastGradientArgsOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range BroadcastGradientArgsOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value BroadcastGradientArgsOp::s0() {
  return *getODSOperands(0).begin();
}

::mlir::Value BroadcastGradientArgsOp::s1() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange BroadcastGradientArgsOp::s0Mutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange BroadcastGradientArgsOp::s1Mutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> BroadcastGradientArgsOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range BroadcastGradientArgsOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value BroadcastGradientArgsOp::r0() {
  return *getODSResults(0).begin();
}

::mlir::Value BroadcastGradientArgsOp::r1() {
  return *getODSResults(1).begin();
}

::mlir::Type BroadcastGradientArgsOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool BroadcastGradientArgsOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr BroadcastGradientArgsOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void BroadcastGradientArgsOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type r0, ::mlir::Type r1, ::mlir::Value s0, ::mlir::Value s1) {
  odsState.addOperands(s0);
  odsState.addOperands(s1);
  odsState.addTypes(r0);
  odsState.addTypes(r1);
}

void BroadcastGradientArgsOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value s0, ::mlir::Value s1) {
  odsState.addOperands(s0);
  odsState.addOperands(s1);
  assert(resultTypes.size() == 2u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void BroadcastGradientArgsOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 2u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult BroadcastGradientArgsOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSResults(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  if (!((((*this->getOperation()).getOperand(0).getType().isa<UnrankedTensorType>())) || (((*this->getOperation()).getOperand(0).getType().cast<ShapedType>().getRank() == 1))))
    return emitOpError("failed to verify that operand 0 is 1-D");
  if (!((((*this->getOperation()).getOperand(1).getType().isa<UnrankedTensorType>())) || (((*this->getOperation()).getOperand(1).getType().cast<ShapedType>().getRank() == 1))))
    return emitOpError("failed to verify that operand 1 is 1-D");
  if (!((((*this->getOperation()).getResult(0).getType().isa<UnrankedTensorType>())) || (((*this->getOperation()).getResult(0).getType().cast<ShapedType>().getRank() == 1))))
    return emitOpError("failed to verify that result 0 is 1-D");
  if (!((((*this->getOperation()).getResult(1).getType().isa<UnrankedTensorType>())) || (((*this->getOperation()).getResult(1).getType().cast<ShapedType>().getRank() == 1))))
    return emitOpError("failed to verify that result 1 is 1-D");
  return Verify(*this);
}

void BroadcastGradientArgsOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::BroadcastGradientArgsOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::BroadcastToOp definitions
//===----------------------------------------------------------------------===//

BroadcastToOpAdaptor::BroadcastToOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

BroadcastToOpAdaptor::BroadcastToOpAdaptor(BroadcastToOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange BroadcastToOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> BroadcastToOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange BroadcastToOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value BroadcastToOpAdaptor::input() {
  return *getODSOperands(0).begin();
}

::mlir::Value BroadcastToOpAdaptor::shape() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr BroadcastToOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult BroadcastToOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> BroadcastToOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range BroadcastToOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value BroadcastToOp::input() {
  return *getODSOperands(0).begin();
}

::mlir::Value BroadcastToOp::shape() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange BroadcastToOp::inputMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange BroadcastToOp::shapeMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> BroadcastToOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range BroadcastToOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value BroadcastToOp::output() {
  return *getODSResults(0).begin();
}

::mlir::Type BroadcastToOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

::mlir::Type BroadcastToOp::Tidx() {
  return mlir::getElementTypeOrSelf(*getODSOperands(1).begin());
}

bool BroadcastToOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
  if (name == "Tidx") return true;
 return false;
}

::mlir::DictionaryAttr BroadcastToOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())},
    {TidxAttrName(),
::mlir::TypeAttr::get(Tidx())}});
}

void BroadcastToOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input, ::mlir::Value shape) {
  odsState.addOperands(input);
  odsState.addOperands(shape);
  odsState.addTypes(output);
}

void BroadcastToOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::Value shape) {
  odsState.addOperands(input);
  odsState.addOperands(shape);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void BroadcastToOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult BroadcastToOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return Verify(*this);
}

void BroadcastToOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::BroadcastToOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::BucketizeOp definitions
//===----------------------------------------------------------------------===//

BucketizeOpAdaptor::BucketizeOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

BucketizeOpAdaptor::BucketizeOpAdaptor(BucketizeOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange BucketizeOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> BucketizeOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange BucketizeOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value BucketizeOpAdaptor::input() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr BucketizeOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::ArrayAttr BucketizeOpAdaptor::boundaries() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("boundaries").cast<::mlir::ArrayAttr>();
  return attr;
}

::mlir::LogicalResult BucketizeOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_boundaries = odsAttrs.get("boundaries");
    if (!tblgen_boundaries)
      return emitError(loc, "'tf.Bucketize' op ""requires attribute 'boundaries'");

    if (tblgen_boundaries && !(((tblgen_boundaries.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_boundaries.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return ((attr.isa<::mlir::FloatAttr>())) && ((attr.cast<::mlir::FloatAttr>().getType().isF32())); }))))
      return emitError(loc, "'tf.Bucketize' op ""attribute 'boundaries' failed to satisfy constraint: 32-bit float array attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> BucketizeOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range BucketizeOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value BucketizeOp::input() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange BucketizeOp::inputMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> BucketizeOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range BucketizeOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value BucketizeOp::output() {
  return *getODSResults(0).begin();
}

::mlir::ArrayAttr BucketizeOp::boundariesAttr() {
  return (*this)->getAttr(boundariesAttrName()).cast<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr BucketizeOp::boundaries() {
  auto attr = boundariesAttr();
  return attr;
}

::mlir::Type BucketizeOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool BucketizeOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr BucketizeOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void BucketizeOp::boundariesAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(boundariesAttrName(), attr);
}

void BucketizeOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input, ::mlir::ArrayAttr boundaries) {
  odsState.addOperands(input);
  odsState.addAttribute(boundariesAttrName(odsState.name), boundaries);
  odsState.addTypes(output);
}

void BucketizeOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::ArrayAttr boundaries) {
  odsState.addOperands(input);
  odsState.addAttribute(boundariesAttrName(odsState.name), boundaries);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void BucketizeOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult BucketizeOp::verify() {
  {
    auto tblgen_boundaries = (*this)->getAttr(boundariesAttrName());
    if (!tblgen_boundaries)
      return emitOpError("requires attribute 'boundaries'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops15(*this, tblgen_boundaries, "boundaries")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops25(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops11(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void BucketizeOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::BucketizeOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::CacheDatasetV2Op definitions
//===----------------------------------------------------------------------===//

CacheDatasetV2OpAdaptor::CacheDatasetV2OpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

CacheDatasetV2OpAdaptor::CacheDatasetV2OpAdaptor(CacheDatasetV2Op &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange CacheDatasetV2OpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> CacheDatasetV2OpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange CacheDatasetV2OpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value CacheDatasetV2OpAdaptor::input_dataset() {
  return *getODSOperands(0).begin();
}

::mlir::Value CacheDatasetV2OpAdaptor::filename() {
  return *getODSOperands(1).begin();
}

::mlir::Value CacheDatasetV2OpAdaptor::cache() {
  return *getODSOperands(2).begin();
}

::mlir::DictionaryAttr CacheDatasetV2OpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::ArrayAttr CacheDatasetV2OpAdaptor::output_types() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("output_types").cast<::mlir::ArrayAttr>();
  return attr;
}

::mlir::ArrayAttr CacheDatasetV2OpAdaptor::output_shapes() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("output_shapes").cast<::mlir::ArrayAttr>();
  return attr;
}

::mlir::StringAttr CacheDatasetV2OpAdaptor::metadata() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("metadata").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("");
  return attr;
}

::mlir::LogicalResult CacheDatasetV2OpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_output_types = odsAttrs.get("output_types");
    if (!tblgen_output_types)
      return emitError(loc, "'tf.CacheDatasetV2' op ""requires attribute 'output_types'");

    if (tblgen_output_types && !((((tblgen_output_types.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_output_types.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return ((attr.isa<::mlir::TypeAttr>())) && ((attr.cast<::mlir::TypeAttr>().getValue().isa<::mlir::Type>())); }))) && ((tblgen_output_types.cast<::mlir::ArrayAttr>().size() >= 1))))
      return emitError(loc, "'tf.CacheDatasetV2' op ""attribute 'output_types' failed to satisfy constraint: type array attribute with at least 1 elements");
  }
  {
    auto tblgen_output_shapes = odsAttrs.get("output_shapes");
    if (!tblgen_output_shapes)
      return emitError(loc, "'tf.CacheDatasetV2' op ""requires attribute 'output_shapes'");

    if (tblgen_output_shapes && !((((tblgen_output_shapes.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_output_shapes.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return (attr.isa<mlir::TF::ShapeAttr>()); }))) && ((tblgen_output_shapes.cast<::mlir::ArrayAttr>().size() >= 1))))
      return emitError(loc, "'tf.CacheDatasetV2' op ""attribute 'output_shapes' failed to satisfy constraint: tensorflow shape attribute array with at least 1 elements");
  }
  {
    auto tblgen_metadata = odsAttrs.get("metadata");
    if (tblgen_metadata && !((tblgen_metadata.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.CacheDatasetV2' op ""attribute 'metadata' failed to satisfy constraint: string attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> CacheDatasetV2Op::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range CacheDatasetV2Op::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value CacheDatasetV2Op::input_dataset() {
  return *getODSOperands(0).begin();
}

::mlir::Value CacheDatasetV2Op::filename() {
  return *getODSOperands(1).begin();
}

::mlir::Value CacheDatasetV2Op::cache() {
  return *getODSOperands(2).begin();
}

::mlir::MutableOperandRange CacheDatasetV2Op::input_datasetMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange CacheDatasetV2Op::filenameMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange CacheDatasetV2Op::cacheMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> CacheDatasetV2Op::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range CacheDatasetV2Op::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value CacheDatasetV2Op::handle() {
  return *getODSResults(0).begin();
}

::mlir::ArrayAttr CacheDatasetV2Op::output_typesAttr() {
  return (*this)->getAttr(output_typesAttrName()).cast<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr CacheDatasetV2Op::output_types() {
  auto attr = output_typesAttr();
  return attr;
}

::mlir::ArrayAttr CacheDatasetV2Op::output_shapesAttr() {
  return (*this)->getAttr(output_shapesAttrName()).cast<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr CacheDatasetV2Op::output_shapes() {
  auto attr = output_shapesAttr();
  return attr;
}

::mlir::StringAttr CacheDatasetV2Op::metadataAttr() {
  return (*this)->getAttr(metadataAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef CacheDatasetV2Op::metadata() {
  auto attr = metadataAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("").getValue();
  return attr.getValue();
}

void CacheDatasetV2Op::output_typesAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(output_typesAttrName(), attr);
}

void CacheDatasetV2Op::output_shapesAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(output_shapesAttrName(), attr);
}

void CacheDatasetV2Op::metadataAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(metadataAttrName(), attr);
}

void CacheDatasetV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type handle, ::mlir::Value input_dataset, ::mlir::Value filename, ::mlir::Value cache, ::mlir::ArrayAttr output_types, ::mlir::ArrayAttr output_shapes, ::mlir::StringAttr metadata) {
  odsState.addOperands(input_dataset);
  odsState.addOperands(filename);
  odsState.addOperands(cache);
  odsState.addAttribute(output_typesAttrName(odsState.name), output_types);
  odsState.addAttribute(output_shapesAttrName(odsState.name), output_shapes);
  odsState.addAttribute(metadataAttrName(odsState.name), metadata);
  odsState.addTypes(handle);
}

void CacheDatasetV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input_dataset, ::mlir::Value filename, ::mlir::Value cache, ::mlir::ArrayAttr output_types, ::mlir::ArrayAttr output_shapes, ::mlir::StringAttr metadata) {
  odsState.addOperands(input_dataset);
  odsState.addOperands(filename);
  odsState.addOperands(cache);
  odsState.addAttribute(output_typesAttrName(odsState.name), output_types);
  odsState.addAttribute(output_shapesAttrName(odsState.name), output_shapes);
  odsState.addAttribute(metadataAttrName(odsState.name), metadata);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void CacheDatasetV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type handle, ::mlir::Value input_dataset, ::mlir::Value filename, ::mlir::Value cache, ::mlir::ArrayAttr output_types, ::mlir::ArrayAttr output_shapes, ::llvm::StringRef metadata) {
  odsState.addOperands(input_dataset);
  odsState.addOperands(filename);
  odsState.addOperands(cache);
  odsState.addAttribute(output_typesAttrName(odsState.name), output_types);
  odsState.addAttribute(output_shapesAttrName(odsState.name), output_shapes);
  odsState.addAttribute(metadataAttrName(odsState.name), odsBuilder.getStringAttr(metadata));
  odsState.addTypes(handle);
}

void CacheDatasetV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input_dataset, ::mlir::Value filename, ::mlir::Value cache, ::mlir::ArrayAttr output_types, ::mlir::ArrayAttr output_shapes, ::llvm::StringRef metadata) {
  odsState.addOperands(input_dataset);
  odsState.addOperands(filename);
  odsState.addOperands(cache);
  odsState.addAttribute(output_typesAttrName(odsState.name), output_types);
  odsState.addAttribute(output_shapesAttrName(odsState.name), output_shapes);
  odsState.addAttribute(metadataAttrName(odsState.name), odsBuilder.getStringAttr(metadata));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void CacheDatasetV2Op::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 3u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult CacheDatasetV2Op::verify() {
  {
    auto tblgen_output_types = (*this)->getAttr(output_typesAttrName());
    if (!tblgen_output_types)
      return emitOpError("requires attribute 'output_types'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops2(*this, tblgen_output_types, "output_types")))
      return ::mlir::failure();
  }
  {
    auto tblgen_output_shapes = (*this)->getAttr(output_shapesAttrName());
    if (!tblgen_output_shapes)
      return emitOpError("requires attribute 'output_shapes'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops3(*this, tblgen_output_shapes, "output_shapes")))
      return ::mlir::failure();
  }
  {
    auto tblgen_metadata = (*this)->getAttr(metadataAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_metadata, "metadata")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops15(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops19(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops15(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void CacheDatasetV2Op::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  for (::mlir::Value value : getODSOperands(2))
    effects.emplace_back(::mlir::MemoryEffects::Read::get(), value, ::mlir::TF::ResourceEffects::DatasetMemoryCache::get());
  for (::mlir::Value value : getODSOperands(2))
    effects.emplace_back(::mlir::MemoryEffects::Write::get(), value, ::mlir::TF::ResourceEffects::DatasetMemoryCache::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::CacheDatasetV2Op)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::CaseOp definitions
//===----------------------------------------------------------------------===//

CaseOpAdaptor::CaseOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

CaseOpAdaptor::CaseOpAdaptor(CaseOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange CaseOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> CaseOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  bool isVariadic[] = {false, true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (odsOperands.size() - 1) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::ValueRange CaseOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value CaseOpAdaptor::branch_index() {
  return *getODSOperands(0).begin();
}

::mlir::ValueRange CaseOpAdaptor::input() {
  return getODSOperands(1);
}

::mlir::DictionaryAttr CaseOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::ArrayAttr CaseOpAdaptor::branches() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("branches").cast<::mlir::ArrayAttr>();
  return attr;
}

::mlir::BoolAttr CaseOpAdaptor::is_stateless() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("is_stateless").cast<::mlir::BoolAttr>();
  return attr;
}

::mlir::LogicalResult CaseOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_branches = odsAttrs.get("branches");
    if (!tblgen_branches)
      return emitError(loc, "'tf.Case' op ""requires attribute 'branches'");

    if (tblgen_branches && !((((tblgen_branches.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_branches.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return (attr.isa<::mlir::SymbolRefAttr>()); }))) && ((tblgen_branches.cast<::mlir::ArrayAttr>().size() >= 1))))
      return emitError(loc, "'tf.Case' op ""attribute 'branches' failed to satisfy constraint: symbol ref array attribute with at least 1 elements");
  }
  {
    auto tblgen_is_stateless = odsAttrs.get("is_stateless");
    if (!tblgen_is_stateless)
      return emitError(loc, "'tf.Case' op ""requires attribute 'is_stateless'");

    if (tblgen_is_stateless && !((tblgen_is_stateless.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.Case' op ""attribute 'is_stateless' failed to satisfy constraint: bool attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> CaseOp::getODSOperandIndexAndLength(unsigned index) {
  bool isVariadic[] = {false, true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (getOperation()->getNumOperands() - 1) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::Operation::operand_range CaseOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value CaseOp::branch_index() {
  return *getODSOperands(0).begin();
}

::mlir::Operation::operand_range CaseOp::input() {
  return getODSOperands(1);
}

::mlir::MutableOperandRange CaseOp::branch_indexMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange CaseOp::inputMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> CaseOp::getODSResultIndexAndLength(unsigned index) {
  bool isVariadic[] = {true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (getOperation()->getNumResults() - 0) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::Operation::result_range CaseOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Operation::result_range CaseOp::output() {
  return getODSResults(0);
}

::mlir::ArrayAttr CaseOp::branchesAttr() {
  return (*this)->getAttr(branchesAttrName()).cast<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr CaseOp::branches() {
  auto attr = branchesAttr();
  return attr;
}

::mlir::BoolAttr CaseOp::is_statelessAttr() {
  return (*this)->getAttr(is_statelessAttrName()).cast<::mlir::BoolAttr>();
}

bool CaseOp::is_stateless() {
  auto attr = is_statelessAttr();
  return attr.getValue();
}

mlir::OperandElementTypeRange CaseOp::Tin() {
  auto values = getODSOperands(1);
return {mlir::OperandElementTypeIterator(values.begin()), mlir::OperandElementTypeIterator(values.end())};
}

mlir::ResultElementTypeRange CaseOp::Tout() {
  auto values = getODSResults(0);
return {mlir::ResultElementTypeIterator(values.begin()), mlir::ResultElementTypeIterator(values.end())};
}

mlir::TF::ResultShapeRange CaseOp::output_shapes() {
  auto values = getODSResults(0);
return {mlir::TF::ResultShapeIterator(values.begin()), mlir::TF::ResultShapeIterator(values.end())};
}

bool CaseOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "Tin") return true;
  if (name == "Tout") return true;
  if (name == "output_shapes") return true;
 return false;
}

::mlir::DictionaryAttr CaseOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TinAttrName(),
ArrayAttr::get(ctx, 
    [&]() {
      llvm::SmallVector<Attribute, 4> ret;
      for (auto t : Tin())
        ret.push_back(TypeAttr::get(t));
      return ret;
    }())},
    {ToutAttrName(),
ArrayAttr::get(ctx, 
    [&]() {
      llvm::SmallVector<Attribute, 4> ret;
      for (auto t : Tout())
        ret.push_back(TypeAttr::get(t));
      return ret;
    }())},
    {output_shapesAttrName(),
ArrayAttr::get(ctx,
      [&](){
        llvm::SmallVector<Attribute, 4> ret;
        for (auto shape : output_shapes())
          ret.push_back(mlir::TF::ShapeAttr::get(ctx, shape));
        return ret;
      }())}});
}

void CaseOp::branchesAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(branchesAttrName(), attr);
}

void CaseOp::is_statelessAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(is_statelessAttrName(), attr);
}

void CaseOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange output, ::mlir::Value branch_index, ::mlir::ValueRange input, ::mlir::ArrayAttr branches, ::mlir::BoolAttr is_stateless) {
  odsState.addOperands(branch_index);
  odsState.addOperands(input);
  odsState.addAttribute(branchesAttrName(odsState.name), branches);
  odsState.addAttribute(is_statelessAttrName(odsState.name), is_stateless);
  odsState.addTypes(output);
}

void CaseOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange output, ::mlir::Value branch_index, ::mlir::ValueRange input, ::mlir::ArrayAttr branches, bool is_stateless) {
  odsState.addOperands(branch_index);
  odsState.addOperands(input);
  odsState.addAttribute(branchesAttrName(odsState.name), branches);
  odsState.addAttribute(is_statelessAttrName(odsState.name), odsBuilder.getBoolAttr(is_stateless));
  odsState.addTypes(output);
}

void CaseOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() >= 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult CaseOp::verify() {
  {
    auto tblgen_branches = (*this)->getAttr(branchesAttrName());
    if (!tblgen_branches)
      return emitOpError("requires attribute 'branches'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops16(*this, tblgen_branches, "branches")))
      return ::mlir::failure();
  }
  {
    auto tblgen_is_stateless = (*this)->getAttr(is_statelessAttrName());
    if (!tblgen_is_stateless)
      return emitOpError("requires attribute 'is_stateless'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_is_stateless, "is_stateless")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops28(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return Verify(*this);
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::CaseOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::CaseRegionOp definitions
//===----------------------------------------------------------------------===//

CaseRegionOpAdaptor::CaseRegionOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

CaseRegionOpAdaptor::CaseRegionOpAdaptor(CaseRegionOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange CaseRegionOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> CaseRegionOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange CaseRegionOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value CaseRegionOpAdaptor::branch_index() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr CaseRegionOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::BoolAttr CaseRegionOpAdaptor::is_stateless() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("is_stateless").cast<::mlir::BoolAttr>();
  return attr;
}

::mlir::RegionRange CaseRegionOpAdaptor::getRegions() {
  return odsRegions;
}

::mlir::RegionRange CaseRegionOpAdaptor::branches() {
  return odsRegions.drop_front(0);
}

::mlir::LogicalResult CaseRegionOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_is_stateless = odsAttrs.get("is_stateless");
    if (!tblgen_is_stateless)
      return emitError(loc, "'tf.CaseRegion' op ""requires attribute 'is_stateless'");

    if (tblgen_is_stateless && !((tblgen_is_stateless.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.CaseRegion' op ""attribute 'is_stateless' failed to satisfy constraint: bool attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> CaseRegionOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range CaseRegionOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value CaseRegionOp::branch_index() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange CaseRegionOp::branch_indexMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> CaseRegionOp::getODSResultIndexAndLength(unsigned index) {
  bool isVariadic[] = {true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (getOperation()->getNumResults() - 0) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::Operation::result_range CaseRegionOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Operation::result_range CaseRegionOp::output() {
  return getODSResults(0);
}

::mlir::MutableArrayRef<::mlir::Region> CaseRegionOp::branches() {
  return (*this)->getRegions().drop_front(0);
}

::mlir::BoolAttr CaseRegionOp::is_statelessAttr() {
  return (*this)->getAttr(is_statelessAttrName()).cast<::mlir::BoolAttr>();
}

bool CaseRegionOp::is_stateless() {
  auto attr = is_statelessAttr();
  return attr.getValue();
}

void CaseRegionOp::is_statelessAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(is_statelessAttrName(), attr);
}

void CaseRegionOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange output, ::mlir::Value branch_index, ::mlir::BoolAttr is_stateless, unsigned branchesCount) {
  odsState.addOperands(branch_index);
  odsState.addAttribute(is_statelessAttrName(odsState.name), is_stateless);
  for (unsigned i = 0; i < branchesCount; ++i)
    (void)odsState.addRegion();
  odsState.addTypes(output);
}

void CaseRegionOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange output, ::mlir::Value branch_index, bool is_stateless, unsigned branchesCount) {
  odsState.addOperands(branch_index);
  odsState.addAttribute(is_statelessAttrName(odsState.name), odsBuilder.getBoolAttr(is_stateless));
  for (unsigned i = 0; i < branchesCount; ++i)
    (void)odsState.addRegion();
  odsState.addTypes(output);
}

void CaseRegionOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes, unsigned numRegions) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  for (unsigned i = 0; i != numRegions; ++i)
    (void)odsState.addRegion();
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult CaseRegionOp::verify() {
  {
    auto tblgen_is_stateless = (*this)->getAttr(is_statelessAttrName());
    if (!tblgen_is_stateless)
      return emitOpError("requires attribute 'is_stateless'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_is_stateless, "is_stateless")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops28(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;

    for (auto &region : branches())
      if (::mlir::failed(__mlir_ods_local_region_constraint_tf_ops0(*this, region, "branches", index++)))
        return ::mlir::failure();
  }
  return Verify(*this);
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::CaseRegionOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::CastOp definitions
//===----------------------------------------------------------------------===//

CastOpAdaptor::CastOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

CastOpAdaptor::CastOpAdaptor(CastOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange CastOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> CastOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange CastOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value CastOpAdaptor::x() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr CastOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::BoolAttr CastOpAdaptor::Truncate() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("Truncate").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(false);
  return attr;
}

::mlir::LogicalResult CastOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_Truncate = odsAttrs.get("Truncate");
    if (tblgen_Truncate && !((tblgen_Truncate.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.Cast' op ""attribute 'Truncate' failed to satisfy constraint: bool attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> CastOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range CastOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value CastOp::x() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange CastOp::xMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> CastOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range CastOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value CastOp::y() {
  return *getODSResults(0).begin();
}

::mlir::BoolAttr CastOp::TruncateAttr() {
  return (*this)->getAttr(TruncateAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool CastOp::Truncate() {
  auto attr = TruncateAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(false).getValue();
  return attr.getValue();
}

::mlir::Type CastOp::SrcT() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

::mlir::Type CastOp::DstT() {
  return mlir::getElementTypeOrSelf(*getODSResults(0).begin());
}

bool CastOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "SrcT") return true;
  if (name == "DstT") return true;
 return false;
}

::mlir::DictionaryAttr CastOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {SrcTAttrName(),
::mlir::TypeAttr::get(SrcT())},
    {DstTAttrName(),
::mlir::TypeAttr::get(DstT())}});
}

void CastOp::TruncateAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(TruncateAttrName(), attr);
}

void CastOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type y, ::mlir::Value x, ::mlir::BoolAttr Truncate) {
  odsState.addOperands(x);
  odsState.addAttribute(TruncateAttrName(odsState.name), Truncate);
  odsState.addTypes(y);
}

void CastOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value x, ::mlir::BoolAttr Truncate) {
  odsState.addOperands(x);
  odsState.addAttribute(TruncateAttrName(odsState.name), Truncate);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void CastOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type y, ::mlir::Value x, bool Truncate) {
  odsState.addOperands(x);
  odsState.addAttribute(TruncateAttrName(odsState.name), odsBuilder.getBoolAttr(Truncate));
  odsState.addTypes(y);
}

void CastOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value x, bool Truncate) {
  odsState.addOperands(x);
  odsState.addAttribute(TruncateAttrName(odsState.name), odsBuilder.getBoolAttr(Truncate));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void CastOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult CastOp::verify() {
  {
    auto tblgen_Truncate = (*this)->getAttr(TruncateAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_Truncate, "Truncate")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void CastOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::CastOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::CeilOp definitions
//===----------------------------------------------------------------------===//

CeilOpAdaptor::CeilOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

CeilOpAdaptor::CeilOpAdaptor(CeilOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange CeilOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> CeilOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange CeilOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value CeilOpAdaptor::x() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr CeilOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult CeilOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> CeilOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range CeilOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value CeilOp::x() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange CeilOp::xMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> CeilOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range CeilOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value CeilOp::y() {
  return *getODSResults(0).begin();
}

::mlir::Type CeilOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool CeilOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr CeilOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void CeilOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type y, ::mlir::Value x) {
  odsState.addOperands(x);
  odsState.addTypes(y);
}

void CeilOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value x) {
  odsState.addOperands(x);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void CeilOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

void CeilOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value x) {
  odsState.addOperands(x);
  odsState.addTypes({x.getType()});

}

void CeilOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  odsState.addTypes({operands[0].getType()});

}

::mlir::LogicalResult CeilOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void CeilOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::CeilOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::CheckNumericsOp definitions
//===----------------------------------------------------------------------===//

CheckNumericsOpAdaptor::CheckNumericsOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

CheckNumericsOpAdaptor::CheckNumericsOpAdaptor(CheckNumericsOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange CheckNumericsOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> CheckNumericsOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange CheckNumericsOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value CheckNumericsOpAdaptor::tensor() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr CheckNumericsOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::StringAttr CheckNumericsOpAdaptor::message() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("message").cast<::mlir::StringAttr>();
  return attr;
}

::mlir::LogicalResult CheckNumericsOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_message = odsAttrs.get("message");
    if (!tblgen_message)
      return emitError(loc, "'tf.CheckNumerics' op ""requires attribute 'message'");

    if (tblgen_message && !((tblgen_message.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.CheckNumerics' op ""attribute 'message' failed to satisfy constraint: string attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> CheckNumericsOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range CheckNumericsOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value CheckNumericsOp::tensor() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange CheckNumericsOp::tensorMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> CheckNumericsOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range CheckNumericsOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value CheckNumericsOp::output() {
  return *getODSResults(0).begin();
}

::mlir::StringAttr CheckNumericsOp::messageAttr() {
  return (*this)->getAttr(messageAttrName()).cast<::mlir::StringAttr>();
}

::llvm::StringRef CheckNumericsOp::message() {
  auto attr = messageAttr();
  return attr.getValue();
}

::mlir::Type CheckNumericsOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool CheckNumericsOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr CheckNumericsOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void CheckNumericsOp::messageAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(messageAttrName(), attr);
}

void CheckNumericsOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value tensor, ::mlir::StringAttr message) {
  odsState.addOperands(tensor);
  odsState.addAttribute(messageAttrName(odsState.name), message);
  odsState.addTypes(output);
}

void CheckNumericsOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value tensor, ::mlir::StringAttr message) {
  odsState.addOperands(tensor);
  odsState.addAttribute(messageAttrName(odsState.name), message);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void CheckNumericsOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value tensor, ::llvm::StringRef message) {
  odsState.addOperands(tensor);
  odsState.addAttribute(messageAttrName(odsState.name), odsBuilder.getStringAttr(message));
  odsState.addTypes(output);
}

void CheckNumericsOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value tensor, ::llvm::StringRef message) {
  odsState.addOperands(tensor);
  odsState.addAttribute(messageAttrName(odsState.name), odsBuilder.getStringAttr(message));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void CheckNumericsOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult CheckNumericsOp::verify() {
  {
    auto tblgen_message = (*this)->getAttr(messageAttrName());
    if (!tblgen_message)
      return emitOpError("requires attribute 'message'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_message, "message")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::CheckNumericsOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::CholeskyOp definitions
//===----------------------------------------------------------------------===//

CholeskyOpAdaptor::CholeskyOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

CholeskyOpAdaptor::CholeskyOpAdaptor(CholeskyOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange CholeskyOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> CholeskyOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange CholeskyOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value CholeskyOpAdaptor::input() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr CholeskyOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult CholeskyOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> CholeskyOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range CholeskyOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value CholeskyOp::input() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange CholeskyOp::inputMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> CholeskyOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range CholeskyOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value CholeskyOp::output() {
  return *getODSResults(0).begin();
}

::mlir::Type CholeskyOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool CholeskyOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr CholeskyOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void CholeskyOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input) {
  odsState.addOperands(input);
  odsState.addTypes(output);
}

void CholeskyOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input) {
  odsState.addOperands(input);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void CholeskyOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult CholeskyOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops29(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops29(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void CholeskyOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::CholeskyOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::ClipByValueOp definitions
//===----------------------------------------------------------------------===//

ClipByValueOpAdaptor::ClipByValueOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

ClipByValueOpAdaptor::ClipByValueOpAdaptor(ClipByValueOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange ClipByValueOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> ClipByValueOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange ClipByValueOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ClipByValueOpAdaptor::t() {
  return *getODSOperands(0).begin();
}

::mlir::Value ClipByValueOpAdaptor::clip_value_min() {
  return *getODSOperands(1).begin();
}

::mlir::Value ClipByValueOpAdaptor::clip_value_max() {
  return *getODSOperands(2).begin();
}

::mlir::DictionaryAttr ClipByValueOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult ClipByValueOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> ClipByValueOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range ClipByValueOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ClipByValueOp::t() {
  return *getODSOperands(0).begin();
}

::mlir::Value ClipByValueOp::clip_value_min() {
  return *getODSOperands(1).begin();
}

::mlir::Value ClipByValueOp::clip_value_max() {
  return *getODSOperands(2).begin();
}

::mlir::MutableOperandRange ClipByValueOp::tMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ClipByValueOp::clip_value_minMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ClipByValueOp::clip_value_maxMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> ClipByValueOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range ClipByValueOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ClipByValueOp::output() {
  return *getODSResults(0).begin();
}

::mlir::Type ClipByValueOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool ClipByValueOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr ClipByValueOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void ClipByValueOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value t, ::mlir::Value clip_value_min, ::mlir::Value clip_value_max) {
  odsState.addOperands(t);
  odsState.addOperands(clip_value_min);
  odsState.addOperands(clip_value_max);
  odsState.addTypes(output);
}

void ClipByValueOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value t, ::mlir::Value clip_value_min, ::mlir::Value clip_value_max) {
  odsState.addOperands(t);
  odsState.addOperands(clip_value_min);
  odsState.addOperands(clip_value_max);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void ClipByValueOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 3u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult ClipByValueOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void ClipByValueOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::ClipByValueOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::CloseSummaryWriterOp definitions
//===----------------------------------------------------------------------===//

CloseSummaryWriterOpAdaptor::CloseSummaryWriterOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

CloseSummaryWriterOpAdaptor::CloseSummaryWriterOpAdaptor(CloseSummaryWriterOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange CloseSummaryWriterOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> CloseSummaryWriterOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange CloseSummaryWriterOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value CloseSummaryWriterOpAdaptor::writer() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr CloseSummaryWriterOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult CloseSummaryWriterOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> CloseSummaryWriterOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range CloseSummaryWriterOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value CloseSummaryWriterOp::writer() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange CloseSummaryWriterOp::writerMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> CloseSummaryWriterOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range CloseSummaryWriterOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

void CloseSummaryWriterOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value writer) {
  odsState.addOperands(writer);
}

void CloseSummaryWriterOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value writer) {
  odsState.addOperands(writer);
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void CloseSummaryWriterOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 0u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult CloseSummaryWriterOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void CloseSummaryWriterOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  for (::mlir::Value value : getODSOperands(0))
    effects.emplace_back(::mlir::MemoryEffects::Free::get(), value, ::mlir::TF::ResourceEffects::Summary::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::CloseSummaryWriterOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::CollectiveBcastRecvOp definitions
//===----------------------------------------------------------------------===//

CollectiveBcastRecvOpAdaptor::CollectiveBcastRecvOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

CollectiveBcastRecvOpAdaptor::CollectiveBcastRecvOpAdaptor(CollectiveBcastRecvOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange CollectiveBcastRecvOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> CollectiveBcastRecvOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange CollectiveBcastRecvOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::DictionaryAttr CollectiveBcastRecvOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::IntegerAttr CollectiveBcastRecvOpAdaptor::group_size() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("group_size").cast<::mlir::IntegerAttr>();
  return attr;
}

::mlir::IntegerAttr CollectiveBcastRecvOpAdaptor::group_key() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("group_key").cast<::mlir::IntegerAttr>();
  return attr;
}

::mlir::IntegerAttr CollectiveBcastRecvOpAdaptor::instance_key() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("instance_key").cast<::mlir::IntegerAttr>();
  return attr;
}

::mlir::Attribute CollectiveBcastRecvOpAdaptor::shape() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::Attribute attr = odsAttrs.get("shape").cast<::mlir::Attribute>();
  return attr;
}

::mlir::StringAttr CollectiveBcastRecvOpAdaptor::communication_hint() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("communication_hint").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("auto");
  return attr;
}

::mlir::FloatAttr CollectiveBcastRecvOpAdaptor::timeout_seconds() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::FloatAttr attr = odsAttrs.get("timeout_seconds").dyn_cast_or_null<::mlir::FloatAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getFloatAttr(::mlir::Builder(odsAttrs.getContext()).getF32Type(), 0.0f);
  return attr;
}

::mlir::LogicalResult CollectiveBcastRecvOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_group_size = odsAttrs.get("group_size");
    if (!tblgen_group_size)
      return emitError(loc, "'tf.CollectiveBcastRecv' op ""requires attribute 'group_size'");

    if (tblgen_group_size && !(((tblgen_group_size.isa<::mlir::IntegerAttr>())) && ((tblgen_group_size.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.CollectiveBcastRecv' op ""attribute 'group_size' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_group_key = odsAttrs.get("group_key");
    if (!tblgen_group_key)
      return emitError(loc, "'tf.CollectiveBcastRecv' op ""requires attribute 'group_key'");

    if (tblgen_group_key && !(((tblgen_group_key.isa<::mlir::IntegerAttr>())) && ((tblgen_group_key.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.CollectiveBcastRecv' op ""attribute 'group_key' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_instance_key = odsAttrs.get("instance_key");
    if (!tblgen_instance_key)
      return emitError(loc, "'tf.CollectiveBcastRecv' op ""requires attribute 'instance_key'");

    if (tblgen_instance_key && !(((tblgen_instance_key.isa<::mlir::IntegerAttr>())) && ((tblgen_instance_key.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.CollectiveBcastRecv' op ""attribute 'instance_key' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_shape = odsAttrs.get("shape");
    if (!tblgen_shape)
      return emitError(loc, "'tf.CollectiveBcastRecv' op ""requires attribute 'shape'");

    if (tblgen_shape && !((tblgen_shape.isa<mlir::TF::ShapeAttr>())))
      return emitError(loc, "'tf.CollectiveBcastRecv' op ""attribute 'shape' failed to satisfy constraint: TensorFlow shape attribute");
  }
  {
    auto tblgen_communication_hint = odsAttrs.get("communication_hint");
    if (tblgen_communication_hint && !((tblgen_communication_hint.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.CollectiveBcastRecv' op ""attribute 'communication_hint' failed to satisfy constraint: string attribute");
  }
  {
    auto tblgen_timeout_seconds = odsAttrs.get("timeout_seconds");
    if (tblgen_timeout_seconds && !(((tblgen_timeout_seconds.isa<::mlir::FloatAttr>())) && ((tblgen_timeout_seconds.cast<::mlir::FloatAttr>().getType().isF32()))))
      return emitError(loc, "'tf.CollectiveBcastRecv' op ""attribute 'timeout_seconds' failed to satisfy constraint: 32-bit float attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> CollectiveBcastRecvOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range CollectiveBcastRecvOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

std::pair<unsigned, unsigned> CollectiveBcastRecvOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range CollectiveBcastRecvOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value CollectiveBcastRecvOp::data() {
  return *getODSResults(0).begin();
}

::mlir::IntegerAttr CollectiveBcastRecvOp::group_sizeAttr() {
  return (*this)->getAttr(group_sizeAttrName()).cast<::mlir::IntegerAttr>();
}

uint64_t CollectiveBcastRecvOp::group_size() {
  auto attr = group_sizeAttr();
  return attr.getValue().getZExtValue();
}

::mlir::IntegerAttr CollectiveBcastRecvOp::group_keyAttr() {
  return (*this)->getAttr(group_keyAttrName()).cast<::mlir::IntegerAttr>();
}

uint64_t CollectiveBcastRecvOp::group_key() {
  auto attr = group_keyAttr();
  return attr.getValue().getZExtValue();
}

::mlir::IntegerAttr CollectiveBcastRecvOp::instance_keyAttr() {
  return (*this)->getAttr(instance_keyAttrName()).cast<::mlir::IntegerAttr>();
}

uint64_t CollectiveBcastRecvOp::instance_key() {
  auto attr = instance_keyAttr();
  return attr.getValue().getZExtValue();
}

::mlir::Attribute CollectiveBcastRecvOp::shapeAttr() {
  return (*this)->getAttr(shapeAttrName()).cast<::mlir::Attribute>();
}

llvm::Optional<llvm::ArrayRef<int64_t>> CollectiveBcastRecvOp::shape() {
  auto attr = shapeAttr();
  return attr.cast<mlir::TF::ShapeAttr>().getValue();
}

::mlir::StringAttr CollectiveBcastRecvOp::communication_hintAttr() {
  return (*this)->getAttr(communication_hintAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef CollectiveBcastRecvOp::communication_hint() {
  auto attr = communication_hintAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("auto").getValue();
  return attr.getValue();
}

::mlir::FloatAttr CollectiveBcastRecvOp::timeout_secondsAttr() {
  return (*this)->getAttr(timeout_secondsAttrName()).dyn_cast_or_null<::mlir::FloatAttr>();
}

::llvm::APFloat CollectiveBcastRecvOp::timeout_seconds() {
  auto attr = timeout_secondsAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getFloatAttr(::mlir::Builder((*this)->getContext()).getF32Type(), 0.0f).getValue();
  return attr.getValue();
}

::mlir::Type CollectiveBcastRecvOp::T() {
  return mlir::getElementTypeOrSelf(*getODSResults(0).begin());
}

bool CollectiveBcastRecvOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr CollectiveBcastRecvOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void CollectiveBcastRecvOp::group_sizeAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(group_sizeAttrName(), attr);
}

void CollectiveBcastRecvOp::group_keyAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(group_keyAttrName(), attr);
}

void CollectiveBcastRecvOp::instance_keyAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(instance_keyAttrName(), attr);
}

void CollectiveBcastRecvOp::shapeAttr(::mlir::Attribute attr) {
  (*this)->setAttr(shapeAttrName(), attr);
}

void CollectiveBcastRecvOp::communication_hintAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(communication_hintAttrName(), attr);
}

void CollectiveBcastRecvOp::timeout_secondsAttr(::mlir::FloatAttr attr) {
  (*this)->setAttr(timeout_secondsAttrName(), attr);
}

void CollectiveBcastRecvOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type data, ::mlir::IntegerAttr group_size, ::mlir::IntegerAttr group_key, ::mlir::IntegerAttr instance_key, ::mlir::Attribute shape, ::mlir::StringAttr communication_hint, ::mlir::FloatAttr timeout_seconds) {
  odsState.addAttribute(group_sizeAttrName(odsState.name), group_size);
  odsState.addAttribute(group_keyAttrName(odsState.name), group_key);
  odsState.addAttribute(instance_keyAttrName(odsState.name), instance_key);
  odsState.addAttribute(shapeAttrName(odsState.name), shape);
  odsState.addAttribute(communication_hintAttrName(odsState.name), communication_hint);
  odsState.addAttribute(timeout_secondsAttrName(odsState.name), timeout_seconds);
  odsState.addTypes(data);
}

void CollectiveBcastRecvOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::IntegerAttr group_size, ::mlir::IntegerAttr group_key, ::mlir::IntegerAttr instance_key, ::mlir::Attribute shape, ::mlir::StringAttr communication_hint, ::mlir::FloatAttr timeout_seconds) {
  odsState.addAttribute(group_sizeAttrName(odsState.name), group_size);
  odsState.addAttribute(group_keyAttrName(odsState.name), group_key);
  odsState.addAttribute(instance_keyAttrName(odsState.name), instance_key);
  odsState.addAttribute(shapeAttrName(odsState.name), shape);
  odsState.addAttribute(communication_hintAttrName(odsState.name), communication_hint);
  odsState.addAttribute(timeout_secondsAttrName(odsState.name), timeout_seconds);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void CollectiveBcastRecvOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type data, uint64_t group_size, uint64_t group_key, uint64_t instance_key, llvm::Optional<llvm::ArrayRef<int64_t>> shape, ::llvm::StringRef communication_hint, ::llvm::APFloat timeout_seconds) {
  odsState.addAttribute(group_sizeAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), group_size));
  odsState.addAttribute(group_keyAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), group_key));
  odsState.addAttribute(instance_keyAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), instance_key));
  odsState.addAttribute(shapeAttrName(odsState.name), mlir::TF::ShapeAttr::get(odsBuilder.getContext(), shape));
  odsState.addAttribute(communication_hintAttrName(odsState.name), odsBuilder.getStringAttr(communication_hint));
  odsState.addAttribute(timeout_secondsAttrName(odsState.name), odsBuilder.getFloatAttr(odsBuilder.getF32Type(), timeout_seconds));
  odsState.addTypes(data);
}

void CollectiveBcastRecvOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, uint64_t group_size, uint64_t group_key, uint64_t instance_key, llvm::Optional<llvm::ArrayRef<int64_t>> shape, ::llvm::StringRef communication_hint, ::llvm::APFloat timeout_seconds) {
  odsState.addAttribute(group_sizeAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), group_size));
  odsState.addAttribute(group_keyAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), group_key));
  odsState.addAttribute(instance_keyAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), instance_key));
  odsState.addAttribute(shapeAttrName(odsState.name), mlir::TF::ShapeAttr::get(odsBuilder.getContext(), shape));
  odsState.addAttribute(communication_hintAttrName(odsState.name), odsBuilder.getStringAttr(communication_hint));
  odsState.addAttribute(timeout_secondsAttrName(odsState.name), odsBuilder.getFloatAttr(odsBuilder.getF32Type(), timeout_seconds));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void CollectiveBcastRecvOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 0u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult CollectiveBcastRecvOp::verify() {
  {
    auto tblgen_group_size = (*this)->getAttr(group_sizeAttrName());
    if (!tblgen_group_size)
      return emitOpError("requires attribute 'group_size'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_group_size, "group_size")))
      return ::mlir::failure();
  }
  {
    auto tblgen_group_key = (*this)->getAttr(group_keyAttrName());
    if (!tblgen_group_key)
      return emitOpError("requires attribute 'group_key'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_group_key, "group_key")))
      return ::mlir::failure();
  }
  {
    auto tblgen_instance_key = (*this)->getAttr(instance_keyAttrName());
    if (!tblgen_instance_key)
      return emitOpError("requires attribute 'instance_key'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_instance_key, "instance_key")))
      return ::mlir::failure();
  }
  {
    auto tblgen_shape = (*this)->getAttr(shapeAttrName());
    if (!tblgen_shape)
      return emitOpError("requires attribute 'shape'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops17(*this, tblgen_shape, "shape")))
      return ::mlir::failure();
  }
  {
    auto tblgen_communication_hint = (*this)->getAttr(communication_hintAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_communication_hint, "communication_hint")))
      return ::mlir::failure();
  }
  {
    auto tblgen_timeout_seconds = (*this)->getAttr(timeout_secondsAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops5(*this, tblgen_timeout_seconds, "timeout_seconds")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops30(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::CollectiveBcastRecvOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::CollectiveBcastSendOp definitions
//===----------------------------------------------------------------------===//

CollectiveBcastSendOpAdaptor::CollectiveBcastSendOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

CollectiveBcastSendOpAdaptor::CollectiveBcastSendOpAdaptor(CollectiveBcastSendOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange CollectiveBcastSendOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> CollectiveBcastSendOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange CollectiveBcastSendOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value CollectiveBcastSendOpAdaptor::input() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr CollectiveBcastSendOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::IntegerAttr CollectiveBcastSendOpAdaptor::group_size() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("group_size").cast<::mlir::IntegerAttr>();
  return attr;
}

::mlir::IntegerAttr CollectiveBcastSendOpAdaptor::group_key() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("group_key").cast<::mlir::IntegerAttr>();
  return attr;
}

::mlir::IntegerAttr CollectiveBcastSendOpAdaptor::instance_key() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("instance_key").cast<::mlir::IntegerAttr>();
  return attr;
}

::mlir::Attribute CollectiveBcastSendOpAdaptor::shape() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::Attribute attr = odsAttrs.get("shape").cast<::mlir::Attribute>();
  return attr;
}

::mlir::StringAttr CollectiveBcastSendOpAdaptor::communication_hint() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("communication_hint").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("auto");
  return attr;
}

::mlir::FloatAttr CollectiveBcastSendOpAdaptor::timeout_seconds() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::FloatAttr attr = odsAttrs.get("timeout_seconds").dyn_cast_or_null<::mlir::FloatAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getFloatAttr(::mlir::Builder(odsAttrs.getContext()).getF32Type(), 0.0f);
  return attr;
}

::mlir::LogicalResult CollectiveBcastSendOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_group_size = odsAttrs.get("group_size");
    if (!tblgen_group_size)
      return emitError(loc, "'tf.CollectiveBcastSend' op ""requires attribute 'group_size'");

    if (tblgen_group_size && !(((tblgen_group_size.isa<::mlir::IntegerAttr>())) && ((tblgen_group_size.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.CollectiveBcastSend' op ""attribute 'group_size' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_group_key = odsAttrs.get("group_key");
    if (!tblgen_group_key)
      return emitError(loc, "'tf.CollectiveBcastSend' op ""requires attribute 'group_key'");

    if (tblgen_group_key && !(((tblgen_group_key.isa<::mlir::IntegerAttr>())) && ((tblgen_group_key.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.CollectiveBcastSend' op ""attribute 'group_key' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_instance_key = odsAttrs.get("instance_key");
    if (!tblgen_instance_key)
      return emitError(loc, "'tf.CollectiveBcastSend' op ""requires attribute 'instance_key'");

    if (tblgen_instance_key && !(((tblgen_instance_key.isa<::mlir::IntegerAttr>())) && ((tblgen_instance_key.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.CollectiveBcastSend' op ""attribute 'instance_key' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_shape = odsAttrs.get("shape");
    if (!tblgen_shape)
      return emitError(loc, "'tf.CollectiveBcastSend' op ""requires attribute 'shape'");

    if (tblgen_shape && !((tblgen_shape.isa<mlir::TF::ShapeAttr>())))
      return emitError(loc, "'tf.CollectiveBcastSend' op ""attribute 'shape' failed to satisfy constraint: TensorFlow shape attribute");
  }
  {
    auto tblgen_communication_hint = odsAttrs.get("communication_hint");
    if (tblgen_communication_hint && !((tblgen_communication_hint.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.CollectiveBcastSend' op ""attribute 'communication_hint' failed to satisfy constraint: string attribute");
  }
  {
    auto tblgen_timeout_seconds = odsAttrs.get("timeout_seconds");
    if (tblgen_timeout_seconds && !(((tblgen_timeout_seconds.isa<::mlir::FloatAttr>())) && ((tblgen_timeout_seconds.cast<::mlir::FloatAttr>().getType().isF32()))))
      return emitError(loc, "'tf.CollectiveBcastSend' op ""attribute 'timeout_seconds' failed to satisfy constraint: 32-bit float attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> CollectiveBcastSendOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range CollectiveBcastSendOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value CollectiveBcastSendOp::input() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange CollectiveBcastSendOp::inputMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> CollectiveBcastSendOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range CollectiveBcastSendOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value CollectiveBcastSendOp::data() {
  return *getODSResults(0).begin();
}

::mlir::IntegerAttr CollectiveBcastSendOp::group_sizeAttr() {
  return (*this)->getAttr(group_sizeAttrName()).cast<::mlir::IntegerAttr>();
}

uint64_t CollectiveBcastSendOp::group_size() {
  auto attr = group_sizeAttr();
  return attr.getValue().getZExtValue();
}

::mlir::IntegerAttr CollectiveBcastSendOp::group_keyAttr() {
  return (*this)->getAttr(group_keyAttrName()).cast<::mlir::IntegerAttr>();
}

uint64_t CollectiveBcastSendOp::group_key() {
  auto attr = group_keyAttr();
  return attr.getValue().getZExtValue();
}

::mlir::IntegerAttr CollectiveBcastSendOp::instance_keyAttr() {
  return (*this)->getAttr(instance_keyAttrName()).cast<::mlir::IntegerAttr>();
}

uint64_t CollectiveBcastSendOp::instance_key() {
  auto attr = instance_keyAttr();
  return attr.getValue().getZExtValue();
}

::mlir::Attribute CollectiveBcastSendOp::shapeAttr() {
  return (*this)->getAttr(shapeAttrName()).cast<::mlir::Attribute>();
}

llvm::Optional<llvm::ArrayRef<int64_t>> CollectiveBcastSendOp::shape() {
  auto attr = shapeAttr();
  return attr.cast<mlir::TF::ShapeAttr>().getValue();
}

::mlir::StringAttr CollectiveBcastSendOp::communication_hintAttr() {
  return (*this)->getAttr(communication_hintAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef CollectiveBcastSendOp::communication_hint() {
  auto attr = communication_hintAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("auto").getValue();
  return attr.getValue();
}

::mlir::FloatAttr CollectiveBcastSendOp::timeout_secondsAttr() {
  return (*this)->getAttr(timeout_secondsAttrName()).dyn_cast_or_null<::mlir::FloatAttr>();
}

::llvm::APFloat CollectiveBcastSendOp::timeout_seconds() {
  auto attr = timeout_secondsAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getFloatAttr(::mlir::Builder((*this)->getContext()).getF32Type(), 0.0f).getValue();
  return attr.getValue();
}

::mlir::Type CollectiveBcastSendOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool CollectiveBcastSendOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr CollectiveBcastSendOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void CollectiveBcastSendOp::group_sizeAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(group_sizeAttrName(), attr);
}

void CollectiveBcastSendOp::group_keyAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(group_keyAttrName(), attr);
}

void CollectiveBcastSendOp::instance_keyAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(instance_keyAttrName(), attr);
}

void CollectiveBcastSendOp::shapeAttr(::mlir::Attribute attr) {
  (*this)->setAttr(shapeAttrName(), attr);
}

void CollectiveBcastSendOp::communication_hintAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(communication_hintAttrName(), attr);
}

void CollectiveBcastSendOp::timeout_secondsAttr(::mlir::FloatAttr attr) {
  (*this)->setAttr(timeout_secondsAttrName(), attr);
}

void CollectiveBcastSendOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type data, ::mlir::Value input, ::mlir::IntegerAttr group_size, ::mlir::IntegerAttr group_key, ::mlir::IntegerAttr instance_key, ::mlir::Attribute shape, ::mlir::StringAttr communication_hint, ::mlir::FloatAttr timeout_seconds) {
  odsState.addOperands(input);
  odsState.addAttribute(group_sizeAttrName(odsState.name), group_size);
  odsState.addAttribute(group_keyAttrName(odsState.name), group_key);
  odsState.addAttribute(instance_keyAttrName(odsState.name), instance_key);
  odsState.addAttribute(shapeAttrName(odsState.name), shape);
  odsState.addAttribute(communication_hintAttrName(odsState.name), communication_hint);
  odsState.addAttribute(timeout_secondsAttrName(odsState.name), timeout_seconds);
  odsState.addTypes(data);
}

void CollectiveBcastSendOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::IntegerAttr group_size, ::mlir::IntegerAttr group_key, ::mlir::IntegerAttr instance_key, ::mlir::Attribute shape, ::mlir::StringAttr communication_hint, ::mlir::FloatAttr timeout_seconds) {
  odsState.addOperands(input);
  odsState.addAttribute(group_sizeAttrName(odsState.name), group_size);
  odsState.addAttribute(group_keyAttrName(odsState.name), group_key);
  odsState.addAttribute(instance_keyAttrName(odsState.name), instance_key);
  odsState.addAttribute(shapeAttrName(odsState.name), shape);
  odsState.addAttribute(communication_hintAttrName(odsState.name), communication_hint);
  odsState.addAttribute(timeout_secondsAttrName(odsState.name), timeout_seconds);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void CollectiveBcastSendOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type data, ::mlir::Value input, uint64_t group_size, uint64_t group_key, uint64_t instance_key, llvm::Optional<llvm::ArrayRef<int64_t>> shape, ::llvm::StringRef communication_hint, ::llvm::APFloat timeout_seconds) {
  odsState.addOperands(input);
  odsState.addAttribute(group_sizeAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), group_size));
  odsState.addAttribute(group_keyAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), group_key));
  odsState.addAttribute(instance_keyAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), instance_key));
  odsState.addAttribute(shapeAttrName(odsState.name), mlir::TF::ShapeAttr::get(odsBuilder.getContext(), shape));
  odsState.addAttribute(communication_hintAttrName(odsState.name), odsBuilder.getStringAttr(communication_hint));
  odsState.addAttribute(timeout_secondsAttrName(odsState.name), odsBuilder.getFloatAttr(odsBuilder.getF32Type(), timeout_seconds));
  odsState.addTypes(data);
}

void CollectiveBcastSendOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, uint64_t group_size, uint64_t group_key, uint64_t instance_key, llvm::Optional<llvm::ArrayRef<int64_t>> shape, ::llvm::StringRef communication_hint, ::llvm::APFloat timeout_seconds) {
  odsState.addOperands(input);
  odsState.addAttribute(group_sizeAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), group_size));
  odsState.addAttribute(group_keyAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), group_key));
  odsState.addAttribute(instance_keyAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), instance_key));
  odsState.addAttribute(shapeAttrName(odsState.name), mlir::TF::ShapeAttr::get(odsBuilder.getContext(), shape));
  odsState.addAttribute(communication_hintAttrName(odsState.name), odsBuilder.getStringAttr(communication_hint));
  odsState.addAttribute(timeout_secondsAttrName(odsState.name), odsBuilder.getFloatAttr(odsBuilder.getF32Type(), timeout_seconds));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void CollectiveBcastSendOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult CollectiveBcastSendOp::verify() {
  {
    auto tblgen_group_size = (*this)->getAttr(group_sizeAttrName());
    if (!tblgen_group_size)
      return emitOpError("requires attribute 'group_size'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_group_size, "group_size")))
      return ::mlir::failure();
  }
  {
    auto tblgen_group_key = (*this)->getAttr(group_keyAttrName());
    if (!tblgen_group_key)
      return emitOpError("requires attribute 'group_key'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_group_key, "group_key")))
      return ::mlir::failure();
  }
  {
    auto tblgen_instance_key = (*this)->getAttr(instance_keyAttrName());
    if (!tblgen_instance_key)
      return emitOpError("requires attribute 'instance_key'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_instance_key, "instance_key")))
      return ::mlir::failure();
  }
  {
    auto tblgen_shape = (*this)->getAttr(shapeAttrName());
    if (!tblgen_shape)
      return emitOpError("requires attribute 'shape'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops17(*this, tblgen_shape, "shape")))
      return ::mlir::failure();
  }
  {
    auto tblgen_communication_hint = (*this)->getAttr(communication_hintAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_communication_hint, "communication_hint")))
      return ::mlir::failure();
  }
  {
    auto tblgen_timeout_seconds = (*this)->getAttr(timeout_secondsAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops5(*this, tblgen_timeout_seconds, "timeout_seconds")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops30(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops30(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::CollectiveBcastSendOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::CollectiveGatherOp definitions
//===----------------------------------------------------------------------===//

CollectiveGatherOpAdaptor::CollectiveGatherOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

CollectiveGatherOpAdaptor::CollectiveGatherOpAdaptor(CollectiveGatherOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange CollectiveGatherOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> CollectiveGatherOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange CollectiveGatherOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value CollectiveGatherOpAdaptor::input() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr CollectiveGatherOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::IntegerAttr CollectiveGatherOpAdaptor::group_size() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("group_size").cast<::mlir::IntegerAttr>();
  return attr;
}

::mlir::IntegerAttr CollectiveGatherOpAdaptor::group_key() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("group_key").cast<::mlir::IntegerAttr>();
  return attr;
}

::mlir::IntegerAttr CollectiveGatherOpAdaptor::instance_key() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("instance_key").cast<::mlir::IntegerAttr>();
  return attr;
}

::mlir::Attribute CollectiveGatherOpAdaptor::shape() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::Attribute attr = odsAttrs.get("shape").cast<::mlir::Attribute>();
  return attr;
}

::mlir::StringAttr CollectiveGatherOpAdaptor::communication_hint() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("communication_hint").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("auto");
  return attr;
}

::mlir::FloatAttr CollectiveGatherOpAdaptor::timeout_seconds() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::FloatAttr attr = odsAttrs.get("timeout_seconds").dyn_cast_or_null<::mlir::FloatAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getFloatAttr(::mlir::Builder(odsAttrs.getContext()).getF32Type(), 0.0f);
  return attr;
}

::mlir::LogicalResult CollectiveGatherOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_group_size = odsAttrs.get("group_size");
    if (!tblgen_group_size)
      return emitError(loc, "'tf.CollectiveGather' op ""requires attribute 'group_size'");

    if (tblgen_group_size && !(((tblgen_group_size.isa<::mlir::IntegerAttr>())) && ((tblgen_group_size.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.CollectiveGather' op ""attribute 'group_size' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_group_key = odsAttrs.get("group_key");
    if (!tblgen_group_key)
      return emitError(loc, "'tf.CollectiveGather' op ""requires attribute 'group_key'");

    if (tblgen_group_key && !(((tblgen_group_key.isa<::mlir::IntegerAttr>())) && ((tblgen_group_key.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.CollectiveGather' op ""attribute 'group_key' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_instance_key = odsAttrs.get("instance_key");
    if (!tblgen_instance_key)
      return emitError(loc, "'tf.CollectiveGather' op ""requires attribute 'instance_key'");

    if (tblgen_instance_key && !(((tblgen_instance_key.isa<::mlir::IntegerAttr>())) && ((tblgen_instance_key.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.CollectiveGather' op ""attribute 'instance_key' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_shape = odsAttrs.get("shape");
    if (!tblgen_shape)
      return emitError(loc, "'tf.CollectiveGather' op ""requires attribute 'shape'");

    if (tblgen_shape && !((tblgen_shape.isa<mlir::TF::ShapeAttr>())))
      return emitError(loc, "'tf.CollectiveGather' op ""attribute 'shape' failed to satisfy constraint: TensorFlow shape attribute");
  }
  {
    auto tblgen_communication_hint = odsAttrs.get("communication_hint");
    if (tblgen_communication_hint && !((tblgen_communication_hint.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.CollectiveGather' op ""attribute 'communication_hint' failed to satisfy constraint: string attribute");
  }
  {
    auto tblgen_timeout_seconds = odsAttrs.get("timeout_seconds");
    if (tblgen_timeout_seconds && !(((tblgen_timeout_seconds.isa<::mlir::FloatAttr>())) && ((tblgen_timeout_seconds.cast<::mlir::FloatAttr>().getType().isF32()))))
      return emitError(loc, "'tf.CollectiveGather' op ""attribute 'timeout_seconds' failed to satisfy constraint: 32-bit float attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> CollectiveGatherOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range CollectiveGatherOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value CollectiveGatherOp::input() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange CollectiveGatherOp::inputMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> CollectiveGatherOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range CollectiveGatherOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value CollectiveGatherOp::data() {
  return *getODSResults(0).begin();
}

::mlir::IntegerAttr CollectiveGatherOp::group_sizeAttr() {
  return (*this)->getAttr(group_sizeAttrName()).cast<::mlir::IntegerAttr>();
}

uint64_t CollectiveGatherOp::group_size() {
  auto attr = group_sizeAttr();
  return attr.getValue().getZExtValue();
}

::mlir::IntegerAttr CollectiveGatherOp::group_keyAttr() {
  return (*this)->getAttr(group_keyAttrName()).cast<::mlir::IntegerAttr>();
}

uint64_t CollectiveGatherOp::group_key() {
  auto attr = group_keyAttr();
  return attr.getValue().getZExtValue();
}

::mlir::IntegerAttr CollectiveGatherOp::instance_keyAttr() {
  return (*this)->getAttr(instance_keyAttrName()).cast<::mlir::IntegerAttr>();
}

uint64_t CollectiveGatherOp::instance_key() {
  auto attr = instance_keyAttr();
  return attr.getValue().getZExtValue();
}

::mlir::Attribute CollectiveGatherOp::shapeAttr() {
  return (*this)->getAttr(shapeAttrName()).cast<::mlir::Attribute>();
}

llvm::Optional<llvm::ArrayRef<int64_t>> CollectiveGatherOp::shape() {
  auto attr = shapeAttr();
  return attr.cast<mlir::TF::ShapeAttr>().getValue();
}

::mlir::StringAttr CollectiveGatherOp::communication_hintAttr() {
  return (*this)->getAttr(communication_hintAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef CollectiveGatherOp::communication_hint() {
  auto attr = communication_hintAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("auto").getValue();
  return attr.getValue();
}

::mlir::FloatAttr CollectiveGatherOp::timeout_secondsAttr() {
  return (*this)->getAttr(timeout_secondsAttrName()).dyn_cast_or_null<::mlir::FloatAttr>();
}

::llvm::APFloat CollectiveGatherOp::timeout_seconds() {
  auto attr = timeout_secondsAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getFloatAttr(::mlir::Builder((*this)->getContext()).getF32Type(), 0.0f).getValue();
  return attr.getValue();
}

::mlir::Type CollectiveGatherOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool CollectiveGatherOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr CollectiveGatherOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void CollectiveGatherOp::group_sizeAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(group_sizeAttrName(), attr);
}

void CollectiveGatherOp::group_keyAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(group_keyAttrName(), attr);
}

void CollectiveGatherOp::instance_keyAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(instance_keyAttrName(), attr);
}

void CollectiveGatherOp::shapeAttr(::mlir::Attribute attr) {
  (*this)->setAttr(shapeAttrName(), attr);
}

void CollectiveGatherOp::communication_hintAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(communication_hintAttrName(), attr);
}

void CollectiveGatherOp::timeout_secondsAttr(::mlir::FloatAttr attr) {
  (*this)->setAttr(timeout_secondsAttrName(), attr);
}

void CollectiveGatherOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type data, ::mlir::Value input, ::mlir::IntegerAttr group_size, ::mlir::IntegerAttr group_key, ::mlir::IntegerAttr instance_key, ::mlir::Attribute shape, ::mlir::StringAttr communication_hint, ::mlir::FloatAttr timeout_seconds) {
  odsState.addOperands(input);
  odsState.addAttribute(group_sizeAttrName(odsState.name), group_size);
  odsState.addAttribute(group_keyAttrName(odsState.name), group_key);
  odsState.addAttribute(instance_keyAttrName(odsState.name), instance_key);
  odsState.addAttribute(shapeAttrName(odsState.name), shape);
  odsState.addAttribute(communication_hintAttrName(odsState.name), communication_hint);
  odsState.addAttribute(timeout_secondsAttrName(odsState.name), timeout_seconds);
  odsState.addTypes(data);
}

void CollectiveGatherOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::IntegerAttr group_size, ::mlir::IntegerAttr group_key, ::mlir::IntegerAttr instance_key, ::mlir::Attribute shape, ::mlir::StringAttr communication_hint, ::mlir::FloatAttr timeout_seconds) {
  odsState.addOperands(input);
  odsState.addAttribute(group_sizeAttrName(odsState.name), group_size);
  odsState.addAttribute(group_keyAttrName(odsState.name), group_key);
  odsState.addAttribute(instance_keyAttrName(odsState.name), instance_key);
  odsState.addAttribute(shapeAttrName(odsState.name), shape);
  odsState.addAttribute(communication_hintAttrName(odsState.name), communication_hint);
  odsState.addAttribute(timeout_secondsAttrName(odsState.name), timeout_seconds);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void CollectiveGatherOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type data, ::mlir::Value input, uint64_t group_size, uint64_t group_key, uint64_t instance_key, llvm::Optional<llvm::ArrayRef<int64_t>> shape, ::llvm::StringRef communication_hint, ::llvm::APFloat timeout_seconds) {
  odsState.addOperands(input);
  odsState.addAttribute(group_sizeAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), group_size));
  odsState.addAttribute(group_keyAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), group_key));
  odsState.addAttribute(instance_keyAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), instance_key));
  odsState.addAttribute(shapeAttrName(odsState.name), mlir::TF::ShapeAttr::get(odsBuilder.getContext(), shape));
  odsState.addAttribute(communication_hintAttrName(odsState.name), odsBuilder.getStringAttr(communication_hint));
  odsState.addAttribute(timeout_secondsAttrName(odsState.name), odsBuilder.getFloatAttr(odsBuilder.getF32Type(), timeout_seconds));
  odsState.addTypes(data);
}

void CollectiveGatherOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, uint64_t group_size, uint64_t group_key, uint64_t instance_key, llvm::Optional<llvm::ArrayRef<int64_t>> shape, ::llvm::StringRef communication_hint, ::llvm::APFloat timeout_seconds) {
  odsState.addOperands(input);
  odsState.addAttribute(group_sizeAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), group_size));
  odsState.addAttribute(group_keyAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), group_key));
  odsState.addAttribute(instance_keyAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), instance_key));
  odsState.addAttribute(shapeAttrName(odsState.name), mlir::TF::ShapeAttr::get(odsBuilder.getContext(), shape));
  odsState.addAttribute(communication_hintAttrName(odsState.name), odsBuilder.getStringAttr(communication_hint));
  odsState.addAttribute(timeout_secondsAttrName(odsState.name), odsBuilder.getFloatAttr(odsBuilder.getF32Type(), timeout_seconds));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void CollectiveGatherOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult CollectiveGatherOp::verify() {
  {
    auto tblgen_group_size = (*this)->getAttr(group_sizeAttrName());
    if (!tblgen_group_size)
      return emitOpError("requires attribute 'group_size'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_group_size, "group_size")))
      return ::mlir::failure();
  }
  {
    auto tblgen_group_key = (*this)->getAttr(group_keyAttrName());
    if (!tblgen_group_key)
      return emitOpError("requires attribute 'group_key'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_group_key, "group_key")))
      return ::mlir::failure();
  }
  {
    auto tblgen_instance_key = (*this)->getAttr(instance_keyAttrName());
    if (!tblgen_instance_key)
      return emitOpError("requires attribute 'instance_key'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_instance_key, "instance_key")))
      return ::mlir::failure();
  }
  {
    auto tblgen_shape = (*this)->getAttr(shapeAttrName());
    if (!tblgen_shape)
      return emitOpError("requires attribute 'shape'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops17(*this, tblgen_shape, "shape")))
      return ::mlir::failure();
  }
  {
    auto tblgen_communication_hint = (*this)->getAttr(communication_hintAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_communication_hint, "communication_hint")))
      return ::mlir::failure();
  }
  {
    auto tblgen_timeout_seconds = (*this)->getAttr(timeout_secondsAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops5(*this, tblgen_timeout_seconds, "timeout_seconds")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops31(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops31(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::CollectiveGatherOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::CollectivePermuteOp definitions
//===----------------------------------------------------------------------===//

CollectivePermuteOpAdaptor::CollectivePermuteOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

CollectivePermuteOpAdaptor::CollectivePermuteOpAdaptor(CollectivePermuteOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange CollectivePermuteOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> CollectivePermuteOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange CollectivePermuteOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value CollectivePermuteOpAdaptor::input() {
  return *getODSOperands(0).begin();
}

::mlir::Value CollectivePermuteOpAdaptor::source_target_pairs() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr CollectivePermuteOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult CollectivePermuteOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> CollectivePermuteOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range CollectivePermuteOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value CollectivePermuteOp::input() {
  return *getODSOperands(0).begin();
}

::mlir::Value CollectivePermuteOp::source_target_pairs() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange CollectivePermuteOp::inputMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange CollectivePermuteOp::source_target_pairsMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> CollectivePermuteOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range CollectivePermuteOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value CollectivePermuteOp::output() {
  return *getODSResults(0).begin();
}

::mlir::Type CollectivePermuteOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool CollectivePermuteOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr CollectivePermuteOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void CollectivePermuteOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input, ::mlir::Value source_target_pairs) {
  odsState.addOperands(input);
  odsState.addOperands(source_target_pairs);
  odsState.addTypes(output);
}

void CollectivePermuteOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::Value source_target_pairs) {
  odsState.addOperands(input);
  odsState.addOperands(source_target_pairs);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void CollectivePermuteOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult CollectivePermuteOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops11(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::CollectivePermuteOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::CollectiveReduceOp definitions
//===----------------------------------------------------------------------===//

CollectiveReduceOpAdaptor::CollectiveReduceOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

CollectiveReduceOpAdaptor::CollectiveReduceOpAdaptor(CollectiveReduceOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange CollectiveReduceOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> CollectiveReduceOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange CollectiveReduceOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value CollectiveReduceOpAdaptor::input() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr CollectiveReduceOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::IntegerAttr CollectiveReduceOpAdaptor::group_size() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("group_size").cast<::mlir::IntegerAttr>();
  return attr;
}

::mlir::IntegerAttr CollectiveReduceOpAdaptor::group_key() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("group_key").cast<::mlir::IntegerAttr>();
  return attr;
}

::mlir::IntegerAttr CollectiveReduceOpAdaptor::instance_key() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("instance_key").cast<::mlir::IntegerAttr>();
  return attr;
}

::mlir::StringAttr CollectiveReduceOpAdaptor::merge_op() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("merge_op").cast<::mlir::StringAttr>();
  return attr;
}

::mlir::StringAttr CollectiveReduceOpAdaptor::final_op() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("final_op").cast<::mlir::StringAttr>();
  return attr;
}

::mlir::ArrayAttr CollectiveReduceOpAdaptor::subdiv_offsets() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("subdiv_offsets").cast<::mlir::ArrayAttr>();
  return attr;
}

::mlir::ArrayAttr CollectiveReduceOpAdaptor::wait_for() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("wait_for").dyn_cast_or_null<::mlir::ArrayAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getI64ArrayAttr({});
  return attr;
}

::mlir::StringAttr CollectiveReduceOpAdaptor::communication_hint() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("communication_hint").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("auto");
  return attr;
}

::mlir::FloatAttr CollectiveReduceOpAdaptor::timeout_seconds() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::FloatAttr attr = odsAttrs.get("timeout_seconds").dyn_cast_or_null<::mlir::FloatAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getFloatAttr(::mlir::Builder(odsAttrs.getContext()).getF32Type(), 0.0f);
  return attr;
}

::mlir::LogicalResult CollectiveReduceOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_group_size = odsAttrs.get("group_size");
    if (!tblgen_group_size)
      return emitError(loc, "'tf.CollectiveReduce' op ""requires attribute 'group_size'");

    if (tblgen_group_size && !(((tblgen_group_size.isa<::mlir::IntegerAttr>())) && ((tblgen_group_size.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.CollectiveReduce' op ""attribute 'group_size' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_group_key = odsAttrs.get("group_key");
    if (!tblgen_group_key)
      return emitError(loc, "'tf.CollectiveReduce' op ""requires attribute 'group_key'");

    if (tblgen_group_key && !(((tblgen_group_key.isa<::mlir::IntegerAttr>())) && ((tblgen_group_key.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.CollectiveReduce' op ""attribute 'group_key' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_instance_key = odsAttrs.get("instance_key");
    if (!tblgen_instance_key)
      return emitError(loc, "'tf.CollectiveReduce' op ""requires attribute 'instance_key'");

    if (tblgen_instance_key && !(((tblgen_instance_key.isa<::mlir::IntegerAttr>())) && ((tblgen_instance_key.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.CollectiveReduce' op ""attribute 'instance_key' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_merge_op = odsAttrs.get("merge_op");
    if (!tblgen_merge_op)
      return emitError(loc, "'tf.CollectiveReduce' op ""requires attribute 'merge_op'");

    if (tblgen_merge_op && !((tblgen_merge_op.cast<StringAttr>().getValue() == "Min" || tblgen_merge_op.cast<StringAttr>().getValue() == "Max" || tblgen_merge_op.cast<StringAttr>().getValue() == "Mul" || tblgen_merge_op.cast<StringAttr>().getValue() == "Add")))
      return emitError(loc, "'tf.CollectiveReduce' op ""attribute 'merge_op' failed to satisfy constraint: string attribute whose value is Min, or Max, or Mul, or Add");
  }
  {
    auto tblgen_final_op = odsAttrs.get("final_op");
    if (!tblgen_final_op)
      return emitError(loc, "'tf.CollectiveReduce' op ""requires attribute 'final_op'");

    if (tblgen_final_op && !((tblgen_final_op.cast<StringAttr>().getValue() == "Id" || tblgen_final_op.cast<StringAttr>().getValue() == "Div")))
      return emitError(loc, "'tf.CollectiveReduce' op ""attribute 'final_op' failed to satisfy constraint: string attribute whose value is Id, or Div");
  }
  {
    auto tblgen_subdiv_offsets = odsAttrs.get("subdiv_offsets");
    if (!tblgen_subdiv_offsets)
      return emitError(loc, "'tf.CollectiveReduce' op ""requires attribute 'subdiv_offsets'");

    if (tblgen_subdiv_offsets && !(((tblgen_subdiv_offsets.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_subdiv_offsets.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return ((attr.isa<::mlir::IntegerAttr>())) && ((attr.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64))); }))))
      return emitError(loc, "'tf.CollectiveReduce' op ""attribute 'subdiv_offsets' failed to satisfy constraint: 64-bit integer array attribute");
  }
  {
    auto tblgen_wait_for = odsAttrs.get("wait_for");
    if (tblgen_wait_for && !(((tblgen_wait_for.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_wait_for.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return ((attr.isa<::mlir::IntegerAttr>())) && ((attr.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64))); }))))
      return emitError(loc, "'tf.CollectiveReduce' op ""attribute 'wait_for' failed to satisfy constraint: 64-bit integer array attribute");
  }
  {
    auto tblgen_communication_hint = odsAttrs.get("communication_hint");
    if (tblgen_communication_hint && !((tblgen_communication_hint.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.CollectiveReduce' op ""attribute 'communication_hint' failed to satisfy constraint: string attribute");
  }
  {
    auto tblgen_timeout_seconds = odsAttrs.get("timeout_seconds");
    if (tblgen_timeout_seconds && !(((tblgen_timeout_seconds.isa<::mlir::FloatAttr>())) && ((tblgen_timeout_seconds.cast<::mlir::FloatAttr>().getType().isF32()))))
      return emitError(loc, "'tf.CollectiveReduce' op ""attribute 'timeout_seconds' failed to satisfy constraint: 32-bit float attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> CollectiveReduceOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range CollectiveReduceOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value CollectiveReduceOp::input() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange CollectiveReduceOp::inputMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> CollectiveReduceOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range CollectiveReduceOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value CollectiveReduceOp::data() {
  return *getODSResults(0).begin();
}

::mlir::IntegerAttr CollectiveReduceOp::group_sizeAttr() {
  return (*this)->getAttr(group_sizeAttrName()).cast<::mlir::IntegerAttr>();
}

uint64_t CollectiveReduceOp::group_size() {
  auto attr = group_sizeAttr();
  return attr.getValue().getZExtValue();
}

::mlir::IntegerAttr CollectiveReduceOp::group_keyAttr() {
  return (*this)->getAttr(group_keyAttrName()).cast<::mlir::IntegerAttr>();
}

uint64_t CollectiveReduceOp::group_key() {
  auto attr = group_keyAttr();
  return attr.getValue().getZExtValue();
}

::mlir::IntegerAttr CollectiveReduceOp::instance_keyAttr() {
  return (*this)->getAttr(instance_keyAttrName()).cast<::mlir::IntegerAttr>();
}

uint64_t CollectiveReduceOp::instance_key() {
  auto attr = instance_keyAttr();
  return attr.getValue().getZExtValue();
}

::mlir::StringAttr CollectiveReduceOp::merge_opAttr() {
  return (*this)->getAttr(merge_opAttrName()).cast<::mlir::StringAttr>();
}

::llvm::StringRef CollectiveReduceOp::merge_op() {
  auto attr = merge_opAttr();
  return attr.getValue();
}

::mlir::StringAttr CollectiveReduceOp::final_opAttr() {
  return (*this)->getAttr(final_opAttrName()).cast<::mlir::StringAttr>();
}

::llvm::StringRef CollectiveReduceOp::final_op() {
  auto attr = final_opAttr();
  return attr.getValue();
}

::mlir::ArrayAttr CollectiveReduceOp::subdiv_offsetsAttr() {
  return (*this)->getAttr(subdiv_offsetsAttrName()).cast<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr CollectiveReduceOp::subdiv_offsets() {
  auto attr = subdiv_offsetsAttr();
  return attr;
}

::mlir::ArrayAttr CollectiveReduceOp::wait_forAttr() {
  return (*this)->getAttr(wait_forAttrName()).dyn_cast_or_null<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr CollectiveReduceOp::wait_for() {
  auto attr = wait_forAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getI64ArrayAttr({});
  return attr;
}

::mlir::StringAttr CollectiveReduceOp::communication_hintAttr() {
  return (*this)->getAttr(communication_hintAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef CollectiveReduceOp::communication_hint() {
  auto attr = communication_hintAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("auto").getValue();
  return attr.getValue();
}

::mlir::FloatAttr CollectiveReduceOp::timeout_secondsAttr() {
  return (*this)->getAttr(timeout_secondsAttrName()).dyn_cast_or_null<::mlir::FloatAttr>();
}

::llvm::APFloat CollectiveReduceOp::timeout_seconds() {
  auto attr = timeout_secondsAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getFloatAttr(::mlir::Builder((*this)->getContext()).getF32Type(), 0.0f).getValue();
  return attr.getValue();
}

::mlir::Type CollectiveReduceOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool CollectiveReduceOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr CollectiveReduceOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void CollectiveReduceOp::group_sizeAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(group_sizeAttrName(), attr);
}

void CollectiveReduceOp::group_keyAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(group_keyAttrName(), attr);
}

void CollectiveReduceOp::instance_keyAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(instance_keyAttrName(), attr);
}

void CollectiveReduceOp::merge_opAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(merge_opAttrName(), attr);
}

void CollectiveReduceOp::final_opAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(final_opAttrName(), attr);
}

void CollectiveReduceOp::subdiv_offsetsAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(subdiv_offsetsAttrName(), attr);
}

void CollectiveReduceOp::wait_forAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(wait_forAttrName(), attr);
}

void CollectiveReduceOp::communication_hintAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(communication_hintAttrName(), attr);
}

void CollectiveReduceOp::timeout_secondsAttr(::mlir::FloatAttr attr) {
  (*this)->setAttr(timeout_secondsAttrName(), attr);
}

void CollectiveReduceOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type data, ::mlir::Value input, ::mlir::IntegerAttr group_size, ::mlir::IntegerAttr group_key, ::mlir::IntegerAttr instance_key, ::mlir::StringAttr merge_op, ::mlir::StringAttr final_op, ::mlir::ArrayAttr subdiv_offsets, ::mlir::ArrayAttr wait_for, ::mlir::StringAttr communication_hint, ::mlir::FloatAttr timeout_seconds) {
  odsState.addOperands(input);
  odsState.addAttribute(group_sizeAttrName(odsState.name), group_size);
  odsState.addAttribute(group_keyAttrName(odsState.name), group_key);
  odsState.addAttribute(instance_keyAttrName(odsState.name), instance_key);
  odsState.addAttribute(merge_opAttrName(odsState.name), merge_op);
  odsState.addAttribute(final_opAttrName(odsState.name), final_op);
  odsState.addAttribute(subdiv_offsetsAttrName(odsState.name), subdiv_offsets);
  odsState.addAttribute(wait_forAttrName(odsState.name), wait_for);
  odsState.addAttribute(communication_hintAttrName(odsState.name), communication_hint);
  odsState.addAttribute(timeout_secondsAttrName(odsState.name), timeout_seconds);
  odsState.addTypes(data);
}

void CollectiveReduceOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::IntegerAttr group_size, ::mlir::IntegerAttr group_key, ::mlir::IntegerAttr instance_key, ::mlir::StringAttr merge_op, ::mlir::StringAttr final_op, ::mlir::ArrayAttr subdiv_offsets, ::mlir::ArrayAttr wait_for, ::mlir::StringAttr communication_hint, ::mlir::FloatAttr timeout_seconds) {
  odsState.addOperands(input);
  odsState.addAttribute(group_sizeAttrName(odsState.name), group_size);
  odsState.addAttribute(group_keyAttrName(odsState.name), group_key);
  odsState.addAttribute(instance_keyAttrName(odsState.name), instance_key);
  odsState.addAttribute(merge_opAttrName(odsState.name), merge_op);
  odsState.addAttribute(final_opAttrName(odsState.name), final_op);
  odsState.addAttribute(subdiv_offsetsAttrName(odsState.name), subdiv_offsets);
  odsState.addAttribute(wait_forAttrName(odsState.name), wait_for);
  odsState.addAttribute(communication_hintAttrName(odsState.name), communication_hint);
  odsState.addAttribute(timeout_secondsAttrName(odsState.name), timeout_seconds);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void CollectiveReduceOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type data, ::mlir::Value input, uint64_t group_size, uint64_t group_key, uint64_t instance_key, ::llvm::StringRef merge_op, ::llvm::StringRef final_op, ::mlir::ArrayAttr subdiv_offsets, ::mlir::ArrayAttr wait_for, ::llvm::StringRef communication_hint, ::llvm::APFloat timeout_seconds) {
  odsState.addOperands(input);
  odsState.addAttribute(group_sizeAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), group_size));
  odsState.addAttribute(group_keyAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), group_key));
  odsState.addAttribute(instance_keyAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), instance_key));
  odsState.addAttribute(merge_opAttrName(odsState.name), odsBuilder.getStringAttr(merge_op));
  odsState.addAttribute(final_opAttrName(odsState.name), odsBuilder.getStringAttr(final_op));
  odsState.addAttribute(subdiv_offsetsAttrName(odsState.name), subdiv_offsets);
  odsState.addAttribute(wait_forAttrName(odsState.name), wait_for);
  odsState.addAttribute(communication_hintAttrName(odsState.name), odsBuilder.getStringAttr(communication_hint));
  odsState.addAttribute(timeout_secondsAttrName(odsState.name), odsBuilder.getFloatAttr(odsBuilder.getF32Type(), timeout_seconds));
  odsState.addTypes(data);
}

void CollectiveReduceOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, uint64_t group_size, uint64_t group_key, uint64_t instance_key, ::llvm::StringRef merge_op, ::llvm::StringRef final_op, ::mlir::ArrayAttr subdiv_offsets, ::mlir::ArrayAttr wait_for, ::llvm::StringRef communication_hint, ::llvm::APFloat timeout_seconds) {
  odsState.addOperands(input);
  odsState.addAttribute(group_sizeAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), group_size));
  odsState.addAttribute(group_keyAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), group_key));
  odsState.addAttribute(instance_keyAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), instance_key));
  odsState.addAttribute(merge_opAttrName(odsState.name), odsBuilder.getStringAttr(merge_op));
  odsState.addAttribute(final_opAttrName(odsState.name), odsBuilder.getStringAttr(final_op));
  odsState.addAttribute(subdiv_offsetsAttrName(odsState.name), subdiv_offsets);
  odsState.addAttribute(wait_forAttrName(odsState.name), wait_for);
  odsState.addAttribute(communication_hintAttrName(odsState.name), odsBuilder.getStringAttr(communication_hint));
  odsState.addAttribute(timeout_secondsAttrName(odsState.name), odsBuilder.getFloatAttr(odsBuilder.getF32Type(), timeout_seconds));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void CollectiveReduceOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult CollectiveReduceOp::verify() {
  {
    auto tblgen_group_size = (*this)->getAttr(group_sizeAttrName());
    if (!tblgen_group_size)
      return emitOpError("requires attribute 'group_size'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_group_size, "group_size")))
      return ::mlir::failure();
  }
  {
    auto tblgen_group_key = (*this)->getAttr(group_keyAttrName());
    if (!tblgen_group_key)
      return emitOpError("requires attribute 'group_key'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_group_key, "group_key")))
      return ::mlir::failure();
  }
  {
    auto tblgen_instance_key = (*this)->getAttr(instance_keyAttrName());
    if (!tblgen_instance_key)
      return emitOpError("requires attribute 'instance_key'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_instance_key, "instance_key")))
      return ::mlir::failure();
  }
  {
    auto tblgen_merge_op = (*this)->getAttr(merge_opAttrName());
    if (!tblgen_merge_op)
      return emitOpError("requires attribute 'merge_op'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops18(*this, tblgen_merge_op, "merge_op")))
      return ::mlir::failure();
  }
  {
    auto tblgen_final_op = (*this)->getAttr(final_opAttrName());
    if (!tblgen_final_op)
      return emitOpError("requires attribute 'final_op'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops19(*this, tblgen_final_op, "final_op")))
      return ::mlir::failure();
  }
  {
    auto tblgen_subdiv_offsets = (*this)->getAttr(subdiv_offsetsAttrName());
    if (!tblgen_subdiv_offsets)
      return emitOpError("requires attribute 'subdiv_offsets'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops13(*this, tblgen_subdiv_offsets, "subdiv_offsets")))
      return ::mlir::failure();
  }
  {
    auto tblgen_wait_for = (*this)->getAttr(wait_forAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops13(*this, tblgen_wait_for, "wait_for")))
      return ::mlir::failure();
  }
  {
    auto tblgen_communication_hint = (*this)->getAttr(communication_hintAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_communication_hint, "communication_hint")))
      return ::mlir::failure();
  }
  {
    auto tblgen_timeout_seconds = (*this)->getAttr(timeout_secondsAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops5(*this, tblgen_timeout_seconds, "timeout_seconds")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops32(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops32(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::CollectiveReduceOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::CollectiveReduceV2Op definitions
//===----------------------------------------------------------------------===//

CollectiveReduceV2OpAdaptor::CollectiveReduceV2OpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

CollectiveReduceV2OpAdaptor::CollectiveReduceV2OpAdaptor(CollectiveReduceV2Op &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange CollectiveReduceV2OpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> CollectiveReduceV2OpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  bool isVariadic[] = {false, false, false, false, true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (odsOperands.size() - 4) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::ValueRange CollectiveReduceV2OpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value CollectiveReduceV2OpAdaptor::input() {
  return *getODSOperands(0).begin();
}

::mlir::Value CollectiveReduceV2OpAdaptor::group_size() {
  return *getODSOperands(1).begin();
}

::mlir::Value CollectiveReduceV2OpAdaptor::group_key() {
  return *getODSOperands(2).begin();
}

::mlir::Value CollectiveReduceV2OpAdaptor::instance_key() {
  return *getODSOperands(3).begin();
}

::mlir::ValueRange CollectiveReduceV2OpAdaptor::ordering_token() {
  return getODSOperands(4);
}

::mlir::DictionaryAttr CollectiveReduceV2OpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::StringAttr CollectiveReduceV2OpAdaptor::merge_op() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("merge_op").cast<::mlir::StringAttr>();
  return attr;
}

::mlir::StringAttr CollectiveReduceV2OpAdaptor::final_op() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("final_op").cast<::mlir::StringAttr>();
  return attr;
}

::mlir::StringAttr CollectiveReduceV2OpAdaptor::communication_hint() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("communication_hint").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("auto");
  return attr;
}

::mlir::FloatAttr CollectiveReduceV2OpAdaptor::timeout_seconds() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::FloatAttr attr = odsAttrs.get("timeout_seconds").dyn_cast_or_null<::mlir::FloatAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getFloatAttr(::mlir::Builder(odsAttrs.getContext()).getF32Type(), 0.0f);
  return attr;
}

::mlir::IntegerAttr CollectiveReduceV2OpAdaptor::max_subdivs_per_device() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("max_subdivs_per_device").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), -1);
  return attr;
}

::mlir::LogicalResult CollectiveReduceV2OpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_merge_op = odsAttrs.get("merge_op");
    if (!tblgen_merge_op)
      return emitError(loc, "'tf.CollectiveReduceV2' op ""requires attribute 'merge_op'");

    if (tblgen_merge_op && !((tblgen_merge_op.cast<StringAttr>().getValue() == "Min" || tblgen_merge_op.cast<StringAttr>().getValue() == "Max" || tblgen_merge_op.cast<StringAttr>().getValue() == "Mul" || tblgen_merge_op.cast<StringAttr>().getValue() == "Add")))
      return emitError(loc, "'tf.CollectiveReduceV2' op ""attribute 'merge_op' failed to satisfy constraint: string attribute whose value is Min, or Max, or Mul, or Add");
  }
  {
    auto tblgen_final_op = odsAttrs.get("final_op");
    if (!tblgen_final_op)
      return emitError(loc, "'tf.CollectiveReduceV2' op ""requires attribute 'final_op'");

    if (tblgen_final_op && !((tblgen_final_op.cast<StringAttr>().getValue() == "Id" || tblgen_final_op.cast<StringAttr>().getValue() == "Div")))
      return emitError(loc, "'tf.CollectiveReduceV2' op ""attribute 'final_op' failed to satisfy constraint: string attribute whose value is Id, or Div");
  }
  {
    auto tblgen_communication_hint = odsAttrs.get("communication_hint");
    if (tblgen_communication_hint && !((tblgen_communication_hint.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.CollectiveReduceV2' op ""attribute 'communication_hint' failed to satisfy constraint: string attribute");
  }
  {
    auto tblgen_timeout_seconds = odsAttrs.get("timeout_seconds");
    if (tblgen_timeout_seconds && !(((tblgen_timeout_seconds.isa<::mlir::FloatAttr>())) && ((tblgen_timeout_seconds.cast<::mlir::FloatAttr>().getType().isF32()))))
      return emitError(loc, "'tf.CollectiveReduceV2' op ""attribute 'timeout_seconds' failed to satisfy constraint: 32-bit float attribute");
  }
  {
    auto tblgen_max_subdivs_per_device = odsAttrs.get("max_subdivs_per_device");
    if (tblgen_max_subdivs_per_device && !(((tblgen_max_subdivs_per_device.isa<::mlir::IntegerAttr>())) && ((tblgen_max_subdivs_per_device.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.CollectiveReduceV2' op ""attribute 'max_subdivs_per_device' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> CollectiveReduceV2Op::getODSOperandIndexAndLength(unsigned index) {
  bool isVariadic[] = {false, false, false, false, true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (getOperation()->getNumOperands() - 4) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::Operation::operand_range CollectiveReduceV2Op::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value CollectiveReduceV2Op::input() {
  return *getODSOperands(0).begin();
}

::mlir::Value CollectiveReduceV2Op::group_size() {
  return *getODSOperands(1).begin();
}

::mlir::Value CollectiveReduceV2Op::group_key() {
  return *getODSOperands(2).begin();
}

::mlir::Value CollectiveReduceV2Op::instance_key() {
  return *getODSOperands(3).begin();
}

::mlir::Operation::operand_range CollectiveReduceV2Op::ordering_token() {
  return getODSOperands(4);
}

::mlir::MutableOperandRange CollectiveReduceV2Op::inputMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange CollectiveReduceV2Op::group_sizeMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange CollectiveReduceV2Op::group_keyMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange CollectiveReduceV2Op::instance_keyMutable() {
  auto range = getODSOperandIndexAndLength(3);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange CollectiveReduceV2Op::ordering_tokenMutable() {
  auto range = getODSOperandIndexAndLength(4);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> CollectiveReduceV2Op::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range CollectiveReduceV2Op::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value CollectiveReduceV2Op::data() {
  return *getODSResults(0).begin();
}

::mlir::StringAttr CollectiveReduceV2Op::merge_opAttr() {
  return (*this)->getAttr(merge_opAttrName()).cast<::mlir::StringAttr>();
}

::llvm::StringRef CollectiveReduceV2Op::merge_op() {
  auto attr = merge_opAttr();
  return attr.getValue();
}

::mlir::StringAttr CollectiveReduceV2Op::final_opAttr() {
  return (*this)->getAttr(final_opAttrName()).cast<::mlir::StringAttr>();
}

::llvm::StringRef CollectiveReduceV2Op::final_op() {
  auto attr = final_opAttr();
  return attr.getValue();
}

::mlir::StringAttr CollectiveReduceV2Op::communication_hintAttr() {
  return (*this)->getAttr(communication_hintAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef CollectiveReduceV2Op::communication_hint() {
  auto attr = communication_hintAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("auto").getValue();
  return attr.getValue();
}

::mlir::FloatAttr CollectiveReduceV2Op::timeout_secondsAttr() {
  return (*this)->getAttr(timeout_secondsAttrName()).dyn_cast_or_null<::mlir::FloatAttr>();
}

::llvm::APFloat CollectiveReduceV2Op::timeout_seconds() {
  auto attr = timeout_secondsAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getFloatAttr(::mlir::Builder((*this)->getContext()).getF32Type(), 0.0f).getValue();
  return attr.getValue();
}

::mlir::IntegerAttr CollectiveReduceV2Op::max_subdivs_per_deviceAttr() {
  return (*this)->getAttr(max_subdivs_per_deviceAttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t CollectiveReduceV2Op::max_subdivs_per_device() {
  auto attr = max_subdivs_per_deviceAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), -1).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

size_t CollectiveReduceV2Op::Nordering_token() {
  auto range = getODSOperands(4);
return std::distance(range.begin(), range.end());
}

::mlir::Type CollectiveReduceV2Op::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool CollectiveReduceV2Op::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "Nordering_token") return true;
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr CollectiveReduceV2Op::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {Nordering_tokenAttrName(),
odsBuilder.getI64IntegerAttr(Nordering_token())},
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void CollectiveReduceV2Op::merge_opAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(merge_opAttrName(), attr);
}

void CollectiveReduceV2Op::final_opAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(final_opAttrName(), attr);
}

void CollectiveReduceV2Op::communication_hintAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(communication_hintAttrName(), attr);
}

void CollectiveReduceV2Op::timeout_secondsAttr(::mlir::FloatAttr attr) {
  (*this)->setAttr(timeout_secondsAttrName(), attr);
}

void CollectiveReduceV2Op::max_subdivs_per_deviceAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(max_subdivs_per_deviceAttrName(), attr);
}

void CollectiveReduceV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type data, ::mlir::Value input, ::mlir::Value group_size, ::mlir::Value group_key, ::mlir::Value instance_key, ::mlir::ValueRange ordering_token, ::mlir::StringAttr merge_op, ::mlir::StringAttr final_op, ::mlir::StringAttr communication_hint, ::mlir::FloatAttr timeout_seconds, ::mlir::IntegerAttr max_subdivs_per_device) {
  odsState.addOperands(input);
  odsState.addOperands(group_size);
  odsState.addOperands(group_key);
  odsState.addOperands(instance_key);
  odsState.addOperands(ordering_token);
  odsState.addAttribute(merge_opAttrName(odsState.name), merge_op);
  odsState.addAttribute(final_opAttrName(odsState.name), final_op);
  odsState.addAttribute(communication_hintAttrName(odsState.name), communication_hint);
  odsState.addAttribute(timeout_secondsAttrName(odsState.name), timeout_seconds);
  odsState.addAttribute(max_subdivs_per_deviceAttrName(odsState.name), max_subdivs_per_device);
  odsState.addTypes(data);
}

void CollectiveReduceV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::Value group_size, ::mlir::Value group_key, ::mlir::Value instance_key, ::mlir::ValueRange ordering_token, ::mlir::StringAttr merge_op, ::mlir::StringAttr final_op, ::mlir::StringAttr communication_hint, ::mlir::FloatAttr timeout_seconds, ::mlir::IntegerAttr max_subdivs_per_device) {
  odsState.addOperands(input);
  odsState.addOperands(group_size);
  odsState.addOperands(group_key);
  odsState.addOperands(instance_key);
  odsState.addOperands(ordering_token);
  odsState.addAttribute(merge_opAttrName(odsState.name), merge_op);
  odsState.addAttribute(final_opAttrName(odsState.name), final_op);
  odsState.addAttribute(communication_hintAttrName(odsState.name), communication_hint);
  odsState.addAttribute(timeout_secondsAttrName(odsState.name), timeout_seconds);
  odsState.addAttribute(max_subdivs_per_deviceAttrName(odsState.name), max_subdivs_per_device);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void CollectiveReduceV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type data, ::mlir::Value input, ::mlir::Value group_size, ::mlir::Value group_key, ::mlir::Value instance_key, ::mlir::ValueRange ordering_token, ::llvm::StringRef merge_op, ::llvm::StringRef final_op, ::llvm::StringRef communication_hint, ::llvm::APFloat timeout_seconds, uint64_t max_subdivs_per_device) {
  odsState.addOperands(input);
  odsState.addOperands(group_size);
  odsState.addOperands(group_key);
  odsState.addOperands(instance_key);
  odsState.addOperands(ordering_token);
  odsState.addAttribute(merge_opAttrName(odsState.name), odsBuilder.getStringAttr(merge_op));
  odsState.addAttribute(final_opAttrName(odsState.name), odsBuilder.getStringAttr(final_op));
  odsState.addAttribute(communication_hintAttrName(odsState.name), odsBuilder.getStringAttr(communication_hint));
  odsState.addAttribute(timeout_secondsAttrName(odsState.name), odsBuilder.getFloatAttr(odsBuilder.getF32Type(), timeout_seconds));
  odsState.addAttribute(max_subdivs_per_deviceAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), max_subdivs_per_device));
  odsState.addTypes(data);
}

void CollectiveReduceV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::Value group_size, ::mlir::Value group_key, ::mlir::Value instance_key, ::mlir::ValueRange ordering_token, ::llvm::StringRef merge_op, ::llvm::StringRef final_op, ::llvm::StringRef communication_hint, ::llvm::APFloat timeout_seconds, uint64_t max_subdivs_per_device) {
  odsState.addOperands(input);
  odsState.addOperands(group_size);
  odsState.addOperands(group_key);
  odsState.addOperands(instance_key);
  odsState.addOperands(ordering_token);
  odsState.addAttribute(merge_opAttrName(odsState.name), odsBuilder.getStringAttr(merge_op));
  odsState.addAttribute(final_opAttrName(odsState.name), odsBuilder.getStringAttr(final_op));
  odsState.addAttribute(communication_hintAttrName(odsState.name), odsBuilder.getStringAttr(communication_hint));
  odsState.addAttribute(timeout_secondsAttrName(odsState.name), odsBuilder.getFloatAttr(odsBuilder.getF32Type(), timeout_seconds));
  odsState.addAttribute(max_subdivs_per_deviceAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), max_subdivs_per_device));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void CollectiveReduceV2Op::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() >= 4u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult CollectiveReduceV2Op::verify() {
  {
    auto tblgen_merge_op = (*this)->getAttr(merge_opAttrName());
    if (!tblgen_merge_op)
      return emitOpError("requires attribute 'merge_op'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops18(*this, tblgen_merge_op, "merge_op")))
      return ::mlir::failure();
  }
  {
    auto tblgen_final_op = (*this)->getAttr(final_opAttrName());
    if (!tblgen_final_op)
      return emitOpError("requires attribute 'final_op'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops19(*this, tblgen_final_op, "final_op")))
      return ::mlir::failure();
  }
  {
    auto tblgen_communication_hint = (*this)->getAttr(communication_hintAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_communication_hint, "communication_hint")))
      return ::mlir::failure();
  }
  {
    auto tblgen_timeout_seconds = (*this)->getAttr(timeout_secondsAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops5(*this, tblgen_timeout_seconds, "timeout_seconds")))
      return ::mlir::failure();
  }
  {
    auto tblgen_max_subdivs_per_device = (*this)->getAttr(max_subdivs_per_deviceAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_max_subdivs_per_device, "max_subdivs_per_device")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops32(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops11(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops11(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup3 = getODSOperands(3);

    for (auto v : valueGroup3) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops11(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup4 = getODSOperands(4);

    for (auto v : valueGroup4) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops32(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::CollectiveReduceV2Op)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::ComplexAbsOp definitions
//===----------------------------------------------------------------------===//

ComplexAbsOpAdaptor::ComplexAbsOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

ComplexAbsOpAdaptor::ComplexAbsOpAdaptor(ComplexAbsOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange ComplexAbsOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> ComplexAbsOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange ComplexAbsOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ComplexAbsOpAdaptor::x() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr ComplexAbsOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult ComplexAbsOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> ComplexAbsOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range ComplexAbsOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ComplexAbsOp::x() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange ComplexAbsOp::xMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> ComplexAbsOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range ComplexAbsOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ComplexAbsOp::y() {
  return *getODSResults(0).begin();
}

::mlir::Type ComplexAbsOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

::mlir::Type ComplexAbsOp::Tout() {
  return mlir::getElementTypeOrSelf(*getODSResults(0).begin());
}

bool ComplexAbsOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
  if (name == "Tout") return true;
 return false;
}

::mlir::DictionaryAttr ComplexAbsOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())},
    {ToutAttrName(),
::mlir::TypeAttr::get(Tout())}});
}

void ComplexAbsOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type y, ::mlir::Value x) {
  odsState.addOperands(x);
  odsState.addTypes(y);
}

void ComplexAbsOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value x) {
  odsState.addOperands(x);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void ComplexAbsOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult ComplexAbsOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops12(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops13(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void ComplexAbsOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::ComplexAbsOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::ComplexOp definitions
//===----------------------------------------------------------------------===//

ComplexOpAdaptor::ComplexOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

ComplexOpAdaptor::ComplexOpAdaptor(ComplexOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange ComplexOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> ComplexOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange ComplexOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ComplexOpAdaptor::real() {
  return *getODSOperands(0).begin();
}

::mlir::Value ComplexOpAdaptor::imag() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr ComplexOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult ComplexOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> ComplexOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range ComplexOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ComplexOp::real() {
  return *getODSOperands(0).begin();
}

::mlir::Value ComplexOp::imag() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange ComplexOp::realMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ComplexOp::imagMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> ComplexOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range ComplexOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ComplexOp::out() {
  return *getODSResults(0).begin();
}

::mlir::Type ComplexOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

::mlir::Type ComplexOp::Tout() {
  return mlir::getElementTypeOrSelf(*getODSResults(0).begin());
}

bool ComplexOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
  if (name == "Tout") return true;
 return false;
}

::mlir::DictionaryAttr ComplexOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())},
    {ToutAttrName(),
::mlir::TypeAttr::get(Tout())}});
}

void ComplexOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type out, ::mlir::Value real, ::mlir::Value imag) {
  odsState.addOperands(real);
  odsState.addOperands(imag);
  odsState.addTypes(out);
}

void ComplexOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value real, ::mlir::Value imag) {
  odsState.addOperands(real);
  odsState.addOperands(imag);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void ComplexOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult ComplexOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops13(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops13(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops12(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void ComplexOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::ComplexOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::ConcatOffsetOp definitions
//===----------------------------------------------------------------------===//

ConcatOffsetOpAdaptor::ConcatOffsetOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

ConcatOffsetOpAdaptor::ConcatOffsetOpAdaptor(ConcatOffsetOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange ConcatOffsetOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> ConcatOffsetOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  bool isVariadic[] = {false, true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (odsOperands.size() - 1) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::ValueRange ConcatOffsetOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ConcatOffsetOpAdaptor::concat_dim() {
  return *getODSOperands(0).begin();
}

::mlir::ValueRange ConcatOffsetOpAdaptor::shape() {
  return getODSOperands(1);
}

::mlir::DictionaryAttr ConcatOffsetOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult ConcatOffsetOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> ConcatOffsetOp::getODSOperandIndexAndLength(unsigned index) {
  bool isVariadic[] = {false, true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (getOperation()->getNumOperands() - 1) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::Operation::operand_range ConcatOffsetOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ConcatOffsetOp::concat_dim() {
  return *getODSOperands(0).begin();
}

::mlir::Operation::operand_range ConcatOffsetOp::shape() {
  return getODSOperands(1);
}

::mlir::MutableOperandRange ConcatOffsetOp::concat_dimMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ConcatOffsetOp::shapeMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> ConcatOffsetOp::getODSResultIndexAndLength(unsigned index) {
  bool isVariadic[] = {true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (getOperation()->getNumResults() - 0) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::Operation::result_range ConcatOffsetOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Operation::result_range ConcatOffsetOp::offset() {
  return getODSResults(0);
}

size_t ConcatOffsetOp::N() {
  auto range = getODSOperands(1);
return std::distance(range.begin(), range.end());
}

bool ConcatOffsetOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "N") return true;
 return false;
}

::mlir::DictionaryAttr ConcatOffsetOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {NAttrName(),
odsBuilder.getI64IntegerAttr(N())}});
}

void ConcatOffsetOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange offset, ::mlir::Value concat_dim, ::mlir::ValueRange shape) {
  odsState.addOperands(concat_dim);
  odsState.addOperands(shape);
  odsState.addTypes(offset);
}

void ConcatOffsetOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() >= 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult ConcatOffsetOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops11(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops11(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops11(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return Verify(*this);
}

void ConcatOffsetOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::ConcatOffsetOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::ConcatOp definitions
//===----------------------------------------------------------------------===//

ConcatOpAdaptor::ConcatOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

ConcatOpAdaptor::ConcatOpAdaptor(ConcatOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange ConcatOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> ConcatOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  bool isVariadic[] = {false, true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (odsOperands.size() - 1) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::ValueRange ConcatOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ConcatOpAdaptor::concat_dim() {
  return *getODSOperands(0).begin();
}

::mlir::ValueRange ConcatOpAdaptor::values() {
  return getODSOperands(1);
}

::mlir::DictionaryAttr ConcatOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult ConcatOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> ConcatOp::getODSOperandIndexAndLength(unsigned index) {
  bool isVariadic[] = {false, true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (getOperation()->getNumOperands() - 1) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::Operation::operand_range ConcatOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ConcatOp::concat_dim() {
  return *getODSOperands(0).begin();
}

::mlir::Operation::operand_range ConcatOp::values() {
  return getODSOperands(1);
}

::mlir::MutableOperandRange ConcatOp::concat_dimMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ConcatOp::valuesMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> ConcatOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range ConcatOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ConcatOp::output() {
  return *getODSResults(0).begin();
}

size_t ConcatOp::N() {
  auto range = getODSOperands(1);
return std::distance(range.begin(), range.end());
}

::mlir::Type ConcatOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(1).begin());
}

bool ConcatOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "N") return true;
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr ConcatOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {NAttrName(),
odsBuilder.getI64IntegerAttr(N())},
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void ConcatOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value concat_dim, ::mlir::ValueRange values) {
  odsState.addOperands(concat_dim);
  odsState.addOperands(values);
  odsState.addTypes(output);
}

void ConcatOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value concat_dim, ::mlir::ValueRange values) {
  odsState.addOperands(concat_dim);
  odsState.addOperands(values);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void ConcatOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() >= 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult ConcatOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops11(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return Verify(*this);
}

void ConcatOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::ConcatOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::ConcatV2Op definitions
//===----------------------------------------------------------------------===//

ConcatV2OpAdaptor::ConcatV2OpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

ConcatV2OpAdaptor::ConcatV2OpAdaptor(ConcatV2Op &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange ConcatV2OpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> ConcatV2OpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  bool isVariadic[] = {true, false};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (odsOperands.size() - 1) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::ValueRange ConcatV2OpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::ValueRange ConcatV2OpAdaptor::values() {
  return getODSOperands(0);
}

::mlir::Value ConcatV2OpAdaptor::axis() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr ConcatV2OpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult ConcatV2OpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> ConcatV2Op::getODSOperandIndexAndLength(unsigned index) {
  bool isVariadic[] = {true, false};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (getOperation()->getNumOperands() - 1) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::Operation::operand_range ConcatV2Op::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Operation::operand_range ConcatV2Op::values() {
  return getODSOperands(0);
}

::mlir::Value ConcatV2Op::axis() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange ConcatV2Op::valuesMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ConcatV2Op::axisMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> ConcatV2Op::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range ConcatV2Op::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ConcatV2Op::output() {
  return *getODSResults(0).begin();
}

size_t ConcatV2Op::N() {
  auto range = getODSOperands(0);
return std::distance(range.begin(), range.end());
}

::mlir::Type ConcatV2Op::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

::mlir::Type ConcatV2Op::Tidx() {
  return mlir::getElementTypeOrSelf(*getODSOperands(1).begin());
}

bool ConcatV2Op::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "N") return true;
  if (name == "T") return true;
  if (name == "Tidx") return true;
 return false;
}

::mlir::DictionaryAttr ConcatV2Op::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {NAttrName(),
odsBuilder.getI64IntegerAttr(N())},
    {TAttrName(),
::mlir::TypeAttr::get(T())},
    {TidxAttrName(),
::mlir::TypeAttr::get(Tidx())}});
}

void ConcatV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::ValueRange values, ::mlir::Value axis) {
  odsState.addOperands(values);
  odsState.addOperands(axis);
  odsState.addTypes(output);
}

void ConcatV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange values, ::mlir::Value axis) {
  odsState.addOperands(values);
  odsState.addOperands(axis);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void ConcatV2Op::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() >= 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult ConcatV2Op::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return Verify(*this);
}

void ConcatV2Op::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::ConcatV2Op)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::ConfigureAndInitializeGlobalTPUOp definitions
//===----------------------------------------------------------------------===//

ConfigureAndInitializeGlobalTPUOpAdaptor::ConfigureAndInitializeGlobalTPUOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

ConfigureAndInitializeGlobalTPUOpAdaptor::ConfigureAndInitializeGlobalTPUOpAdaptor(ConfigureAndInitializeGlobalTPUOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange ConfigureAndInitializeGlobalTPUOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> ConfigureAndInitializeGlobalTPUOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange ConfigureAndInitializeGlobalTPUOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::DictionaryAttr ConfigureAndInitializeGlobalTPUOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult ConfigureAndInitializeGlobalTPUOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> ConfigureAndInitializeGlobalTPUOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range ConfigureAndInitializeGlobalTPUOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

std::pair<unsigned, unsigned> ConfigureAndInitializeGlobalTPUOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range ConfigureAndInitializeGlobalTPUOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ConfigureAndInitializeGlobalTPUOp::output() {
  return *getODSResults(0).begin();
}

void ConfigureAndInitializeGlobalTPUOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output) {
  odsState.addTypes(output);
}

void ConfigureAndInitializeGlobalTPUOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes) {
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void ConfigureAndInitializeGlobalTPUOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 0u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult ConfigureAndInitializeGlobalTPUOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops11(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::ConfigureAndInitializeGlobalTPUOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::ConfigureDistributedTPUOp definitions
//===----------------------------------------------------------------------===//

ConfigureDistributedTPUOpAdaptor::ConfigureDistributedTPUOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

ConfigureDistributedTPUOpAdaptor::ConfigureDistributedTPUOpAdaptor(ConfigureDistributedTPUOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange ConfigureDistributedTPUOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> ConfigureDistributedTPUOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange ConfigureDistributedTPUOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::DictionaryAttr ConfigureDistributedTPUOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::StringAttr ConfigureDistributedTPUOpAdaptor::embedding_config() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("embedding_config").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("");
  return attr;
}

::mlir::StringAttr ConfigureDistributedTPUOpAdaptor::tpu_embedding_config() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("tpu_embedding_config").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("");
  return attr;
}

::mlir::BoolAttr ConfigureDistributedTPUOpAdaptor::is_global_init() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("is_global_init").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(false);
  return attr;
}

::mlir::BoolAttr ConfigureDistributedTPUOpAdaptor::enable_whole_mesh_compilations() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("enable_whole_mesh_compilations").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(false);
  return attr;
}

::mlir::BoolAttr ConfigureDistributedTPUOpAdaptor::compilation_failure_closes_chips() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("compilation_failure_closes_chips").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(true);
  return attr;
}

::mlir::IntegerAttr ConfigureDistributedTPUOpAdaptor::tpu_cancellation_closes_chips() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("tpu_cancellation_closes_chips").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), 0);
  return attr;
}

::mlir::LogicalResult ConfigureDistributedTPUOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_embedding_config = odsAttrs.get("embedding_config");
    if (tblgen_embedding_config && !((tblgen_embedding_config.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.ConfigureDistributedTPU' op ""attribute 'embedding_config' failed to satisfy constraint: string attribute");
  }
  {
    auto tblgen_tpu_embedding_config = odsAttrs.get("tpu_embedding_config");
    if (tblgen_tpu_embedding_config && !((tblgen_tpu_embedding_config.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.ConfigureDistributedTPU' op ""attribute 'tpu_embedding_config' failed to satisfy constraint: string attribute");
  }
  {
    auto tblgen_is_global_init = odsAttrs.get("is_global_init");
    if (tblgen_is_global_init && !((tblgen_is_global_init.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.ConfigureDistributedTPU' op ""attribute 'is_global_init' failed to satisfy constraint: bool attribute");
  }
  {
    auto tblgen_enable_whole_mesh_compilations = odsAttrs.get("enable_whole_mesh_compilations");
    if (tblgen_enable_whole_mesh_compilations && !((tblgen_enable_whole_mesh_compilations.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.ConfigureDistributedTPU' op ""attribute 'enable_whole_mesh_compilations' failed to satisfy constraint: bool attribute");
  }
  {
    auto tblgen_compilation_failure_closes_chips = odsAttrs.get("compilation_failure_closes_chips");
    if (tblgen_compilation_failure_closes_chips && !((tblgen_compilation_failure_closes_chips.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.ConfigureDistributedTPU' op ""attribute 'compilation_failure_closes_chips' failed to satisfy constraint: bool attribute");
  }
  {
    auto tblgen_tpu_cancellation_closes_chips = odsAttrs.get("tpu_cancellation_closes_chips");
    if (tblgen_tpu_cancellation_closes_chips && !(((tblgen_tpu_cancellation_closes_chips.isa<::mlir::IntegerAttr>())) && ((tblgen_tpu_cancellation_closes_chips.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.ConfigureDistributedTPU' op ""attribute 'tpu_cancellation_closes_chips' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> ConfigureDistributedTPUOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range ConfigureDistributedTPUOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

std::pair<unsigned, unsigned> ConfigureDistributedTPUOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range ConfigureDistributedTPUOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ConfigureDistributedTPUOp::topology() {
  return *getODSResults(0).begin();
}

::mlir::StringAttr ConfigureDistributedTPUOp::embedding_configAttr() {
  return (*this)->getAttr(embedding_configAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef ConfigureDistributedTPUOp::embedding_config() {
  auto attr = embedding_configAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("").getValue();
  return attr.getValue();
}

::mlir::StringAttr ConfigureDistributedTPUOp::tpu_embedding_configAttr() {
  return (*this)->getAttr(tpu_embedding_configAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef ConfigureDistributedTPUOp::tpu_embedding_config() {
  auto attr = tpu_embedding_configAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("").getValue();
  return attr.getValue();
}

::mlir::BoolAttr ConfigureDistributedTPUOp::is_global_initAttr() {
  return (*this)->getAttr(is_global_initAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool ConfigureDistributedTPUOp::is_global_init() {
  auto attr = is_global_initAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(false).getValue();
  return attr.getValue();
}

::mlir::BoolAttr ConfigureDistributedTPUOp::enable_whole_mesh_compilationsAttr() {
  return (*this)->getAttr(enable_whole_mesh_compilationsAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool ConfigureDistributedTPUOp::enable_whole_mesh_compilations() {
  auto attr = enable_whole_mesh_compilationsAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(false).getValue();
  return attr.getValue();
}

::mlir::BoolAttr ConfigureDistributedTPUOp::compilation_failure_closes_chipsAttr() {
  return (*this)->getAttr(compilation_failure_closes_chipsAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool ConfigureDistributedTPUOp::compilation_failure_closes_chips() {
  auto attr = compilation_failure_closes_chipsAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(true).getValue();
  return attr.getValue();
}

::mlir::IntegerAttr ConfigureDistributedTPUOp::tpu_cancellation_closes_chipsAttr() {
  return (*this)->getAttr(tpu_cancellation_closes_chipsAttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t ConfigureDistributedTPUOp::tpu_cancellation_closes_chips() {
  auto attr = tpu_cancellation_closes_chipsAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), 0).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

void ConfigureDistributedTPUOp::embedding_configAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(embedding_configAttrName(), attr);
}

void ConfigureDistributedTPUOp::tpu_embedding_configAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(tpu_embedding_configAttrName(), attr);
}

void ConfigureDistributedTPUOp::is_global_initAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(is_global_initAttrName(), attr);
}

void ConfigureDistributedTPUOp::enable_whole_mesh_compilationsAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(enable_whole_mesh_compilationsAttrName(), attr);
}

void ConfigureDistributedTPUOp::compilation_failure_closes_chipsAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(compilation_failure_closes_chipsAttrName(), attr);
}

void ConfigureDistributedTPUOp::tpu_cancellation_closes_chipsAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(tpu_cancellation_closes_chipsAttrName(), attr);
}

void ConfigureDistributedTPUOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type topology, ::mlir::StringAttr embedding_config, ::mlir::StringAttr tpu_embedding_config, ::mlir::BoolAttr is_global_init, ::mlir::BoolAttr enable_whole_mesh_compilations, ::mlir::BoolAttr compilation_failure_closes_chips, ::mlir::IntegerAttr tpu_cancellation_closes_chips) {
  odsState.addAttribute(embedding_configAttrName(odsState.name), embedding_config);
  odsState.addAttribute(tpu_embedding_configAttrName(odsState.name), tpu_embedding_config);
  odsState.addAttribute(is_global_initAttrName(odsState.name), is_global_init);
  odsState.addAttribute(enable_whole_mesh_compilationsAttrName(odsState.name), enable_whole_mesh_compilations);
  odsState.addAttribute(compilation_failure_closes_chipsAttrName(odsState.name), compilation_failure_closes_chips);
  odsState.addAttribute(tpu_cancellation_closes_chipsAttrName(odsState.name), tpu_cancellation_closes_chips);
  odsState.addTypes(topology);
}

void ConfigureDistributedTPUOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::StringAttr embedding_config, ::mlir::StringAttr tpu_embedding_config, ::mlir::BoolAttr is_global_init, ::mlir::BoolAttr enable_whole_mesh_compilations, ::mlir::BoolAttr compilation_failure_closes_chips, ::mlir::IntegerAttr tpu_cancellation_closes_chips) {
  odsState.addAttribute(embedding_configAttrName(odsState.name), embedding_config);
  odsState.addAttribute(tpu_embedding_configAttrName(odsState.name), tpu_embedding_config);
  odsState.addAttribute(is_global_initAttrName(odsState.name), is_global_init);
  odsState.addAttribute(enable_whole_mesh_compilationsAttrName(odsState.name), enable_whole_mesh_compilations);
  odsState.addAttribute(compilation_failure_closes_chipsAttrName(odsState.name), compilation_failure_closes_chips);
  odsState.addAttribute(tpu_cancellation_closes_chipsAttrName(odsState.name), tpu_cancellation_closes_chips);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void ConfigureDistributedTPUOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type topology, ::llvm::StringRef embedding_config, ::llvm::StringRef tpu_embedding_config, bool is_global_init, bool enable_whole_mesh_compilations, bool compilation_failure_closes_chips, uint64_t tpu_cancellation_closes_chips) {
  odsState.addAttribute(embedding_configAttrName(odsState.name), odsBuilder.getStringAttr(embedding_config));
  odsState.addAttribute(tpu_embedding_configAttrName(odsState.name), odsBuilder.getStringAttr(tpu_embedding_config));
  odsState.addAttribute(is_global_initAttrName(odsState.name), odsBuilder.getBoolAttr(is_global_init));
  odsState.addAttribute(enable_whole_mesh_compilationsAttrName(odsState.name), odsBuilder.getBoolAttr(enable_whole_mesh_compilations));
  odsState.addAttribute(compilation_failure_closes_chipsAttrName(odsState.name), odsBuilder.getBoolAttr(compilation_failure_closes_chips));
  odsState.addAttribute(tpu_cancellation_closes_chipsAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), tpu_cancellation_closes_chips));
  odsState.addTypes(topology);
}

void ConfigureDistributedTPUOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::llvm::StringRef embedding_config, ::llvm::StringRef tpu_embedding_config, bool is_global_init, bool enable_whole_mesh_compilations, bool compilation_failure_closes_chips, uint64_t tpu_cancellation_closes_chips) {
  odsState.addAttribute(embedding_configAttrName(odsState.name), odsBuilder.getStringAttr(embedding_config));
  odsState.addAttribute(tpu_embedding_configAttrName(odsState.name), odsBuilder.getStringAttr(tpu_embedding_config));
  odsState.addAttribute(is_global_initAttrName(odsState.name), odsBuilder.getBoolAttr(is_global_init));
  odsState.addAttribute(enable_whole_mesh_compilationsAttrName(odsState.name), odsBuilder.getBoolAttr(enable_whole_mesh_compilations));
  odsState.addAttribute(compilation_failure_closes_chipsAttrName(odsState.name), odsBuilder.getBoolAttr(compilation_failure_closes_chips));
  odsState.addAttribute(tpu_cancellation_closes_chipsAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), tpu_cancellation_closes_chips));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void ConfigureDistributedTPUOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 0u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult ConfigureDistributedTPUOp::verify() {
  {
    auto tblgen_embedding_config = (*this)->getAttr(embedding_configAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_embedding_config, "embedding_config")))
      return ::mlir::failure();
  }
  {
    auto tblgen_tpu_embedding_config = (*this)->getAttr(tpu_embedding_configAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_tpu_embedding_config, "tpu_embedding_config")))
      return ::mlir::failure();
  }
  {
    auto tblgen_is_global_init = (*this)->getAttr(is_global_initAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_is_global_init, "is_global_init")))
      return ::mlir::failure();
  }
  {
    auto tblgen_enable_whole_mesh_compilations = (*this)->getAttr(enable_whole_mesh_compilationsAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_enable_whole_mesh_compilations, "enable_whole_mesh_compilations")))
      return ::mlir::failure();
  }
  {
    auto tblgen_compilation_failure_closes_chips = (*this)->getAttr(compilation_failure_closes_chipsAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_compilation_failure_closes_chips, "compilation_failure_closes_chips")))
      return ::mlir::failure();
  }
  {
    auto tblgen_tpu_cancellation_closes_chips = (*this)->getAttr(tpu_cancellation_closes_chipsAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_tpu_cancellation_closes_chips, "tpu_cancellation_closes_chips")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops19(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::ConfigureDistributedTPUOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::ConfigureTPUEmbeddingOp definitions
//===----------------------------------------------------------------------===//

ConfigureTPUEmbeddingOpAdaptor::ConfigureTPUEmbeddingOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

ConfigureTPUEmbeddingOpAdaptor::ConfigureTPUEmbeddingOpAdaptor(ConfigureTPUEmbeddingOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange ConfigureTPUEmbeddingOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> ConfigureTPUEmbeddingOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange ConfigureTPUEmbeddingOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::DictionaryAttr ConfigureTPUEmbeddingOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::StringAttr ConfigureTPUEmbeddingOpAdaptor::config() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("config").cast<::mlir::StringAttr>();
  return attr;
}

::mlir::LogicalResult ConfigureTPUEmbeddingOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_config = odsAttrs.get("config");
    if (!tblgen_config)
      return emitError(loc, "'tf.ConfigureTPUEmbedding' op ""requires attribute 'config'");

    if (tblgen_config && !((tblgen_config.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.ConfigureTPUEmbedding' op ""attribute 'config' failed to satisfy constraint: string attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> ConfigureTPUEmbeddingOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range ConfigureTPUEmbeddingOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

std::pair<unsigned, unsigned> ConfigureTPUEmbeddingOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range ConfigureTPUEmbeddingOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::StringAttr ConfigureTPUEmbeddingOp::configAttr() {
  return (*this)->getAttr(configAttrName()).cast<::mlir::StringAttr>();
}

::llvm::StringRef ConfigureTPUEmbeddingOp::config() {
  auto attr = configAttr();
  return attr.getValue();
}

void ConfigureTPUEmbeddingOp::configAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(configAttrName(), attr);
}

void ConfigureTPUEmbeddingOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::StringAttr config) {
  odsState.addAttribute(configAttrName(odsState.name), config);
}

void ConfigureTPUEmbeddingOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::StringAttr config) {
  odsState.addAttribute(configAttrName(odsState.name), config);
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void ConfigureTPUEmbeddingOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::llvm::StringRef config) {
  odsState.addAttribute(configAttrName(odsState.name), odsBuilder.getStringAttr(config));
}

void ConfigureTPUEmbeddingOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::llvm::StringRef config) {
  odsState.addAttribute(configAttrName(odsState.name), odsBuilder.getStringAttr(config));
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void ConfigureTPUEmbeddingOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 0u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 0u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult ConfigureTPUEmbeddingOp::verify() {
  {
    auto tblgen_config = (*this)->getAttr(configAttrName());
    if (!tblgen_config)
      return emitOpError("requires attribute 'config'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_config, "config")))
      return ::mlir::failure();
  }
  return ::mlir::success();
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::ConfigureTPUEmbeddingOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::ConjOp definitions
//===----------------------------------------------------------------------===//

ConjOpAdaptor::ConjOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

ConjOpAdaptor::ConjOpAdaptor(ConjOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange ConjOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> ConjOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange ConjOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ConjOpAdaptor::input() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr ConjOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult ConjOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> ConjOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range ConjOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ConjOp::input() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange ConjOp::inputMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> ConjOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range ConjOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ConjOp::output() {
  return *getODSResults(0).begin();
}

::mlir::Type ConjOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool ConjOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr ConjOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void ConjOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input) {
  odsState.addOperands(input);
  odsState.addTypes(output);
}

void ConjOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input) {
  odsState.addOperands(input);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void ConjOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

void ConjOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value input) {
  odsState.addOperands(input);
  odsState.addTypes({input.getType()});

}

void ConjOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  odsState.addTypes({operands[0].getType()});

}

::mlir::LogicalResult ConjOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops33(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops33(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void ConjOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::ConjOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::ConjugateTransposeOp definitions
//===----------------------------------------------------------------------===//

ConjugateTransposeOpAdaptor::ConjugateTransposeOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

ConjugateTransposeOpAdaptor::ConjugateTransposeOpAdaptor(ConjugateTransposeOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange ConjugateTransposeOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> ConjugateTransposeOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange ConjugateTransposeOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ConjugateTransposeOpAdaptor::x() {
  return *getODSOperands(0).begin();
}

::mlir::Value ConjugateTransposeOpAdaptor::perm() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr ConjugateTransposeOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult ConjugateTransposeOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> ConjugateTransposeOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range ConjugateTransposeOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ConjugateTransposeOp::x() {
  return *getODSOperands(0).begin();
}

::mlir::Value ConjugateTransposeOp::perm() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange ConjugateTransposeOp::xMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ConjugateTransposeOp::permMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> ConjugateTransposeOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range ConjugateTransposeOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ConjugateTransposeOp::y() {
  return *getODSResults(0).begin();
}

::mlir::Type ConjugateTransposeOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

::mlir::Type ConjugateTransposeOp::Tperm() {
  return mlir::getElementTypeOrSelf(*getODSOperands(1).begin());
}

bool ConjugateTransposeOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
  if (name == "Tperm") return true;
 return false;
}

::mlir::DictionaryAttr ConjugateTransposeOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())},
    {TpermAttrName(),
::mlir::TypeAttr::get(Tperm())}});
}

void ConjugateTransposeOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type y, ::mlir::Value x, ::mlir::Value perm) {
  odsState.addOperands(x);
  odsState.addOperands(perm);
  odsState.addTypes(y);
}

void ConjugateTransposeOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value x, ::mlir::Value perm) {
  odsState.addOperands(x);
  odsState.addOperands(perm);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void ConjugateTransposeOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult ConjugateTransposeOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void ConjugateTransposeOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::ConjugateTransposeOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::ConstOp definitions
//===----------------------------------------------------------------------===//

ConstOpAdaptor::ConstOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

ConstOpAdaptor::ConstOpAdaptor(ConstOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange ConstOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> ConstOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange ConstOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::DictionaryAttr ConstOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::ElementsAttr ConstOpAdaptor::value() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ElementsAttr attr = odsAttrs.get("value").cast<::mlir::ElementsAttr>();
  return attr;
}

::mlir::LogicalResult ConstOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_value = odsAttrs.get("value");
    if (!tblgen_value)
      return emitError(loc, "'tf.Const' op ""requires attribute 'value'");

    if (tblgen_value && !((tblgen_value.isa<::mlir::ElementsAttr>())))
      return emitError(loc, "'tf.Const' op ""attribute 'value' failed to satisfy constraint: constant vector/tensor attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> ConstOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range ConstOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

std::pair<unsigned, unsigned> ConstOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range ConstOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ConstOp::output() {
  return *getODSResults(0).begin();
}

::mlir::ElementsAttr ConstOp::valueAttr() {
  return (*this)->getAttr(valueAttrName()).cast<::mlir::ElementsAttr>();
}

::mlir::ElementsAttr ConstOp::value() {
  auto attr = valueAttr();
  return attr;
}

::mlir::Type ConstOp::dtype() {
  return mlir::getElementTypeOrSelf(*getODSResults(0).begin());
}

bool ConstOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "dtype") return true;
 return false;
}

::mlir::DictionaryAttr ConstOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {dtypeAttrName(),
::mlir::TypeAttr::get(dtype())}});
}

void ConstOp::valueAttr(::mlir::ElementsAttr attr) {
  (*this)->setAttr(valueAttrName(), attr);
}

void ConstOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::ElementsAttr value) {
  odsState.addAttribute(valueAttrName(odsState.name), value);
  odsState.addTypes(output);
}

void ConstOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ElementsAttr value) {
  odsState.addAttribute(valueAttrName(odsState.name), value);

        ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
        if (::mlir::succeeded(ConstOp::inferReturnTypes(odsBuilder.getContext(),
                      odsState.location, odsState.operands,
                      odsState.attributes.getDictionary(odsState.getContext()),
                      /*regions=*/{}, inferredReturnTypes)))
          odsState.addTypes(inferredReturnTypes);
        else
          ::llvm::report_fatal_error("Failed to infer result type(s).");
}

void ConstOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ElementsAttr value) {
  odsState.addAttribute(valueAttrName(odsState.name), value);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void ConstOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 0u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

void ConstOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 0u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);

  ::mlir::SmallVector<::mlir::Type, 2> inferredReturnTypes;
  if (::mlir::succeeded(ConstOp::inferReturnTypes(odsBuilder.getContext(),
          odsState.location, operands,
          odsState.attributes.getDictionary(odsState.getContext()),
          odsState.regions, inferredReturnTypes))) {
    assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
    odsState.addTypes(inferredReturnTypes);
  } else {
    ::llvm::report_fatal_error("Failed to infer result type(s).");
  }
}

::mlir::LogicalResult ConstOp::verify() {
  {
    auto tblgen_value = (*this)->getAttr(valueAttrName());
    if (!tblgen_value)
      return emitOpError("requires attribute 'value'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops20(*this, tblgen_value, "value")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void ConstOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::ConstOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::Conv2DBackpropFilterOp definitions
//===----------------------------------------------------------------------===//

Conv2DBackpropFilterOpAdaptor::Conv2DBackpropFilterOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

Conv2DBackpropFilterOpAdaptor::Conv2DBackpropFilterOpAdaptor(Conv2DBackpropFilterOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange Conv2DBackpropFilterOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> Conv2DBackpropFilterOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange Conv2DBackpropFilterOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value Conv2DBackpropFilterOpAdaptor::input() {
  return *getODSOperands(0).begin();
}

::mlir::Value Conv2DBackpropFilterOpAdaptor::filter_sizes() {
  return *getODSOperands(1).begin();
}

::mlir::Value Conv2DBackpropFilterOpAdaptor::out_backprop() {
  return *getODSOperands(2).begin();
}

::mlir::DictionaryAttr Conv2DBackpropFilterOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::ArrayAttr Conv2DBackpropFilterOpAdaptor::strides() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("strides").cast<::mlir::ArrayAttr>();
  return attr;
}

::mlir::BoolAttr Conv2DBackpropFilterOpAdaptor::use_cudnn_on_gpu() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("use_cudnn_on_gpu").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(true);
  return attr;
}

::mlir::StringAttr Conv2DBackpropFilterOpAdaptor::padding() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("padding").cast<::mlir::StringAttr>();
  return attr;
}

::mlir::ArrayAttr Conv2DBackpropFilterOpAdaptor::explicit_paddings() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("explicit_paddings").dyn_cast_or_null<::mlir::ArrayAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getI64ArrayAttr({});
  return attr;
}

::mlir::StringAttr Conv2DBackpropFilterOpAdaptor::data_format() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("data_format").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("NHWC");
  return attr;
}

::mlir::ArrayAttr Conv2DBackpropFilterOpAdaptor::dilations() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("dilations").dyn_cast_or_null<::mlir::ArrayAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getI64ArrayAttr({1, 1, 1, 1});
  return attr;
}

::mlir::LogicalResult Conv2DBackpropFilterOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_strides = odsAttrs.get("strides");
    if (!tblgen_strides)
      return emitError(loc, "'tf.Conv2DBackpropFilter' op ""requires attribute 'strides'");

    if (tblgen_strides && !(((tblgen_strides.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_strides.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return ((attr.isa<::mlir::IntegerAttr>())) && ((attr.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64))); }))))
      return emitError(loc, "'tf.Conv2DBackpropFilter' op ""attribute 'strides' failed to satisfy constraint: 64-bit integer array attribute");
  }
  {
    auto tblgen_use_cudnn_on_gpu = odsAttrs.get("use_cudnn_on_gpu");
    if (tblgen_use_cudnn_on_gpu && !((tblgen_use_cudnn_on_gpu.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.Conv2DBackpropFilter' op ""attribute 'use_cudnn_on_gpu' failed to satisfy constraint: bool attribute");
  }
  {
    auto tblgen_padding = odsAttrs.get("padding");
    if (!tblgen_padding)
      return emitError(loc, "'tf.Conv2DBackpropFilter' op ""requires attribute 'padding'");

    if (tblgen_padding && !((tblgen_padding.cast<StringAttr>().getValue() == "SAME" || tblgen_padding.cast<StringAttr>().getValue() == "VALID" || tblgen_padding.cast<StringAttr>().getValue() == "EXPLICIT")))
      return emitError(loc, "'tf.Conv2DBackpropFilter' op ""attribute 'padding' failed to satisfy constraint: string attribute whose value is SAME, or VALID, or EXPLICIT");
  }
  {
    auto tblgen_explicit_paddings = odsAttrs.get("explicit_paddings");
    if (tblgen_explicit_paddings && !(((tblgen_explicit_paddings.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_explicit_paddings.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return ((attr.isa<::mlir::IntegerAttr>())) && ((attr.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64))); }))))
      return emitError(loc, "'tf.Conv2DBackpropFilter' op ""attribute 'explicit_paddings' failed to satisfy constraint: 64-bit integer array attribute");
  }
  {
    auto tblgen_data_format = odsAttrs.get("data_format");
    if (tblgen_data_format && !((tblgen_data_format.cast<StringAttr>().getValue() == "NHWC" || tblgen_data_format.cast<StringAttr>().getValue() == "NCHW")))
      return emitError(loc, "'tf.Conv2DBackpropFilter' op ""attribute 'data_format' failed to satisfy constraint: 'NHWC' or 'NCHW' convnet data format");
  }
  {
    auto tblgen_dilations = odsAttrs.get("dilations");
    if (tblgen_dilations && !(((tblgen_dilations.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_dilations.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return ((attr.isa<::mlir::IntegerAttr>())) && ((attr.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64))); }))))
      return emitError(loc, "'tf.Conv2DBackpropFilter' op ""attribute 'dilations' failed to satisfy constraint: 64-bit integer array attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> Conv2DBackpropFilterOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range Conv2DBackpropFilterOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value Conv2DBackpropFilterOp::input() {
  return *getODSOperands(0).begin();
}

::mlir::Value Conv2DBackpropFilterOp::filter_sizes() {
  return *getODSOperands(1).begin();
}

::mlir::Value Conv2DBackpropFilterOp::out_backprop() {
  return *getODSOperands(2).begin();
}

::mlir::MutableOperandRange Conv2DBackpropFilterOp::inputMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange Conv2DBackpropFilterOp::filter_sizesMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange Conv2DBackpropFilterOp::out_backpropMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> Conv2DBackpropFilterOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range Conv2DBackpropFilterOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value Conv2DBackpropFilterOp::output() {
  return *getODSResults(0).begin();
}

::mlir::ArrayAttr Conv2DBackpropFilterOp::stridesAttr() {
  return (*this)->getAttr(stridesAttrName()).cast<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr Conv2DBackpropFilterOp::strides() {
  auto attr = stridesAttr();
  return attr;
}

::mlir::BoolAttr Conv2DBackpropFilterOp::use_cudnn_on_gpuAttr() {
  return (*this)->getAttr(use_cudnn_on_gpuAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool Conv2DBackpropFilterOp::use_cudnn_on_gpu() {
  auto attr = use_cudnn_on_gpuAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(true).getValue();
  return attr.getValue();
}

::mlir::StringAttr Conv2DBackpropFilterOp::paddingAttr() {
  return (*this)->getAttr(paddingAttrName()).cast<::mlir::StringAttr>();
}

::llvm::StringRef Conv2DBackpropFilterOp::padding() {
  auto attr = paddingAttr();
  return attr.getValue();
}

::mlir::ArrayAttr Conv2DBackpropFilterOp::explicit_paddingsAttr() {
  return (*this)->getAttr(explicit_paddingsAttrName()).dyn_cast_or_null<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr Conv2DBackpropFilterOp::explicit_paddings() {
  auto attr = explicit_paddingsAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getI64ArrayAttr({});
  return attr;
}

::mlir::StringAttr Conv2DBackpropFilterOp::data_formatAttr() {
  return (*this)->getAttr(data_formatAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef Conv2DBackpropFilterOp::data_format() {
  auto attr = data_formatAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("NHWC").getValue();
  return attr.getValue();
}

::mlir::ArrayAttr Conv2DBackpropFilterOp::dilationsAttr() {
  return (*this)->getAttr(dilationsAttrName()).dyn_cast_or_null<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr Conv2DBackpropFilterOp::dilations() {
  auto attr = dilationsAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getI64ArrayAttr({1, 1, 1, 1});
  return attr;
}

::mlir::Type Conv2DBackpropFilterOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool Conv2DBackpropFilterOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr Conv2DBackpropFilterOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void Conv2DBackpropFilterOp::stridesAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(stridesAttrName(), attr);
}

void Conv2DBackpropFilterOp::use_cudnn_on_gpuAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(use_cudnn_on_gpuAttrName(), attr);
}

void Conv2DBackpropFilterOp::paddingAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(paddingAttrName(), attr);
}

void Conv2DBackpropFilterOp::explicit_paddingsAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(explicit_paddingsAttrName(), attr);
}

void Conv2DBackpropFilterOp::data_formatAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(data_formatAttrName(), attr);
}

void Conv2DBackpropFilterOp::dilationsAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(dilationsAttrName(), attr);
}

void Conv2DBackpropFilterOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input, ::mlir::Value filter_sizes, ::mlir::Value out_backprop, ::mlir::ArrayAttr strides, ::mlir::BoolAttr use_cudnn_on_gpu, ::mlir::StringAttr padding, ::mlir::ArrayAttr explicit_paddings, ::mlir::StringAttr data_format, ::mlir::ArrayAttr dilations) {
  odsState.addOperands(input);
  odsState.addOperands(filter_sizes);
  odsState.addOperands(out_backprop);
  odsState.addAttribute(stridesAttrName(odsState.name), strides);
  odsState.addAttribute(use_cudnn_on_gpuAttrName(odsState.name), use_cudnn_on_gpu);
  odsState.addAttribute(paddingAttrName(odsState.name), padding);
  odsState.addAttribute(explicit_paddingsAttrName(odsState.name), explicit_paddings);
  odsState.addAttribute(data_formatAttrName(odsState.name), data_format);
  odsState.addAttribute(dilationsAttrName(odsState.name), dilations);
  odsState.addTypes(output);
}

void Conv2DBackpropFilterOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::Value filter_sizes, ::mlir::Value out_backprop, ::mlir::ArrayAttr strides, ::mlir::BoolAttr use_cudnn_on_gpu, ::mlir::StringAttr padding, ::mlir::ArrayAttr explicit_paddings, ::mlir::StringAttr data_format, ::mlir::ArrayAttr dilations) {
  odsState.addOperands(input);
  odsState.addOperands(filter_sizes);
  odsState.addOperands(out_backprop);
  odsState.addAttribute(stridesAttrName(odsState.name), strides);
  odsState.addAttribute(use_cudnn_on_gpuAttrName(odsState.name), use_cudnn_on_gpu);
  odsState.addAttribute(paddingAttrName(odsState.name), padding);
  odsState.addAttribute(explicit_paddingsAttrName(odsState.name), explicit_paddings);
  odsState.addAttribute(data_formatAttrName(odsState.name), data_format);
  odsState.addAttribute(dilationsAttrName(odsState.name), dilations);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void Conv2DBackpropFilterOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input, ::mlir::Value filter_sizes, ::mlir::Value out_backprop, ::mlir::ArrayAttr strides, bool use_cudnn_on_gpu, ::llvm::StringRef padding, ::mlir::ArrayAttr explicit_paddings, ::llvm::StringRef data_format, ::mlir::ArrayAttr dilations) {
  odsState.addOperands(input);
  odsState.addOperands(filter_sizes);
  odsState.addOperands(out_backprop);
  odsState.addAttribute(stridesAttrName(odsState.name), strides);
  odsState.addAttribute(use_cudnn_on_gpuAttrName(odsState.name), odsBuilder.getBoolAttr(use_cudnn_on_gpu));
  odsState.addAttribute(paddingAttrName(odsState.name), odsBuilder.getStringAttr(padding));
  odsState.addAttribute(explicit_paddingsAttrName(odsState.name), explicit_paddings);
  odsState.addAttribute(data_formatAttrName(odsState.name), odsBuilder.getStringAttr(data_format));
  odsState.addAttribute(dilationsAttrName(odsState.name), dilations);
  odsState.addTypes(output);
}

void Conv2DBackpropFilterOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::Value filter_sizes, ::mlir::Value out_backprop, ::mlir::ArrayAttr strides, bool use_cudnn_on_gpu, ::llvm::StringRef padding, ::mlir::ArrayAttr explicit_paddings, ::llvm::StringRef data_format, ::mlir::ArrayAttr dilations) {
  odsState.addOperands(input);
  odsState.addOperands(filter_sizes);
  odsState.addOperands(out_backprop);
  odsState.addAttribute(stridesAttrName(odsState.name), strides);
  odsState.addAttribute(use_cudnn_on_gpuAttrName(odsState.name), odsBuilder.getBoolAttr(use_cudnn_on_gpu));
  odsState.addAttribute(paddingAttrName(odsState.name), odsBuilder.getStringAttr(padding));
  odsState.addAttribute(explicit_paddingsAttrName(odsState.name), explicit_paddings);
  odsState.addAttribute(data_formatAttrName(odsState.name), odsBuilder.getStringAttr(data_format));
  odsState.addAttribute(dilationsAttrName(odsState.name), dilations);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void Conv2DBackpropFilterOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 3u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult Conv2DBackpropFilterOp::verify() {
  {
    auto tblgen_strides = (*this)->getAttr(stridesAttrName());
    if (!tblgen_strides)
      return emitOpError("requires attribute 'strides'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops13(*this, tblgen_strides, "strides")))
      return ::mlir::failure();
  }
  {
    auto tblgen_use_cudnn_on_gpu = (*this)->getAttr(use_cudnn_on_gpuAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_use_cudnn_on_gpu, "use_cudnn_on_gpu")))
      return ::mlir::failure();
  }
  {
    auto tblgen_padding = (*this)->getAttr(paddingAttrName());
    if (!tblgen_padding)
      return emitOpError("requires attribute 'padding'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops21(*this, tblgen_padding, "padding")))
      return ::mlir::failure();
  }
  {
    auto tblgen_explicit_paddings = (*this)->getAttr(explicit_paddingsAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops13(*this, tblgen_explicit_paddings, "explicit_paddings")))
      return ::mlir::failure();
  }
  {
    auto tblgen_data_format = (*this)->getAttr(data_formatAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops11(*this, tblgen_data_format, "data_format")))
      return ::mlir::failure();
  }
  {
    auto tblgen_dilations = (*this)->getAttr(dilationsAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops13(*this, tblgen_dilations, "dilations")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops11(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void Conv2DBackpropFilterOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::Conv2DBackpropFilterOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::Conv2DBackpropInputOp definitions
//===----------------------------------------------------------------------===//

Conv2DBackpropInputOpAdaptor::Conv2DBackpropInputOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

Conv2DBackpropInputOpAdaptor::Conv2DBackpropInputOpAdaptor(Conv2DBackpropInputOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange Conv2DBackpropInputOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> Conv2DBackpropInputOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange Conv2DBackpropInputOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value Conv2DBackpropInputOpAdaptor::input_sizes() {
  return *getODSOperands(0).begin();
}

::mlir::Value Conv2DBackpropInputOpAdaptor::filter() {
  return *getODSOperands(1).begin();
}

::mlir::Value Conv2DBackpropInputOpAdaptor::out_backprop() {
  return *getODSOperands(2).begin();
}

::mlir::DictionaryAttr Conv2DBackpropInputOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::ArrayAttr Conv2DBackpropInputOpAdaptor::strides() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("strides").cast<::mlir::ArrayAttr>();
  return attr;
}

::mlir::BoolAttr Conv2DBackpropInputOpAdaptor::use_cudnn_on_gpu() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("use_cudnn_on_gpu").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(true);
  return attr;
}

::mlir::StringAttr Conv2DBackpropInputOpAdaptor::padding() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("padding").cast<::mlir::StringAttr>();
  return attr;
}

::mlir::ArrayAttr Conv2DBackpropInputOpAdaptor::explicit_paddings() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("explicit_paddings").dyn_cast_or_null<::mlir::ArrayAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getI64ArrayAttr({});
  return attr;
}

::mlir::StringAttr Conv2DBackpropInputOpAdaptor::data_format() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("data_format").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("NHWC");
  return attr;
}

::mlir::ArrayAttr Conv2DBackpropInputOpAdaptor::dilations() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("dilations").dyn_cast_or_null<::mlir::ArrayAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getI64ArrayAttr({1, 1, 1, 1});
  return attr;
}

::mlir::LogicalResult Conv2DBackpropInputOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_strides = odsAttrs.get("strides");
    if (!tblgen_strides)
      return emitError(loc, "'tf.Conv2DBackpropInput' op ""requires attribute 'strides'");

    if (tblgen_strides && !(((tblgen_strides.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_strides.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return ((attr.isa<::mlir::IntegerAttr>())) && ((attr.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64))); }))))
      return emitError(loc, "'tf.Conv2DBackpropInput' op ""attribute 'strides' failed to satisfy constraint: 64-bit integer array attribute");
  }
  {
    auto tblgen_use_cudnn_on_gpu = odsAttrs.get("use_cudnn_on_gpu");
    if (tblgen_use_cudnn_on_gpu && !((tblgen_use_cudnn_on_gpu.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.Conv2DBackpropInput' op ""attribute 'use_cudnn_on_gpu' failed to satisfy constraint: bool attribute");
  }
  {
    auto tblgen_padding = odsAttrs.get("padding");
    if (!tblgen_padding)
      return emitError(loc, "'tf.Conv2DBackpropInput' op ""requires attribute 'padding'");

    if (tblgen_padding && !((tblgen_padding.cast<StringAttr>().getValue() == "SAME" || tblgen_padding.cast<StringAttr>().getValue() == "VALID" || tblgen_padding.cast<StringAttr>().getValue() == "EXPLICIT")))
      return emitError(loc, "'tf.Conv2DBackpropInput' op ""attribute 'padding' failed to satisfy constraint: string attribute whose value is SAME, or VALID, or EXPLICIT");
  }
  {
    auto tblgen_explicit_paddings = odsAttrs.get("explicit_paddings");
    if (tblgen_explicit_paddings && !(((tblgen_explicit_paddings.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_explicit_paddings.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return ((attr.isa<::mlir::IntegerAttr>())) && ((attr.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64))); }))))
      return emitError(loc, "'tf.Conv2DBackpropInput' op ""attribute 'explicit_paddings' failed to satisfy constraint: 64-bit integer array attribute");
  }
  {
    auto tblgen_data_format = odsAttrs.get("data_format");
    if (tblgen_data_format && !((tblgen_data_format.cast<StringAttr>().getValue() == "NHWC" || tblgen_data_format.cast<StringAttr>().getValue() == "NCHW")))
      return emitError(loc, "'tf.Conv2DBackpropInput' op ""attribute 'data_format' failed to satisfy constraint: 'NHWC' or 'NCHW' convnet data format");
  }
  {
    auto tblgen_dilations = odsAttrs.get("dilations");
    if (tblgen_dilations && !(((tblgen_dilations.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_dilations.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return ((attr.isa<::mlir::IntegerAttr>())) && ((attr.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64))); }))))
      return emitError(loc, "'tf.Conv2DBackpropInput' op ""attribute 'dilations' failed to satisfy constraint: 64-bit integer array attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> Conv2DBackpropInputOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range Conv2DBackpropInputOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value Conv2DBackpropInputOp::input_sizes() {
  return *getODSOperands(0).begin();
}

::mlir::Value Conv2DBackpropInputOp::filter() {
  return *getODSOperands(1).begin();
}

::mlir::Value Conv2DBackpropInputOp::out_backprop() {
  return *getODSOperands(2).begin();
}

::mlir::MutableOperandRange Conv2DBackpropInputOp::input_sizesMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange Conv2DBackpropInputOp::filterMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange Conv2DBackpropInputOp::out_backpropMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> Conv2DBackpropInputOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range Conv2DBackpropInputOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value Conv2DBackpropInputOp::output() {
  return *getODSResults(0).begin();
}

::mlir::ArrayAttr Conv2DBackpropInputOp::stridesAttr() {
  return (*this)->getAttr(stridesAttrName()).cast<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr Conv2DBackpropInputOp::strides() {
  auto attr = stridesAttr();
  return attr;
}

::mlir::BoolAttr Conv2DBackpropInputOp::use_cudnn_on_gpuAttr() {
  return (*this)->getAttr(use_cudnn_on_gpuAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool Conv2DBackpropInputOp::use_cudnn_on_gpu() {
  auto attr = use_cudnn_on_gpuAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(true).getValue();
  return attr.getValue();
}

::mlir::StringAttr Conv2DBackpropInputOp::paddingAttr() {
  return (*this)->getAttr(paddingAttrName()).cast<::mlir::StringAttr>();
}

::llvm::StringRef Conv2DBackpropInputOp::padding() {
  auto attr = paddingAttr();
  return attr.getValue();
}

::mlir::ArrayAttr Conv2DBackpropInputOp::explicit_paddingsAttr() {
  return (*this)->getAttr(explicit_paddingsAttrName()).dyn_cast_or_null<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr Conv2DBackpropInputOp::explicit_paddings() {
  auto attr = explicit_paddingsAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getI64ArrayAttr({});
  return attr;
}

::mlir::StringAttr Conv2DBackpropInputOp::data_formatAttr() {
  return (*this)->getAttr(data_formatAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef Conv2DBackpropInputOp::data_format() {
  auto attr = data_formatAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("NHWC").getValue();
  return attr.getValue();
}

::mlir::ArrayAttr Conv2DBackpropInputOp::dilationsAttr() {
  return (*this)->getAttr(dilationsAttrName()).dyn_cast_or_null<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr Conv2DBackpropInputOp::dilations() {
  auto attr = dilationsAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getI64ArrayAttr({1, 1, 1, 1});
  return attr;
}

::mlir::Type Conv2DBackpropInputOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(1).begin());
}

bool Conv2DBackpropInputOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr Conv2DBackpropInputOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void Conv2DBackpropInputOp::stridesAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(stridesAttrName(), attr);
}

void Conv2DBackpropInputOp::use_cudnn_on_gpuAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(use_cudnn_on_gpuAttrName(), attr);
}

void Conv2DBackpropInputOp::paddingAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(paddingAttrName(), attr);
}

void Conv2DBackpropInputOp::explicit_paddingsAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(explicit_paddingsAttrName(), attr);
}

void Conv2DBackpropInputOp::data_formatAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(data_formatAttrName(), attr);
}

void Conv2DBackpropInputOp::dilationsAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(dilationsAttrName(), attr);
}

void Conv2DBackpropInputOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input_sizes, ::mlir::Value filter, ::mlir::Value out_backprop, ::mlir::ArrayAttr strides, ::mlir::BoolAttr use_cudnn_on_gpu, ::mlir::StringAttr padding, ::mlir::ArrayAttr explicit_paddings, ::mlir::StringAttr data_format, ::mlir::ArrayAttr dilations) {
  odsState.addOperands(input_sizes);
  odsState.addOperands(filter);
  odsState.addOperands(out_backprop);
  odsState.addAttribute(stridesAttrName(odsState.name), strides);
  odsState.addAttribute(use_cudnn_on_gpuAttrName(odsState.name), use_cudnn_on_gpu);
  odsState.addAttribute(paddingAttrName(odsState.name), padding);
  odsState.addAttribute(explicit_paddingsAttrName(odsState.name), explicit_paddings);
  odsState.addAttribute(data_formatAttrName(odsState.name), data_format);
  odsState.addAttribute(dilationsAttrName(odsState.name), dilations);
  odsState.addTypes(output);
}

void Conv2DBackpropInputOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input_sizes, ::mlir::Value filter, ::mlir::Value out_backprop, ::mlir::ArrayAttr strides, ::mlir::BoolAttr use_cudnn_on_gpu, ::mlir::StringAttr padding, ::mlir::ArrayAttr explicit_paddings, ::mlir::StringAttr data_format, ::mlir::ArrayAttr dilations) {
  odsState.addOperands(input_sizes);
  odsState.addOperands(filter);
  odsState.addOperands(out_backprop);
  odsState.addAttribute(stridesAttrName(odsState.name), strides);
  odsState.addAttribute(use_cudnn_on_gpuAttrName(odsState.name), use_cudnn_on_gpu);
  odsState.addAttribute(paddingAttrName(odsState.name), padding);
  odsState.addAttribute(explicit_paddingsAttrName(odsState.name), explicit_paddings);
  odsState.addAttribute(data_formatAttrName(odsState.name), data_format);
  odsState.addAttribute(dilationsAttrName(odsState.name), dilations);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void Conv2DBackpropInputOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input_sizes, ::mlir::Value filter, ::mlir::Value out_backprop, ::mlir::ArrayAttr strides, bool use_cudnn_on_gpu, ::llvm::StringRef padding, ::mlir::ArrayAttr explicit_paddings, ::llvm::StringRef data_format, ::mlir::ArrayAttr dilations) {
  odsState.addOperands(input_sizes);
  odsState.addOperands(filter);
  odsState.addOperands(out_backprop);
  odsState.addAttribute(stridesAttrName(odsState.name), strides);
  odsState.addAttribute(use_cudnn_on_gpuAttrName(odsState.name), odsBuilder.getBoolAttr(use_cudnn_on_gpu));
  odsState.addAttribute(paddingAttrName(odsState.name), odsBuilder.getStringAttr(padding));
  odsState.addAttribute(explicit_paddingsAttrName(odsState.name), explicit_paddings);
  odsState.addAttribute(data_formatAttrName(odsState.name), odsBuilder.getStringAttr(data_format));
  odsState.addAttribute(dilationsAttrName(odsState.name), dilations);
  odsState.addTypes(output);
}

void Conv2DBackpropInputOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input_sizes, ::mlir::Value filter, ::mlir::Value out_backprop, ::mlir::ArrayAttr strides, bool use_cudnn_on_gpu, ::llvm::StringRef padding, ::mlir::ArrayAttr explicit_paddings, ::llvm::StringRef data_format, ::mlir::ArrayAttr dilations) {
  odsState.addOperands(input_sizes);
  odsState.addOperands(filter);
  odsState.addOperands(out_backprop);
  odsState.addAttribute(stridesAttrName(odsState.name), strides);
  odsState.addAttribute(use_cudnn_on_gpuAttrName(odsState.name), odsBuilder.getBoolAttr(use_cudnn_on_gpu));
  odsState.addAttribute(paddingAttrName(odsState.name), odsBuilder.getStringAttr(padding));
  odsState.addAttribute(explicit_paddingsAttrName(odsState.name), explicit_paddings);
  odsState.addAttribute(data_formatAttrName(odsState.name), odsBuilder.getStringAttr(data_format));
  odsState.addAttribute(dilationsAttrName(odsState.name), dilations);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void Conv2DBackpropInputOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 3u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult Conv2DBackpropInputOp::verify() {
  {
    auto tblgen_strides = (*this)->getAttr(stridesAttrName());
    if (!tblgen_strides)
      return emitOpError("requires attribute 'strides'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops13(*this, tblgen_strides, "strides")))
      return ::mlir::failure();
  }
  {
    auto tblgen_use_cudnn_on_gpu = (*this)->getAttr(use_cudnn_on_gpuAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_use_cudnn_on_gpu, "use_cudnn_on_gpu")))
      return ::mlir::failure();
  }
  {
    auto tblgen_padding = (*this)->getAttr(paddingAttrName());
    if (!tblgen_padding)
      return emitOpError("requires attribute 'padding'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops21(*this, tblgen_padding, "padding")))
      return ::mlir::failure();
  }
  {
    auto tblgen_explicit_paddings = (*this)->getAttr(explicit_paddingsAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops13(*this, tblgen_explicit_paddings, "explicit_paddings")))
      return ::mlir::failure();
  }
  {
    auto tblgen_data_format = (*this)->getAttr(data_formatAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops11(*this, tblgen_data_format, "data_format")))
      return ::mlir::failure();
  }
  {
    auto tblgen_dilations = (*this)->getAttr(dilationsAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops13(*this, tblgen_dilations, "dilations")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops11(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops34(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops34(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops34(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return Verify(*this);
}

void Conv2DBackpropInputOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::Conv2DBackpropInputOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::Conv2DOp definitions
//===----------------------------------------------------------------------===//

Conv2DOpAdaptor::Conv2DOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

Conv2DOpAdaptor::Conv2DOpAdaptor(Conv2DOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange Conv2DOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> Conv2DOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange Conv2DOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value Conv2DOpAdaptor::input() {
  return *getODSOperands(0).begin();
}

::mlir::Value Conv2DOpAdaptor::filter() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr Conv2DOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::ArrayAttr Conv2DOpAdaptor::strides() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("strides").cast<::mlir::ArrayAttr>();
  return attr;
}

::mlir::BoolAttr Conv2DOpAdaptor::use_cudnn_on_gpu() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("use_cudnn_on_gpu").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(true);
  return attr;
}

::mlir::StringAttr Conv2DOpAdaptor::padding() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("padding").cast<::mlir::StringAttr>();
  return attr;
}

::mlir::ArrayAttr Conv2DOpAdaptor::explicit_paddings() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("explicit_paddings").dyn_cast_or_null<::mlir::ArrayAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getI64ArrayAttr({});
  return attr;
}

::mlir::StringAttr Conv2DOpAdaptor::data_format() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("data_format").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("NHWC");
  return attr;
}

::mlir::ArrayAttr Conv2DOpAdaptor::dilations() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("dilations").dyn_cast_or_null<::mlir::ArrayAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getI64ArrayAttr({1, 1, 1, 1});
  return attr;
}

::mlir::LogicalResult Conv2DOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_strides = odsAttrs.get("strides");
    if (!tblgen_strides)
      return emitError(loc, "'tf.Conv2D' op ""requires attribute 'strides'");

    if (tblgen_strides && !(((tblgen_strides.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_strides.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return ((attr.isa<::mlir::IntegerAttr>())) && ((attr.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64))); }))))
      return emitError(loc, "'tf.Conv2D' op ""attribute 'strides' failed to satisfy constraint: 64-bit integer array attribute");
  }
  {
    auto tblgen_use_cudnn_on_gpu = odsAttrs.get("use_cudnn_on_gpu");
    if (tblgen_use_cudnn_on_gpu && !((tblgen_use_cudnn_on_gpu.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.Conv2D' op ""attribute 'use_cudnn_on_gpu' failed to satisfy constraint: bool attribute");
  }
  {
    auto tblgen_padding = odsAttrs.get("padding");
    if (!tblgen_padding)
      return emitError(loc, "'tf.Conv2D' op ""requires attribute 'padding'");

    if (tblgen_padding && !((tblgen_padding.cast<StringAttr>().getValue() == "SAME" || tblgen_padding.cast<StringAttr>().getValue() == "VALID" || tblgen_padding.cast<StringAttr>().getValue() == "EXPLICIT")))
      return emitError(loc, "'tf.Conv2D' op ""attribute 'padding' failed to satisfy constraint: string attribute whose value is SAME, or VALID, or EXPLICIT");
  }
  {
    auto tblgen_explicit_paddings = odsAttrs.get("explicit_paddings");
    if (tblgen_explicit_paddings && !(((tblgen_explicit_paddings.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_explicit_paddings.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return ((attr.isa<::mlir::IntegerAttr>())) && ((attr.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64))); }))))
      return emitError(loc, "'tf.Conv2D' op ""attribute 'explicit_paddings' failed to satisfy constraint: 64-bit integer array attribute");
  }
  {
    auto tblgen_data_format = odsAttrs.get("data_format");
    if (tblgen_data_format && !((tblgen_data_format.cast<StringAttr>().getValue() == "NHWC" || tblgen_data_format.cast<StringAttr>().getValue() == "NCHW")))
      return emitError(loc, "'tf.Conv2D' op ""attribute 'data_format' failed to satisfy constraint: 'NHWC' or 'NCHW' convnet data format");
  }
  {
    auto tblgen_dilations = odsAttrs.get("dilations");
    if (tblgen_dilations && !(((tblgen_dilations.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_dilations.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return ((attr.isa<::mlir::IntegerAttr>())) && ((attr.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64))); }))))
      return emitError(loc, "'tf.Conv2D' op ""attribute 'dilations' failed to satisfy constraint: 64-bit integer array attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> Conv2DOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range Conv2DOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value Conv2DOp::input() {
  return *getODSOperands(0).begin();
}

::mlir::Value Conv2DOp::filter() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange Conv2DOp::inputMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange Conv2DOp::filterMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> Conv2DOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range Conv2DOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value Conv2DOp::output() {
  return *getODSResults(0).begin();
}

::mlir::ArrayAttr Conv2DOp::stridesAttr() {
  return (*this)->getAttr(stridesAttrName()).cast<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr Conv2DOp::strides() {
  auto attr = stridesAttr();
  return attr;
}

::mlir::BoolAttr Conv2DOp::use_cudnn_on_gpuAttr() {
  return (*this)->getAttr(use_cudnn_on_gpuAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool Conv2DOp::use_cudnn_on_gpu() {
  auto attr = use_cudnn_on_gpuAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(true).getValue();
  return attr.getValue();
}

::mlir::StringAttr Conv2DOp::paddingAttr() {
  return (*this)->getAttr(paddingAttrName()).cast<::mlir::StringAttr>();
}

::llvm::StringRef Conv2DOp::padding() {
  auto attr = paddingAttr();
  return attr.getValue();
}

::mlir::ArrayAttr Conv2DOp::explicit_paddingsAttr() {
  return (*this)->getAttr(explicit_paddingsAttrName()).dyn_cast_or_null<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr Conv2DOp::explicit_paddings() {
  auto attr = explicit_paddingsAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getI64ArrayAttr({});
  return attr;
}

::mlir::StringAttr Conv2DOp::data_formatAttr() {
  return (*this)->getAttr(data_formatAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef Conv2DOp::data_format() {
  auto attr = data_formatAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("NHWC").getValue();
  return attr.getValue();
}

::mlir::ArrayAttr Conv2DOp::dilationsAttr() {
  return (*this)->getAttr(dilationsAttrName()).dyn_cast_or_null<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr Conv2DOp::dilations() {
  auto attr = dilationsAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getI64ArrayAttr({1, 1, 1, 1});
  return attr;
}

::mlir::Type Conv2DOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool Conv2DOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr Conv2DOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void Conv2DOp::stridesAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(stridesAttrName(), attr);
}

void Conv2DOp::use_cudnn_on_gpuAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(use_cudnn_on_gpuAttrName(), attr);
}

void Conv2DOp::paddingAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(paddingAttrName(), attr);
}

void Conv2DOp::explicit_paddingsAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(explicit_paddingsAttrName(), attr);
}

void Conv2DOp::data_formatAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(data_formatAttrName(), attr);
}

void Conv2DOp::dilationsAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(dilationsAttrName(), attr);
}

void Conv2DOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input, ::mlir::Value filter, ::mlir::ArrayAttr strides, ::mlir::BoolAttr use_cudnn_on_gpu, ::mlir::StringAttr padding, ::mlir::ArrayAttr explicit_paddings, ::mlir::StringAttr data_format, ::mlir::ArrayAttr dilations) {
  odsState.addOperands(input);
  odsState.addOperands(filter);
  odsState.addAttribute(stridesAttrName(odsState.name), strides);
  odsState.addAttribute(use_cudnn_on_gpuAttrName(odsState.name), use_cudnn_on_gpu);
  odsState.addAttribute(paddingAttrName(odsState.name), padding);
  odsState.addAttribute(explicit_paddingsAttrName(odsState.name), explicit_paddings);
  odsState.addAttribute(data_formatAttrName(odsState.name), data_format);
  odsState.addAttribute(dilationsAttrName(odsState.name), dilations);
  odsState.addTypes(output);
}

void Conv2DOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value input, ::mlir::Value filter, ::mlir::ArrayAttr strides, ::mlir::BoolAttr use_cudnn_on_gpu, ::mlir::StringAttr padding, ::mlir::ArrayAttr explicit_paddings, ::mlir::StringAttr data_format, ::mlir::ArrayAttr dilations) {
  odsState.addOperands(input);
  odsState.addOperands(filter);
  odsState.addAttribute(stridesAttrName(odsState.name), strides);
  odsState.addAttribute(use_cudnn_on_gpuAttrName(odsState.name), use_cudnn_on_gpu);
  odsState.addAttribute(paddingAttrName(odsState.name), padding);
  odsState.addAttribute(explicit_paddingsAttrName(odsState.name), explicit_paddings);
  odsState.addAttribute(data_formatAttrName(odsState.name), data_format);
  odsState.addAttribute(dilationsAttrName(odsState.name), dilations);

        ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
        if (::mlir::succeeded(Conv2DOp::inferReturnTypes(odsBuilder.getContext(),
                      odsState.location, odsState.operands,
                      odsState.attributes.getDictionary(odsState.getContext()),
                      /*regions=*/{}, inferredReturnTypes)))
          odsState.addTypes(inferredReturnTypes);
        else
          ::llvm::report_fatal_error("Failed to infer result type(s).");
}

void Conv2DOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::Value filter, ::mlir::ArrayAttr strides, ::mlir::BoolAttr use_cudnn_on_gpu, ::mlir::StringAttr padding, ::mlir::ArrayAttr explicit_paddings, ::mlir::StringAttr data_format, ::mlir::ArrayAttr dilations) {
  odsState.addOperands(input);
  odsState.addOperands(filter);
  odsState.addAttribute(stridesAttrName(odsState.name), strides);
  odsState.addAttribute(use_cudnn_on_gpuAttrName(odsState.name), use_cudnn_on_gpu);
  odsState.addAttribute(paddingAttrName(odsState.name), padding);
  odsState.addAttribute(explicit_paddingsAttrName(odsState.name), explicit_paddings);
  odsState.addAttribute(data_formatAttrName(odsState.name), data_format);
  odsState.addAttribute(dilationsAttrName(odsState.name), dilations);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void Conv2DOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input, ::mlir::Value filter, ::mlir::ArrayAttr strides, bool use_cudnn_on_gpu, ::llvm::StringRef padding, ::mlir::ArrayAttr explicit_paddings, ::llvm::StringRef data_format, ::mlir::ArrayAttr dilations) {
  odsState.addOperands(input);
  odsState.addOperands(filter);
  odsState.addAttribute(stridesAttrName(odsState.name), strides);
  odsState.addAttribute(use_cudnn_on_gpuAttrName(odsState.name), odsBuilder.getBoolAttr(use_cudnn_on_gpu));
  odsState.addAttribute(paddingAttrName(odsState.name), odsBuilder.getStringAttr(padding));
  odsState.addAttribute(explicit_paddingsAttrName(odsState.name), explicit_paddings);
  odsState.addAttribute(data_formatAttrName(odsState.name), odsBuilder.getStringAttr(data_format));
  odsState.addAttribute(dilationsAttrName(odsState.name), dilations);
  odsState.addTypes(output);
}

void Conv2DOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value input, ::mlir::Value filter, ::mlir::ArrayAttr strides, bool use_cudnn_on_gpu, ::llvm::StringRef padding, ::mlir::ArrayAttr explicit_paddings, ::llvm::StringRef data_format, ::mlir::ArrayAttr dilations) {
  odsState.addOperands(input);
  odsState.addOperands(filter);
  odsState.addAttribute(stridesAttrName(odsState.name), strides);
  odsState.addAttribute(use_cudnn_on_gpuAttrName(odsState.name), odsBuilder.getBoolAttr(use_cudnn_on_gpu));
  odsState.addAttribute(paddingAttrName(odsState.name), odsBuilder.getStringAttr(padding));
  odsState.addAttribute(explicit_paddingsAttrName(odsState.name), explicit_paddings);
  odsState.addAttribute(data_formatAttrName(odsState.name), odsBuilder.getStringAttr(data_format));
  odsState.addAttribute(dilationsAttrName(odsState.name), dilations);

        ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
        if (::mlir::succeeded(Conv2DOp::inferReturnTypes(odsBuilder.getContext(),
                      odsState.location, odsState.operands,
                      odsState.attributes.getDictionary(odsState.getContext()),
                      /*regions=*/{}, inferredReturnTypes)))
          odsState.addTypes(inferredReturnTypes);
        else
          ::llvm::report_fatal_error("Failed to infer result type(s).");
}

void Conv2DOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::Value filter, ::mlir::ArrayAttr strides, bool use_cudnn_on_gpu, ::llvm::StringRef padding, ::mlir::ArrayAttr explicit_paddings, ::llvm::StringRef data_format, ::mlir::ArrayAttr dilations) {
  odsState.addOperands(input);
  odsState.addOperands(filter);
  odsState.addAttribute(stridesAttrName(odsState.name), strides);
  odsState.addAttribute(use_cudnn_on_gpuAttrName(odsState.name), odsBuilder.getBoolAttr(use_cudnn_on_gpu));
  odsState.addAttribute(paddingAttrName(odsState.name), odsBuilder.getStringAttr(padding));
  odsState.addAttribute(explicit_paddingsAttrName(odsState.name), explicit_paddings);
  odsState.addAttribute(data_formatAttrName(odsState.name), odsBuilder.getStringAttr(data_format));
  odsState.addAttribute(dilationsAttrName(odsState.name), dilations);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void Conv2DOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

void Conv2DOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);

  ::mlir::SmallVector<::mlir::Type, 2> inferredReturnTypes;
  if (::mlir::succeeded(Conv2DOp::inferReturnTypes(odsBuilder.getContext(),
          odsState.location, operands,
          odsState.attributes.getDictionary(odsState.getContext()),
          odsState.regions, inferredReturnTypes))) {
    assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
    odsState.addTypes(inferredReturnTypes);
  } else {
    ::llvm::report_fatal_error("Failed to infer result type(s).");
  }
}

::mlir::LogicalResult Conv2DOp::verify() {
  {
    auto tblgen_strides = (*this)->getAttr(stridesAttrName());
    if (!tblgen_strides)
      return emitOpError("requires attribute 'strides'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops13(*this, tblgen_strides, "strides")))
      return ::mlir::failure();
  }
  {
    auto tblgen_use_cudnn_on_gpu = (*this)->getAttr(use_cudnn_on_gpuAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_use_cudnn_on_gpu, "use_cudnn_on_gpu")))
      return ::mlir::failure();
  }
  {
    auto tblgen_padding = (*this)->getAttr(paddingAttrName());
    if (!tblgen_padding)
      return emitOpError("requires attribute 'padding'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops21(*this, tblgen_padding, "padding")))
      return ::mlir::failure();
  }
  {
    auto tblgen_explicit_paddings = (*this)->getAttr(explicit_paddingsAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops13(*this, tblgen_explicit_paddings, "explicit_paddings")))
      return ::mlir::failure();
  }
  {
    auto tblgen_data_format = (*this)->getAttr(data_formatAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops11(*this, tblgen_data_format, "data_format")))
      return ::mlir::failure();
  }
  {
    auto tblgen_dilations = (*this)->getAttr(dilationsAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops13(*this, tblgen_dilations, "dilations")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops34(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops34(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops34(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return Verify(*this);
}

void Conv2DOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::Conv2DOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::Conv3DBackpropFilterV2Op definitions
//===----------------------------------------------------------------------===//

Conv3DBackpropFilterV2OpAdaptor::Conv3DBackpropFilterV2OpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

Conv3DBackpropFilterV2OpAdaptor::Conv3DBackpropFilterV2OpAdaptor(Conv3DBackpropFilterV2Op &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange Conv3DBackpropFilterV2OpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> Conv3DBackpropFilterV2OpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange Conv3DBackpropFilterV2OpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value Conv3DBackpropFilterV2OpAdaptor::input() {
  return *getODSOperands(0).begin();
}

::mlir::Value Conv3DBackpropFilterV2OpAdaptor::filter_sizes() {
  return *getODSOperands(1).begin();
}

::mlir::Value Conv3DBackpropFilterV2OpAdaptor::out_backprop() {
  return *getODSOperands(2).begin();
}

::mlir::DictionaryAttr Conv3DBackpropFilterV2OpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::ArrayAttr Conv3DBackpropFilterV2OpAdaptor::strides() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("strides").cast<::mlir::ArrayAttr>();
  return attr;
}

::mlir::StringAttr Conv3DBackpropFilterV2OpAdaptor::padding() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("padding").cast<::mlir::StringAttr>();
  return attr;
}

::mlir::StringAttr Conv3DBackpropFilterV2OpAdaptor::data_format() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("data_format").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("NDHWC");
  return attr;
}

::mlir::ArrayAttr Conv3DBackpropFilterV2OpAdaptor::dilations() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("dilations").dyn_cast_or_null<::mlir::ArrayAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getI64ArrayAttr({1, 1, 1, 1, 1});
  return attr;
}

::mlir::LogicalResult Conv3DBackpropFilterV2OpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_strides = odsAttrs.get("strides");
    if (!tblgen_strides)
      return emitError(loc, "'tf.Conv3DBackpropFilterV2' op ""requires attribute 'strides'");

    if (tblgen_strides && !((((tblgen_strides.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_strides.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return ((attr.isa<::mlir::IntegerAttr>())) && ((attr.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64))); }))) && ((tblgen_strides.cast<::mlir::ArrayAttr>().size() >= 5))))
      return emitError(loc, "'tf.Conv3DBackpropFilterV2' op ""attribute 'strides' failed to satisfy constraint: 64-bit integer array attribute with at least 5 elements");
  }
  {
    auto tblgen_padding = odsAttrs.get("padding");
    if (!tblgen_padding)
      return emitError(loc, "'tf.Conv3DBackpropFilterV2' op ""requires attribute 'padding'");

    if (tblgen_padding && !((tblgen_padding.cast<StringAttr>().getValue() == "SAME" || tblgen_padding.cast<StringAttr>().getValue() == "VALID")))
      return emitError(loc, "'tf.Conv3DBackpropFilterV2' op ""attribute 'padding' failed to satisfy constraint: string attribute whose value is SAME, or VALID");
  }
  {
    auto tblgen_data_format = odsAttrs.get("data_format");
    if (tblgen_data_format && !((tblgen_data_format.cast<StringAttr>().getValue() == "NDHWC" || tblgen_data_format.cast<StringAttr>().getValue() == "NCDHW")))
      return emitError(loc, "'tf.Conv3DBackpropFilterV2' op ""attribute 'data_format' failed to satisfy constraint: string attribute whose value is NDHWC, or NCDHW");
  }
  {
    auto tblgen_dilations = odsAttrs.get("dilations");
    if (tblgen_dilations && !(((tblgen_dilations.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_dilations.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return ((attr.isa<::mlir::IntegerAttr>())) && ((attr.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64))); }))))
      return emitError(loc, "'tf.Conv3DBackpropFilterV2' op ""attribute 'dilations' failed to satisfy constraint: 64-bit integer array attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> Conv3DBackpropFilterV2Op::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range Conv3DBackpropFilterV2Op::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value Conv3DBackpropFilterV2Op::input() {
  return *getODSOperands(0).begin();
}

::mlir::Value Conv3DBackpropFilterV2Op::filter_sizes() {
  return *getODSOperands(1).begin();
}

::mlir::Value Conv3DBackpropFilterV2Op::out_backprop() {
  return *getODSOperands(2).begin();
}

::mlir::MutableOperandRange Conv3DBackpropFilterV2Op::inputMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange Conv3DBackpropFilterV2Op::filter_sizesMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange Conv3DBackpropFilterV2Op::out_backpropMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> Conv3DBackpropFilterV2Op::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range Conv3DBackpropFilterV2Op::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value Conv3DBackpropFilterV2Op::output() {
  return *getODSResults(0).begin();
}

::mlir::ArrayAttr Conv3DBackpropFilterV2Op::stridesAttr() {
  return (*this)->getAttr(stridesAttrName()).cast<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr Conv3DBackpropFilterV2Op::strides() {
  auto attr = stridesAttr();
  return attr;
}

::mlir::StringAttr Conv3DBackpropFilterV2Op::paddingAttr() {
  return (*this)->getAttr(paddingAttrName()).cast<::mlir::StringAttr>();
}

::llvm::StringRef Conv3DBackpropFilterV2Op::padding() {
  auto attr = paddingAttr();
  return attr.getValue();
}

::mlir::StringAttr Conv3DBackpropFilterV2Op::data_formatAttr() {
  return (*this)->getAttr(data_formatAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef Conv3DBackpropFilterV2Op::data_format() {
  auto attr = data_formatAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("NDHWC").getValue();
  return attr.getValue();
}

::mlir::ArrayAttr Conv3DBackpropFilterV2Op::dilationsAttr() {
  return (*this)->getAttr(dilationsAttrName()).dyn_cast_or_null<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr Conv3DBackpropFilterV2Op::dilations() {
  auto attr = dilationsAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getI64ArrayAttr({1, 1, 1, 1, 1});
  return attr;
}

::mlir::Type Conv3DBackpropFilterV2Op::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool Conv3DBackpropFilterV2Op::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr Conv3DBackpropFilterV2Op::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void Conv3DBackpropFilterV2Op::stridesAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(stridesAttrName(), attr);
}

void Conv3DBackpropFilterV2Op::paddingAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(paddingAttrName(), attr);
}

void Conv3DBackpropFilterV2Op::data_formatAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(data_formatAttrName(), attr);
}

void Conv3DBackpropFilterV2Op::dilationsAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(dilationsAttrName(), attr);
}

void Conv3DBackpropFilterV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input, ::mlir::Value filter_sizes, ::mlir::Value out_backprop, ::mlir::ArrayAttr strides, ::mlir::StringAttr padding, ::mlir::StringAttr data_format, ::mlir::ArrayAttr dilations) {
  odsState.addOperands(input);
  odsState.addOperands(filter_sizes);
  odsState.addOperands(out_backprop);
  odsState.addAttribute(stridesAttrName(odsState.name), strides);
  odsState.addAttribute(paddingAttrName(odsState.name), padding);
  odsState.addAttribute(data_formatAttrName(odsState.name), data_format);
  odsState.addAttribute(dilationsAttrName(odsState.name), dilations);
  odsState.addTypes(output);
}

void Conv3DBackpropFilterV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::Value filter_sizes, ::mlir::Value out_backprop, ::mlir::ArrayAttr strides, ::mlir::StringAttr padding, ::mlir::StringAttr data_format, ::mlir::ArrayAttr dilations) {
  odsState.addOperands(input);
  odsState.addOperands(filter_sizes);
  odsState.addOperands(out_backprop);
  odsState.addAttribute(stridesAttrName(odsState.name), strides);
  odsState.addAttribute(paddingAttrName(odsState.name), padding);
  odsState.addAttribute(data_formatAttrName(odsState.name), data_format);
  odsState.addAttribute(dilationsAttrName(odsState.name), dilations);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void Conv3DBackpropFilterV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input, ::mlir::Value filter_sizes, ::mlir::Value out_backprop, ::mlir::ArrayAttr strides, ::llvm::StringRef padding, ::llvm::StringRef data_format, ::mlir::ArrayAttr dilations) {
  odsState.addOperands(input);
  odsState.addOperands(filter_sizes);
  odsState.addOperands(out_backprop);
  odsState.addAttribute(stridesAttrName(odsState.name), strides);
  odsState.addAttribute(paddingAttrName(odsState.name), odsBuilder.getStringAttr(padding));
  odsState.addAttribute(data_formatAttrName(odsState.name), odsBuilder.getStringAttr(data_format));
  odsState.addAttribute(dilationsAttrName(odsState.name), dilations);
  odsState.addTypes(output);
}

void Conv3DBackpropFilterV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::Value filter_sizes, ::mlir::Value out_backprop, ::mlir::ArrayAttr strides, ::llvm::StringRef padding, ::llvm::StringRef data_format, ::mlir::ArrayAttr dilations) {
  odsState.addOperands(input);
  odsState.addOperands(filter_sizes);
  odsState.addOperands(out_backprop);
  odsState.addAttribute(stridesAttrName(odsState.name), strides);
  odsState.addAttribute(paddingAttrName(odsState.name), odsBuilder.getStringAttr(padding));
  odsState.addAttribute(data_formatAttrName(odsState.name), odsBuilder.getStringAttr(data_format));
  odsState.addAttribute(dilationsAttrName(odsState.name), dilations);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void Conv3DBackpropFilterV2Op::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 3u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult Conv3DBackpropFilterV2Op::verify() {
  {
    auto tblgen_strides = (*this)->getAttr(stridesAttrName());
    if (!tblgen_strides)
      return emitOpError("requires attribute 'strides'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops7(*this, tblgen_strides, "strides")))
      return ::mlir::failure();
  }
  {
    auto tblgen_padding = (*this)->getAttr(paddingAttrName());
    if (!tblgen_padding)
      return emitOpError("requires attribute 'padding'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops8(*this, tblgen_padding, "padding")))
      return ::mlir::failure();
  }
  {
    auto tblgen_data_format = (*this)->getAttr(data_formatAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops9(*this, tblgen_data_format, "data_format")))
      return ::mlir::failure();
  }
  {
    auto tblgen_dilations = (*this)->getAttr(dilationsAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops13(*this, tblgen_dilations, "dilations")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops11(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void Conv3DBackpropFilterV2Op::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::Conv3DBackpropFilterV2Op)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::Conv3DBackpropInputV2Op definitions
//===----------------------------------------------------------------------===//

Conv3DBackpropInputV2OpAdaptor::Conv3DBackpropInputV2OpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

Conv3DBackpropInputV2OpAdaptor::Conv3DBackpropInputV2OpAdaptor(Conv3DBackpropInputV2Op &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange Conv3DBackpropInputV2OpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> Conv3DBackpropInputV2OpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange Conv3DBackpropInputV2OpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value Conv3DBackpropInputV2OpAdaptor::input_sizes() {
  return *getODSOperands(0).begin();
}

::mlir::Value Conv3DBackpropInputV2OpAdaptor::filter() {
  return *getODSOperands(1).begin();
}

::mlir::Value Conv3DBackpropInputV2OpAdaptor::out_backprop() {
  return *getODSOperands(2).begin();
}

::mlir::DictionaryAttr Conv3DBackpropInputV2OpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::ArrayAttr Conv3DBackpropInputV2OpAdaptor::strides() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("strides").cast<::mlir::ArrayAttr>();
  return attr;
}

::mlir::StringAttr Conv3DBackpropInputV2OpAdaptor::padding() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("padding").cast<::mlir::StringAttr>();
  return attr;
}

::mlir::StringAttr Conv3DBackpropInputV2OpAdaptor::data_format() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("data_format").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("NDHWC");
  return attr;
}

::mlir::ArrayAttr Conv3DBackpropInputV2OpAdaptor::dilations() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("dilations").dyn_cast_or_null<::mlir::ArrayAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getI64ArrayAttr({1, 1, 1, 1, 1});
  return attr;
}

::mlir::LogicalResult Conv3DBackpropInputV2OpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_strides = odsAttrs.get("strides");
    if (!tblgen_strides)
      return emitError(loc, "'tf.Conv3DBackpropInputV2' op ""requires attribute 'strides'");

    if (tblgen_strides && !((((tblgen_strides.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_strides.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return ((attr.isa<::mlir::IntegerAttr>())) && ((attr.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64))); }))) && ((tblgen_strides.cast<::mlir::ArrayAttr>().size() >= 5))))
      return emitError(loc, "'tf.Conv3DBackpropInputV2' op ""attribute 'strides' failed to satisfy constraint: 64-bit integer array attribute with at least 5 elements");
  }
  {
    auto tblgen_padding = odsAttrs.get("padding");
    if (!tblgen_padding)
      return emitError(loc, "'tf.Conv3DBackpropInputV2' op ""requires attribute 'padding'");

    if (tblgen_padding && !((tblgen_padding.cast<StringAttr>().getValue() == "SAME" || tblgen_padding.cast<StringAttr>().getValue() == "VALID")))
      return emitError(loc, "'tf.Conv3DBackpropInputV2' op ""attribute 'padding' failed to satisfy constraint: string attribute whose value is SAME, or VALID");
  }
  {
    auto tblgen_data_format = odsAttrs.get("data_format");
    if (tblgen_data_format && !((tblgen_data_format.cast<StringAttr>().getValue() == "NDHWC" || tblgen_data_format.cast<StringAttr>().getValue() == "NCDHW")))
      return emitError(loc, "'tf.Conv3DBackpropInputV2' op ""attribute 'data_format' failed to satisfy constraint: string attribute whose value is NDHWC, or NCDHW");
  }
  {
    auto tblgen_dilations = odsAttrs.get("dilations");
    if (tblgen_dilations && !(((tblgen_dilations.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_dilations.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return ((attr.isa<::mlir::IntegerAttr>())) && ((attr.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64))); }))))
      return emitError(loc, "'tf.Conv3DBackpropInputV2' op ""attribute 'dilations' failed to satisfy constraint: 64-bit integer array attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> Conv3DBackpropInputV2Op::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range Conv3DBackpropInputV2Op::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value Conv3DBackpropInputV2Op::input_sizes() {
  return *getODSOperands(0).begin();
}

::mlir::Value Conv3DBackpropInputV2Op::filter() {
  return *getODSOperands(1).begin();
}

::mlir::Value Conv3DBackpropInputV2Op::out_backprop() {
  return *getODSOperands(2).begin();
}

::mlir::MutableOperandRange Conv3DBackpropInputV2Op::input_sizesMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange Conv3DBackpropInputV2Op::filterMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange Conv3DBackpropInputV2Op::out_backpropMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> Conv3DBackpropInputV2Op::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range Conv3DBackpropInputV2Op::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value Conv3DBackpropInputV2Op::output() {
  return *getODSResults(0).begin();
}

::mlir::ArrayAttr Conv3DBackpropInputV2Op::stridesAttr() {
  return (*this)->getAttr(stridesAttrName()).cast<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr Conv3DBackpropInputV2Op::strides() {
  auto attr = stridesAttr();
  return attr;
}

::mlir::StringAttr Conv3DBackpropInputV2Op::paddingAttr() {
  return (*this)->getAttr(paddingAttrName()).cast<::mlir::StringAttr>();
}

::llvm::StringRef Conv3DBackpropInputV2Op::padding() {
  auto attr = paddingAttr();
  return attr.getValue();
}

::mlir::StringAttr Conv3DBackpropInputV2Op::data_formatAttr() {
  return (*this)->getAttr(data_formatAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef Conv3DBackpropInputV2Op::data_format() {
  auto attr = data_formatAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("NDHWC").getValue();
  return attr.getValue();
}

::mlir::ArrayAttr Conv3DBackpropInputV2Op::dilationsAttr() {
  return (*this)->getAttr(dilationsAttrName()).dyn_cast_or_null<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr Conv3DBackpropInputV2Op::dilations() {
  auto attr = dilationsAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getI64ArrayAttr({1, 1, 1, 1, 1});
  return attr;
}

::mlir::Type Conv3DBackpropInputV2Op::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(1).begin());
}

::mlir::Type Conv3DBackpropInputV2Op::Tshape() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool Conv3DBackpropInputV2Op::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
  if (name == "Tshape") return true;
 return false;
}

::mlir::DictionaryAttr Conv3DBackpropInputV2Op::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())},
    {TshapeAttrName(),
::mlir::TypeAttr::get(Tshape())}});
}

void Conv3DBackpropInputV2Op::stridesAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(stridesAttrName(), attr);
}

void Conv3DBackpropInputV2Op::paddingAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(paddingAttrName(), attr);
}

void Conv3DBackpropInputV2Op::data_formatAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(data_formatAttrName(), attr);
}

void Conv3DBackpropInputV2Op::dilationsAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(dilationsAttrName(), attr);
}

void Conv3DBackpropInputV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input_sizes, ::mlir::Value filter, ::mlir::Value out_backprop, ::mlir::ArrayAttr strides, ::mlir::StringAttr padding, ::mlir::StringAttr data_format, ::mlir::ArrayAttr dilations) {
  odsState.addOperands(input_sizes);
  odsState.addOperands(filter);
  odsState.addOperands(out_backprop);
  odsState.addAttribute(stridesAttrName(odsState.name), strides);
  odsState.addAttribute(paddingAttrName(odsState.name), padding);
  odsState.addAttribute(data_formatAttrName(odsState.name), data_format);
  odsState.addAttribute(dilationsAttrName(odsState.name), dilations);
  odsState.addTypes(output);
}

void Conv3DBackpropInputV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input_sizes, ::mlir::Value filter, ::mlir::Value out_backprop, ::mlir::ArrayAttr strides, ::mlir::StringAttr padding, ::mlir::StringAttr data_format, ::mlir::ArrayAttr dilations) {
  odsState.addOperands(input_sizes);
  odsState.addOperands(filter);
  odsState.addOperands(out_backprop);
  odsState.addAttribute(stridesAttrName(odsState.name), strides);
  odsState.addAttribute(paddingAttrName(odsState.name), padding);
  odsState.addAttribute(data_formatAttrName(odsState.name), data_format);
  odsState.addAttribute(dilationsAttrName(odsState.name), dilations);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void Conv3DBackpropInputV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input_sizes, ::mlir::Value filter, ::mlir::Value out_backprop, ::mlir::ArrayAttr strides, ::llvm::StringRef padding, ::llvm::StringRef data_format, ::mlir::ArrayAttr dilations) {
  odsState.addOperands(input_sizes);
  odsState.addOperands(filter);
  odsState.addOperands(out_backprop);
  odsState.addAttribute(stridesAttrName(odsState.name), strides);
  odsState.addAttribute(paddingAttrName(odsState.name), odsBuilder.getStringAttr(padding));
  odsState.addAttribute(data_formatAttrName(odsState.name), odsBuilder.getStringAttr(data_format));
  odsState.addAttribute(dilationsAttrName(odsState.name), dilations);
  odsState.addTypes(output);
}

void Conv3DBackpropInputV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input_sizes, ::mlir::Value filter, ::mlir::Value out_backprop, ::mlir::ArrayAttr strides, ::llvm::StringRef padding, ::llvm::StringRef data_format, ::mlir::ArrayAttr dilations) {
  odsState.addOperands(input_sizes);
  odsState.addOperands(filter);
  odsState.addOperands(out_backprop);
  odsState.addAttribute(stridesAttrName(odsState.name), strides);
  odsState.addAttribute(paddingAttrName(odsState.name), odsBuilder.getStringAttr(padding));
  odsState.addAttribute(data_formatAttrName(odsState.name), odsBuilder.getStringAttr(data_format));
  odsState.addAttribute(dilationsAttrName(odsState.name), dilations);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void Conv3DBackpropInputV2Op::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 3u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult Conv3DBackpropInputV2Op::verify() {
  {
    auto tblgen_strides = (*this)->getAttr(stridesAttrName());
    if (!tblgen_strides)
      return emitOpError("requires attribute 'strides'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops7(*this, tblgen_strides, "strides")))
      return ::mlir::failure();
  }
  {
    auto tblgen_padding = (*this)->getAttr(paddingAttrName());
    if (!tblgen_padding)
      return emitOpError("requires attribute 'padding'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops8(*this, tblgen_padding, "padding")))
      return ::mlir::failure();
  }
  {
    auto tblgen_data_format = (*this)->getAttr(data_formatAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops9(*this, tblgen_data_format, "data_format")))
      return ::mlir::failure();
  }
  {
    auto tblgen_dilations = (*this)->getAttr(dilationsAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops13(*this, tblgen_dilations, "dilations")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void Conv3DBackpropInputV2Op::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::Conv3DBackpropInputV2Op)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::Conv3DOp definitions
//===----------------------------------------------------------------------===//

Conv3DOpAdaptor::Conv3DOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

Conv3DOpAdaptor::Conv3DOpAdaptor(Conv3DOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange Conv3DOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> Conv3DOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange Conv3DOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value Conv3DOpAdaptor::input() {
  return *getODSOperands(0).begin();
}

::mlir::Value Conv3DOpAdaptor::filter() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr Conv3DOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::ArrayAttr Conv3DOpAdaptor::strides() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("strides").cast<::mlir::ArrayAttr>();
  return attr;
}

::mlir::StringAttr Conv3DOpAdaptor::padding() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("padding").cast<::mlir::StringAttr>();
  return attr;
}

::mlir::StringAttr Conv3DOpAdaptor::data_format() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("data_format").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("NDHWC");
  return attr;
}

::mlir::ArrayAttr Conv3DOpAdaptor::dilations() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("dilations").dyn_cast_or_null<::mlir::ArrayAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getI64ArrayAttr({1, 1, 1, 1, 1});
  return attr;
}

::mlir::LogicalResult Conv3DOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_strides = odsAttrs.get("strides");
    if (!tblgen_strides)
      return emitError(loc, "'tf.Conv3D' op ""requires attribute 'strides'");

    if (tblgen_strides && !((((tblgen_strides.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_strides.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return ((attr.isa<::mlir::IntegerAttr>())) && ((attr.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64))); }))) && ((tblgen_strides.cast<::mlir::ArrayAttr>().size() >= 5))))
      return emitError(loc, "'tf.Conv3D' op ""attribute 'strides' failed to satisfy constraint: 64-bit integer array attribute with at least 5 elements");
  }
  {
    auto tblgen_padding = odsAttrs.get("padding");
    if (!tblgen_padding)
      return emitError(loc, "'tf.Conv3D' op ""requires attribute 'padding'");

    if (tblgen_padding && !((tblgen_padding.cast<StringAttr>().getValue() == "SAME" || tblgen_padding.cast<StringAttr>().getValue() == "VALID")))
      return emitError(loc, "'tf.Conv3D' op ""attribute 'padding' failed to satisfy constraint: string attribute whose value is SAME, or VALID");
  }
  {
    auto tblgen_data_format = odsAttrs.get("data_format");
    if (tblgen_data_format && !((tblgen_data_format.cast<StringAttr>().getValue() == "NDHWC" || tblgen_data_format.cast<StringAttr>().getValue() == "NCDHW")))
      return emitError(loc, "'tf.Conv3D' op ""attribute 'data_format' failed to satisfy constraint: string attribute whose value is NDHWC, or NCDHW");
  }
  {
    auto tblgen_dilations = odsAttrs.get("dilations");
    if (tblgen_dilations && !(((tblgen_dilations.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_dilations.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return ((attr.isa<::mlir::IntegerAttr>())) && ((attr.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64))); }))))
      return emitError(loc, "'tf.Conv3D' op ""attribute 'dilations' failed to satisfy constraint: 64-bit integer array attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> Conv3DOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range Conv3DOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value Conv3DOp::input() {
  return *getODSOperands(0).begin();
}

::mlir::Value Conv3DOp::filter() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange Conv3DOp::inputMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange Conv3DOp::filterMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> Conv3DOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range Conv3DOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value Conv3DOp::output() {
  return *getODSResults(0).begin();
}

::mlir::ArrayAttr Conv3DOp::stridesAttr() {
  return (*this)->getAttr(stridesAttrName()).cast<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr Conv3DOp::strides() {
  auto attr = stridesAttr();
  return attr;
}

::mlir::StringAttr Conv3DOp::paddingAttr() {
  return (*this)->getAttr(paddingAttrName()).cast<::mlir::StringAttr>();
}

::llvm::StringRef Conv3DOp::padding() {
  auto attr = paddingAttr();
  return attr.getValue();
}

::mlir::StringAttr Conv3DOp::data_formatAttr() {
  return (*this)->getAttr(data_formatAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef Conv3DOp::data_format() {
  auto attr = data_formatAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("NDHWC").getValue();
  return attr.getValue();
}

::mlir::ArrayAttr Conv3DOp::dilationsAttr() {
  return (*this)->getAttr(dilationsAttrName()).dyn_cast_or_null<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr Conv3DOp::dilations() {
  auto attr = dilationsAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getI64ArrayAttr({1, 1, 1, 1, 1});
  return attr;
}

::mlir::Type Conv3DOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool Conv3DOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr Conv3DOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void Conv3DOp::stridesAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(stridesAttrName(), attr);
}

void Conv3DOp::paddingAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(paddingAttrName(), attr);
}

void Conv3DOp::data_formatAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(data_formatAttrName(), attr);
}

void Conv3DOp::dilationsAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(dilationsAttrName(), attr);
}

void Conv3DOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input, ::mlir::Value filter, ::mlir::ArrayAttr strides, ::mlir::StringAttr padding, ::mlir::StringAttr data_format, ::mlir::ArrayAttr dilations) {
  odsState.addOperands(input);
  odsState.addOperands(filter);
  odsState.addAttribute(stridesAttrName(odsState.name), strides);
  odsState.addAttribute(paddingAttrName(odsState.name), padding);
  odsState.addAttribute(data_formatAttrName(odsState.name), data_format);
  odsState.addAttribute(dilationsAttrName(odsState.name), dilations);
  odsState.addTypes(output);
}

void Conv3DOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value input, ::mlir::Value filter, ::mlir::ArrayAttr strides, ::mlir::StringAttr padding, ::mlir::StringAttr data_format, ::mlir::ArrayAttr dilations) {
  odsState.addOperands(input);
  odsState.addOperands(filter);
  odsState.addAttribute(stridesAttrName(odsState.name), strides);
  odsState.addAttribute(paddingAttrName(odsState.name), padding);
  odsState.addAttribute(data_formatAttrName(odsState.name), data_format);
  odsState.addAttribute(dilationsAttrName(odsState.name), dilations);

        ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
        if (::mlir::succeeded(Conv3DOp::inferReturnTypes(odsBuilder.getContext(),
                      odsState.location, odsState.operands,
                      odsState.attributes.getDictionary(odsState.getContext()),
                      /*regions=*/{}, inferredReturnTypes)))
          odsState.addTypes(inferredReturnTypes);
        else
          ::llvm::report_fatal_error("Failed to infer result type(s).");
}

void Conv3DOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::Value filter, ::mlir::ArrayAttr strides, ::mlir::StringAttr padding, ::mlir::StringAttr data_format, ::mlir::ArrayAttr dilations) {
  odsState.addOperands(input);
  odsState.addOperands(filter);
  odsState.addAttribute(stridesAttrName(odsState.name), strides);
  odsState.addAttribute(paddingAttrName(odsState.name), padding);
  odsState.addAttribute(data_formatAttrName(odsState.name), data_format);
  odsState.addAttribute(dilationsAttrName(odsState.name), dilations);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void Conv3DOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input, ::mlir::Value filter, ::mlir::ArrayAttr strides, ::llvm::StringRef padding, ::llvm::StringRef data_format, ::mlir::ArrayAttr dilations) {
  odsState.addOperands(input);
  odsState.addOperands(filter);
  odsState.addAttribute(stridesAttrName(odsState.name), strides);
  odsState.addAttribute(paddingAttrName(odsState.name), odsBuilder.getStringAttr(padding));
  odsState.addAttribute(data_formatAttrName(odsState.name), odsBuilder.getStringAttr(data_format));
  odsState.addAttribute(dilationsAttrName(odsState.name), dilations);
  odsState.addTypes(output);
}

void Conv3DOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value input, ::mlir::Value filter, ::mlir::ArrayAttr strides, ::llvm::StringRef padding, ::llvm::StringRef data_format, ::mlir::ArrayAttr dilations) {
  odsState.addOperands(input);
  odsState.addOperands(filter);
  odsState.addAttribute(stridesAttrName(odsState.name), strides);
  odsState.addAttribute(paddingAttrName(odsState.name), odsBuilder.getStringAttr(padding));
  odsState.addAttribute(data_formatAttrName(odsState.name), odsBuilder.getStringAttr(data_format));
  odsState.addAttribute(dilationsAttrName(odsState.name), dilations);

        ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
        if (::mlir::succeeded(Conv3DOp::inferReturnTypes(odsBuilder.getContext(),
                      odsState.location, odsState.operands,
                      odsState.attributes.getDictionary(odsState.getContext()),
                      /*regions=*/{}, inferredReturnTypes)))
          odsState.addTypes(inferredReturnTypes);
        else
          ::llvm::report_fatal_error("Failed to infer result type(s).");
}

void Conv3DOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::Value filter, ::mlir::ArrayAttr strides, ::llvm::StringRef padding, ::llvm::StringRef data_format, ::mlir::ArrayAttr dilations) {
  odsState.addOperands(input);
  odsState.addOperands(filter);
  odsState.addAttribute(stridesAttrName(odsState.name), strides);
  odsState.addAttribute(paddingAttrName(odsState.name), odsBuilder.getStringAttr(padding));
  odsState.addAttribute(data_formatAttrName(odsState.name), odsBuilder.getStringAttr(data_format));
  odsState.addAttribute(dilationsAttrName(odsState.name), dilations);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void Conv3DOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

void Conv3DOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);

  ::mlir::SmallVector<::mlir::Type, 2> inferredReturnTypes;
  if (::mlir::succeeded(Conv3DOp::inferReturnTypes(odsBuilder.getContext(),
          odsState.location, operands,
          odsState.attributes.getDictionary(odsState.getContext()),
          odsState.regions, inferredReturnTypes))) {
    assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
    odsState.addTypes(inferredReturnTypes);
  } else {
    ::llvm::report_fatal_error("Failed to infer result type(s).");
  }
}

::mlir::LogicalResult Conv3DOp::verify() {
  {
    auto tblgen_strides = (*this)->getAttr(stridesAttrName());
    if (!tblgen_strides)
      return emitOpError("requires attribute 'strides'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops7(*this, tblgen_strides, "strides")))
      return ::mlir::failure();
  }
  {
    auto tblgen_padding = (*this)->getAttr(paddingAttrName());
    if (!tblgen_padding)
      return emitOpError("requires attribute 'padding'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops8(*this, tblgen_padding, "padding")))
      return ::mlir::failure();
  }
  {
    auto tblgen_data_format = (*this)->getAttr(data_formatAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops9(*this, tblgen_data_format, "data_format")))
      return ::mlir::failure();
  }
  {
    auto tblgen_dilations = (*this)->getAttr(dilationsAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops13(*this, tblgen_dilations, "dilations")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return Verify(*this);
}

void Conv3DOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::Conv3DOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::CosOp definitions
//===----------------------------------------------------------------------===//

CosOpAdaptor::CosOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

CosOpAdaptor::CosOpAdaptor(CosOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange CosOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> CosOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange CosOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value CosOpAdaptor::x() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr CosOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult CosOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> CosOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range CosOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value CosOp::x() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange CosOp::xMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> CosOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range CosOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value CosOp::y() {
  return *getODSResults(0).begin();
}

::mlir::Type CosOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool CosOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr CosOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void CosOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type y, ::mlir::Value x) {
  odsState.addOperands(x);
  odsState.addTypes(y);
}

void CosOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value x) {
  odsState.addOperands(x);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void CosOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult CosOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops2(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops2(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void CosOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::CosOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::CoshOp definitions
//===----------------------------------------------------------------------===//

CoshOpAdaptor::CoshOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

CoshOpAdaptor::CoshOpAdaptor(CoshOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange CoshOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> CoshOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange CoshOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value CoshOpAdaptor::x() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr CoshOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult CoshOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> CoshOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range CoshOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value CoshOp::x() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange CoshOp::xMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> CoshOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range CoshOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value CoshOp::y() {
  return *getODSResults(0).begin();
}

::mlir::Type CoshOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool CoshOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr CoshOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void CoshOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type y, ::mlir::Value x) {
  odsState.addOperands(x);
  odsState.addTypes(y);
}

void CoshOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value x) {
  odsState.addOperands(x);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void CoshOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult CoshOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops2(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops2(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void CoshOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::CoshOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::CreateSummaryDbWriterOp definitions
//===----------------------------------------------------------------------===//

CreateSummaryDbWriterOpAdaptor::CreateSummaryDbWriterOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

CreateSummaryDbWriterOpAdaptor::CreateSummaryDbWriterOpAdaptor(CreateSummaryDbWriterOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange CreateSummaryDbWriterOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> CreateSummaryDbWriterOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange CreateSummaryDbWriterOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value CreateSummaryDbWriterOpAdaptor::writer() {
  return *getODSOperands(0).begin();
}

::mlir::Value CreateSummaryDbWriterOpAdaptor::db_uri() {
  return *getODSOperands(1).begin();
}

::mlir::Value CreateSummaryDbWriterOpAdaptor::experiment_name() {
  return *getODSOperands(2).begin();
}

::mlir::Value CreateSummaryDbWriterOpAdaptor::run_name() {
  return *getODSOperands(3).begin();
}

::mlir::Value CreateSummaryDbWriterOpAdaptor::user_name() {
  return *getODSOperands(4).begin();
}

::mlir::DictionaryAttr CreateSummaryDbWriterOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult CreateSummaryDbWriterOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> CreateSummaryDbWriterOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range CreateSummaryDbWriterOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value CreateSummaryDbWriterOp::writer() {
  return *getODSOperands(0).begin();
}

::mlir::Value CreateSummaryDbWriterOp::db_uri() {
  return *getODSOperands(1).begin();
}

::mlir::Value CreateSummaryDbWriterOp::experiment_name() {
  return *getODSOperands(2).begin();
}

::mlir::Value CreateSummaryDbWriterOp::run_name() {
  return *getODSOperands(3).begin();
}

::mlir::Value CreateSummaryDbWriterOp::user_name() {
  return *getODSOperands(4).begin();
}

::mlir::MutableOperandRange CreateSummaryDbWriterOp::writerMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange CreateSummaryDbWriterOp::db_uriMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange CreateSummaryDbWriterOp::experiment_nameMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange CreateSummaryDbWriterOp::run_nameMutable() {
  auto range = getODSOperandIndexAndLength(3);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange CreateSummaryDbWriterOp::user_nameMutable() {
  auto range = getODSOperandIndexAndLength(4);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> CreateSummaryDbWriterOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range CreateSummaryDbWriterOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

void CreateSummaryDbWriterOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value writer, ::mlir::Value db_uri, ::mlir::Value experiment_name, ::mlir::Value run_name, ::mlir::Value user_name) {
  odsState.addOperands(writer);
  odsState.addOperands(db_uri);
  odsState.addOperands(experiment_name);
  odsState.addOperands(run_name);
  odsState.addOperands(user_name);
}

void CreateSummaryDbWriterOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value writer, ::mlir::Value db_uri, ::mlir::Value experiment_name, ::mlir::Value run_name, ::mlir::Value user_name) {
  odsState.addOperands(writer);
  odsState.addOperands(db_uri);
  odsState.addOperands(experiment_name);
  odsState.addOperands(run_name);
  odsState.addOperands(user_name);
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void CreateSummaryDbWriterOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 5u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 0u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult CreateSummaryDbWriterOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops19(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops19(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup3 = getODSOperands(3);

    for (auto v : valueGroup3) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops19(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup4 = getODSOperands(4);

    for (auto v : valueGroup4) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops19(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void CreateSummaryDbWriterOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  for (::mlir::Value value : getODSOperands(0))
    effects.emplace_back(::mlir::MemoryEffects::Write::get(), value, ::mlir::TF::ResourceEffects::Summary::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::CreateSummaryDbWriterOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::CreateSummaryFileWriterOp definitions
//===----------------------------------------------------------------------===//

CreateSummaryFileWriterOpAdaptor::CreateSummaryFileWriterOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

CreateSummaryFileWriterOpAdaptor::CreateSummaryFileWriterOpAdaptor(CreateSummaryFileWriterOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange CreateSummaryFileWriterOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> CreateSummaryFileWriterOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange CreateSummaryFileWriterOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value CreateSummaryFileWriterOpAdaptor::writer() {
  return *getODSOperands(0).begin();
}

::mlir::Value CreateSummaryFileWriterOpAdaptor::logdir() {
  return *getODSOperands(1).begin();
}

::mlir::Value CreateSummaryFileWriterOpAdaptor::max_queue() {
  return *getODSOperands(2).begin();
}

::mlir::Value CreateSummaryFileWriterOpAdaptor::flush_millis() {
  return *getODSOperands(3).begin();
}

::mlir::Value CreateSummaryFileWriterOpAdaptor::filename_suffix() {
  return *getODSOperands(4).begin();
}

::mlir::DictionaryAttr CreateSummaryFileWriterOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult CreateSummaryFileWriterOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> CreateSummaryFileWriterOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range CreateSummaryFileWriterOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value CreateSummaryFileWriterOp::writer() {
  return *getODSOperands(0).begin();
}

::mlir::Value CreateSummaryFileWriterOp::logdir() {
  return *getODSOperands(1).begin();
}

::mlir::Value CreateSummaryFileWriterOp::max_queue() {
  return *getODSOperands(2).begin();
}

::mlir::Value CreateSummaryFileWriterOp::flush_millis() {
  return *getODSOperands(3).begin();
}

::mlir::Value CreateSummaryFileWriterOp::filename_suffix() {
  return *getODSOperands(4).begin();
}

::mlir::MutableOperandRange CreateSummaryFileWriterOp::writerMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange CreateSummaryFileWriterOp::logdirMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange CreateSummaryFileWriterOp::max_queueMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange CreateSummaryFileWriterOp::flush_millisMutable() {
  auto range = getODSOperandIndexAndLength(3);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange CreateSummaryFileWriterOp::filename_suffixMutable() {
  auto range = getODSOperandIndexAndLength(4);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> CreateSummaryFileWriterOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range CreateSummaryFileWriterOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

void CreateSummaryFileWriterOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value writer, ::mlir::Value logdir, ::mlir::Value max_queue, ::mlir::Value flush_millis, ::mlir::Value filename_suffix) {
  odsState.addOperands(writer);
  odsState.addOperands(logdir);
  odsState.addOperands(max_queue);
  odsState.addOperands(flush_millis);
  odsState.addOperands(filename_suffix);
}

void CreateSummaryFileWriterOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value writer, ::mlir::Value logdir, ::mlir::Value max_queue, ::mlir::Value flush_millis, ::mlir::Value filename_suffix) {
  odsState.addOperands(writer);
  odsState.addOperands(logdir);
  odsState.addOperands(max_queue);
  odsState.addOperands(flush_millis);
  odsState.addOperands(filename_suffix);
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void CreateSummaryFileWriterOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 5u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 0u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult CreateSummaryFileWriterOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops19(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops11(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup3 = getODSOperands(3);

    for (auto v : valueGroup3) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops11(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup4 = getODSOperands(4);

    for (auto v : valueGroup4) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops19(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void CreateSummaryFileWriterOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  for (::mlir::Value value : getODSOperands(0))
    effects.emplace_back(::mlir::MemoryEffects::Write::get(), value, ::mlir::TF::ResourceEffects::Summary::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::CreateSummaryFileWriterOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::CrossOp definitions
//===----------------------------------------------------------------------===//

CrossOpAdaptor::CrossOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

CrossOpAdaptor::CrossOpAdaptor(CrossOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange CrossOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> CrossOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange CrossOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value CrossOpAdaptor::a() {
  return *getODSOperands(0).begin();
}

::mlir::Value CrossOpAdaptor::b() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr CrossOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult CrossOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> CrossOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range CrossOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value CrossOp::a() {
  return *getODSOperands(0).begin();
}

::mlir::Value CrossOp::b() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange CrossOp::aMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange CrossOp::bMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> CrossOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range CrossOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value CrossOp::product() {
  return *getODSResults(0).begin();
}

::mlir::Type CrossOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool CrossOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr CrossOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void CrossOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type product, ::mlir::Value a, ::mlir::Value b) {
  odsState.addOperands(a);
  odsState.addOperands(b);
  odsState.addTypes(product);
}

void CrossOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value a, ::mlir::Value b) {
  odsState.addOperands(a);
  odsState.addOperands(b);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void CrossOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

void CrossOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value a, ::mlir::Value b) {
  odsState.addOperands(a);
  odsState.addOperands(b);
  odsState.addTypes({a.getType()});

}

void CrossOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  odsState.addTypes({operands[0].getType()});

}

::mlir::LogicalResult CrossOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops35(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops35(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops35(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void CrossOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::CrossOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::CrossReplicaSumOp definitions
//===----------------------------------------------------------------------===//

CrossReplicaSumOpAdaptor::CrossReplicaSumOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

CrossReplicaSumOpAdaptor::CrossReplicaSumOpAdaptor(CrossReplicaSumOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange CrossReplicaSumOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> CrossReplicaSumOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange CrossReplicaSumOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value CrossReplicaSumOpAdaptor::input() {
  return *getODSOperands(0).begin();
}

::mlir::Value CrossReplicaSumOpAdaptor::group_assignment() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr CrossReplicaSumOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult CrossReplicaSumOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> CrossReplicaSumOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range CrossReplicaSumOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value CrossReplicaSumOp::input() {
  return *getODSOperands(0).begin();
}

::mlir::Value CrossReplicaSumOp::group_assignment() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange CrossReplicaSumOp::inputMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange CrossReplicaSumOp::group_assignmentMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> CrossReplicaSumOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range CrossReplicaSumOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value CrossReplicaSumOp::output() {
  return *getODSResults(0).begin();
}

::mlir::Type CrossReplicaSumOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool CrossReplicaSumOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr CrossReplicaSumOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void CrossReplicaSumOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input, ::mlir::Value group_assignment) {
  odsState.addOperands(input);
  odsState.addOperands(group_assignment);
  odsState.addTypes(output);
}

void CrossReplicaSumOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::Value group_assignment) {
  odsState.addOperands(input);
  odsState.addOperands(group_assignment);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void CrossReplicaSumOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult CrossReplicaSumOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops36(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops11(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops36(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  if (!((tf_type::AreCastCompatible(llvm::makeArrayRef({(*this->getODSOperands(0).begin()).getType(), (*this->getODSResults(0).begin()).getType()})))))
    return emitOpError("failed to verify that all of {input, output} have dynamically equal types ");
  return ::mlir::success();
}

void CrossReplicaSumOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::CrossReplicaSumOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::CumprodOp definitions
//===----------------------------------------------------------------------===//

CumprodOpAdaptor::CumprodOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

CumprodOpAdaptor::CumprodOpAdaptor(CumprodOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange CumprodOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> CumprodOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange CumprodOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value CumprodOpAdaptor::x() {
  return *getODSOperands(0).begin();
}

::mlir::Value CumprodOpAdaptor::axis() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr CumprodOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::BoolAttr CumprodOpAdaptor::exclusive() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("exclusive").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(false);
  return attr;
}

::mlir::BoolAttr CumprodOpAdaptor::reverse() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("reverse").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(false);
  return attr;
}

::mlir::LogicalResult CumprodOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_exclusive = odsAttrs.get("exclusive");
    if (tblgen_exclusive && !((tblgen_exclusive.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.Cumprod' op ""attribute 'exclusive' failed to satisfy constraint: bool attribute");
  }
  {
    auto tblgen_reverse = odsAttrs.get("reverse");
    if (tblgen_reverse && !((tblgen_reverse.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.Cumprod' op ""attribute 'reverse' failed to satisfy constraint: bool attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> CumprodOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range CumprodOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value CumprodOp::x() {
  return *getODSOperands(0).begin();
}

::mlir::Value CumprodOp::axis() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange CumprodOp::xMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange CumprodOp::axisMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> CumprodOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range CumprodOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value CumprodOp::out() {
  return *getODSResults(0).begin();
}

::mlir::BoolAttr CumprodOp::exclusiveAttr() {
  return (*this)->getAttr(exclusiveAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool CumprodOp::exclusive() {
  auto attr = exclusiveAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(false).getValue();
  return attr.getValue();
}

::mlir::BoolAttr CumprodOp::reverseAttr() {
  return (*this)->getAttr(reverseAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool CumprodOp::reverse() {
  auto attr = reverseAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(false).getValue();
  return attr.getValue();
}

::mlir::Type CumprodOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

::mlir::Type CumprodOp::Tidx() {
  return mlir::getElementTypeOrSelf(*getODSOperands(1).begin());
}

bool CumprodOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
  if (name == "Tidx") return true;
 return false;
}

::mlir::DictionaryAttr CumprodOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())},
    {TidxAttrName(),
::mlir::TypeAttr::get(Tidx())}});
}

void CumprodOp::exclusiveAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(exclusiveAttrName(), attr);
}

void CumprodOp::reverseAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(reverseAttrName(), attr);
}

void CumprodOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type out, ::mlir::Value x, ::mlir::Value axis, ::mlir::BoolAttr exclusive, ::mlir::BoolAttr reverse) {
  odsState.addOperands(x);
  odsState.addOperands(axis);
  odsState.addAttribute(exclusiveAttrName(odsState.name), exclusive);
  odsState.addAttribute(reverseAttrName(odsState.name), reverse);
  odsState.addTypes(out);
}

void CumprodOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value x, ::mlir::Value axis, ::mlir::BoolAttr exclusive, ::mlir::BoolAttr reverse) {
  odsState.addOperands(x);
  odsState.addOperands(axis);
  odsState.addAttribute(exclusiveAttrName(odsState.name), exclusive);
  odsState.addAttribute(reverseAttrName(odsState.name), reverse);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void CumprodOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type out, ::mlir::Value x, ::mlir::Value axis, bool exclusive, bool reverse) {
  odsState.addOperands(x);
  odsState.addOperands(axis);
  odsState.addAttribute(exclusiveAttrName(odsState.name), odsBuilder.getBoolAttr(exclusive));
  odsState.addAttribute(reverseAttrName(odsState.name), odsBuilder.getBoolAttr(reverse));
  odsState.addTypes(out);
}

void CumprodOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value x, ::mlir::Value axis, bool exclusive, bool reverse) {
  odsState.addOperands(x);
  odsState.addOperands(axis);
  odsState.addAttribute(exclusiveAttrName(odsState.name), odsBuilder.getBoolAttr(exclusive));
  odsState.addAttribute(reverseAttrName(odsState.name), odsBuilder.getBoolAttr(reverse));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void CumprodOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult CumprodOp::verify() {
  {
    auto tblgen_exclusive = (*this)->getAttr(exclusiveAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_exclusive, "exclusive")))
      return ::mlir::failure();
  }
  {
    auto tblgen_reverse = (*this)->getAttr(reverseAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_reverse, "reverse")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  if (!((tf_type::AreCastCompatible(llvm::makeArrayRef({(*this->getODSOperands(0).begin()).getType(), (*this->getODSResults(0).begin()).getType()})))))
    return emitOpError("failed to verify that all of {x, out} have dynamically equal types ");
  return Verify(*this);
}

void CumprodOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::CumprodOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::CumsumOp definitions
//===----------------------------------------------------------------------===//

CumsumOpAdaptor::CumsumOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

CumsumOpAdaptor::CumsumOpAdaptor(CumsumOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange CumsumOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> CumsumOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange CumsumOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value CumsumOpAdaptor::x() {
  return *getODSOperands(0).begin();
}

::mlir::Value CumsumOpAdaptor::axis() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr CumsumOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::BoolAttr CumsumOpAdaptor::exclusive() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("exclusive").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(false);
  return attr;
}

::mlir::BoolAttr CumsumOpAdaptor::reverse() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("reverse").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(false);
  return attr;
}

::mlir::LogicalResult CumsumOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_exclusive = odsAttrs.get("exclusive");
    if (tblgen_exclusive && !((tblgen_exclusive.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.Cumsum' op ""attribute 'exclusive' failed to satisfy constraint: bool attribute");
  }
  {
    auto tblgen_reverse = odsAttrs.get("reverse");
    if (tblgen_reverse && !((tblgen_reverse.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.Cumsum' op ""attribute 'reverse' failed to satisfy constraint: bool attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> CumsumOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range CumsumOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value CumsumOp::x() {
  return *getODSOperands(0).begin();
}

::mlir::Value CumsumOp::axis() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange CumsumOp::xMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange CumsumOp::axisMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> CumsumOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range CumsumOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value CumsumOp::out() {
  return *getODSResults(0).begin();
}

::mlir::BoolAttr CumsumOp::exclusiveAttr() {
  return (*this)->getAttr(exclusiveAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool CumsumOp::exclusive() {
  auto attr = exclusiveAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(false).getValue();
  return attr.getValue();
}

::mlir::BoolAttr CumsumOp::reverseAttr() {
  return (*this)->getAttr(reverseAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool CumsumOp::reverse() {
  auto attr = reverseAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(false).getValue();
  return attr.getValue();
}

::mlir::Type CumsumOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

::mlir::Type CumsumOp::Tidx() {
  return mlir::getElementTypeOrSelf(*getODSOperands(1).begin());
}

bool CumsumOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
  if (name == "Tidx") return true;
 return false;
}

::mlir::DictionaryAttr CumsumOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())},
    {TidxAttrName(),
::mlir::TypeAttr::get(Tidx())}});
}

void CumsumOp::exclusiveAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(exclusiveAttrName(), attr);
}

void CumsumOp::reverseAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(reverseAttrName(), attr);
}

void CumsumOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type out, ::mlir::Value x, ::mlir::Value axis, ::mlir::BoolAttr exclusive, ::mlir::BoolAttr reverse) {
  odsState.addOperands(x);
  odsState.addOperands(axis);
  odsState.addAttribute(exclusiveAttrName(odsState.name), exclusive);
  odsState.addAttribute(reverseAttrName(odsState.name), reverse);
  odsState.addTypes(out);
}

void CumsumOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value x, ::mlir::Value axis, ::mlir::BoolAttr exclusive, ::mlir::BoolAttr reverse) {
  odsState.addOperands(x);
  odsState.addOperands(axis);
  odsState.addAttribute(exclusiveAttrName(odsState.name), exclusive);
  odsState.addAttribute(reverseAttrName(odsState.name), reverse);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void CumsumOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type out, ::mlir::Value x, ::mlir::Value axis, bool exclusive, bool reverse) {
  odsState.addOperands(x);
  odsState.addOperands(axis);
  odsState.addAttribute(exclusiveAttrName(odsState.name), odsBuilder.getBoolAttr(exclusive));
  odsState.addAttribute(reverseAttrName(odsState.name), odsBuilder.getBoolAttr(reverse));
  odsState.addTypes(out);
}

void CumsumOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value x, ::mlir::Value axis, bool exclusive, bool reverse) {
  odsState.addOperands(x);
  odsState.addOperands(axis);
  odsState.addAttribute(exclusiveAttrName(odsState.name), odsBuilder.getBoolAttr(exclusive));
  odsState.addAttribute(reverseAttrName(odsState.name), odsBuilder.getBoolAttr(reverse));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void CumsumOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult CumsumOp::verify() {
  {
    auto tblgen_exclusive = (*this)->getAttr(exclusiveAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_exclusive, "exclusive")))
      return ::mlir::failure();
  }
  {
    auto tblgen_reverse = (*this)->getAttr(reverseAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_reverse, "reverse")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  if (!((tf_type::AreCastCompatible(llvm::makeArrayRef({(*this->getODSOperands(0).begin()).getType(), (*this->getODSResults(0).begin()).getType()})))))
    return emitOpError("failed to verify that all of {x, out} have dynamically equal types ");
  return Verify(*this);
}

void CumsumOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::CumsumOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::DataFormatDimMapOp definitions
//===----------------------------------------------------------------------===//

DataFormatDimMapOpAdaptor::DataFormatDimMapOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

DataFormatDimMapOpAdaptor::DataFormatDimMapOpAdaptor(DataFormatDimMapOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange DataFormatDimMapOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> DataFormatDimMapOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange DataFormatDimMapOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value DataFormatDimMapOpAdaptor::x() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr DataFormatDimMapOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::StringAttr DataFormatDimMapOpAdaptor::src_format() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("src_format").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("NHWC");
  return attr;
}

::mlir::StringAttr DataFormatDimMapOpAdaptor::dst_format() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("dst_format").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("NCHW");
  return attr;
}

::mlir::LogicalResult DataFormatDimMapOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_src_format = odsAttrs.get("src_format");
    if (tblgen_src_format && !((tblgen_src_format.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.DataFormatDimMap' op ""attribute 'src_format' failed to satisfy constraint: string attribute");
  }
  {
    auto tblgen_dst_format = odsAttrs.get("dst_format");
    if (tblgen_dst_format && !((tblgen_dst_format.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.DataFormatDimMap' op ""attribute 'dst_format' failed to satisfy constraint: string attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> DataFormatDimMapOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range DataFormatDimMapOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value DataFormatDimMapOp::x() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange DataFormatDimMapOp::xMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> DataFormatDimMapOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range DataFormatDimMapOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value DataFormatDimMapOp::y() {
  return *getODSResults(0).begin();
}

::mlir::StringAttr DataFormatDimMapOp::src_formatAttr() {
  return (*this)->getAttr(src_formatAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef DataFormatDimMapOp::src_format() {
  auto attr = src_formatAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("NHWC").getValue();
  return attr.getValue();
}

::mlir::StringAttr DataFormatDimMapOp::dst_formatAttr() {
  return (*this)->getAttr(dst_formatAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef DataFormatDimMapOp::dst_format() {
  auto attr = dst_formatAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("NCHW").getValue();
  return attr.getValue();
}

::mlir::Type DataFormatDimMapOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool DataFormatDimMapOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr DataFormatDimMapOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void DataFormatDimMapOp::src_formatAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(src_formatAttrName(), attr);
}

void DataFormatDimMapOp::dst_formatAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(dst_formatAttrName(), attr);
}

void DataFormatDimMapOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type y, ::mlir::Value x, ::mlir::StringAttr src_format, ::mlir::StringAttr dst_format) {
  odsState.addOperands(x);
  odsState.addAttribute(src_formatAttrName(odsState.name), src_format);
  odsState.addAttribute(dst_formatAttrName(odsState.name), dst_format);
  odsState.addTypes(y);
}

void DataFormatDimMapOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value x, ::mlir::StringAttr src_format, ::mlir::StringAttr dst_format) {
  odsState.addOperands(x);
  odsState.addAttribute(src_formatAttrName(odsState.name), src_format);
  odsState.addAttribute(dst_formatAttrName(odsState.name), dst_format);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void DataFormatDimMapOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type y, ::mlir::Value x, ::llvm::StringRef src_format, ::llvm::StringRef dst_format) {
  odsState.addOperands(x);
  odsState.addAttribute(src_formatAttrName(odsState.name), odsBuilder.getStringAttr(src_format));
  odsState.addAttribute(dst_formatAttrName(odsState.name), odsBuilder.getStringAttr(dst_format));
  odsState.addTypes(y);
}

void DataFormatDimMapOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value x, ::llvm::StringRef src_format, ::llvm::StringRef dst_format) {
  odsState.addOperands(x);
  odsState.addAttribute(src_formatAttrName(odsState.name), odsBuilder.getStringAttr(src_format));
  odsState.addAttribute(dst_formatAttrName(odsState.name), odsBuilder.getStringAttr(dst_format));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void DataFormatDimMapOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult DataFormatDimMapOp::verify() {
  {
    auto tblgen_src_format = (*this)->getAttr(src_formatAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_src_format, "src_format")))
      return ::mlir::failure();
  }
  {
    auto tblgen_dst_format = (*this)->getAttr(dst_formatAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_dst_format, "dst_format")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void DataFormatDimMapOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::DataFormatDimMapOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::DataFormatVecPermuteOp definitions
//===----------------------------------------------------------------------===//

DataFormatVecPermuteOpAdaptor::DataFormatVecPermuteOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

DataFormatVecPermuteOpAdaptor::DataFormatVecPermuteOpAdaptor(DataFormatVecPermuteOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange DataFormatVecPermuteOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> DataFormatVecPermuteOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange DataFormatVecPermuteOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value DataFormatVecPermuteOpAdaptor::x() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr DataFormatVecPermuteOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::StringAttr DataFormatVecPermuteOpAdaptor::src_format() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("src_format").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("NHWC");
  return attr;
}

::mlir::StringAttr DataFormatVecPermuteOpAdaptor::dst_format() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("dst_format").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("NCHW");
  return attr;
}

::mlir::LogicalResult DataFormatVecPermuteOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_src_format = odsAttrs.get("src_format");
    if (tblgen_src_format && !((tblgen_src_format.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.DataFormatVecPermute' op ""attribute 'src_format' failed to satisfy constraint: string attribute");
  }
  {
    auto tblgen_dst_format = odsAttrs.get("dst_format");
    if (tblgen_dst_format && !((tblgen_dst_format.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.DataFormatVecPermute' op ""attribute 'dst_format' failed to satisfy constraint: string attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> DataFormatVecPermuteOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range DataFormatVecPermuteOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value DataFormatVecPermuteOp::x() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange DataFormatVecPermuteOp::xMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> DataFormatVecPermuteOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range DataFormatVecPermuteOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value DataFormatVecPermuteOp::y() {
  return *getODSResults(0).begin();
}

::mlir::StringAttr DataFormatVecPermuteOp::src_formatAttr() {
  return (*this)->getAttr(src_formatAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef DataFormatVecPermuteOp::src_format() {
  auto attr = src_formatAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("NHWC").getValue();
  return attr.getValue();
}

::mlir::StringAttr DataFormatVecPermuteOp::dst_formatAttr() {
  return (*this)->getAttr(dst_formatAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef DataFormatVecPermuteOp::dst_format() {
  auto attr = dst_formatAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("NCHW").getValue();
  return attr.getValue();
}

::mlir::Type DataFormatVecPermuteOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool DataFormatVecPermuteOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr DataFormatVecPermuteOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void DataFormatVecPermuteOp::src_formatAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(src_formatAttrName(), attr);
}

void DataFormatVecPermuteOp::dst_formatAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(dst_formatAttrName(), attr);
}

void DataFormatVecPermuteOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type y, ::mlir::Value x, ::mlir::StringAttr src_format, ::mlir::StringAttr dst_format) {
  odsState.addOperands(x);
  odsState.addAttribute(src_formatAttrName(odsState.name), src_format);
  odsState.addAttribute(dst_formatAttrName(odsState.name), dst_format);
  odsState.addTypes(y);
}

void DataFormatVecPermuteOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value x, ::mlir::StringAttr src_format, ::mlir::StringAttr dst_format) {
  odsState.addOperands(x);
  odsState.addAttribute(src_formatAttrName(odsState.name), src_format);
  odsState.addAttribute(dst_formatAttrName(odsState.name), dst_format);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void DataFormatVecPermuteOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type y, ::mlir::Value x, ::llvm::StringRef src_format, ::llvm::StringRef dst_format) {
  odsState.addOperands(x);
  odsState.addAttribute(src_formatAttrName(odsState.name), odsBuilder.getStringAttr(src_format));
  odsState.addAttribute(dst_formatAttrName(odsState.name), odsBuilder.getStringAttr(dst_format));
  odsState.addTypes(y);
}

void DataFormatVecPermuteOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value x, ::llvm::StringRef src_format, ::llvm::StringRef dst_format) {
  odsState.addOperands(x);
  odsState.addAttribute(src_formatAttrName(odsState.name), odsBuilder.getStringAttr(src_format));
  odsState.addAttribute(dst_formatAttrName(odsState.name), odsBuilder.getStringAttr(dst_format));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void DataFormatVecPermuteOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

void DataFormatVecPermuteOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value x, ::mlir::StringAttr src_format, ::mlir::StringAttr dst_format) {
  odsState.addOperands(x);
  odsState.addAttribute(src_formatAttrName(odsState.name), src_format);
  odsState.addAttribute(dst_formatAttrName(odsState.name), dst_format);
  odsState.addTypes({x.getType()});

}

void DataFormatVecPermuteOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  odsState.addTypes({operands[0].getType()});

}

::mlir::LogicalResult DataFormatVecPermuteOp::verify() {
  {
    auto tblgen_src_format = (*this)->getAttr(src_formatAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_src_format, "src_format")))
      return ::mlir::failure();
  }
  {
    auto tblgen_dst_format = (*this)->getAttr(dst_formatAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_dst_format, "dst_format")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return Verify(*this);
}

void DataFormatVecPermuteOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::DataFormatVecPermuteOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::DebugIdentityV2Op definitions
//===----------------------------------------------------------------------===//

DebugIdentityV2OpAdaptor::DebugIdentityV2OpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

DebugIdentityV2OpAdaptor::DebugIdentityV2OpAdaptor(DebugIdentityV2Op &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange DebugIdentityV2OpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> DebugIdentityV2OpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange DebugIdentityV2OpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value DebugIdentityV2OpAdaptor::input() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr DebugIdentityV2OpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::StringAttr DebugIdentityV2OpAdaptor::tfdbg_context_id() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("tfdbg_context_id").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("");
  return attr;
}

::mlir::StringAttr DebugIdentityV2OpAdaptor::op_name() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("op_name").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("");
  return attr;
}

::mlir::IntegerAttr DebugIdentityV2OpAdaptor::output_slot() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("output_slot").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), -1);
  return attr;
}

::mlir::IntegerAttr DebugIdentityV2OpAdaptor::tensor_debug_mode() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("tensor_debug_mode").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), -1);
  return attr;
}

::mlir::ArrayAttr DebugIdentityV2OpAdaptor::debug_urls() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("debug_urls").dyn_cast_or_null<::mlir::ArrayAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStrArrayAttr({});
  return attr;
}

::mlir::IntegerAttr DebugIdentityV2OpAdaptor::circular_buffer_size() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("circular_buffer_size").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), 1000);
  return attr;
}

::mlir::StringAttr DebugIdentityV2OpAdaptor::tfdbg_run_id() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("tfdbg_run_id").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("");
  return attr;
}

::mlir::LogicalResult DebugIdentityV2OpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_tfdbg_context_id = odsAttrs.get("tfdbg_context_id");
    if (tblgen_tfdbg_context_id && !((tblgen_tfdbg_context_id.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.DebugIdentityV2' op ""attribute 'tfdbg_context_id' failed to satisfy constraint: string attribute");
  }
  {
    auto tblgen_op_name = odsAttrs.get("op_name");
    if (tblgen_op_name && !((tblgen_op_name.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.DebugIdentityV2' op ""attribute 'op_name' failed to satisfy constraint: string attribute");
  }
  {
    auto tblgen_output_slot = odsAttrs.get("output_slot");
    if (tblgen_output_slot && !(((tblgen_output_slot.isa<::mlir::IntegerAttr>())) && ((tblgen_output_slot.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.DebugIdentityV2' op ""attribute 'output_slot' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_tensor_debug_mode = odsAttrs.get("tensor_debug_mode");
    if (tblgen_tensor_debug_mode && !(((tblgen_tensor_debug_mode.isa<::mlir::IntegerAttr>())) && ((tblgen_tensor_debug_mode.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.DebugIdentityV2' op ""attribute 'tensor_debug_mode' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_debug_urls = odsAttrs.get("debug_urls");
    if (tblgen_debug_urls && !(((tblgen_debug_urls.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_debug_urls.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return (attr.isa<::mlir::StringAttr>()); }))))
      return emitError(loc, "'tf.DebugIdentityV2' op ""attribute 'debug_urls' failed to satisfy constraint: string array attribute");
  }
  {
    auto tblgen_circular_buffer_size = odsAttrs.get("circular_buffer_size");
    if (tblgen_circular_buffer_size && !(((tblgen_circular_buffer_size.isa<::mlir::IntegerAttr>())) && ((tblgen_circular_buffer_size.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.DebugIdentityV2' op ""attribute 'circular_buffer_size' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_tfdbg_run_id = odsAttrs.get("tfdbg_run_id");
    if (tblgen_tfdbg_run_id && !((tblgen_tfdbg_run_id.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.DebugIdentityV2' op ""attribute 'tfdbg_run_id' failed to satisfy constraint: string attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> DebugIdentityV2Op::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range DebugIdentityV2Op::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value DebugIdentityV2Op::input() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange DebugIdentityV2Op::inputMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> DebugIdentityV2Op::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range DebugIdentityV2Op::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value DebugIdentityV2Op::output() {
  return *getODSResults(0).begin();
}

::mlir::StringAttr DebugIdentityV2Op::tfdbg_context_idAttr() {
  return (*this)->getAttr(tfdbg_context_idAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef DebugIdentityV2Op::tfdbg_context_id() {
  auto attr = tfdbg_context_idAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("").getValue();
  return attr.getValue();
}

::mlir::StringAttr DebugIdentityV2Op::op_nameAttr() {
  return (*this)->getAttr(op_nameAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef DebugIdentityV2Op::op_name() {
  auto attr = op_nameAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("").getValue();
  return attr.getValue();
}

::mlir::IntegerAttr DebugIdentityV2Op::output_slotAttr() {
  return (*this)->getAttr(output_slotAttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t DebugIdentityV2Op::output_slot() {
  auto attr = output_slotAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), -1).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

::mlir::IntegerAttr DebugIdentityV2Op::tensor_debug_modeAttr() {
  return (*this)->getAttr(tensor_debug_modeAttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t DebugIdentityV2Op::tensor_debug_mode() {
  auto attr = tensor_debug_modeAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), -1).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

::mlir::ArrayAttr DebugIdentityV2Op::debug_urlsAttr() {
  return (*this)->getAttr(debug_urlsAttrName()).dyn_cast_or_null<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr DebugIdentityV2Op::debug_urls() {
  auto attr = debug_urlsAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStrArrayAttr({});
  return attr;
}

::mlir::IntegerAttr DebugIdentityV2Op::circular_buffer_sizeAttr() {
  return (*this)->getAttr(circular_buffer_sizeAttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t DebugIdentityV2Op::circular_buffer_size() {
  auto attr = circular_buffer_sizeAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), 1000).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

::mlir::StringAttr DebugIdentityV2Op::tfdbg_run_idAttr() {
  return (*this)->getAttr(tfdbg_run_idAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef DebugIdentityV2Op::tfdbg_run_id() {
  auto attr = tfdbg_run_idAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("").getValue();
  return attr.getValue();
}

::mlir::Type DebugIdentityV2Op::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool DebugIdentityV2Op::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr DebugIdentityV2Op::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void DebugIdentityV2Op::tfdbg_context_idAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(tfdbg_context_idAttrName(), attr);
}

void DebugIdentityV2Op::op_nameAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(op_nameAttrName(), attr);
}

void DebugIdentityV2Op::output_slotAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(output_slotAttrName(), attr);
}

void DebugIdentityV2Op::tensor_debug_modeAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(tensor_debug_modeAttrName(), attr);
}

void DebugIdentityV2Op::debug_urlsAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(debug_urlsAttrName(), attr);
}

void DebugIdentityV2Op::circular_buffer_sizeAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(circular_buffer_sizeAttrName(), attr);
}

void DebugIdentityV2Op::tfdbg_run_idAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(tfdbg_run_idAttrName(), attr);
}

void DebugIdentityV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input, ::mlir::StringAttr tfdbg_context_id, ::mlir::StringAttr op_name, ::mlir::IntegerAttr output_slot, ::mlir::IntegerAttr tensor_debug_mode, ::mlir::ArrayAttr debug_urls, ::mlir::IntegerAttr circular_buffer_size, ::mlir::StringAttr tfdbg_run_id) {
  odsState.addOperands(input);
  odsState.addAttribute(tfdbg_context_idAttrName(odsState.name), tfdbg_context_id);
  odsState.addAttribute(op_nameAttrName(odsState.name), op_name);
  odsState.addAttribute(output_slotAttrName(odsState.name), output_slot);
  odsState.addAttribute(tensor_debug_modeAttrName(odsState.name), tensor_debug_mode);
  odsState.addAttribute(debug_urlsAttrName(odsState.name), debug_urls);
  odsState.addAttribute(circular_buffer_sizeAttrName(odsState.name), circular_buffer_size);
  odsState.addAttribute(tfdbg_run_idAttrName(odsState.name), tfdbg_run_id);
  odsState.addTypes(output);
}

void DebugIdentityV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::StringAttr tfdbg_context_id, ::mlir::StringAttr op_name, ::mlir::IntegerAttr output_slot, ::mlir::IntegerAttr tensor_debug_mode, ::mlir::ArrayAttr debug_urls, ::mlir::IntegerAttr circular_buffer_size, ::mlir::StringAttr tfdbg_run_id) {
  odsState.addOperands(input);
  odsState.addAttribute(tfdbg_context_idAttrName(odsState.name), tfdbg_context_id);
  odsState.addAttribute(op_nameAttrName(odsState.name), op_name);
  odsState.addAttribute(output_slotAttrName(odsState.name), output_slot);
  odsState.addAttribute(tensor_debug_modeAttrName(odsState.name), tensor_debug_mode);
  odsState.addAttribute(debug_urlsAttrName(odsState.name), debug_urls);
  odsState.addAttribute(circular_buffer_sizeAttrName(odsState.name), circular_buffer_size);
  odsState.addAttribute(tfdbg_run_idAttrName(odsState.name), tfdbg_run_id);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void DebugIdentityV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input, ::llvm::StringRef tfdbg_context_id, ::llvm::StringRef op_name, uint64_t output_slot, uint64_t tensor_debug_mode, ::mlir::ArrayAttr debug_urls, uint64_t circular_buffer_size, ::llvm::StringRef tfdbg_run_id) {
  odsState.addOperands(input);
  odsState.addAttribute(tfdbg_context_idAttrName(odsState.name), odsBuilder.getStringAttr(tfdbg_context_id));
  odsState.addAttribute(op_nameAttrName(odsState.name), odsBuilder.getStringAttr(op_name));
  odsState.addAttribute(output_slotAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), output_slot));
  odsState.addAttribute(tensor_debug_modeAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), tensor_debug_mode));
  odsState.addAttribute(debug_urlsAttrName(odsState.name), debug_urls);
  odsState.addAttribute(circular_buffer_sizeAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), circular_buffer_size));
  odsState.addAttribute(tfdbg_run_idAttrName(odsState.name), odsBuilder.getStringAttr(tfdbg_run_id));
  odsState.addTypes(output);
}

void DebugIdentityV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::llvm::StringRef tfdbg_context_id, ::llvm::StringRef op_name, uint64_t output_slot, uint64_t tensor_debug_mode, ::mlir::ArrayAttr debug_urls, uint64_t circular_buffer_size, ::llvm::StringRef tfdbg_run_id) {
  odsState.addOperands(input);
  odsState.addAttribute(tfdbg_context_idAttrName(odsState.name), odsBuilder.getStringAttr(tfdbg_context_id));
  odsState.addAttribute(op_nameAttrName(odsState.name), odsBuilder.getStringAttr(op_name));
  odsState.addAttribute(output_slotAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), output_slot));
  odsState.addAttribute(tensor_debug_modeAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), tensor_debug_mode));
  odsState.addAttribute(debug_urlsAttrName(odsState.name), debug_urls);
  odsState.addAttribute(circular_buffer_sizeAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), circular_buffer_size));
  odsState.addAttribute(tfdbg_run_idAttrName(odsState.name), odsBuilder.getStringAttr(tfdbg_run_id));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void DebugIdentityV2Op::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult DebugIdentityV2Op::verify() {
  {
    auto tblgen_tfdbg_context_id = (*this)->getAttr(tfdbg_context_idAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_tfdbg_context_id, "tfdbg_context_id")))
      return ::mlir::failure();
  }
  {
    auto tblgen_op_name = (*this)->getAttr(op_nameAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_op_name, "op_name")))
      return ::mlir::failure();
  }
  {
    auto tblgen_output_slot = (*this)->getAttr(output_slotAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_output_slot, "output_slot")))
      return ::mlir::failure();
  }
  {
    auto tblgen_tensor_debug_mode = (*this)->getAttr(tensor_debug_modeAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_tensor_debug_mode, "tensor_debug_mode")))
      return ::mlir::failure();
  }
  {
    auto tblgen_debug_urls = (*this)->getAttr(debug_urlsAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops22(*this, tblgen_debug_urls, "debug_urls")))
      return ::mlir::failure();
  }
  {
    auto tblgen_circular_buffer_size = (*this)->getAttr(circular_buffer_sizeAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_circular_buffer_size, "circular_buffer_size")))
      return ::mlir::failure();
  }
  {
    auto tblgen_tfdbg_run_id = (*this)->getAttr(tfdbg_run_idAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_tfdbg_run_id, "tfdbg_run_id")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::DebugIdentityV2Op)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::DecodeAndCropJpegOp definitions
//===----------------------------------------------------------------------===//

DecodeAndCropJpegOpAdaptor::DecodeAndCropJpegOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

DecodeAndCropJpegOpAdaptor::DecodeAndCropJpegOpAdaptor(DecodeAndCropJpegOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange DecodeAndCropJpegOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> DecodeAndCropJpegOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange DecodeAndCropJpegOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value DecodeAndCropJpegOpAdaptor::contents() {
  return *getODSOperands(0).begin();
}

::mlir::Value DecodeAndCropJpegOpAdaptor::crop_window() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr DecodeAndCropJpegOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::IntegerAttr DecodeAndCropJpegOpAdaptor::channels() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("channels").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), 0);
  return attr;
}

::mlir::IntegerAttr DecodeAndCropJpegOpAdaptor::ratio() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("ratio").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), 1);
  return attr;
}

::mlir::BoolAttr DecodeAndCropJpegOpAdaptor::fancy_upscaling() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("fancy_upscaling").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(true);
  return attr;
}

::mlir::BoolAttr DecodeAndCropJpegOpAdaptor::try_recover_truncated() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("try_recover_truncated").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(false);
  return attr;
}

::mlir::FloatAttr DecodeAndCropJpegOpAdaptor::acceptable_fraction() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::FloatAttr attr = odsAttrs.get("acceptable_fraction").dyn_cast_or_null<::mlir::FloatAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getFloatAttr(::mlir::Builder(odsAttrs.getContext()).getF32Type(), 1.0f);
  return attr;
}

::mlir::StringAttr DecodeAndCropJpegOpAdaptor::dct_method() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("dct_method").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("");
  return attr;
}

::mlir::LogicalResult DecodeAndCropJpegOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_channels = odsAttrs.get("channels");
    if (tblgen_channels && !(((tblgen_channels.isa<::mlir::IntegerAttr>())) && ((tblgen_channels.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.DecodeAndCropJpeg' op ""attribute 'channels' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_ratio = odsAttrs.get("ratio");
    if (tblgen_ratio && !(((tblgen_ratio.isa<::mlir::IntegerAttr>())) && ((tblgen_ratio.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.DecodeAndCropJpeg' op ""attribute 'ratio' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_fancy_upscaling = odsAttrs.get("fancy_upscaling");
    if (tblgen_fancy_upscaling && !((tblgen_fancy_upscaling.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.DecodeAndCropJpeg' op ""attribute 'fancy_upscaling' failed to satisfy constraint: bool attribute");
  }
  {
    auto tblgen_try_recover_truncated = odsAttrs.get("try_recover_truncated");
    if (tblgen_try_recover_truncated && !((tblgen_try_recover_truncated.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.DecodeAndCropJpeg' op ""attribute 'try_recover_truncated' failed to satisfy constraint: bool attribute");
  }
  {
    auto tblgen_acceptable_fraction = odsAttrs.get("acceptable_fraction");
    if (tblgen_acceptable_fraction && !(((tblgen_acceptable_fraction.isa<::mlir::FloatAttr>())) && ((tblgen_acceptable_fraction.cast<::mlir::FloatAttr>().getType().isF32()))))
      return emitError(loc, "'tf.DecodeAndCropJpeg' op ""attribute 'acceptable_fraction' failed to satisfy constraint: 32-bit float attribute");
  }
  {
    auto tblgen_dct_method = odsAttrs.get("dct_method");
    if (tblgen_dct_method && !((tblgen_dct_method.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.DecodeAndCropJpeg' op ""attribute 'dct_method' failed to satisfy constraint: string attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> DecodeAndCropJpegOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range DecodeAndCropJpegOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value DecodeAndCropJpegOp::contents() {
  return *getODSOperands(0).begin();
}

::mlir::Value DecodeAndCropJpegOp::crop_window() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange DecodeAndCropJpegOp::contentsMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange DecodeAndCropJpegOp::crop_windowMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> DecodeAndCropJpegOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range DecodeAndCropJpegOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value DecodeAndCropJpegOp::image() {
  return *getODSResults(0).begin();
}

::mlir::IntegerAttr DecodeAndCropJpegOp::channelsAttr() {
  return (*this)->getAttr(channelsAttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t DecodeAndCropJpegOp::channels() {
  auto attr = channelsAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), 0).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

::mlir::IntegerAttr DecodeAndCropJpegOp::ratioAttr() {
  return (*this)->getAttr(ratioAttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t DecodeAndCropJpegOp::ratio() {
  auto attr = ratioAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), 1).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

::mlir::BoolAttr DecodeAndCropJpegOp::fancy_upscalingAttr() {
  return (*this)->getAttr(fancy_upscalingAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool DecodeAndCropJpegOp::fancy_upscaling() {
  auto attr = fancy_upscalingAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(true).getValue();
  return attr.getValue();
}

::mlir::BoolAttr DecodeAndCropJpegOp::try_recover_truncatedAttr() {
  return (*this)->getAttr(try_recover_truncatedAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool DecodeAndCropJpegOp::try_recover_truncated() {
  auto attr = try_recover_truncatedAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(false).getValue();
  return attr.getValue();
}

::mlir::FloatAttr DecodeAndCropJpegOp::acceptable_fractionAttr() {
  return (*this)->getAttr(acceptable_fractionAttrName()).dyn_cast_or_null<::mlir::FloatAttr>();
}

::llvm::APFloat DecodeAndCropJpegOp::acceptable_fraction() {
  auto attr = acceptable_fractionAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getFloatAttr(::mlir::Builder((*this)->getContext()).getF32Type(), 1.0f).getValue();
  return attr.getValue();
}

::mlir::StringAttr DecodeAndCropJpegOp::dct_methodAttr() {
  return (*this)->getAttr(dct_methodAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef DecodeAndCropJpegOp::dct_method() {
  auto attr = dct_methodAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("").getValue();
  return attr.getValue();
}

void DecodeAndCropJpegOp::channelsAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(channelsAttrName(), attr);
}

void DecodeAndCropJpegOp::ratioAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(ratioAttrName(), attr);
}

void DecodeAndCropJpegOp::fancy_upscalingAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(fancy_upscalingAttrName(), attr);
}

void DecodeAndCropJpegOp::try_recover_truncatedAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(try_recover_truncatedAttrName(), attr);
}

void DecodeAndCropJpegOp::acceptable_fractionAttr(::mlir::FloatAttr attr) {
  (*this)->setAttr(acceptable_fractionAttrName(), attr);
}

void DecodeAndCropJpegOp::dct_methodAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(dct_methodAttrName(), attr);
}

void DecodeAndCropJpegOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type image, ::mlir::Value contents, ::mlir::Value crop_window, ::mlir::IntegerAttr channels, ::mlir::IntegerAttr ratio, ::mlir::BoolAttr fancy_upscaling, ::mlir::BoolAttr try_recover_truncated, ::mlir::FloatAttr acceptable_fraction, ::mlir::StringAttr dct_method) {
  odsState.addOperands(contents);
  odsState.addOperands(crop_window);
  odsState.addAttribute(channelsAttrName(odsState.name), channels);
  odsState.addAttribute(ratioAttrName(odsState.name), ratio);
  odsState.addAttribute(fancy_upscalingAttrName(odsState.name), fancy_upscaling);
  odsState.addAttribute(try_recover_truncatedAttrName(odsState.name), try_recover_truncated);
  odsState.addAttribute(acceptable_fractionAttrName(odsState.name), acceptable_fraction);
  odsState.addAttribute(dct_methodAttrName(odsState.name), dct_method);
  odsState.addTypes(image);
}

void DecodeAndCropJpegOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value contents, ::mlir::Value crop_window, ::mlir::IntegerAttr channels, ::mlir::IntegerAttr ratio, ::mlir::BoolAttr fancy_upscaling, ::mlir::BoolAttr try_recover_truncated, ::mlir::FloatAttr acceptable_fraction, ::mlir::StringAttr dct_method) {
  odsState.addOperands(contents);
  odsState.addOperands(crop_window);
  odsState.addAttribute(channelsAttrName(odsState.name), channels);
  odsState.addAttribute(ratioAttrName(odsState.name), ratio);
  odsState.addAttribute(fancy_upscalingAttrName(odsState.name), fancy_upscaling);
  odsState.addAttribute(try_recover_truncatedAttrName(odsState.name), try_recover_truncated);
  odsState.addAttribute(acceptable_fractionAttrName(odsState.name), acceptable_fraction);
  odsState.addAttribute(dct_methodAttrName(odsState.name), dct_method);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void DecodeAndCropJpegOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type image, ::mlir::Value contents, ::mlir::Value crop_window, uint64_t channels, uint64_t ratio, bool fancy_upscaling, bool try_recover_truncated, ::llvm::APFloat acceptable_fraction, ::llvm::StringRef dct_method) {
  odsState.addOperands(contents);
  odsState.addOperands(crop_window);
  odsState.addAttribute(channelsAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), channels));
  odsState.addAttribute(ratioAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), ratio));
  odsState.addAttribute(fancy_upscalingAttrName(odsState.name), odsBuilder.getBoolAttr(fancy_upscaling));
  odsState.addAttribute(try_recover_truncatedAttrName(odsState.name), odsBuilder.getBoolAttr(try_recover_truncated));
  odsState.addAttribute(acceptable_fractionAttrName(odsState.name), odsBuilder.getFloatAttr(odsBuilder.getF32Type(), acceptable_fraction));
  odsState.addAttribute(dct_methodAttrName(odsState.name), odsBuilder.getStringAttr(dct_method));
  odsState.addTypes(image);
}

void DecodeAndCropJpegOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value contents, ::mlir::Value crop_window, uint64_t channels, uint64_t ratio, bool fancy_upscaling, bool try_recover_truncated, ::llvm::APFloat acceptable_fraction, ::llvm::StringRef dct_method) {
  odsState.addOperands(contents);
  odsState.addOperands(crop_window);
  odsState.addAttribute(channelsAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), channels));
  odsState.addAttribute(ratioAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), ratio));
  odsState.addAttribute(fancy_upscalingAttrName(odsState.name), odsBuilder.getBoolAttr(fancy_upscaling));
  odsState.addAttribute(try_recover_truncatedAttrName(odsState.name), odsBuilder.getBoolAttr(try_recover_truncated));
  odsState.addAttribute(acceptable_fractionAttrName(odsState.name), odsBuilder.getFloatAttr(odsBuilder.getF32Type(), acceptable_fraction));
  odsState.addAttribute(dct_methodAttrName(odsState.name), odsBuilder.getStringAttr(dct_method));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void DecodeAndCropJpegOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult DecodeAndCropJpegOp::verify() {
  {
    auto tblgen_channels = (*this)->getAttr(channelsAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_channels, "channels")))
      return ::mlir::failure();
  }
  {
    auto tblgen_ratio = (*this)->getAttr(ratioAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_ratio, "ratio")))
      return ::mlir::failure();
  }
  {
    auto tblgen_fancy_upscaling = (*this)->getAttr(fancy_upscalingAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_fancy_upscaling, "fancy_upscaling")))
      return ::mlir::failure();
  }
  {
    auto tblgen_try_recover_truncated = (*this)->getAttr(try_recover_truncatedAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_try_recover_truncated, "try_recover_truncated")))
      return ::mlir::failure();
  }
  {
    auto tblgen_acceptable_fraction = (*this)->getAttr(acceptable_fractionAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops5(*this, tblgen_acceptable_fraction, "acceptable_fraction")))
      return ::mlir::failure();
  }
  {
    auto tblgen_dct_method = (*this)->getAttr(dct_methodAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_dct_method, "dct_method")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops19(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops11(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops37(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void DecodeAndCropJpegOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::DecodeAndCropJpegOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::DecodeGifOp definitions
//===----------------------------------------------------------------------===//

DecodeGifOpAdaptor::DecodeGifOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

DecodeGifOpAdaptor::DecodeGifOpAdaptor(DecodeGifOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange DecodeGifOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> DecodeGifOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange DecodeGifOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value DecodeGifOpAdaptor::contents() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr DecodeGifOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult DecodeGifOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> DecodeGifOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range DecodeGifOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value DecodeGifOp::contents() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange DecodeGifOp::contentsMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> DecodeGifOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range DecodeGifOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value DecodeGifOp::image() {
  return *getODSResults(0).begin();
}

void DecodeGifOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type image, ::mlir::Value contents) {
  odsState.addOperands(contents);
  odsState.addTypes(image);
}

void DecodeGifOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value contents) {
  odsState.addOperands(contents);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void DecodeGifOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult DecodeGifOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops19(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops37(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void DecodeGifOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::DecodeGifOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::DecodeJpegOp definitions
//===----------------------------------------------------------------------===//

DecodeJpegOpAdaptor::DecodeJpegOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

DecodeJpegOpAdaptor::DecodeJpegOpAdaptor(DecodeJpegOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange DecodeJpegOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> DecodeJpegOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange DecodeJpegOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value DecodeJpegOpAdaptor::contents() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr DecodeJpegOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::IntegerAttr DecodeJpegOpAdaptor::channels() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("channels").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), 0);
  return attr;
}

::mlir::IntegerAttr DecodeJpegOpAdaptor::ratio() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("ratio").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), 1);
  return attr;
}

::mlir::BoolAttr DecodeJpegOpAdaptor::fancy_upscaling() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("fancy_upscaling").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(true);
  return attr;
}

::mlir::BoolAttr DecodeJpegOpAdaptor::try_recover_truncated() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("try_recover_truncated").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(false);
  return attr;
}

::mlir::FloatAttr DecodeJpegOpAdaptor::acceptable_fraction() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::FloatAttr attr = odsAttrs.get("acceptable_fraction").dyn_cast_or_null<::mlir::FloatAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getFloatAttr(::mlir::Builder(odsAttrs.getContext()).getF32Type(), 1.0f);
  return attr;
}

::mlir::StringAttr DecodeJpegOpAdaptor::dct_method() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("dct_method").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("");
  return attr;
}

::mlir::LogicalResult DecodeJpegOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_channels = odsAttrs.get("channels");
    if (tblgen_channels && !(((tblgen_channels.isa<::mlir::IntegerAttr>())) && ((tblgen_channels.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.DecodeJpeg' op ""attribute 'channels' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_ratio = odsAttrs.get("ratio");
    if (tblgen_ratio && !(((tblgen_ratio.isa<::mlir::IntegerAttr>())) && ((tblgen_ratio.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.DecodeJpeg' op ""attribute 'ratio' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_fancy_upscaling = odsAttrs.get("fancy_upscaling");
    if (tblgen_fancy_upscaling && !((tblgen_fancy_upscaling.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.DecodeJpeg' op ""attribute 'fancy_upscaling' failed to satisfy constraint: bool attribute");
  }
  {
    auto tblgen_try_recover_truncated = odsAttrs.get("try_recover_truncated");
    if (tblgen_try_recover_truncated && !((tblgen_try_recover_truncated.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.DecodeJpeg' op ""attribute 'try_recover_truncated' failed to satisfy constraint: bool attribute");
  }
  {
    auto tblgen_acceptable_fraction = odsAttrs.get("acceptable_fraction");
    if (tblgen_acceptable_fraction && !(((tblgen_acceptable_fraction.isa<::mlir::FloatAttr>())) && ((tblgen_acceptable_fraction.cast<::mlir::FloatAttr>().getType().isF32()))))
      return emitError(loc, "'tf.DecodeJpeg' op ""attribute 'acceptable_fraction' failed to satisfy constraint: 32-bit float attribute");
  }
  {
    auto tblgen_dct_method = odsAttrs.get("dct_method");
    if (tblgen_dct_method && !((tblgen_dct_method.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.DecodeJpeg' op ""attribute 'dct_method' failed to satisfy constraint: string attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> DecodeJpegOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range DecodeJpegOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value DecodeJpegOp::contents() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange DecodeJpegOp::contentsMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> DecodeJpegOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range DecodeJpegOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value DecodeJpegOp::image() {
  return *getODSResults(0).begin();
}

::mlir::IntegerAttr DecodeJpegOp::channelsAttr() {
  return (*this)->getAttr(channelsAttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t DecodeJpegOp::channels() {
  auto attr = channelsAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), 0).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

::mlir::IntegerAttr DecodeJpegOp::ratioAttr() {
  return (*this)->getAttr(ratioAttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t DecodeJpegOp::ratio() {
  auto attr = ratioAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), 1).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

::mlir::BoolAttr DecodeJpegOp::fancy_upscalingAttr() {
  return (*this)->getAttr(fancy_upscalingAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool DecodeJpegOp::fancy_upscaling() {
  auto attr = fancy_upscalingAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(true).getValue();
  return attr.getValue();
}

::mlir::BoolAttr DecodeJpegOp::try_recover_truncatedAttr() {
  return (*this)->getAttr(try_recover_truncatedAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool DecodeJpegOp::try_recover_truncated() {
  auto attr = try_recover_truncatedAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(false).getValue();
  return attr.getValue();
}

::mlir::FloatAttr DecodeJpegOp::acceptable_fractionAttr() {
  return (*this)->getAttr(acceptable_fractionAttrName()).dyn_cast_or_null<::mlir::FloatAttr>();
}

::llvm::APFloat DecodeJpegOp::acceptable_fraction() {
  auto attr = acceptable_fractionAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getFloatAttr(::mlir::Builder((*this)->getContext()).getF32Type(), 1.0f).getValue();
  return attr.getValue();
}

::mlir::StringAttr DecodeJpegOp::dct_methodAttr() {
  return (*this)->getAttr(dct_methodAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef DecodeJpegOp::dct_method() {
  auto attr = dct_methodAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("").getValue();
  return attr.getValue();
}

void DecodeJpegOp::channelsAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(channelsAttrName(), attr);
}

void DecodeJpegOp::ratioAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(ratioAttrName(), attr);
}

void DecodeJpegOp::fancy_upscalingAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(fancy_upscalingAttrName(), attr);
}

void DecodeJpegOp::try_recover_truncatedAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(try_recover_truncatedAttrName(), attr);
}

void DecodeJpegOp::acceptable_fractionAttr(::mlir::FloatAttr attr) {
  (*this)->setAttr(acceptable_fractionAttrName(), attr);
}

void DecodeJpegOp::dct_methodAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(dct_methodAttrName(), attr);
}

void DecodeJpegOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type image, ::mlir::Value contents, ::mlir::IntegerAttr channels, ::mlir::IntegerAttr ratio, ::mlir::BoolAttr fancy_upscaling, ::mlir::BoolAttr try_recover_truncated, ::mlir::FloatAttr acceptable_fraction, ::mlir::StringAttr dct_method) {
  odsState.addOperands(contents);
  odsState.addAttribute(channelsAttrName(odsState.name), channels);
  odsState.addAttribute(ratioAttrName(odsState.name), ratio);
  odsState.addAttribute(fancy_upscalingAttrName(odsState.name), fancy_upscaling);
  odsState.addAttribute(try_recover_truncatedAttrName(odsState.name), try_recover_truncated);
  odsState.addAttribute(acceptable_fractionAttrName(odsState.name), acceptable_fraction);
  odsState.addAttribute(dct_methodAttrName(odsState.name), dct_method);
  odsState.addTypes(image);
}

void DecodeJpegOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value contents, ::mlir::IntegerAttr channels, ::mlir::IntegerAttr ratio, ::mlir::BoolAttr fancy_upscaling, ::mlir::BoolAttr try_recover_truncated, ::mlir::FloatAttr acceptable_fraction, ::mlir::StringAttr dct_method) {
  odsState.addOperands(contents);
  odsState.addAttribute(channelsAttrName(odsState.name), channels);
  odsState.addAttribute(ratioAttrName(odsState.name), ratio);
  odsState.addAttribute(fancy_upscalingAttrName(odsState.name), fancy_upscaling);
  odsState.addAttribute(try_recover_truncatedAttrName(odsState.name), try_recover_truncated);
  odsState.addAttribute(acceptable_fractionAttrName(odsState.name), acceptable_fraction);
  odsState.addAttribute(dct_methodAttrName(odsState.name), dct_method);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void DecodeJpegOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type image, ::mlir::Value contents, uint64_t channels, uint64_t ratio, bool fancy_upscaling, bool try_recover_truncated, ::llvm::APFloat acceptable_fraction, ::llvm::StringRef dct_method) {
  odsState.addOperands(contents);
  odsState.addAttribute(channelsAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), channels));
  odsState.addAttribute(ratioAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), ratio));
  odsState.addAttribute(fancy_upscalingAttrName(odsState.name), odsBuilder.getBoolAttr(fancy_upscaling));
  odsState.addAttribute(try_recover_truncatedAttrName(odsState.name), odsBuilder.getBoolAttr(try_recover_truncated));
  odsState.addAttribute(acceptable_fractionAttrName(odsState.name), odsBuilder.getFloatAttr(odsBuilder.getF32Type(), acceptable_fraction));
  odsState.addAttribute(dct_methodAttrName(odsState.name), odsBuilder.getStringAttr(dct_method));
  odsState.addTypes(image);
}

void DecodeJpegOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value contents, uint64_t channels, uint64_t ratio, bool fancy_upscaling, bool try_recover_truncated, ::llvm::APFloat acceptable_fraction, ::llvm::StringRef dct_method) {
  odsState.addOperands(contents);
  odsState.addAttribute(channelsAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), channels));
  odsState.addAttribute(ratioAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), ratio));
  odsState.addAttribute(fancy_upscalingAttrName(odsState.name), odsBuilder.getBoolAttr(fancy_upscaling));
  odsState.addAttribute(try_recover_truncatedAttrName(odsState.name), odsBuilder.getBoolAttr(try_recover_truncated));
  odsState.addAttribute(acceptable_fractionAttrName(odsState.name), odsBuilder.getFloatAttr(odsBuilder.getF32Type(), acceptable_fraction));
  odsState.addAttribute(dct_methodAttrName(odsState.name), odsBuilder.getStringAttr(dct_method));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void DecodeJpegOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult DecodeJpegOp::verify() {
  {
    auto tblgen_channels = (*this)->getAttr(channelsAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_channels, "channels")))
      return ::mlir::failure();
  }
  {
    auto tblgen_ratio = (*this)->getAttr(ratioAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_ratio, "ratio")))
      return ::mlir::failure();
  }
  {
    auto tblgen_fancy_upscaling = (*this)->getAttr(fancy_upscalingAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_fancy_upscaling, "fancy_upscaling")))
      return ::mlir::failure();
  }
  {
    auto tblgen_try_recover_truncated = (*this)->getAttr(try_recover_truncatedAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_try_recover_truncated, "try_recover_truncated")))
      return ::mlir::failure();
  }
  {
    auto tblgen_acceptable_fraction = (*this)->getAttr(acceptable_fractionAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops5(*this, tblgen_acceptable_fraction, "acceptable_fraction")))
      return ::mlir::failure();
  }
  {
    auto tblgen_dct_method = (*this)->getAttr(dct_methodAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_dct_method, "dct_method")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops19(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops37(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void DecodeJpegOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::DecodeJpegOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::DecodePaddedRawOp definitions
//===----------------------------------------------------------------------===//

DecodePaddedRawOpAdaptor::DecodePaddedRawOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

DecodePaddedRawOpAdaptor::DecodePaddedRawOpAdaptor(DecodePaddedRawOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange DecodePaddedRawOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> DecodePaddedRawOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange DecodePaddedRawOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value DecodePaddedRawOpAdaptor::input_bytes() {
  return *getODSOperands(0).begin();
}

::mlir::Value DecodePaddedRawOpAdaptor::fixed_length() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr DecodePaddedRawOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::BoolAttr DecodePaddedRawOpAdaptor::little_endian() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("little_endian").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(true);
  return attr;
}

::mlir::LogicalResult DecodePaddedRawOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_little_endian = odsAttrs.get("little_endian");
    if (tblgen_little_endian && !((tblgen_little_endian.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.DecodePaddedRaw' op ""attribute 'little_endian' failed to satisfy constraint: bool attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> DecodePaddedRawOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range DecodePaddedRawOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value DecodePaddedRawOp::input_bytes() {
  return *getODSOperands(0).begin();
}

::mlir::Value DecodePaddedRawOp::fixed_length() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange DecodePaddedRawOp::input_bytesMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange DecodePaddedRawOp::fixed_lengthMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> DecodePaddedRawOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range DecodePaddedRawOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value DecodePaddedRawOp::output() {
  return *getODSResults(0).begin();
}

::mlir::BoolAttr DecodePaddedRawOp::little_endianAttr() {
  return (*this)->getAttr(little_endianAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool DecodePaddedRawOp::little_endian() {
  auto attr = little_endianAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(true).getValue();
  return attr.getValue();
}

::mlir::Type DecodePaddedRawOp::out_type() {
  return mlir::getElementTypeOrSelf(*getODSResults(0).begin());
}

bool DecodePaddedRawOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "out_type") return true;
 return false;
}

::mlir::DictionaryAttr DecodePaddedRawOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {out_typeAttrName(),
::mlir::TypeAttr::get(out_type())}});
}

void DecodePaddedRawOp::little_endianAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(little_endianAttrName(), attr);
}

void DecodePaddedRawOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input_bytes, ::mlir::Value fixed_length, ::mlir::BoolAttr little_endian) {
  odsState.addOperands(input_bytes);
  odsState.addOperands(fixed_length);
  odsState.addAttribute(little_endianAttrName(odsState.name), little_endian);
  odsState.addTypes(output);
}

void DecodePaddedRawOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input_bytes, ::mlir::Value fixed_length, ::mlir::BoolAttr little_endian) {
  odsState.addOperands(input_bytes);
  odsState.addOperands(fixed_length);
  odsState.addAttribute(little_endianAttrName(odsState.name), little_endian);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void DecodePaddedRawOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input_bytes, ::mlir::Value fixed_length, bool little_endian) {
  odsState.addOperands(input_bytes);
  odsState.addOperands(fixed_length);
  odsState.addAttribute(little_endianAttrName(odsState.name), odsBuilder.getBoolAttr(little_endian));
  odsState.addTypes(output);
}

void DecodePaddedRawOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input_bytes, ::mlir::Value fixed_length, bool little_endian) {
  odsState.addOperands(input_bytes);
  odsState.addOperands(fixed_length);
  odsState.addAttribute(little_endianAttrName(odsState.name), odsBuilder.getBoolAttr(little_endian));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void DecodePaddedRawOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult DecodePaddedRawOp::verify() {
  {
    auto tblgen_little_endian = (*this)->getAttr(little_endianAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_little_endian, "little_endian")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops19(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops11(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops38(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void DecodePaddedRawOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::DecodePaddedRawOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::DecodePngOp definitions
//===----------------------------------------------------------------------===//

DecodePngOpAdaptor::DecodePngOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

DecodePngOpAdaptor::DecodePngOpAdaptor(DecodePngOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange DecodePngOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> DecodePngOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange DecodePngOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value DecodePngOpAdaptor::contents() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr DecodePngOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::IntegerAttr DecodePngOpAdaptor::channels() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("channels").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), 0);
  return attr;
}

::mlir::LogicalResult DecodePngOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_channels = odsAttrs.get("channels");
    if (tblgen_channels && !(((tblgen_channels.isa<::mlir::IntegerAttr>())) && ((tblgen_channels.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.DecodePng' op ""attribute 'channels' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> DecodePngOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range DecodePngOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value DecodePngOp::contents() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange DecodePngOp::contentsMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> DecodePngOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range DecodePngOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value DecodePngOp::image() {
  return *getODSResults(0).begin();
}

::mlir::IntegerAttr DecodePngOp::channelsAttr() {
  return (*this)->getAttr(channelsAttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t DecodePngOp::channels() {
  auto attr = channelsAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), 0).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

::mlir::Type DecodePngOp::dtype() {
  return mlir::getElementTypeOrSelf(*getODSResults(0).begin());
}

bool DecodePngOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "dtype") return true;
 return false;
}

::mlir::DictionaryAttr DecodePngOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {dtypeAttrName(),
::mlir::TypeAttr::get(dtype())}});
}

void DecodePngOp::channelsAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(channelsAttrName(), attr);
}

void DecodePngOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type image, ::mlir::Value contents, ::mlir::IntegerAttr channels) {
  odsState.addOperands(contents);
  odsState.addAttribute(channelsAttrName(odsState.name), channels);
  odsState.addTypes(image);
}

void DecodePngOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value contents, ::mlir::IntegerAttr channels) {
  odsState.addOperands(contents);
  odsState.addAttribute(channelsAttrName(odsState.name), channels);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void DecodePngOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type image, ::mlir::Value contents, uint64_t channels) {
  odsState.addOperands(contents);
  odsState.addAttribute(channelsAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), channels));
  odsState.addTypes(image);
}

void DecodePngOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value contents, uint64_t channels) {
  odsState.addOperands(contents);
  odsState.addAttribute(channelsAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), channels));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void DecodePngOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult DecodePngOp::verify() {
  {
    auto tblgen_channels = (*this)->getAttr(channelsAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_channels, "channels")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops19(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops39(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void DecodePngOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::DecodePngOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::DeleteIteratorOp definitions
//===----------------------------------------------------------------------===//

DeleteIteratorOpAdaptor::DeleteIteratorOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

DeleteIteratorOpAdaptor::DeleteIteratorOpAdaptor(DeleteIteratorOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange DeleteIteratorOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> DeleteIteratorOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange DeleteIteratorOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value DeleteIteratorOpAdaptor::handle() {
  return *getODSOperands(0).begin();
}

::mlir::Value DeleteIteratorOpAdaptor::deleter() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr DeleteIteratorOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult DeleteIteratorOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> DeleteIteratorOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range DeleteIteratorOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value DeleteIteratorOp::handle() {
  return *getODSOperands(0).begin();
}

::mlir::Value DeleteIteratorOp::deleter() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange DeleteIteratorOp::handleMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange DeleteIteratorOp::deleterMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> DeleteIteratorOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range DeleteIteratorOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

void DeleteIteratorOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value handle, ::mlir::Value deleter) {
  odsState.addOperands(handle);
  odsState.addOperands(deleter);
}

void DeleteIteratorOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value handle, ::mlir::Value deleter) {
  odsState.addOperands(handle);
  odsState.addOperands(deleter);
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void DeleteIteratorOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 0u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult DeleteIteratorOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops15(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void DeleteIteratorOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  for (::mlir::Value value : getODSOperands(0))
    effects.emplace_back(::mlir::MemoryEffects::Free::get(), value, ::mlir::TF::ResourceEffects::DatasetIterator::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::DeleteIteratorOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::DeleteMemoryCacheOp definitions
//===----------------------------------------------------------------------===//

DeleteMemoryCacheOpAdaptor::DeleteMemoryCacheOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

DeleteMemoryCacheOpAdaptor::DeleteMemoryCacheOpAdaptor(DeleteMemoryCacheOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange DeleteMemoryCacheOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> DeleteMemoryCacheOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange DeleteMemoryCacheOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value DeleteMemoryCacheOpAdaptor::handle() {
  return *getODSOperands(0).begin();
}

::mlir::Value DeleteMemoryCacheOpAdaptor::deleter() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr DeleteMemoryCacheOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult DeleteMemoryCacheOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> DeleteMemoryCacheOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range DeleteMemoryCacheOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value DeleteMemoryCacheOp::handle() {
  return *getODSOperands(0).begin();
}

::mlir::Value DeleteMemoryCacheOp::deleter() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange DeleteMemoryCacheOp::handleMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange DeleteMemoryCacheOp::deleterMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> DeleteMemoryCacheOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range DeleteMemoryCacheOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

void DeleteMemoryCacheOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value handle, ::mlir::Value deleter) {
  odsState.addOperands(handle);
  odsState.addOperands(deleter);
}

void DeleteMemoryCacheOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value handle, ::mlir::Value deleter) {
  odsState.addOperands(handle);
  odsState.addOperands(deleter);
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void DeleteMemoryCacheOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 0u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult DeleteMemoryCacheOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops15(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void DeleteMemoryCacheOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  for (::mlir::Value value : getODSOperands(0))
    effects.emplace_back(::mlir::MemoryEffects::Free::get(), value, ::mlir::TF::ResourceEffects::DatasetMemoryCache::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::DeleteMemoryCacheOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::DeleteMultiDeviceIteratorOp definitions
//===----------------------------------------------------------------------===//

DeleteMultiDeviceIteratorOpAdaptor::DeleteMultiDeviceIteratorOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

DeleteMultiDeviceIteratorOpAdaptor::DeleteMultiDeviceIteratorOpAdaptor(DeleteMultiDeviceIteratorOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange DeleteMultiDeviceIteratorOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> DeleteMultiDeviceIteratorOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  bool isVariadic[] = {false, true, false};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (odsOperands.size() - 2) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::ValueRange DeleteMultiDeviceIteratorOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value DeleteMultiDeviceIteratorOpAdaptor::multi_device_iterator() {
  return *getODSOperands(0).begin();
}

::mlir::ValueRange DeleteMultiDeviceIteratorOpAdaptor::iterators() {
  return getODSOperands(1);
}

::mlir::Value DeleteMultiDeviceIteratorOpAdaptor::deleter() {
  return *getODSOperands(2).begin();
}

::mlir::DictionaryAttr DeleteMultiDeviceIteratorOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult DeleteMultiDeviceIteratorOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> DeleteMultiDeviceIteratorOp::getODSOperandIndexAndLength(unsigned index) {
  bool isVariadic[] = {false, true, false};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (getOperation()->getNumOperands() - 2) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::Operation::operand_range DeleteMultiDeviceIteratorOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value DeleteMultiDeviceIteratorOp::multi_device_iterator() {
  return *getODSOperands(0).begin();
}

::mlir::Operation::operand_range DeleteMultiDeviceIteratorOp::iterators() {
  return getODSOperands(1);
}

::mlir::Value DeleteMultiDeviceIteratorOp::deleter() {
  return *getODSOperands(2).begin();
}

::mlir::MutableOperandRange DeleteMultiDeviceIteratorOp::multi_device_iteratorMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange DeleteMultiDeviceIteratorOp::iteratorsMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange DeleteMultiDeviceIteratorOp::deleterMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> DeleteMultiDeviceIteratorOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range DeleteMultiDeviceIteratorOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

size_t DeleteMultiDeviceIteratorOp::N() {
  auto range = getODSOperands(1);
return std::distance(range.begin(), range.end());
}

bool DeleteMultiDeviceIteratorOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "N") return true;
 return false;
}

::mlir::DictionaryAttr DeleteMultiDeviceIteratorOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {NAttrName(),
odsBuilder.getI64IntegerAttr(N())}});
}

void DeleteMultiDeviceIteratorOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value multi_device_iterator, ::mlir::ValueRange iterators, ::mlir::Value deleter) {
  odsState.addOperands(multi_device_iterator);
  odsState.addOperands(iterators);
  odsState.addOperands(deleter);
}

void DeleteMultiDeviceIteratorOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value multi_device_iterator, ::mlir::ValueRange iterators, ::mlir::Value deleter) {
  odsState.addOperands(multi_device_iterator);
  odsState.addOperands(iterators);
  odsState.addOperands(deleter);
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void DeleteMultiDeviceIteratorOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() >= 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 0u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult DeleteMultiDeviceIteratorOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops15(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void DeleteMultiDeviceIteratorOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  for (::mlir::Value value : getODSOperands(0))
    effects.emplace_back(::mlir::MemoryEffects::Free::get(), value, ::mlir::TF::ResourceEffects::DatasetIterator::get());
  for (::mlir::Value value : getODSOperands(1))
    effects.emplace_back(::mlir::MemoryEffects::Read::get(), value, ::mlir::TF::ResourceEffects::DatasetIterator::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::DeleteMultiDeviceIteratorOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::DeleteRandomSeedGeneratorOp definitions
//===----------------------------------------------------------------------===//

DeleteRandomSeedGeneratorOpAdaptor::DeleteRandomSeedGeneratorOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

DeleteRandomSeedGeneratorOpAdaptor::DeleteRandomSeedGeneratorOpAdaptor(DeleteRandomSeedGeneratorOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange DeleteRandomSeedGeneratorOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> DeleteRandomSeedGeneratorOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange DeleteRandomSeedGeneratorOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value DeleteRandomSeedGeneratorOpAdaptor::handle() {
  return *getODSOperands(0).begin();
}

::mlir::Value DeleteRandomSeedGeneratorOpAdaptor::deleter() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr DeleteRandomSeedGeneratorOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult DeleteRandomSeedGeneratorOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> DeleteRandomSeedGeneratorOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range DeleteRandomSeedGeneratorOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value DeleteRandomSeedGeneratorOp::handle() {
  return *getODSOperands(0).begin();
}

::mlir::Value DeleteRandomSeedGeneratorOp::deleter() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange DeleteRandomSeedGeneratorOp::handleMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange DeleteRandomSeedGeneratorOp::deleterMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> DeleteRandomSeedGeneratorOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range DeleteRandomSeedGeneratorOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

void DeleteRandomSeedGeneratorOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value handle, ::mlir::Value deleter) {
  odsState.addOperands(handle);
  odsState.addOperands(deleter);
}

void DeleteRandomSeedGeneratorOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value handle, ::mlir::Value deleter) {
  odsState.addOperands(handle);
  odsState.addOperands(deleter);
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void DeleteRandomSeedGeneratorOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 0u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult DeleteRandomSeedGeneratorOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops15(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void DeleteRandomSeedGeneratorOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  for (::mlir::Value value : getODSOperands(0))
    effects.emplace_back(::mlir::MemoryEffects::Free::get(), value, ::mlir::TF::ResourceEffects::DatasetSeedGenerator::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::DeleteRandomSeedGeneratorOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::DeleteSeedGeneratorOp definitions
//===----------------------------------------------------------------------===//

DeleteSeedGeneratorOpAdaptor::DeleteSeedGeneratorOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

DeleteSeedGeneratorOpAdaptor::DeleteSeedGeneratorOpAdaptor(DeleteSeedGeneratorOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange DeleteSeedGeneratorOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> DeleteSeedGeneratorOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange DeleteSeedGeneratorOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value DeleteSeedGeneratorOpAdaptor::handle() {
  return *getODSOperands(0).begin();
}

::mlir::Value DeleteSeedGeneratorOpAdaptor::deleter() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr DeleteSeedGeneratorOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult DeleteSeedGeneratorOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> DeleteSeedGeneratorOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range DeleteSeedGeneratorOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value DeleteSeedGeneratorOp::handle() {
  return *getODSOperands(0).begin();
}

::mlir::Value DeleteSeedGeneratorOp::deleter() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange DeleteSeedGeneratorOp::handleMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange DeleteSeedGeneratorOp::deleterMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> DeleteSeedGeneratorOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range DeleteSeedGeneratorOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

void DeleteSeedGeneratorOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value handle, ::mlir::Value deleter) {
  odsState.addOperands(handle);
  odsState.addOperands(deleter);
}

void DeleteSeedGeneratorOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value handle, ::mlir::Value deleter) {
  odsState.addOperands(handle);
  odsState.addOperands(deleter);
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void DeleteSeedGeneratorOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 0u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult DeleteSeedGeneratorOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops15(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void DeleteSeedGeneratorOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  for (::mlir::Value value : getODSOperands(0))
    effects.emplace_back(::mlir::MemoryEffects::Free::get(), value, ::mlir::TF::ResourceEffects::DatasetSeedGenerator::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::DeleteSeedGeneratorOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::DepthToSpaceOp definitions
//===----------------------------------------------------------------------===//

DepthToSpaceOpAdaptor::DepthToSpaceOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

DepthToSpaceOpAdaptor::DepthToSpaceOpAdaptor(DepthToSpaceOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange DepthToSpaceOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> DepthToSpaceOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange DepthToSpaceOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value DepthToSpaceOpAdaptor::input() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr DepthToSpaceOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::IntegerAttr DepthToSpaceOpAdaptor::block_size() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("block_size").cast<::mlir::IntegerAttr>();
  return attr;
}

::mlir::StringAttr DepthToSpaceOpAdaptor::data_format() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("data_format").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("NHWC");
  return attr;
}

::mlir::LogicalResult DepthToSpaceOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_block_size = odsAttrs.get("block_size");
    if (!tblgen_block_size)
      return emitError(loc, "'tf.DepthToSpace' op ""requires attribute 'block_size'");

    if (tblgen_block_size && !((((tblgen_block_size.isa<::mlir::IntegerAttr>())) && ((tblgen_block_size.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))) && ((tblgen_block_size.cast<::mlir::IntegerAttr>().getInt() >= 2))))
      return emitError(loc, "'tf.DepthToSpace' op ""attribute 'block_size' failed to satisfy constraint: 64-bit signless integer attribute whose minimum value is 2");
  }
  {
    auto tblgen_data_format = odsAttrs.get("data_format");
    if (tblgen_data_format && !((tblgen_data_format.cast<StringAttr>().getValue() == "NHWC" || tblgen_data_format.cast<StringAttr>().getValue() == "NCHW" || tblgen_data_format.cast<StringAttr>().getValue() == "NCHW_VECT_C")))
      return emitError(loc, "'tf.DepthToSpace' op ""attribute 'data_format' failed to satisfy constraint: string attribute whose value is NHWC, or NCHW, or NCHW_VECT_C");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> DepthToSpaceOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range DepthToSpaceOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value DepthToSpaceOp::input() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange DepthToSpaceOp::inputMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> DepthToSpaceOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range DepthToSpaceOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value DepthToSpaceOp::output() {
  return *getODSResults(0).begin();
}

::mlir::IntegerAttr DepthToSpaceOp::block_sizeAttr() {
  return (*this)->getAttr(block_sizeAttrName()).cast<::mlir::IntegerAttr>();
}

uint64_t DepthToSpaceOp::block_size() {
  auto attr = block_sizeAttr();
  return attr.getValue().getZExtValue();
}

::mlir::StringAttr DepthToSpaceOp::data_formatAttr() {
  return (*this)->getAttr(data_formatAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef DepthToSpaceOp::data_format() {
  auto attr = data_formatAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("NHWC").getValue();
  return attr.getValue();
}

::mlir::Type DepthToSpaceOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool DepthToSpaceOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr DepthToSpaceOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void DepthToSpaceOp::block_sizeAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(block_sizeAttrName(), attr);
}

void DepthToSpaceOp::data_formatAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(data_formatAttrName(), attr);
}

void DepthToSpaceOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input, ::mlir::IntegerAttr block_size, ::mlir::StringAttr data_format) {
  odsState.addOperands(input);
  odsState.addAttribute(block_sizeAttrName(odsState.name), block_size);
  odsState.addAttribute(data_formatAttrName(odsState.name), data_format);
  odsState.addTypes(output);
}

void DepthToSpaceOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::IntegerAttr block_size, ::mlir::StringAttr data_format) {
  odsState.addOperands(input);
  odsState.addAttribute(block_sizeAttrName(odsState.name), block_size);
  odsState.addAttribute(data_formatAttrName(odsState.name), data_format);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void DepthToSpaceOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input, uint64_t block_size, ::llvm::StringRef data_format) {
  odsState.addOperands(input);
  odsState.addAttribute(block_sizeAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), block_size));
  odsState.addAttribute(data_formatAttrName(odsState.name), odsBuilder.getStringAttr(data_format));
  odsState.addTypes(output);
}

void DepthToSpaceOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, uint64_t block_size, ::llvm::StringRef data_format) {
  odsState.addOperands(input);
  odsState.addAttribute(block_sizeAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), block_size));
  odsState.addAttribute(data_formatAttrName(odsState.name), odsBuilder.getStringAttr(data_format));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void DepthToSpaceOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult DepthToSpaceOp::verify() {
  {
    auto tblgen_block_size = (*this)->getAttr(block_sizeAttrName());
    if (!tblgen_block_size)
      return emitOpError("requires attribute 'block_size'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops14(*this, tblgen_block_size, "block_size")))
      return ::mlir::failure();
  }
  {
    auto tblgen_data_format = (*this)->getAttr(data_formatAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops23(*this, tblgen_data_format, "data_format")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void DepthToSpaceOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::DepthToSpaceOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::DepthwiseConv2dNativeBackpropFilterOp definitions
//===----------------------------------------------------------------------===//

DepthwiseConv2dNativeBackpropFilterOpAdaptor::DepthwiseConv2dNativeBackpropFilterOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

DepthwiseConv2dNativeBackpropFilterOpAdaptor::DepthwiseConv2dNativeBackpropFilterOpAdaptor(DepthwiseConv2dNativeBackpropFilterOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange DepthwiseConv2dNativeBackpropFilterOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> DepthwiseConv2dNativeBackpropFilterOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange DepthwiseConv2dNativeBackpropFilterOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value DepthwiseConv2dNativeBackpropFilterOpAdaptor::input() {
  return *getODSOperands(0).begin();
}

::mlir::Value DepthwiseConv2dNativeBackpropFilterOpAdaptor::filter_sizes() {
  return *getODSOperands(1).begin();
}

::mlir::Value DepthwiseConv2dNativeBackpropFilterOpAdaptor::out_backprop() {
  return *getODSOperands(2).begin();
}

::mlir::DictionaryAttr DepthwiseConv2dNativeBackpropFilterOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::ArrayAttr DepthwiseConv2dNativeBackpropFilterOpAdaptor::strides() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("strides").cast<::mlir::ArrayAttr>();
  return attr;
}

::mlir::StringAttr DepthwiseConv2dNativeBackpropFilterOpAdaptor::padding() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("padding").cast<::mlir::StringAttr>();
  return attr;
}

::mlir::ArrayAttr DepthwiseConv2dNativeBackpropFilterOpAdaptor::explicit_paddings() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("explicit_paddings").dyn_cast_or_null<::mlir::ArrayAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getI64ArrayAttr({});
  return attr;
}

::mlir::StringAttr DepthwiseConv2dNativeBackpropFilterOpAdaptor::data_format() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("data_format").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("NHWC");
  return attr;
}

::mlir::ArrayAttr DepthwiseConv2dNativeBackpropFilterOpAdaptor::dilations() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("dilations").dyn_cast_or_null<::mlir::ArrayAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getI64ArrayAttr({1, 1, 1, 1});
  return attr;
}

::mlir::LogicalResult DepthwiseConv2dNativeBackpropFilterOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_strides = odsAttrs.get("strides");
    if (!tblgen_strides)
      return emitError(loc, "'tf.DepthwiseConv2dNativeBackpropFilter' op ""requires attribute 'strides'");

    if (tblgen_strides && !(((tblgen_strides.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_strides.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return ((attr.isa<::mlir::IntegerAttr>())) && ((attr.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64))); }))))
      return emitError(loc, "'tf.DepthwiseConv2dNativeBackpropFilter' op ""attribute 'strides' failed to satisfy constraint: 64-bit integer array attribute");
  }
  {
    auto tblgen_padding = odsAttrs.get("padding");
    if (!tblgen_padding)
      return emitError(loc, "'tf.DepthwiseConv2dNativeBackpropFilter' op ""requires attribute 'padding'");

    if (tblgen_padding && !((tblgen_padding.cast<StringAttr>().getValue() == "SAME" || tblgen_padding.cast<StringAttr>().getValue() == "VALID" || tblgen_padding.cast<StringAttr>().getValue() == "EXPLICIT")))
      return emitError(loc, "'tf.DepthwiseConv2dNativeBackpropFilter' op ""attribute 'padding' failed to satisfy constraint: string attribute whose value is SAME, or VALID, or EXPLICIT");
  }
  {
    auto tblgen_explicit_paddings = odsAttrs.get("explicit_paddings");
    if (tblgen_explicit_paddings && !(((tblgen_explicit_paddings.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_explicit_paddings.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return ((attr.isa<::mlir::IntegerAttr>())) && ((attr.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64))); }))))
      return emitError(loc, "'tf.DepthwiseConv2dNativeBackpropFilter' op ""attribute 'explicit_paddings' failed to satisfy constraint: 64-bit integer array attribute");
  }
  {
    auto tblgen_data_format = odsAttrs.get("data_format");
    if (tblgen_data_format && !((tblgen_data_format.cast<StringAttr>().getValue() == "NHWC" || tblgen_data_format.cast<StringAttr>().getValue() == "NCHW")))
      return emitError(loc, "'tf.DepthwiseConv2dNativeBackpropFilter' op ""attribute 'data_format' failed to satisfy constraint: 'NHWC' or 'NCHW' convnet data format");
  }
  {
    auto tblgen_dilations = odsAttrs.get("dilations");
    if (tblgen_dilations && !(((tblgen_dilations.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_dilations.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return ((attr.isa<::mlir::IntegerAttr>())) && ((attr.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64))); }))))
      return emitError(loc, "'tf.DepthwiseConv2dNativeBackpropFilter' op ""attribute 'dilations' failed to satisfy constraint: 64-bit integer array attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> DepthwiseConv2dNativeBackpropFilterOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range DepthwiseConv2dNativeBackpropFilterOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value DepthwiseConv2dNativeBackpropFilterOp::input() {
  return *getODSOperands(0).begin();
}

::mlir::Value DepthwiseConv2dNativeBackpropFilterOp::filter_sizes() {
  return *getODSOperands(1).begin();
}

::mlir::Value DepthwiseConv2dNativeBackpropFilterOp::out_backprop() {
  return *getODSOperands(2).begin();
}

::mlir::MutableOperandRange DepthwiseConv2dNativeBackpropFilterOp::inputMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange DepthwiseConv2dNativeBackpropFilterOp::filter_sizesMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange DepthwiseConv2dNativeBackpropFilterOp::out_backpropMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> DepthwiseConv2dNativeBackpropFilterOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range DepthwiseConv2dNativeBackpropFilterOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value DepthwiseConv2dNativeBackpropFilterOp::output() {
  return *getODSResults(0).begin();
}

::mlir::ArrayAttr DepthwiseConv2dNativeBackpropFilterOp::stridesAttr() {
  return (*this)->getAttr(stridesAttrName()).cast<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr DepthwiseConv2dNativeBackpropFilterOp::strides() {
  auto attr = stridesAttr();
  return attr;
}

::mlir::StringAttr DepthwiseConv2dNativeBackpropFilterOp::paddingAttr() {
  return (*this)->getAttr(paddingAttrName()).cast<::mlir::StringAttr>();
}

::llvm::StringRef DepthwiseConv2dNativeBackpropFilterOp::padding() {
  auto attr = paddingAttr();
  return attr.getValue();
}

::mlir::ArrayAttr DepthwiseConv2dNativeBackpropFilterOp::explicit_paddingsAttr() {
  return (*this)->getAttr(explicit_paddingsAttrName()).dyn_cast_or_null<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr DepthwiseConv2dNativeBackpropFilterOp::explicit_paddings() {
  auto attr = explicit_paddingsAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getI64ArrayAttr({});
  return attr;
}

::mlir::StringAttr DepthwiseConv2dNativeBackpropFilterOp::data_formatAttr() {
  return (*this)->getAttr(data_formatAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef DepthwiseConv2dNativeBackpropFilterOp::data_format() {
  auto attr = data_formatAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("NHWC").getValue();
  return attr.getValue();
}

::mlir::ArrayAttr DepthwiseConv2dNativeBackpropFilterOp::dilationsAttr() {
  return (*this)->getAttr(dilationsAttrName()).dyn_cast_or_null<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr DepthwiseConv2dNativeBackpropFilterOp::dilations() {
  auto attr = dilationsAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getI64ArrayAttr({1, 1, 1, 1});
  return attr;
}

::mlir::Type DepthwiseConv2dNativeBackpropFilterOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool DepthwiseConv2dNativeBackpropFilterOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr DepthwiseConv2dNativeBackpropFilterOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void DepthwiseConv2dNativeBackpropFilterOp::stridesAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(stridesAttrName(), attr);
}

void DepthwiseConv2dNativeBackpropFilterOp::paddingAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(paddingAttrName(), attr);
}

void DepthwiseConv2dNativeBackpropFilterOp::explicit_paddingsAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(explicit_paddingsAttrName(), attr);
}

void DepthwiseConv2dNativeBackpropFilterOp::data_formatAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(data_formatAttrName(), attr);
}

void DepthwiseConv2dNativeBackpropFilterOp::dilationsAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(dilationsAttrName(), attr);
}

void DepthwiseConv2dNativeBackpropFilterOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input, ::mlir::Value filter_sizes, ::mlir::Value out_backprop, ::mlir::ArrayAttr strides, ::mlir::StringAttr padding, ::mlir::ArrayAttr explicit_paddings, ::mlir::StringAttr data_format, ::mlir::ArrayAttr dilations) {
  odsState.addOperands(input);
  odsState.addOperands(filter_sizes);
  odsState.addOperands(out_backprop);
  odsState.addAttribute(stridesAttrName(odsState.name), strides);
  odsState.addAttribute(paddingAttrName(odsState.name), padding);
  odsState.addAttribute(explicit_paddingsAttrName(odsState.name), explicit_paddings);
  odsState.addAttribute(data_formatAttrName(odsState.name), data_format);
  odsState.addAttribute(dilationsAttrName(odsState.name), dilations);
  odsState.addTypes(output);
}

void DepthwiseConv2dNativeBackpropFilterOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::Value filter_sizes, ::mlir::Value out_backprop, ::mlir::ArrayAttr strides, ::mlir::StringAttr padding, ::mlir::ArrayAttr explicit_paddings, ::mlir::StringAttr data_format, ::mlir::ArrayAttr dilations) {
  odsState.addOperands(input);
  odsState.addOperands(filter_sizes);
  odsState.addOperands(out_backprop);
  odsState.addAttribute(stridesAttrName(odsState.name), strides);
  odsState.addAttribute(paddingAttrName(odsState.name), padding);
  odsState.addAttribute(explicit_paddingsAttrName(odsState.name), explicit_paddings);
  odsState.addAttribute(data_formatAttrName(odsState.name), data_format);
  odsState.addAttribute(dilationsAttrName(odsState.name), dilations);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void DepthwiseConv2dNativeBackpropFilterOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input, ::mlir::Value filter_sizes, ::mlir::Value out_backprop, ::mlir::ArrayAttr strides, ::llvm::StringRef padding, ::mlir::ArrayAttr explicit_paddings, ::llvm::StringRef data_format, ::mlir::ArrayAttr dilations) {
  odsState.addOperands(input);
  odsState.addOperands(filter_sizes);
  odsState.addOperands(out_backprop);
  odsState.addAttribute(stridesAttrName(odsState.name), strides);
  odsState.addAttribute(paddingAttrName(odsState.name), odsBuilder.getStringAttr(padding));
  odsState.addAttribute(explicit_paddingsAttrName(odsState.name), explicit_paddings);
  odsState.addAttribute(data_formatAttrName(odsState.name), odsBuilder.getStringAttr(data_format));
  odsState.addAttribute(dilationsAttrName(odsState.name), dilations);
  odsState.addTypes(output);
}

void DepthwiseConv2dNativeBackpropFilterOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::Value filter_sizes, ::mlir::Value out_backprop, ::mlir::ArrayAttr strides, ::llvm::StringRef padding, ::mlir::ArrayAttr explicit_paddings, ::llvm::StringRef data_format, ::mlir::ArrayAttr dilations) {
  odsState.addOperands(input);
  odsState.addOperands(filter_sizes);
  odsState.addOperands(out_backprop);
  odsState.addAttribute(stridesAttrName(odsState.name), strides);
  odsState.addAttribute(paddingAttrName(odsState.name), odsBuilder.getStringAttr(padding));
  odsState.addAttribute(explicit_paddingsAttrName(odsState.name), explicit_paddings);
  odsState.addAttribute(data_formatAttrName(odsState.name), odsBuilder.getStringAttr(data_format));
  odsState.addAttribute(dilationsAttrName(odsState.name), dilations);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void DepthwiseConv2dNativeBackpropFilterOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 3u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult DepthwiseConv2dNativeBackpropFilterOp::verify() {
  {
    auto tblgen_strides = (*this)->getAttr(stridesAttrName());
    if (!tblgen_strides)
      return emitOpError("requires attribute 'strides'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops13(*this, tblgen_strides, "strides")))
      return ::mlir::failure();
  }
  {
    auto tblgen_padding = (*this)->getAttr(paddingAttrName());
    if (!tblgen_padding)
      return emitOpError("requires attribute 'padding'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops21(*this, tblgen_padding, "padding")))
      return ::mlir::failure();
  }
  {
    auto tblgen_explicit_paddings = (*this)->getAttr(explicit_paddingsAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops13(*this, tblgen_explicit_paddings, "explicit_paddings")))
      return ::mlir::failure();
  }
  {
    auto tblgen_data_format = (*this)->getAttr(data_formatAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops11(*this, tblgen_data_format, "data_format")))
      return ::mlir::failure();
  }
  {
    auto tblgen_dilations = (*this)->getAttr(dilationsAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops13(*this, tblgen_dilations, "dilations")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops11(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void DepthwiseConv2dNativeBackpropFilterOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::DepthwiseConv2dNativeBackpropFilterOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::DepthwiseConv2dNativeBackpropInputOp definitions
//===----------------------------------------------------------------------===//

DepthwiseConv2dNativeBackpropInputOpAdaptor::DepthwiseConv2dNativeBackpropInputOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

DepthwiseConv2dNativeBackpropInputOpAdaptor::DepthwiseConv2dNativeBackpropInputOpAdaptor(DepthwiseConv2dNativeBackpropInputOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange DepthwiseConv2dNativeBackpropInputOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> DepthwiseConv2dNativeBackpropInputOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange DepthwiseConv2dNativeBackpropInputOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value DepthwiseConv2dNativeBackpropInputOpAdaptor::input_sizes() {
  return *getODSOperands(0).begin();
}

::mlir::Value DepthwiseConv2dNativeBackpropInputOpAdaptor::filter() {
  return *getODSOperands(1).begin();
}

::mlir::Value DepthwiseConv2dNativeBackpropInputOpAdaptor::out_backprop() {
  return *getODSOperands(2).begin();
}

::mlir::DictionaryAttr DepthwiseConv2dNativeBackpropInputOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::ArrayAttr DepthwiseConv2dNativeBackpropInputOpAdaptor::strides() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("strides").cast<::mlir::ArrayAttr>();
  return attr;
}

::mlir::StringAttr DepthwiseConv2dNativeBackpropInputOpAdaptor::padding() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("padding").cast<::mlir::StringAttr>();
  return attr;
}

::mlir::ArrayAttr DepthwiseConv2dNativeBackpropInputOpAdaptor::explicit_paddings() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("explicit_paddings").dyn_cast_or_null<::mlir::ArrayAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getI64ArrayAttr({});
  return attr;
}

::mlir::StringAttr DepthwiseConv2dNativeBackpropInputOpAdaptor::data_format() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("data_format").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("NHWC");
  return attr;
}

::mlir::ArrayAttr DepthwiseConv2dNativeBackpropInputOpAdaptor::dilations() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("dilations").dyn_cast_or_null<::mlir::ArrayAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getI64ArrayAttr({1, 1, 1, 1});
  return attr;
}

::mlir::LogicalResult DepthwiseConv2dNativeBackpropInputOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_strides = odsAttrs.get("strides");
    if (!tblgen_strides)
      return emitError(loc, "'tf.DepthwiseConv2dNativeBackpropInput' op ""requires attribute 'strides'");

    if (tblgen_strides && !(((tblgen_strides.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_strides.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return ((attr.isa<::mlir::IntegerAttr>())) && ((attr.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64))); }))))
      return emitError(loc, "'tf.DepthwiseConv2dNativeBackpropInput' op ""attribute 'strides' failed to satisfy constraint: 64-bit integer array attribute");
  }
  {
    auto tblgen_padding = odsAttrs.get("padding");
    if (!tblgen_padding)
      return emitError(loc, "'tf.DepthwiseConv2dNativeBackpropInput' op ""requires attribute 'padding'");

    if (tblgen_padding && !((tblgen_padding.cast<StringAttr>().getValue() == "SAME" || tblgen_padding.cast<StringAttr>().getValue() == "VALID" || tblgen_padding.cast<StringAttr>().getValue() == "EXPLICIT")))
      return emitError(loc, "'tf.DepthwiseConv2dNativeBackpropInput' op ""attribute 'padding' failed to satisfy constraint: string attribute whose value is SAME, or VALID, or EXPLICIT");
  }
  {
    auto tblgen_explicit_paddings = odsAttrs.get("explicit_paddings");
    if (tblgen_explicit_paddings && !(((tblgen_explicit_paddings.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_explicit_paddings.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return ((attr.isa<::mlir::IntegerAttr>())) && ((attr.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64))); }))))
      return emitError(loc, "'tf.DepthwiseConv2dNativeBackpropInput' op ""attribute 'explicit_paddings' failed to satisfy constraint: 64-bit integer array attribute");
  }
  {
    auto tblgen_data_format = odsAttrs.get("data_format");
    if (tblgen_data_format && !((tblgen_data_format.cast<StringAttr>().getValue() == "NHWC" || tblgen_data_format.cast<StringAttr>().getValue() == "NCHW")))
      return emitError(loc, "'tf.DepthwiseConv2dNativeBackpropInput' op ""attribute 'data_format' failed to satisfy constraint: 'NHWC' or 'NCHW' convnet data format");
  }
  {
    auto tblgen_dilations = odsAttrs.get("dilations");
    if (tblgen_dilations && !(((tblgen_dilations.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_dilations.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return ((attr.isa<::mlir::IntegerAttr>())) && ((attr.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64))); }))))
      return emitError(loc, "'tf.DepthwiseConv2dNativeBackpropInput' op ""attribute 'dilations' failed to satisfy constraint: 64-bit integer array attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> DepthwiseConv2dNativeBackpropInputOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range DepthwiseConv2dNativeBackpropInputOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value DepthwiseConv2dNativeBackpropInputOp::input_sizes() {
  return *getODSOperands(0).begin();
}

::mlir::Value DepthwiseConv2dNativeBackpropInputOp::filter() {
  return *getODSOperands(1).begin();
}

::mlir::Value DepthwiseConv2dNativeBackpropInputOp::out_backprop() {
  return *getODSOperands(2).begin();
}

::mlir::MutableOperandRange DepthwiseConv2dNativeBackpropInputOp::input_sizesMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange DepthwiseConv2dNativeBackpropInputOp::filterMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange DepthwiseConv2dNativeBackpropInputOp::out_backpropMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> DepthwiseConv2dNativeBackpropInputOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range DepthwiseConv2dNativeBackpropInputOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value DepthwiseConv2dNativeBackpropInputOp::output() {
  return *getODSResults(0).begin();
}

::mlir::ArrayAttr DepthwiseConv2dNativeBackpropInputOp::stridesAttr() {
  return (*this)->getAttr(stridesAttrName()).cast<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr DepthwiseConv2dNativeBackpropInputOp::strides() {
  auto attr = stridesAttr();
  return attr;
}

::mlir::StringAttr DepthwiseConv2dNativeBackpropInputOp::paddingAttr() {
  return (*this)->getAttr(paddingAttrName()).cast<::mlir::StringAttr>();
}

::llvm::StringRef DepthwiseConv2dNativeBackpropInputOp::padding() {
  auto attr = paddingAttr();
  return attr.getValue();
}

::mlir::ArrayAttr DepthwiseConv2dNativeBackpropInputOp::explicit_paddingsAttr() {
  return (*this)->getAttr(explicit_paddingsAttrName()).dyn_cast_or_null<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr DepthwiseConv2dNativeBackpropInputOp::explicit_paddings() {
  auto attr = explicit_paddingsAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getI64ArrayAttr({});
  return attr;
}

::mlir::StringAttr DepthwiseConv2dNativeBackpropInputOp::data_formatAttr() {
  return (*this)->getAttr(data_formatAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef DepthwiseConv2dNativeBackpropInputOp::data_format() {
  auto attr = data_formatAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("NHWC").getValue();
  return attr.getValue();
}

::mlir::ArrayAttr DepthwiseConv2dNativeBackpropInputOp::dilationsAttr() {
  return (*this)->getAttr(dilationsAttrName()).dyn_cast_or_null<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr DepthwiseConv2dNativeBackpropInputOp::dilations() {
  auto attr = dilationsAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getI64ArrayAttr({1, 1, 1, 1});
  return attr;
}

::mlir::Type DepthwiseConv2dNativeBackpropInputOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(1).begin());
}

bool DepthwiseConv2dNativeBackpropInputOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr DepthwiseConv2dNativeBackpropInputOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void DepthwiseConv2dNativeBackpropInputOp::stridesAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(stridesAttrName(), attr);
}

void DepthwiseConv2dNativeBackpropInputOp::paddingAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(paddingAttrName(), attr);
}

void DepthwiseConv2dNativeBackpropInputOp::explicit_paddingsAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(explicit_paddingsAttrName(), attr);
}

void DepthwiseConv2dNativeBackpropInputOp::data_formatAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(data_formatAttrName(), attr);
}

void DepthwiseConv2dNativeBackpropInputOp::dilationsAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(dilationsAttrName(), attr);
}

void DepthwiseConv2dNativeBackpropInputOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input_sizes, ::mlir::Value filter, ::mlir::Value out_backprop, ::mlir::ArrayAttr strides, ::mlir::StringAttr padding, ::mlir::ArrayAttr explicit_paddings, ::mlir::StringAttr data_format, ::mlir::ArrayAttr dilations) {
  odsState.addOperands(input_sizes);
  odsState.addOperands(filter);
  odsState.addOperands(out_backprop);
  odsState.addAttribute(stridesAttrName(odsState.name), strides);
  odsState.addAttribute(paddingAttrName(odsState.name), padding);
  odsState.addAttribute(explicit_paddingsAttrName(odsState.name), explicit_paddings);
  odsState.addAttribute(data_formatAttrName(odsState.name), data_format);
  odsState.addAttribute(dilationsAttrName(odsState.name), dilations);
  odsState.addTypes(output);
}

void DepthwiseConv2dNativeBackpropInputOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input_sizes, ::mlir::Value filter, ::mlir::Value out_backprop, ::mlir::ArrayAttr strides, ::mlir::StringAttr padding, ::mlir::ArrayAttr explicit_paddings, ::mlir::StringAttr data_format, ::mlir::ArrayAttr dilations) {
  odsState.addOperands(input_sizes);
  odsState.addOperands(filter);
  odsState.addOperands(out_backprop);
  odsState.addAttribute(stridesAttrName(odsState.name), strides);
  odsState.addAttribute(paddingAttrName(odsState.name), padding);
  odsState.addAttribute(explicit_paddingsAttrName(odsState.name), explicit_paddings);
  odsState.addAttribute(data_formatAttrName(odsState.name), data_format);
  odsState.addAttribute(dilationsAttrName(odsState.name), dilations);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void DepthwiseConv2dNativeBackpropInputOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input_sizes, ::mlir::Value filter, ::mlir::Value out_backprop, ::mlir::ArrayAttr strides, ::llvm::StringRef padding, ::mlir::ArrayAttr explicit_paddings, ::llvm::StringRef data_format, ::mlir::ArrayAttr dilations) {
  odsState.addOperands(input_sizes);
  odsState.addOperands(filter);
  odsState.addOperands(out_backprop);
  odsState.addAttribute(stridesAttrName(odsState.name), strides);
  odsState.addAttribute(paddingAttrName(odsState.name), odsBuilder.getStringAttr(padding));
  odsState.addAttribute(explicit_paddingsAttrName(odsState.name), explicit_paddings);
  odsState.addAttribute(data_formatAttrName(odsState.name), odsBuilder.getStringAttr(data_format));
  odsState.addAttribute(dilationsAttrName(odsState.name), dilations);
  odsState.addTypes(output);
}

void DepthwiseConv2dNativeBackpropInputOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input_sizes, ::mlir::Value filter, ::mlir::Value out_backprop, ::mlir::ArrayAttr strides, ::llvm::StringRef padding, ::mlir::ArrayAttr explicit_paddings, ::llvm::StringRef data_format, ::mlir::ArrayAttr dilations) {
  odsState.addOperands(input_sizes);
  odsState.addOperands(filter);
  odsState.addOperands(out_backprop);
  odsState.addAttribute(stridesAttrName(odsState.name), strides);
  odsState.addAttribute(paddingAttrName(odsState.name), odsBuilder.getStringAttr(padding));
  odsState.addAttribute(explicit_paddingsAttrName(odsState.name), explicit_paddings);
  odsState.addAttribute(data_formatAttrName(odsState.name), odsBuilder.getStringAttr(data_format));
  odsState.addAttribute(dilationsAttrName(odsState.name), dilations);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void DepthwiseConv2dNativeBackpropInputOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 3u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult DepthwiseConv2dNativeBackpropInputOp::verify() {
  {
    auto tblgen_strides = (*this)->getAttr(stridesAttrName());
    if (!tblgen_strides)
      return emitOpError("requires attribute 'strides'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops13(*this, tblgen_strides, "strides")))
      return ::mlir::failure();
  }
  {
    auto tblgen_padding = (*this)->getAttr(paddingAttrName());
    if (!tblgen_padding)
      return emitOpError("requires attribute 'padding'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops21(*this, tblgen_padding, "padding")))
      return ::mlir::failure();
  }
  {
    auto tblgen_explicit_paddings = (*this)->getAttr(explicit_paddingsAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops13(*this, tblgen_explicit_paddings, "explicit_paddings")))
      return ::mlir::failure();
  }
  {
    auto tblgen_data_format = (*this)->getAttr(data_formatAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops11(*this, tblgen_data_format, "data_format")))
      return ::mlir::failure();
  }
  {
    auto tblgen_dilations = (*this)->getAttr(dilationsAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops13(*this, tblgen_dilations, "dilations")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops11(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void DepthwiseConv2dNativeBackpropInputOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::DepthwiseConv2dNativeBackpropInputOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::DepthwiseConv2dNativeOp definitions
//===----------------------------------------------------------------------===//

DepthwiseConv2dNativeOpAdaptor::DepthwiseConv2dNativeOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

DepthwiseConv2dNativeOpAdaptor::DepthwiseConv2dNativeOpAdaptor(DepthwiseConv2dNativeOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange DepthwiseConv2dNativeOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> DepthwiseConv2dNativeOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange DepthwiseConv2dNativeOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value DepthwiseConv2dNativeOpAdaptor::input() {
  return *getODSOperands(0).begin();
}

::mlir::Value DepthwiseConv2dNativeOpAdaptor::filter() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr DepthwiseConv2dNativeOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::ArrayAttr DepthwiseConv2dNativeOpAdaptor::strides() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("strides").cast<::mlir::ArrayAttr>();
  return attr;
}

::mlir::StringAttr DepthwiseConv2dNativeOpAdaptor::padding() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("padding").cast<::mlir::StringAttr>();
  return attr;
}

::mlir::ArrayAttr DepthwiseConv2dNativeOpAdaptor::explicit_paddings() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("explicit_paddings").dyn_cast_or_null<::mlir::ArrayAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getI64ArrayAttr({});
  return attr;
}

::mlir::StringAttr DepthwiseConv2dNativeOpAdaptor::data_format() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("data_format").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("NHWC");
  return attr;
}

::mlir::ArrayAttr DepthwiseConv2dNativeOpAdaptor::dilations() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("dilations").dyn_cast_or_null<::mlir::ArrayAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getI64ArrayAttr({1, 1, 1, 1});
  return attr;
}

::mlir::LogicalResult DepthwiseConv2dNativeOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_strides = odsAttrs.get("strides");
    if (!tblgen_strides)
      return emitError(loc, "'tf.DepthwiseConv2dNative' op ""requires attribute 'strides'");

    if (tblgen_strides && !(((tblgen_strides.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_strides.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return ((attr.isa<::mlir::IntegerAttr>())) && ((attr.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64))); }))))
      return emitError(loc, "'tf.DepthwiseConv2dNative' op ""attribute 'strides' failed to satisfy constraint: 64-bit integer array attribute");
  }
  {
    auto tblgen_padding = odsAttrs.get("padding");
    if (!tblgen_padding)
      return emitError(loc, "'tf.DepthwiseConv2dNative' op ""requires attribute 'padding'");

    if (tblgen_padding && !((tblgen_padding.cast<StringAttr>().getValue() == "SAME" || tblgen_padding.cast<StringAttr>().getValue() == "VALID" || tblgen_padding.cast<StringAttr>().getValue() == "EXPLICIT")))
      return emitError(loc, "'tf.DepthwiseConv2dNative' op ""attribute 'padding' failed to satisfy constraint: string attribute whose value is SAME, or VALID, or EXPLICIT");
  }
  {
    auto tblgen_explicit_paddings = odsAttrs.get("explicit_paddings");
    if (tblgen_explicit_paddings && !(((tblgen_explicit_paddings.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_explicit_paddings.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return ((attr.isa<::mlir::IntegerAttr>())) && ((attr.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64))); }))))
      return emitError(loc, "'tf.DepthwiseConv2dNative' op ""attribute 'explicit_paddings' failed to satisfy constraint: 64-bit integer array attribute");
  }
  {
    auto tblgen_data_format = odsAttrs.get("data_format");
    if (tblgen_data_format && !((tblgen_data_format.cast<StringAttr>().getValue() == "NHWC" || tblgen_data_format.cast<StringAttr>().getValue() == "NCHW")))
      return emitError(loc, "'tf.DepthwiseConv2dNative' op ""attribute 'data_format' failed to satisfy constraint: 'NHWC' or 'NCHW' convnet data format");
  }
  {
    auto tblgen_dilations = odsAttrs.get("dilations");
    if (tblgen_dilations && !(((tblgen_dilations.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_dilations.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return ((attr.isa<::mlir::IntegerAttr>())) && ((attr.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64))); }))))
      return emitError(loc, "'tf.DepthwiseConv2dNative' op ""attribute 'dilations' failed to satisfy constraint: 64-bit integer array attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> DepthwiseConv2dNativeOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range DepthwiseConv2dNativeOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value DepthwiseConv2dNativeOp::input() {
  return *getODSOperands(0).begin();
}

::mlir::Value DepthwiseConv2dNativeOp::filter() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange DepthwiseConv2dNativeOp::inputMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange DepthwiseConv2dNativeOp::filterMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> DepthwiseConv2dNativeOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range DepthwiseConv2dNativeOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value DepthwiseConv2dNativeOp::output() {
  return *getODSResults(0).begin();
}

::mlir::ArrayAttr DepthwiseConv2dNativeOp::stridesAttr() {
  return (*this)->getAttr(stridesAttrName()).cast<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr DepthwiseConv2dNativeOp::strides() {
  auto attr = stridesAttr();
  return attr;
}

::mlir::StringAttr DepthwiseConv2dNativeOp::paddingAttr() {
  return (*this)->getAttr(paddingAttrName()).cast<::mlir::StringAttr>();
}

::llvm::StringRef DepthwiseConv2dNativeOp::padding() {
  auto attr = paddingAttr();
  return attr.getValue();
}

::mlir::ArrayAttr DepthwiseConv2dNativeOp::explicit_paddingsAttr() {
  return (*this)->getAttr(explicit_paddingsAttrName()).dyn_cast_or_null<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr DepthwiseConv2dNativeOp::explicit_paddings() {
  auto attr = explicit_paddingsAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getI64ArrayAttr({});
  return attr;
}

::mlir::StringAttr DepthwiseConv2dNativeOp::data_formatAttr() {
  return (*this)->getAttr(data_formatAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef DepthwiseConv2dNativeOp::data_format() {
  auto attr = data_formatAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("NHWC").getValue();
  return attr.getValue();
}

::mlir::ArrayAttr DepthwiseConv2dNativeOp::dilationsAttr() {
  return (*this)->getAttr(dilationsAttrName()).dyn_cast_or_null<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr DepthwiseConv2dNativeOp::dilations() {
  auto attr = dilationsAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getI64ArrayAttr({1, 1, 1, 1});
  return attr;
}

::mlir::Type DepthwiseConv2dNativeOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool DepthwiseConv2dNativeOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr DepthwiseConv2dNativeOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void DepthwiseConv2dNativeOp::stridesAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(stridesAttrName(), attr);
}

void DepthwiseConv2dNativeOp::paddingAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(paddingAttrName(), attr);
}

void DepthwiseConv2dNativeOp::explicit_paddingsAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(explicit_paddingsAttrName(), attr);
}

void DepthwiseConv2dNativeOp::data_formatAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(data_formatAttrName(), attr);
}

void DepthwiseConv2dNativeOp::dilationsAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(dilationsAttrName(), attr);
}

void DepthwiseConv2dNativeOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input, ::mlir::Value filter, ::mlir::ArrayAttr strides, ::mlir::StringAttr padding, ::mlir::ArrayAttr explicit_paddings, ::mlir::StringAttr data_format, ::mlir::ArrayAttr dilations) {
  odsState.addOperands(input);
  odsState.addOperands(filter);
  odsState.addAttribute(stridesAttrName(odsState.name), strides);
  odsState.addAttribute(paddingAttrName(odsState.name), padding);
  odsState.addAttribute(explicit_paddingsAttrName(odsState.name), explicit_paddings);
  odsState.addAttribute(data_formatAttrName(odsState.name), data_format);
  odsState.addAttribute(dilationsAttrName(odsState.name), dilations);
  odsState.addTypes(output);
}

void DepthwiseConv2dNativeOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::Value filter, ::mlir::ArrayAttr strides, ::mlir::StringAttr padding, ::mlir::ArrayAttr explicit_paddings, ::mlir::StringAttr data_format, ::mlir::ArrayAttr dilations) {
  odsState.addOperands(input);
  odsState.addOperands(filter);
  odsState.addAttribute(stridesAttrName(odsState.name), strides);
  odsState.addAttribute(paddingAttrName(odsState.name), padding);
  odsState.addAttribute(explicit_paddingsAttrName(odsState.name), explicit_paddings);
  odsState.addAttribute(data_formatAttrName(odsState.name), data_format);
  odsState.addAttribute(dilationsAttrName(odsState.name), dilations);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void DepthwiseConv2dNativeOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input, ::mlir::Value filter, ::mlir::ArrayAttr strides, ::llvm::StringRef padding, ::mlir::ArrayAttr explicit_paddings, ::llvm::StringRef data_format, ::mlir::ArrayAttr dilations) {
  odsState.addOperands(input);
  odsState.addOperands(filter);
  odsState.addAttribute(stridesAttrName(odsState.name), strides);
  odsState.addAttribute(paddingAttrName(odsState.name), odsBuilder.getStringAttr(padding));
  odsState.addAttribute(explicit_paddingsAttrName(odsState.name), explicit_paddings);
  odsState.addAttribute(data_formatAttrName(odsState.name), odsBuilder.getStringAttr(data_format));
  odsState.addAttribute(dilationsAttrName(odsState.name), dilations);
  odsState.addTypes(output);
}

void DepthwiseConv2dNativeOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::Value filter, ::mlir::ArrayAttr strides, ::llvm::StringRef padding, ::mlir::ArrayAttr explicit_paddings, ::llvm::StringRef data_format, ::mlir::ArrayAttr dilations) {
  odsState.addOperands(input);
  odsState.addOperands(filter);
  odsState.addAttribute(stridesAttrName(odsState.name), strides);
  odsState.addAttribute(paddingAttrName(odsState.name), odsBuilder.getStringAttr(padding));
  odsState.addAttribute(explicit_paddingsAttrName(odsState.name), explicit_paddings);
  odsState.addAttribute(data_formatAttrName(odsState.name), odsBuilder.getStringAttr(data_format));
  odsState.addAttribute(dilationsAttrName(odsState.name), dilations);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void DepthwiseConv2dNativeOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult DepthwiseConv2dNativeOp::verify() {
  {
    auto tblgen_strides = (*this)->getAttr(stridesAttrName());
    if (!tblgen_strides)
      return emitOpError("requires attribute 'strides'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops13(*this, tblgen_strides, "strides")))
      return ::mlir::failure();
  }
  {
    auto tblgen_padding = (*this)->getAttr(paddingAttrName());
    if (!tblgen_padding)
      return emitOpError("requires attribute 'padding'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops21(*this, tblgen_padding, "padding")))
      return ::mlir::failure();
  }
  {
    auto tblgen_explicit_paddings = (*this)->getAttr(explicit_paddingsAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops13(*this, tblgen_explicit_paddings, "explicit_paddings")))
      return ::mlir::failure();
  }
  {
    auto tblgen_data_format = (*this)->getAttr(data_formatAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops11(*this, tblgen_data_format, "data_format")))
      return ::mlir::failure();
  }
  {
    auto tblgen_dilations = (*this)->getAttr(dilationsAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops13(*this, tblgen_dilations, "dilations")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void DepthwiseConv2dNativeOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::DepthwiseConv2dNativeOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::DequantizeOp definitions
//===----------------------------------------------------------------------===//

DequantizeOpAdaptor::DequantizeOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

DequantizeOpAdaptor::DequantizeOpAdaptor(DequantizeOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange DequantizeOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> DequantizeOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange DequantizeOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value DequantizeOpAdaptor::input() {
  return *getODSOperands(0).begin();
}

::mlir::Value DequantizeOpAdaptor::min_range() {
  return *getODSOperands(1).begin();
}

::mlir::Value DequantizeOpAdaptor::max_range() {
  return *getODSOperands(2).begin();
}

::mlir::DictionaryAttr DequantizeOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::StringAttr DequantizeOpAdaptor::mode() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("mode").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("MIN_COMBINED");
  return attr;
}

::mlir::BoolAttr DequantizeOpAdaptor::narrow_range() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("narrow_range").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(false);
  return attr;
}

::mlir::IntegerAttr DequantizeOpAdaptor::axis() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("axis").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), -1);
  return attr;
}

::mlir::LogicalResult DequantizeOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_mode = odsAttrs.get("mode");
    if (tblgen_mode && !((tblgen_mode.cast<StringAttr>().getValue() == "MIN_COMBINED" || tblgen_mode.cast<StringAttr>().getValue() == "MIN_FIRST" || tblgen_mode.cast<StringAttr>().getValue() == "SCALED")))
      return emitError(loc, "'tf.Dequantize' op ""attribute 'mode' failed to satisfy constraint: string attribute whose value is MIN_COMBINED, or MIN_FIRST, or SCALED");
  }
  {
    auto tblgen_narrow_range = odsAttrs.get("narrow_range");
    if (tblgen_narrow_range && !((tblgen_narrow_range.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.Dequantize' op ""attribute 'narrow_range' failed to satisfy constraint: bool attribute");
  }
  {
    auto tblgen_axis = odsAttrs.get("axis");
    if (tblgen_axis && !(((tblgen_axis.isa<::mlir::IntegerAttr>())) && ((tblgen_axis.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.Dequantize' op ""attribute 'axis' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> DequantizeOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range DequantizeOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value DequantizeOp::input() {
  return *getODSOperands(0).begin();
}

::mlir::Value DequantizeOp::min_range() {
  return *getODSOperands(1).begin();
}

::mlir::Value DequantizeOp::max_range() {
  return *getODSOperands(2).begin();
}

::mlir::MutableOperandRange DequantizeOp::inputMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange DequantizeOp::min_rangeMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange DequantizeOp::max_rangeMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> DequantizeOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range DequantizeOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value DequantizeOp::output() {
  return *getODSResults(0).begin();
}

::mlir::StringAttr DequantizeOp::modeAttr() {
  return (*this)->getAttr(modeAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef DequantizeOp::mode() {
  auto attr = modeAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("MIN_COMBINED").getValue();
  return attr.getValue();
}

::mlir::BoolAttr DequantizeOp::narrow_rangeAttr() {
  return (*this)->getAttr(narrow_rangeAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool DequantizeOp::narrow_range() {
  auto attr = narrow_rangeAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(false).getValue();
  return attr.getValue();
}

::mlir::IntegerAttr DequantizeOp::axisAttr() {
  return (*this)->getAttr(axisAttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t DequantizeOp::axis() {
  auto attr = axisAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), -1).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

::mlir::Type DequantizeOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

::mlir::Type DequantizeOp::dtype() {
  return mlir::getElementTypeOrSelf(*getODSResults(0).begin());
}

bool DequantizeOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
  if (name == "dtype") return true;
 return false;
}

::mlir::DictionaryAttr DequantizeOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())},
    {dtypeAttrName(),
::mlir::TypeAttr::get(dtype())}});
}

void DequantizeOp::modeAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(modeAttrName(), attr);
}

void DequantizeOp::narrow_rangeAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(narrow_rangeAttrName(), attr);
}

void DequantizeOp::axisAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(axisAttrName(), attr);
}

void DequantizeOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input, ::mlir::Value min_range, ::mlir::Value max_range, ::mlir::StringAttr mode, ::mlir::BoolAttr narrow_range, ::mlir::IntegerAttr axis) {
  odsState.addOperands(input);
  odsState.addOperands(min_range);
  odsState.addOperands(max_range);
  odsState.addAttribute(modeAttrName(odsState.name), mode);
  odsState.addAttribute(narrow_rangeAttrName(odsState.name), narrow_range);
  odsState.addAttribute(axisAttrName(odsState.name), axis);
  odsState.addTypes(output);
}

void DequantizeOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::Value min_range, ::mlir::Value max_range, ::mlir::StringAttr mode, ::mlir::BoolAttr narrow_range, ::mlir::IntegerAttr axis) {
  odsState.addOperands(input);
  odsState.addOperands(min_range);
  odsState.addOperands(max_range);
  odsState.addAttribute(modeAttrName(odsState.name), mode);
  odsState.addAttribute(narrow_rangeAttrName(odsState.name), narrow_range);
  odsState.addAttribute(axisAttrName(odsState.name), axis);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void DequantizeOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input, ::mlir::Value min_range, ::mlir::Value max_range, ::llvm::StringRef mode, bool narrow_range, uint64_t axis) {
  odsState.addOperands(input);
  odsState.addOperands(min_range);
  odsState.addOperands(max_range);
  odsState.addAttribute(modeAttrName(odsState.name), odsBuilder.getStringAttr(mode));
  odsState.addAttribute(narrow_rangeAttrName(odsState.name), odsBuilder.getBoolAttr(narrow_range));
  odsState.addAttribute(axisAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), axis));
  odsState.addTypes(output);
}

void DequantizeOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::Value min_range, ::mlir::Value max_range, ::llvm::StringRef mode, bool narrow_range, uint64_t axis) {
  odsState.addOperands(input);
  odsState.addOperands(min_range);
  odsState.addOperands(max_range);
  odsState.addAttribute(modeAttrName(odsState.name), odsBuilder.getStringAttr(mode));
  odsState.addAttribute(narrow_rangeAttrName(odsState.name), odsBuilder.getBoolAttr(narrow_range));
  odsState.addAttribute(axisAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), axis));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void DequantizeOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 3u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult DequantizeOp::verify() {
  {
    auto tblgen_mode = (*this)->getAttr(modeAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops24(*this, tblgen_mode, "mode")))
      return ::mlir::failure();
  }
  {
    auto tblgen_narrow_range = (*this)->getAttr(narrow_rangeAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_narrow_range, "narrow_range")))
      return ::mlir::failure();
  }
  {
    auto tblgen_axis = (*this)->getAttr(axisAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_axis, "axis")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops40(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops41(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void DequantizeOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::DequantizeOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::DeserializeIteratorOp definitions
//===----------------------------------------------------------------------===//

DeserializeIteratorOpAdaptor::DeserializeIteratorOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

DeserializeIteratorOpAdaptor::DeserializeIteratorOpAdaptor(DeserializeIteratorOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange DeserializeIteratorOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> DeserializeIteratorOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange DeserializeIteratorOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value DeserializeIteratorOpAdaptor::resource_handle() {
  return *getODSOperands(0).begin();
}

::mlir::Value DeserializeIteratorOpAdaptor::serialized() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr DeserializeIteratorOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult DeserializeIteratorOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> DeserializeIteratorOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range DeserializeIteratorOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value DeserializeIteratorOp::resource_handle() {
  return *getODSOperands(0).begin();
}

::mlir::Value DeserializeIteratorOp::serialized() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange DeserializeIteratorOp::resource_handleMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange DeserializeIteratorOp::serializedMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> DeserializeIteratorOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range DeserializeIteratorOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

void DeserializeIteratorOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value resource_handle, ::mlir::Value serialized) {
  odsState.addOperands(resource_handle);
  odsState.addOperands(serialized);
}

void DeserializeIteratorOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value resource_handle, ::mlir::Value serialized) {
  odsState.addOperands(resource_handle);
  odsState.addOperands(serialized);
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void DeserializeIteratorOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 0u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult DeserializeIteratorOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops15(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void DeserializeIteratorOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  for (::mlir::Value value : getODSOperands(0))
    effects.emplace_back(::mlir::MemoryEffects::Write::get(), value, ::mlir::TF::ResourceEffects::DatasetIterator::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::DeserializeIteratorOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::DeserializeSparseOp definitions
//===----------------------------------------------------------------------===//

DeserializeSparseOpAdaptor::DeserializeSparseOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

DeserializeSparseOpAdaptor::DeserializeSparseOpAdaptor(DeserializeSparseOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange DeserializeSparseOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> DeserializeSparseOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange DeserializeSparseOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value DeserializeSparseOpAdaptor::serialized_sparse() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr DeserializeSparseOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult DeserializeSparseOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

void DeserializeSparseOp::getAsmResultNames(::mlir::OpAsmSetValueNameFn setNameFn) {
  auto resultGroup0 = getODSResults(0);
  if (!llvm::empty(resultGroup0))
    setNameFn(*resultGroup0.begin(), "sparse_indices");
  auto resultGroup1 = getODSResults(1);
  if (!llvm::empty(resultGroup1))
    setNameFn(*resultGroup1.begin(), "sparse_values");
  auto resultGroup2 = getODSResults(2);
  if (!llvm::empty(resultGroup2))
    setNameFn(*resultGroup2.begin(), "sparse_shape");
}

std::pair<unsigned, unsigned> DeserializeSparseOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range DeserializeSparseOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value DeserializeSparseOp::serialized_sparse() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange DeserializeSparseOp::serialized_sparseMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> DeserializeSparseOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range DeserializeSparseOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value DeserializeSparseOp::sparse_indices() {
  return *getODSResults(0).begin();
}

::mlir::Value DeserializeSparseOp::sparse_values() {
  return *getODSResults(1).begin();
}

::mlir::Value DeserializeSparseOp::sparse_shape() {
  return *getODSResults(2).begin();
}

::mlir::Type DeserializeSparseOp::Tserialized() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

::mlir::Type DeserializeSparseOp::dtype() {
  return mlir::getElementTypeOrSelf(*getODSResults(1).begin());
}

bool DeserializeSparseOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "Tserialized") return true;
  if (name == "dtype") return true;
 return false;
}

::mlir::DictionaryAttr DeserializeSparseOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TserializedAttrName(),
::mlir::TypeAttr::get(Tserialized())},
    {dtypeAttrName(),
::mlir::TypeAttr::get(dtype())}});
}

void DeserializeSparseOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type sparse_indices, ::mlir::Type sparse_values, ::mlir::Type sparse_shape, ::mlir::Value serialized_sparse) {
  odsState.addOperands(serialized_sparse);
  odsState.addTypes(sparse_indices);
  odsState.addTypes(sparse_values);
  odsState.addTypes(sparse_shape);
}

void DeserializeSparseOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value serialized_sparse) {
  odsState.addOperands(serialized_sparse);
  assert(resultTypes.size() == 3u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void DeserializeSparseOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 3u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult DeserializeSparseOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops42(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops16(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSResults(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSResults(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops16(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void DeserializeSparseOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::DeserializeSparseOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::DestroyResourceOp definitions
//===----------------------------------------------------------------------===//

DestroyResourceOpAdaptor::DestroyResourceOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

DestroyResourceOpAdaptor::DestroyResourceOpAdaptor(DestroyResourceOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange DestroyResourceOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> DestroyResourceOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange DestroyResourceOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value DestroyResourceOpAdaptor::resource() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr DestroyResourceOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::BoolAttr DestroyResourceOpAdaptor::ignore_lookup_error() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("ignore_lookup_error").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(true);
  return attr;
}

::mlir::LogicalResult DestroyResourceOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_ignore_lookup_error = odsAttrs.get("ignore_lookup_error");
    if (tblgen_ignore_lookup_error && !((tblgen_ignore_lookup_error.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.DestroyResourceOp' op ""attribute 'ignore_lookup_error' failed to satisfy constraint: bool attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> DestroyResourceOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range DestroyResourceOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value DestroyResourceOp::resource() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange DestroyResourceOp::resourceMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> DestroyResourceOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range DestroyResourceOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::BoolAttr DestroyResourceOp::ignore_lookup_errorAttr() {
  return (*this)->getAttr(ignore_lookup_errorAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool DestroyResourceOp::ignore_lookup_error() {
  auto attr = ignore_lookup_errorAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(true).getValue();
  return attr.getValue();
}

void DestroyResourceOp::ignore_lookup_errorAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(ignore_lookup_errorAttrName(), attr);
}

void DestroyResourceOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value resource, ::mlir::BoolAttr ignore_lookup_error) {
  odsState.addOperands(resource);
  odsState.addAttribute(ignore_lookup_errorAttrName(odsState.name), ignore_lookup_error);
}

void DestroyResourceOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value resource, ::mlir::BoolAttr ignore_lookup_error) {
  odsState.addOperands(resource);
  odsState.addAttribute(ignore_lookup_errorAttrName(odsState.name), ignore_lookup_error);
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void DestroyResourceOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value resource, bool ignore_lookup_error) {
  odsState.addOperands(resource);
  odsState.addAttribute(ignore_lookup_errorAttrName(odsState.name), odsBuilder.getBoolAttr(ignore_lookup_error));
}

void DestroyResourceOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value resource, bool ignore_lookup_error) {
  odsState.addOperands(resource);
  odsState.addAttribute(ignore_lookup_errorAttrName(odsState.name), odsBuilder.getBoolAttr(ignore_lookup_error));
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void DestroyResourceOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 0u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult DestroyResourceOp::verify() {
  {
    auto tblgen_ignore_lookup_error = (*this)->getAttr(ignore_lookup_errorAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_ignore_lookup_error, "ignore_lookup_error")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::DestroyResourceOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::DeviceIndexOp definitions
//===----------------------------------------------------------------------===//

DeviceIndexOpAdaptor::DeviceIndexOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

DeviceIndexOpAdaptor::DeviceIndexOpAdaptor(DeviceIndexOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange DeviceIndexOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> DeviceIndexOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange DeviceIndexOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::DictionaryAttr DeviceIndexOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::ArrayAttr DeviceIndexOpAdaptor::device_names() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("device_names").cast<::mlir::ArrayAttr>();
  return attr;
}

::mlir::LogicalResult DeviceIndexOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_device_names = odsAttrs.get("device_names");
    if (!tblgen_device_names)
      return emitError(loc, "'tf.DeviceIndex' op ""requires attribute 'device_names'");

    if (tblgen_device_names && !(((tblgen_device_names.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_device_names.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return (attr.isa<::mlir::StringAttr>()); }))))
      return emitError(loc, "'tf.DeviceIndex' op ""attribute 'device_names' failed to satisfy constraint: string array attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> DeviceIndexOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range DeviceIndexOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

std::pair<unsigned, unsigned> DeviceIndexOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range DeviceIndexOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value DeviceIndexOp::index() {
  return *getODSResults(0).begin();
}

::mlir::ArrayAttr DeviceIndexOp::device_namesAttr() {
  return (*this)->getAttr(device_namesAttrName()).cast<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr DeviceIndexOp::device_names() {
  auto attr = device_namesAttr();
  return attr;
}

void DeviceIndexOp::device_namesAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(device_namesAttrName(), attr);
}

void DeviceIndexOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type index, ::mlir::ArrayAttr device_names) {
  odsState.addAttribute(device_namesAttrName(odsState.name), device_names);
  odsState.addTypes(index);
}

void DeviceIndexOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ArrayAttr device_names) {
  odsState.addAttribute(device_namesAttrName(odsState.name), device_names);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void DeviceIndexOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 0u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult DeviceIndexOp::verify() {
  {
    auto tblgen_device_names = (*this)->getAttr(device_namesAttrName());
    if (!tblgen_device_names)
      return emitOpError("requires attribute 'device_names'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops22(*this, tblgen_device_names, "device_names")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops11(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void DeviceIndexOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::DeviceIndexOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::DiagOp definitions
//===----------------------------------------------------------------------===//

DiagOpAdaptor::DiagOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

DiagOpAdaptor::DiagOpAdaptor(DiagOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange DiagOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> DiagOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange DiagOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value DiagOpAdaptor::diagonal() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr DiagOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult DiagOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> DiagOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range DiagOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value DiagOp::diagonal() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange DiagOp::diagonalMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> DiagOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range DiagOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value DiagOp::output() {
  return *getODSResults(0).begin();
}

::mlir::Type DiagOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool DiagOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr DiagOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void DiagOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value diagonal) {
  odsState.addOperands(diagonal);
  odsState.addTypes(output);
}

void DiagOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value diagonal) {
  odsState.addOperands(diagonal);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void DiagOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult DiagOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops22(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops22(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void DiagOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::DiagOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::DiagPartOp definitions
//===----------------------------------------------------------------------===//

DiagPartOpAdaptor::DiagPartOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

DiagPartOpAdaptor::DiagPartOpAdaptor(DiagPartOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange DiagPartOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> DiagPartOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange DiagPartOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value DiagPartOpAdaptor::input() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr DiagPartOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult DiagPartOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> DiagPartOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range DiagPartOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value DiagPartOp::input() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange DiagPartOp::inputMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> DiagPartOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range DiagPartOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value DiagPartOp::diagonal() {
  return *getODSResults(0).begin();
}

::mlir::Type DiagPartOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool DiagPartOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr DiagPartOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void DiagPartOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type diagonal, ::mlir::Value input) {
  odsState.addOperands(input);
  odsState.addTypes(diagonal);
}

void DiagPartOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input) {
  odsState.addOperands(input);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void DiagPartOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult DiagPartOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops22(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops22(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void DiagPartOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::DiagPartOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::DigammaOp definitions
//===----------------------------------------------------------------------===//

DigammaOpAdaptor::DigammaOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

DigammaOpAdaptor::DigammaOpAdaptor(DigammaOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange DigammaOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> DigammaOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange DigammaOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value DigammaOpAdaptor::x() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr DigammaOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult DigammaOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> DigammaOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range DigammaOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value DigammaOp::x() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange DigammaOp::xMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> DigammaOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range DigammaOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value DigammaOp::y() {
  return *getODSResults(0).begin();
}

::mlir::Type DigammaOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool DigammaOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr DigammaOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void DigammaOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type y, ::mlir::Value x) {
  odsState.addOperands(x);
  odsState.addTypes(y);
}

void DigammaOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value x) {
  odsState.addOperands(x);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void DigammaOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult DigammaOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void DigammaOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::DigammaOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::DivNoNanOp definitions
//===----------------------------------------------------------------------===//

DivNoNanOpAdaptor::DivNoNanOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

DivNoNanOpAdaptor::DivNoNanOpAdaptor(DivNoNanOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange DivNoNanOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> DivNoNanOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange DivNoNanOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value DivNoNanOpAdaptor::x() {
  return *getODSOperands(0).begin();
}

::mlir::Value DivNoNanOpAdaptor::y() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr DivNoNanOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult DivNoNanOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> DivNoNanOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range DivNoNanOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value DivNoNanOp::x() {
  return *getODSOperands(0).begin();
}

::mlir::Value DivNoNanOp::y() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange DivNoNanOp::xMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange DivNoNanOp::yMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> DivNoNanOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range DivNoNanOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value DivNoNanOp::z() {
  return *getODSResults(0).begin();
}

::mlir::Type DivNoNanOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool DivNoNanOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr DivNoNanOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void DivNoNanOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, Value x, Value y) {
  auto resultType =
      OpTrait::util::getBroadcastedType(x.getType(), y.getType());
  if (!resultType)
    mlir::emitError(odsState.location, "non-broadcastable operands");
  return build(odsBuilder, odsState, resultType, x, y);
}

void DivNoNanOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type z, ::mlir::Value x, ::mlir::Value y) {
  odsState.addOperands(x);
  odsState.addOperands(y);
  odsState.addTypes(z);
}

void DivNoNanOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value x, ::mlir::Value y) {
  odsState.addOperands(x);
  odsState.addOperands(y);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void DivNoNanOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult DivNoNanOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops2(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops2(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops2(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void DivNoNanOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::DivNoNanOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::DivOp definitions
//===----------------------------------------------------------------------===//

DivOpAdaptor::DivOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

DivOpAdaptor::DivOpAdaptor(DivOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange DivOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> DivOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange DivOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value DivOpAdaptor::x() {
  return *getODSOperands(0).begin();
}

::mlir::Value DivOpAdaptor::y() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr DivOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult DivOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> DivOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range DivOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value DivOp::x() {
  return *getODSOperands(0).begin();
}

::mlir::Value DivOp::y() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange DivOp::xMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange DivOp::yMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> DivOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range DivOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value DivOp::z() {
  return *getODSResults(0).begin();
}

::mlir::Type DivOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool DivOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr DivOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void DivOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, Value x, Value y) {
  auto resultType =
      OpTrait::util::getBroadcastedType(x.getType(), y.getType());
  if (!resultType)
    mlir::emitError(odsState.location, "non-broadcastable operands");
  return build(odsBuilder, odsState, resultType, x, y);
}

void DivOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type z, ::mlir::Value x, ::mlir::Value y) {
  odsState.addOperands(x);
  odsState.addOperands(y);
  odsState.addTypes(z);
}

void DivOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value x, ::mlir::Value y) {
  odsState.addOperands(x);
  odsState.addOperands(y);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void DivOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult DivOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops5(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops5(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops5(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void DivOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::DivOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::DummyMemoryCacheOp definitions
//===----------------------------------------------------------------------===//

DummyMemoryCacheOpAdaptor::DummyMemoryCacheOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

DummyMemoryCacheOpAdaptor::DummyMemoryCacheOpAdaptor(DummyMemoryCacheOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange DummyMemoryCacheOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> DummyMemoryCacheOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange DummyMemoryCacheOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::DictionaryAttr DummyMemoryCacheOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult DummyMemoryCacheOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> DummyMemoryCacheOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range DummyMemoryCacheOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

std::pair<unsigned, unsigned> DummyMemoryCacheOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range DummyMemoryCacheOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value DummyMemoryCacheOp::handle() {
  return *getODSResults(0).begin();
}

void DummyMemoryCacheOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type handle) {
  odsState.addTypes(handle);
}

void DummyMemoryCacheOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes) {
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void DummyMemoryCacheOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 0u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult DummyMemoryCacheOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void DummyMemoryCacheOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  for (::mlir::Value value : getODSResults(0))
    effects.emplace_back(::mlir::MemoryEffects::Allocate::get(), value, ::mlir::TF::ResourceEffects::DatasetMemoryCache::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::DummyMemoryCacheOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::DummySeedGeneratorOp definitions
//===----------------------------------------------------------------------===//

DummySeedGeneratorOpAdaptor::DummySeedGeneratorOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

DummySeedGeneratorOpAdaptor::DummySeedGeneratorOpAdaptor(DummySeedGeneratorOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange DummySeedGeneratorOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> DummySeedGeneratorOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange DummySeedGeneratorOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::DictionaryAttr DummySeedGeneratorOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult DummySeedGeneratorOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> DummySeedGeneratorOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range DummySeedGeneratorOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

std::pair<unsigned, unsigned> DummySeedGeneratorOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range DummySeedGeneratorOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value DummySeedGeneratorOp::handle() {
  return *getODSResults(0).begin();
}

void DummySeedGeneratorOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type handle) {
  odsState.addTypes(handle);
}

void DummySeedGeneratorOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes) {
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void DummySeedGeneratorOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 0u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult DummySeedGeneratorOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void DummySeedGeneratorOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  for (::mlir::Value value : getODSResults(0))
    effects.emplace_back(::mlir::MemoryEffects::Allocate::get(), value, ::mlir::TF::ResourceEffects::DatasetSeedGenerator::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::DummySeedGeneratorOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::DynamicStitchOp definitions
//===----------------------------------------------------------------------===//

DynamicStitchOpAdaptor::DynamicStitchOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

DynamicStitchOpAdaptor::DynamicStitchOpAdaptor(DynamicStitchOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange DynamicStitchOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> DynamicStitchOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  bool isVariadic[] = {true, true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (odsOperands.size() - 0) / 2;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::ValueRange DynamicStitchOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::ValueRange DynamicStitchOpAdaptor::indices() {
  return getODSOperands(0);
}

::mlir::ValueRange DynamicStitchOpAdaptor::data() {
  return getODSOperands(1);
}

::mlir::DictionaryAttr DynamicStitchOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult DynamicStitchOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> DynamicStitchOp::getODSOperandIndexAndLength(unsigned index) {
  bool isVariadic[] = {true, true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (getOperation()->getNumOperands() - 0) / 2;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::Operation::operand_range DynamicStitchOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Operation::operand_range DynamicStitchOp::indices() {
  return getODSOperands(0);
}

::mlir::Operation::operand_range DynamicStitchOp::data() {
  return getODSOperands(1);
}

::mlir::MutableOperandRange DynamicStitchOp::indicesMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange DynamicStitchOp::dataMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> DynamicStitchOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range DynamicStitchOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value DynamicStitchOp::merged() {
  return *getODSResults(0).begin();
}

size_t DynamicStitchOp::N() {
  auto range = getODSOperands(0);
return std::distance(range.begin(), range.end());
}

::mlir::Type DynamicStitchOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(1).begin());
}

bool DynamicStitchOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "N") return true;
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr DynamicStitchOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {NAttrName(),
odsBuilder.getI64IntegerAttr(N())},
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void DynamicStitchOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type merged, ::mlir::ValueRange indices, ::mlir::ValueRange data) {
  odsState.addOperands(indices);
  odsState.addOperands(data);
  odsState.addTypes(merged);
}

void DynamicStitchOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange indices, ::mlir::ValueRange data) {
  odsState.addOperands(indices);
  odsState.addOperands(data);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void DynamicStitchOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult DynamicStitchOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops11(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return Verify(*this);
}

void DynamicStitchOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::DynamicStitchOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::EinsumOp definitions
//===----------------------------------------------------------------------===//

EinsumOpAdaptor::EinsumOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

EinsumOpAdaptor::EinsumOpAdaptor(EinsumOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange EinsumOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> EinsumOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  bool isVariadic[] = {true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (odsOperands.size() - 0) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::ValueRange EinsumOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::ValueRange EinsumOpAdaptor::inputs() {
  return getODSOperands(0);
}

::mlir::DictionaryAttr EinsumOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::StringAttr EinsumOpAdaptor::equation() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("equation").cast<::mlir::StringAttr>();
  return attr;
}

::mlir::LogicalResult EinsumOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_equation = odsAttrs.get("equation");
    if (!tblgen_equation)
      return emitError(loc, "'tf.Einsum' op ""requires attribute 'equation'");

    if (tblgen_equation && !((tblgen_equation.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.Einsum' op ""attribute 'equation' failed to satisfy constraint: string attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> EinsumOp::getODSOperandIndexAndLength(unsigned index) {
  bool isVariadic[] = {true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (getOperation()->getNumOperands() - 0) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::Operation::operand_range EinsumOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Operation::operand_range EinsumOp::inputs() {
  return getODSOperands(0);
}

::mlir::MutableOperandRange EinsumOp::inputsMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> EinsumOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range EinsumOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value EinsumOp::output() {
  return *getODSResults(0).begin();
}

::mlir::StringAttr EinsumOp::equationAttr() {
  return (*this)->getAttr(equationAttrName()).cast<::mlir::StringAttr>();
}

::llvm::StringRef EinsumOp::equation() {
  auto attr = equationAttr();
  return attr.getValue();
}

size_t EinsumOp::N() {
  auto range = getODSOperands(0);
return std::distance(range.begin(), range.end());
}

::mlir::Type EinsumOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool EinsumOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "N") return true;
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr EinsumOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {NAttrName(),
odsBuilder.getI64IntegerAttr(N())},
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void EinsumOp::equationAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(equationAttrName(), attr);
}

void EinsumOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::ValueRange inputs, ::mlir::StringAttr equation) {
  odsState.addOperands(inputs);
  odsState.addAttribute(equationAttrName(odsState.name), equation);
  odsState.addTypes(output);
}

void EinsumOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange inputs, ::mlir::StringAttr equation) {
  odsState.addOperands(inputs);
  odsState.addAttribute(equationAttrName(odsState.name), equation);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void EinsumOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::ValueRange inputs, ::llvm::StringRef equation) {
  odsState.addOperands(inputs);
  odsState.addAttribute(equationAttrName(odsState.name), odsBuilder.getStringAttr(equation));
  odsState.addTypes(output);
}

void EinsumOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange inputs, ::llvm::StringRef equation) {
  odsState.addOperands(inputs);
  odsState.addAttribute(equationAttrName(odsState.name), odsBuilder.getStringAttr(equation));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void EinsumOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult EinsumOp::verify() {
  {
    auto tblgen_equation = (*this)->getAttr(equationAttrName());
    if (!tblgen_equation)
      return emitOpError("requires attribute 'equation'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_equation, "equation")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return Verify(*this);
}

void EinsumOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::EinsumOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::EluGradOp definitions
//===----------------------------------------------------------------------===//

EluGradOpAdaptor::EluGradOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

EluGradOpAdaptor::EluGradOpAdaptor(EluGradOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange EluGradOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> EluGradOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange EluGradOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value EluGradOpAdaptor::gradients() {
  return *getODSOperands(0).begin();
}

::mlir::Value EluGradOpAdaptor::outputs() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr EluGradOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult EluGradOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> EluGradOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range EluGradOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value EluGradOp::gradients() {
  return *getODSOperands(0).begin();
}

::mlir::Value EluGradOp::outputs() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange EluGradOp::gradientsMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange EluGradOp::outputsMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> EluGradOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range EluGradOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value EluGradOp::backprops() {
  return *getODSResults(0).begin();
}

::mlir::Type EluGradOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool EluGradOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr EluGradOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void EluGradOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type backprops, ::mlir::Value gradients, ::mlir::Value outputs) {
  odsState.addOperands(gradients);
  odsState.addOperands(outputs);
  odsState.addTypes(backprops);
}

void EluGradOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value gradients, ::mlir::Value outputs) {
  odsState.addOperands(gradients);
  odsState.addOperands(outputs);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void EluGradOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult EluGradOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void EluGradOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::EluGradOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::EluOp definitions
//===----------------------------------------------------------------------===//

EluOpAdaptor::EluOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

EluOpAdaptor::EluOpAdaptor(EluOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange EluOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> EluOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange EluOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value EluOpAdaptor::features() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr EluOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult EluOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> EluOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range EluOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value EluOp::features() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange EluOp::featuresMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> EluOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range EluOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value EluOp::activations() {
  return *getODSResults(0).begin();
}

::mlir::Type EluOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool EluOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr EluOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void EluOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type activations, ::mlir::Value features) {
  odsState.addOperands(features);
  odsState.addTypes(activations);
}

void EluOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value features) {
  odsState.addOperands(features);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void EluOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult EluOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void EluOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::EluOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::EmptyOp definitions
//===----------------------------------------------------------------------===//

EmptyOpAdaptor::EmptyOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

EmptyOpAdaptor::EmptyOpAdaptor(EmptyOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange EmptyOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> EmptyOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange EmptyOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value EmptyOpAdaptor::shape() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr EmptyOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::BoolAttr EmptyOpAdaptor::init() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("init").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(false);
  return attr;
}

::mlir::LogicalResult EmptyOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_init = odsAttrs.get("init");
    if (tblgen_init && !((tblgen_init.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.Empty' op ""attribute 'init' failed to satisfy constraint: bool attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> EmptyOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range EmptyOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value EmptyOp::shape() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange EmptyOp::shapeMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> EmptyOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range EmptyOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value EmptyOp::output() {
  return *getODSResults(0).begin();
}

::mlir::BoolAttr EmptyOp::initAttr() {
  return (*this)->getAttr(initAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool EmptyOp::init() {
  auto attr = initAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(false).getValue();
  return attr.getValue();
}

::mlir::Type EmptyOp::dtype() {
  return mlir::getElementTypeOrSelf(*getODSResults(0).begin());
}

bool EmptyOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "dtype") return true;
 return false;
}

::mlir::DictionaryAttr EmptyOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {dtypeAttrName(),
::mlir::TypeAttr::get(dtype())}});
}

void EmptyOp::initAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(initAttrName(), attr);
}

void EmptyOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value shape, ::mlir::BoolAttr init) {
  odsState.addOperands(shape);
  odsState.addAttribute(initAttrName(odsState.name), init);
  odsState.addTypes(output);
}

void EmptyOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value shape, ::mlir::BoolAttr init) {
  odsState.addOperands(shape);
  odsState.addAttribute(initAttrName(odsState.name), init);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void EmptyOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value shape, bool init) {
  odsState.addOperands(shape);
  odsState.addAttribute(initAttrName(odsState.name), odsBuilder.getBoolAttr(init));
  odsState.addTypes(output);
}

void EmptyOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value shape, bool init) {
  odsState.addOperands(shape);
  odsState.addAttribute(initAttrName(odsState.name), odsBuilder.getBoolAttr(init));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void EmptyOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult EmptyOp::verify() {
  {
    auto tblgen_init = (*this)->getAttr(initAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_init, "init")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops11(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::EmptyOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::EmptyTensorListOp definitions
//===----------------------------------------------------------------------===//

EmptyTensorListOpAdaptor::EmptyTensorListOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

EmptyTensorListOpAdaptor::EmptyTensorListOpAdaptor(EmptyTensorListOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange EmptyTensorListOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> EmptyTensorListOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange EmptyTensorListOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value EmptyTensorListOpAdaptor::element_shape() {
  return *getODSOperands(0).begin();
}

::mlir::Value EmptyTensorListOpAdaptor::max_num_elements() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr EmptyTensorListOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult EmptyTensorListOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> EmptyTensorListOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range EmptyTensorListOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value EmptyTensorListOp::element_shape() {
  return *getODSOperands(0).begin();
}

::mlir::Value EmptyTensorListOp::max_num_elements() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange EmptyTensorListOp::element_shapeMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange EmptyTensorListOp::max_num_elementsMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> EmptyTensorListOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range EmptyTensorListOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value EmptyTensorListOp::handle() {
  return *getODSResults(0).begin();
}

::mlir::Type EmptyTensorListOp::shape_type() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

::mlir::Type EmptyTensorListOp::element_dtype() {
  return getElementTypeOrSelf(element_type());
}

bool EmptyTensorListOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "shape_type") return true;
  if (name == "element_dtype") return true;
 return false;
}

::mlir::DictionaryAttr EmptyTensorListOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {shape_typeAttrName(),
::mlir::TypeAttr::get(shape_type())},
    {element_dtypeAttrName(),
::mlir::TypeAttr::get(element_dtype())}});
}

void EmptyTensorListOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type handle, ::mlir::Value element_shape, ::mlir::Value max_num_elements) {
  odsState.addOperands(element_shape);
  odsState.addOperands(max_num_elements);
  odsState.addTypes(handle);
}

void EmptyTensorListOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value element_shape, ::mlir::Value max_num_elements) {
  odsState.addOperands(element_shape);
  odsState.addOperands(max_num_elements);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void EmptyTensorListOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult EmptyTensorListOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops11(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops15(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  // This is required to populate derived attributes during export in a
    // meaningful way. Else during export to GraphDef element_type() query
    // will result in out of bounds access/assert.
    if (handle_dtype().getSubtypes().size() != 1) {
      return emitOpError(
          "must have exactly one subtype in the result variant type");
    }

    return Verify(*this);
}

void EmptyTensorListOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::EmptyTensorListOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::EnqueueTPUEmbeddingArbitraryTensorBatchOp definitions
//===----------------------------------------------------------------------===//

EnqueueTPUEmbeddingArbitraryTensorBatchOpAdaptor::EnqueueTPUEmbeddingArbitraryTensorBatchOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

EnqueueTPUEmbeddingArbitraryTensorBatchOpAdaptor::EnqueueTPUEmbeddingArbitraryTensorBatchOpAdaptor(EnqueueTPUEmbeddingArbitraryTensorBatchOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange EnqueueTPUEmbeddingArbitraryTensorBatchOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> EnqueueTPUEmbeddingArbitraryTensorBatchOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  bool isVariadic[] = {true, true, true, false};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (odsOperands.size() - 1) / 3;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::ValueRange EnqueueTPUEmbeddingArbitraryTensorBatchOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::ValueRange EnqueueTPUEmbeddingArbitraryTensorBatchOpAdaptor::sample_indices_or_row_lengths() {
  return getODSOperands(0);
}

::mlir::ValueRange EnqueueTPUEmbeddingArbitraryTensorBatchOpAdaptor::embedding_indices() {
  return getODSOperands(1);
}

::mlir::ValueRange EnqueueTPUEmbeddingArbitraryTensorBatchOpAdaptor::aggregation_weights() {
  return getODSOperands(2);
}

::mlir::Value EnqueueTPUEmbeddingArbitraryTensorBatchOpAdaptor::mode_override() {
  return *getODSOperands(3).begin();
}

::mlir::DictionaryAttr EnqueueTPUEmbeddingArbitraryTensorBatchOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::IntegerAttr EnqueueTPUEmbeddingArbitraryTensorBatchOpAdaptor::device_ordinal() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("device_ordinal").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), -1);
  return attr;
}

::mlir::ArrayAttr EnqueueTPUEmbeddingArbitraryTensorBatchOpAdaptor::combiners() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("combiners").dyn_cast_or_null<::mlir::ArrayAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStrArrayAttr({});
  return attr;
}

::mlir::LogicalResult EnqueueTPUEmbeddingArbitraryTensorBatchOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_device_ordinal = odsAttrs.get("device_ordinal");
    if (tblgen_device_ordinal && !(((tblgen_device_ordinal.isa<::mlir::IntegerAttr>())) && ((tblgen_device_ordinal.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.EnqueueTPUEmbeddingArbitraryTensorBatch' op ""attribute 'device_ordinal' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_combiners = odsAttrs.get("combiners");
    if (tblgen_combiners && !(((tblgen_combiners.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_combiners.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return (attr.isa<::mlir::StringAttr>()); }))))
      return emitError(loc, "'tf.EnqueueTPUEmbeddingArbitraryTensorBatch' op ""attribute 'combiners' failed to satisfy constraint: string array attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> EnqueueTPUEmbeddingArbitraryTensorBatchOp::getODSOperandIndexAndLength(unsigned index) {
  bool isVariadic[] = {true, true, true, false};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (getOperation()->getNumOperands() - 1) / 3;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::Operation::operand_range EnqueueTPUEmbeddingArbitraryTensorBatchOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Operation::operand_range EnqueueTPUEmbeddingArbitraryTensorBatchOp::sample_indices_or_row_lengths() {
  return getODSOperands(0);
}

::mlir::Operation::operand_range EnqueueTPUEmbeddingArbitraryTensorBatchOp::embedding_indices() {
  return getODSOperands(1);
}

::mlir::Operation::operand_range EnqueueTPUEmbeddingArbitraryTensorBatchOp::aggregation_weights() {
  return getODSOperands(2);
}

::mlir::Value EnqueueTPUEmbeddingArbitraryTensorBatchOp::mode_override() {
  return *getODSOperands(3).begin();
}

::mlir::MutableOperandRange EnqueueTPUEmbeddingArbitraryTensorBatchOp::sample_indices_or_row_lengthsMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange EnqueueTPUEmbeddingArbitraryTensorBatchOp::embedding_indicesMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange EnqueueTPUEmbeddingArbitraryTensorBatchOp::aggregation_weightsMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange EnqueueTPUEmbeddingArbitraryTensorBatchOp::mode_overrideMutable() {
  auto range = getODSOperandIndexAndLength(3);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> EnqueueTPUEmbeddingArbitraryTensorBatchOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range EnqueueTPUEmbeddingArbitraryTensorBatchOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::IntegerAttr EnqueueTPUEmbeddingArbitraryTensorBatchOp::device_ordinalAttr() {
  return (*this)->getAttr(device_ordinalAttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t EnqueueTPUEmbeddingArbitraryTensorBatchOp::device_ordinal() {
  auto attr = device_ordinalAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), -1).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

::mlir::ArrayAttr EnqueueTPUEmbeddingArbitraryTensorBatchOp::combinersAttr() {
  return (*this)->getAttr(combinersAttrName()).dyn_cast_or_null<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr EnqueueTPUEmbeddingArbitraryTensorBatchOp::combiners() {
  auto attr = combinersAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStrArrayAttr({});
  return attr;
}

size_t EnqueueTPUEmbeddingArbitraryTensorBatchOp::N() {
  auto range = getODSOperands(0);
return std::distance(range.begin(), range.end());
}

::mlir::Type EnqueueTPUEmbeddingArbitraryTensorBatchOp::T1() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

::mlir::Type EnqueueTPUEmbeddingArbitraryTensorBatchOp::T2() {
  return mlir::getElementTypeOrSelf(*getODSOperands(1).begin());
}

::mlir::Type EnqueueTPUEmbeddingArbitraryTensorBatchOp::T3() {
  return mlir::getElementTypeOrSelf(*getODSOperands(2).begin());
}

bool EnqueueTPUEmbeddingArbitraryTensorBatchOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "N") return true;
  if (name == "T1") return true;
  if (name == "T2") return true;
  if (name == "T3") return true;
 return false;
}

::mlir::DictionaryAttr EnqueueTPUEmbeddingArbitraryTensorBatchOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {NAttrName(),
odsBuilder.getI64IntegerAttr(N())},
    {T1AttrName(),
::mlir::TypeAttr::get(T1())},
    {T2AttrName(),
::mlir::TypeAttr::get(T2())},
    {T3AttrName(),
::mlir::TypeAttr::get(T3())}});
}

void EnqueueTPUEmbeddingArbitraryTensorBatchOp::device_ordinalAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(device_ordinalAttrName(), attr);
}

void EnqueueTPUEmbeddingArbitraryTensorBatchOp::combinersAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(combinersAttrName(), attr);
}

void EnqueueTPUEmbeddingArbitraryTensorBatchOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange sample_indices_or_row_lengths, ::mlir::ValueRange embedding_indices, ::mlir::ValueRange aggregation_weights, ::mlir::Value mode_override, ::mlir::IntegerAttr device_ordinal, ::mlir::ArrayAttr combiners) {
  odsState.addOperands(sample_indices_or_row_lengths);
  odsState.addOperands(embedding_indices);
  odsState.addOperands(aggregation_weights);
  odsState.addOperands(mode_override);
  odsState.addAttribute(device_ordinalAttrName(odsState.name), device_ordinal);
  odsState.addAttribute(combinersAttrName(odsState.name), combiners);
}

void EnqueueTPUEmbeddingArbitraryTensorBatchOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange sample_indices_or_row_lengths, ::mlir::ValueRange embedding_indices, ::mlir::ValueRange aggregation_weights, ::mlir::Value mode_override, ::mlir::IntegerAttr device_ordinal, ::mlir::ArrayAttr combiners) {
  odsState.addOperands(sample_indices_or_row_lengths);
  odsState.addOperands(embedding_indices);
  odsState.addOperands(aggregation_weights);
  odsState.addOperands(mode_override);
  odsState.addAttribute(device_ordinalAttrName(odsState.name), device_ordinal);
  odsState.addAttribute(combinersAttrName(odsState.name), combiners);
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void EnqueueTPUEmbeddingArbitraryTensorBatchOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange sample_indices_or_row_lengths, ::mlir::ValueRange embedding_indices, ::mlir::ValueRange aggregation_weights, ::mlir::Value mode_override, uint64_t device_ordinal, ::mlir::ArrayAttr combiners) {
  odsState.addOperands(sample_indices_or_row_lengths);
  odsState.addOperands(embedding_indices);
  odsState.addOperands(aggregation_weights);
  odsState.addOperands(mode_override);
  odsState.addAttribute(device_ordinalAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), device_ordinal));
  odsState.addAttribute(combinersAttrName(odsState.name), combiners);
}

void EnqueueTPUEmbeddingArbitraryTensorBatchOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange sample_indices_or_row_lengths, ::mlir::ValueRange embedding_indices, ::mlir::ValueRange aggregation_weights, ::mlir::Value mode_override, uint64_t device_ordinal, ::mlir::ArrayAttr combiners) {
  odsState.addOperands(sample_indices_or_row_lengths);
  odsState.addOperands(embedding_indices);
  odsState.addOperands(aggregation_weights);
  odsState.addOperands(mode_override);
  odsState.addAttribute(device_ordinalAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), device_ordinal));
  odsState.addAttribute(combinersAttrName(odsState.name), combiners);
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void EnqueueTPUEmbeddingArbitraryTensorBatchOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() >= 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 0u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult EnqueueTPUEmbeddingArbitraryTensorBatchOp::verify() {
  {
    auto tblgen_device_ordinal = (*this)->getAttr(device_ordinalAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_device_ordinal, "device_ordinal")))
      return ::mlir::failure();
  }
  {
    auto tblgen_combiners = (*this)->getAttr(combinersAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops22(*this, tblgen_combiners, "combiners")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops13(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup3 = getODSOperands(3);

    for (auto v : valueGroup3) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops19(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void EnqueueTPUEmbeddingArbitraryTensorBatchOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  effects.emplace_back(::mlir::MemoryEffects::Write::get(), ::mlir::TF::ResourceEffects::TPUEmbedding::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::EnqueueTPUEmbeddingArbitraryTensorBatchOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::EnqueueTPUEmbeddingBatchOp definitions
//===----------------------------------------------------------------------===//

EnqueueTPUEmbeddingBatchOpAdaptor::EnqueueTPUEmbeddingBatchOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

EnqueueTPUEmbeddingBatchOpAdaptor::EnqueueTPUEmbeddingBatchOpAdaptor(EnqueueTPUEmbeddingBatchOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange EnqueueTPUEmbeddingBatchOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> EnqueueTPUEmbeddingBatchOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  bool isVariadic[] = {true, false};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (odsOperands.size() - 1) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::ValueRange EnqueueTPUEmbeddingBatchOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::ValueRange EnqueueTPUEmbeddingBatchOpAdaptor::batch() {
  return getODSOperands(0);
}

::mlir::Value EnqueueTPUEmbeddingBatchOpAdaptor::mode_override() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr EnqueueTPUEmbeddingBatchOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::IntegerAttr EnqueueTPUEmbeddingBatchOpAdaptor::device_ordinal() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("device_ordinal").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), -1);
  return attr;
}

::mlir::ArrayAttr EnqueueTPUEmbeddingBatchOpAdaptor::combiners() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("combiners").dyn_cast_or_null<::mlir::ArrayAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStrArrayAttr({});
  return attr;
}

::mlir::LogicalResult EnqueueTPUEmbeddingBatchOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_device_ordinal = odsAttrs.get("device_ordinal");
    if (tblgen_device_ordinal && !(((tblgen_device_ordinal.isa<::mlir::IntegerAttr>())) && ((tblgen_device_ordinal.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.EnqueueTPUEmbeddingBatch' op ""attribute 'device_ordinal' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_combiners = odsAttrs.get("combiners");
    if (tblgen_combiners && !(((tblgen_combiners.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_combiners.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return (attr.isa<::mlir::StringAttr>()); }))))
      return emitError(loc, "'tf.EnqueueTPUEmbeddingBatch' op ""attribute 'combiners' failed to satisfy constraint: string array attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> EnqueueTPUEmbeddingBatchOp::getODSOperandIndexAndLength(unsigned index) {
  bool isVariadic[] = {true, false};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (getOperation()->getNumOperands() - 1) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::Operation::operand_range EnqueueTPUEmbeddingBatchOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Operation::operand_range EnqueueTPUEmbeddingBatchOp::batch() {
  return getODSOperands(0);
}

::mlir::Value EnqueueTPUEmbeddingBatchOp::mode_override() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange EnqueueTPUEmbeddingBatchOp::batchMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange EnqueueTPUEmbeddingBatchOp::mode_overrideMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> EnqueueTPUEmbeddingBatchOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range EnqueueTPUEmbeddingBatchOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::IntegerAttr EnqueueTPUEmbeddingBatchOp::device_ordinalAttr() {
  return (*this)->getAttr(device_ordinalAttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t EnqueueTPUEmbeddingBatchOp::device_ordinal() {
  auto attr = device_ordinalAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), -1).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

::mlir::ArrayAttr EnqueueTPUEmbeddingBatchOp::combinersAttr() {
  return (*this)->getAttr(combinersAttrName()).dyn_cast_or_null<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr EnqueueTPUEmbeddingBatchOp::combiners() {
  auto attr = combinersAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStrArrayAttr({});
  return attr;
}

size_t EnqueueTPUEmbeddingBatchOp::N() {
  auto range = getODSOperands(0);
return std::distance(range.begin(), range.end());
}

bool EnqueueTPUEmbeddingBatchOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "N") return true;
 return false;
}

::mlir::DictionaryAttr EnqueueTPUEmbeddingBatchOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {NAttrName(),
odsBuilder.getI64IntegerAttr(N())}});
}

void EnqueueTPUEmbeddingBatchOp::device_ordinalAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(device_ordinalAttrName(), attr);
}

void EnqueueTPUEmbeddingBatchOp::combinersAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(combinersAttrName(), attr);
}

void EnqueueTPUEmbeddingBatchOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange batch, ::mlir::Value mode_override, ::mlir::IntegerAttr device_ordinal, ::mlir::ArrayAttr combiners) {
  odsState.addOperands(batch);
  odsState.addOperands(mode_override);
  odsState.addAttribute(device_ordinalAttrName(odsState.name), device_ordinal);
  odsState.addAttribute(combinersAttrName(odsState.name), combiners);
}

void EnqueueTPUEmbeddingBatchOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange batch, ::mlir::Value mode_override, ::mlir::IntegerAttr device_ordinal, ::mlir::ArrayAttr combiners) {
  odsState.addOperands(batch);
  odsState.addOperands(mode_override);
  odsState.addAttribute(device_ordinalAttrName(odsState.name), device_ordinal);
  odsState.addAttribute(combinersAttrName(odsState.name), combiners);
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void EnqueueTPUEmbeddingBatchOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange batch, ::mlir::Value mode_override, uint64_t device_ordinal, ::mlir::ArrayAttr combiners) {
  odsState.addOperands(batch);
  odsState.addOperands(mode_override);
  odsState.addAttribute(device_ordinalAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), device_ordinal));
  odsState.addAttribute(combinersAttrName(odsState.name), combiners);
}

void EnqueueTPUEmbeddingBatchOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange batch, ::mlir::Value mode_override, uint64_t device_ordinal, ::mlir::ArrayAttr combiners) {
  odsState.addOperands(batch);
  odsState.addOperands(mode_override);
  odsState.addAttribute(device_ordinalAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), device_ordinal));
  odsState.addAttribute(combinersAttrName(odsState.name), combiners);
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void EnqueueTPUEmbeddingBatchOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() >= 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 0u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult EnqueueTPUEmbeddingBatchOp::verify() {
  {
    auto tblgen_device_ordinal = (*this)->getAttr(device_ordinalAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_device_ordinal, "device_ordinal")))
      return ::mlir::failure();
  }
  {
    auto tblgen_combiners = (*this)->getAttr(combinersAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops22(*this, tblgen_combiners, "combiners")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops19(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops19(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void EnqueueTPUEmbeddingBatchOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  effects.emplace_back(::mlir::MemoryEffects::Write::get(), ::mlir::TF::ResourceEffects::TPUEmbedding::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::EnqueueTPUEmbeddingBatchOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::EnqueueTPUEmbeddingIntegerBatchOp definitions
//===----------------------------------------------------------------------===//

EnqueueTPUEmbeddingIntegerBatchOpAdaptor::EnqueueTPUEmbeddingIntegerBatchOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

EnqueueTPUEmbeddingIntegerBatchOpAdaptor::EnqueueTPUEmbeddingIntegerBatchOpAdaptor(EnqueueTPUEmbeddingIntegerBatchOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange EnqueueTPUEmbeddingIntegerBatchOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> EnqueueTPUEmbeddingIntegerBatchOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  bool isVariadic[] = {true, false};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (odsOperands.size() - 1) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::ValueRange EnqueueTPUEmbeddingIntegerBatchOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::ValueRange EnqueueTPUEmbeddingIntegerBatchOpAdaptor::batch() {
  return getODSOperands(0);
}

::mlir::Value EnqueueTPUEmbeddingIntegerBatchOpAdaptor::mode_override() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr EnqueueTPUEmbeddingIntegerBatchOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::IntegerAttr EnqueueTPUEmbeddingIntegerBatchOpAdaptor::device_ordinal() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("device_ordinal").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), -1);
  return attr;
}

::mlir::LogicalResult EnqueueTPUEmbeddingIntegerBatchOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_device_ordinal = odsAttrs.get("device_ordinal");
    if (tblgen_device_ordinal && !(((tblgen_device_ordinal.isa<::mlir::IntegerAttr>())) && ((tblgen_device_ordinal.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.EnqueueTPUEmbeddingIntegerBatch' op ""attribute 'device_ordinal' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> EnqueueTPUEmbeddingIntegerBatchOp::getODSOperandIndexAndLength(unsigned index) {
  bool isVariadic[] = {true, false};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (getOperation()->getNumOperands() - 1) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::Operation::operand_range EnqueueTPUEmbeddingIntegerBatchOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Operation::operand_range EnqueueTPUEmbeddingIntegerBatchOp::batch() {
  return getODSOperands(0);
}

::mlir::Value EnqueueTPUEmbeddingIntegerBatchOp::mode_override() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange EnqueueTPUEmbeddingIntegerBatchOp::batchMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange EnqueueTPUEmbeddingIntegerBatchOp::mode_overrideMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> EnqueueTPUEmbeddingIntegerBatchOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range EnqueueTPUEmbeddingIntegerBatchOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::IntegerAttr EnqueueTPUEmbeddingIntegerBatchOp::device_ordinalAttr() {
  return (*this)->getAttr(device_ordinalAttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t EnqueueTPUEmbeddingIntegerBatchOp::device_ordinal() {
  auto attr = device_ordinalAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), -1).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

size_t EnqueueTPUEmbeddingIntegerBatchOp::N() {
  auto range = getODSOperands(0);
return std::distance(range.begin(), range.end());
}

bool EnqueueTPUEmbeddingIntegerBatchOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "N") return true;
 return false;
}

::mlir::DictionaryAttr EnqueueTPUEmbeddingIntegerBatchOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {NAttrName(),
odsBuilder.getI64IntegerAttr(N())}});
}

void EnqueueTPUEmbeddingIntegerBatchOp::device_ordinalAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(device_ordinalAttrName(), attr);
}

void EnqueueTPUEmbeddingIntegerBatchOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange batch, ::mlir::Value mode_override, ::mlir::IntegerAttr device_ordinal) {
  odsState.addOperands(batch);
  odsState.addOperands(mode_override);
  odsState.addAttribute(device_ordinalAttrName(odsState.name), device_ordinal);
}

void EnqueueTPUEmbeddingIntegerBatchOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange batch, ::mlir::Value mode_override, ::mlir::IntegerAttr device_ordinal) {
  odsState.addOperands(batch);
  odsState.addOperands(mode_override);
  odsState.addAttribute(device_ordinalAttrName(odsState.name), device_ordinal);
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void EnqueueTPUEmbeddingIntegerBatchOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange batch, ::mlir::Value mode_override, uint64_t device_ordinal) {
  odsState.addOperands(batch);
  odsState.addOperands(mode_override);
  odsState.addAttribute(device_ordinalAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), device_ordinal));
}

void EnqueueTPUEmbeddingIntegerBatchOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange batch, ::mlir::Value mode_override, uint64_t device_ordinal) {
  odsState.addOperands(batch);
  odsState.addOperands(mode_override);
  odsState.addAttribute(device_ordinalAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), device_ordinal));
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void EnqueueTPUEmbeddingIntegerBatchOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() >= 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 0u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult EnqueueTPUEmbeddingIntegerBatchOp::verify() {
  {
    auto tblgen_device_ordinal = (*this)->getAttr(device_ordinalAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_device_ordinal, "device_ordinal")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops11(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops19(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void EnqueueTPUEmbeddingIntegerBatchOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  effects.emplace_back(::mlir::MemoryEffects::Write::get(), ::mlir::TF::ResourceEffects::TPUEmbedding::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::EnqueueTPUEmbeddingIntegerBatchOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::EnqueueTPUEmbeddingRaggedTensorBatchOp definitions
//===----------------------------------------------------------------------===//

EnqueueTPUEmbeddingRaggedTensorBatchOpAdaptor::EnqueueTPUEmbeddingRaggedTensorBatchOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

EnqueueTPUEmbeddingRaggedTensorBatchOpAdaptor::EnqueueTPUEmbeddingRaggedTensorBatchOpAdaptor(EnqueueTPUEmbeddingRaggedTensorBatchOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange EnqueueTPUEmbeddingRaggedTensorBatchOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> EnqueueTPUEmbeddingRaggedTensorBatchOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  bool isVariadic[] = {true, true, true, false};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (odsOperands.size() - 1) / 3;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::ValueRange EnqueueTPUEmbeddingRaggedTensorBatchOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::ValueRange EnqueueTPUEmbeddingRaggedTensorBatchOpAdaptor::sample_splits() {
  return getODSOperands(0);
}

::mlir::ValueRange EnqueueTPUEmbeddingRaggedTensorBatchOpAdaptor::embedding_indices() {
  return getODSOperands(1);
}

::mlir::ValueRange EnqueueTPUEmbeddingRaggedTensorBatchOpAdaptor::aggregation_weights() {
  return getODSOperands(2);
}

::mlir::Value EnqueueTPUEmbeddingRaggedTensorBatchOpAdaptor::mode_override() {
  return *getODSOperands(3).begin();
}

::mlir::DictionaryAttr EnqueueTPUEmbeddingRaggedTensorBatchOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::IntegerAttr EnqueueTPUEmbeddingRaggedTensorBatchOpAdaptor::device_ordinal() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("device_ordinal").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), -1);
  return attr;
}

::mlir::ArrayAttr EnqueueTPUEmbeddingRaggedTensorBatchOpAdaptor::combiners() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("combiners").dyn_cast_or_null<::mlir::ArrayAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStrArrayAttr({});
  return attr;
}

::mlir::ArrayAttr EnqueueTPUEmbeddingRaggedTensorBatchOpAdaptor::table_ids() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("table_ids").cast<::mlir::ArrayAttr>();
  return attr;
}

::mlir::ArrayAttr EnqueueTPUEmbeddingRaggedTensorBatchOpAdaptor::max_sequence_lengths() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("max_sequence_lengths").dyn_cast_or_null<::mlir::ArrayAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getI64ArrayAttr({});
  return attr;
}

::mlir::ArrayAttr EnqueueTPUEmbeddingRaggedTensorBatchOpAdaptor::num_features() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("num_features").dyn_cast_or_null<::mlir::ArrayAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getI64ArrayAttr({});
  return attr;
}

::mlir::LogicalResult EnqueueTPUEmbeddingRaggedTensorBatchOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_device_ordinal = odsAttrs.get("device_ordinal");
    if (tblgen_device_ordinal && !(((tblgen_device_ordinal.isa<::mlir::IntegerAttr>())) && ((tblgen_device_ordinal.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.EnqueueTPUEmbeddingRaggedTensorBatch' op ""attribute 'device_ordinal' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_combiners = odsAttrs.get("combiners");
    if (tblgen_combiners && !(((tblgen_combiners.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_combiners.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return (attr.isa<::mlir::StringAttr>()); }))))
      return emitError(loc, "'tf.EnqueueTPUEmbeddingRaggedTensorBatch' op ""attribute 'combiners' failed to satisfy constraint: string array attribute");
  }
  {
    auto tblgen_table_ids = odsAttrs.get("table_ids");
    if (!tblgen_table_ids)
      return emitError(loc, "'tf.EnqueueTPUEmbeddingRaggedTensorBatch' op ""requires attribute 'table_ids'");

    if (tblgen_table_ids && !(((tblgen_table_ids.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_table_ids.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return ((attr.isa<::mlir::IntegerAttr>())) && ((attr.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64))); }))))
      return emitError(loc, "'tf.EnqueueTPUEmbeddingRaggedTensorBatch' op ""attribute 'table_ids' failed to satisfy constraint: 64-bit integer array attribute");
  }
  {
    auto tblgen_max_sequence_lengths = odsAttrs.get("max_sequence_lengths");
    if (tblgen_max_sequence_lengths && !(((tblgen_max_sequence_lengths.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_max_sequence_lengths.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return ((attr.isa<::mlir::IntegerAttr>())) && ((attr.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64))); }))))
      return emitError(loc, "'tf.EnqueueTPUEmbeddingRaggedTensorBatch' op ""attribute 'max_sequence_lengths' failed to satisfy constraint: 64-bit integer array attribute");
  }
  {
    auto tblgen_num_features = odsAttrs.get("num_features");
    if (tblgen_num_features && !(((tblgen_num_features.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_num_features.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return ((attr.isa<::mlir::IntegerAttr>())) && ((attr.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64))); }))))
      return emitError(loc, "'tf.EnqueueTPUEmbeddingRaggedTensorBatch' op ""attribute 'num_features' failed to satisfy constraint: 64-bit integer array attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> EnqueueTPUEmbeddingRaggedTensorBatchOp::getODSOperandIndexAndLength(unsigned index) {
  bool isVariadic[] = {true, true, true, false};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (getOperation()->getNumOperands() - 1) / 3;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::Operation::operand_range EnqueueTPUEmbeddingRaggedTensorBatchOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Operation::operand_range EnqueueTPUEmbeddingRaggedTensorBatchOp::sample_splits() {
  return getODSOperands(0);
}

::mlir::Operation::operand_range EnqueueTPUEmbeddingRaggedTensorBatchOp::embedding_indices() {
  return getODSOperands(1);
}

::mlir::Operation::operand_range EnqueueTPUEmbeddingRaggedTensorBatchOp::aggregation_weights() {
  return getODSOperands(2);
}

::mlir::Value EnqueueTPUEmbeddingRaggedTensorBatchOp::mode_override() {
  return *getODSOperands(3).begin();
}

::mlir::MutableOperandRange EnqueueTPUEmbeddingRaggedTensorBatchOp::sample_splitsMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange EnqueueTPUEmbeddingRaggedTensorBatchOp::embedding_indicesMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange EnqueueTPUEmbeddingRaggedTensorBatchOp::aggregation_weightsMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange EnqueueTPUEmbeddingRaggedTensorBatchOp::mode_overrideMutable() {
  auto range = getODSOperandIndexAndLength(3);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> EnqueueTPUEmbeddingRaggedTensorBatchOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range EnqueueTPUEmbeddingRaggedTensorBatchOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::IntegerAttr EnqueueTPUEmbeddingRaggedTensorBatchOp::device_ordinalAttr() {
  return (*this)->getAttr(device_ordinalAttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t EnqueueTPUEmbeddingRaggedTensorBatchOp::device_ordinal() {
  auto attr = device_ordinalAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), -1).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

::mlir::ArrayAttr EnqueueTPUEmbeddingRaggedTensorBatchOp::combinersAttr() {
  return (*this)->getAttr(combinersAttrName()).dyn_cast_or_null<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr EnqueueTPUEmbeddingRaggedTensorBatchOp::combiners() {
  auto attr = combinersAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStrArrayAttr({});
  return attr;
}

::mlir::ArrayAttr EnqueueTPUEmbeddingRaggedTensorBatchOp::table_idsAttr() {
  return (*this)->getAttr(table_idsAttrName()).cast<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr EnqueueTPUEmbeddingRaggedTensorBatchOp::table_ids() {
  auto attr = table_idsAttr();
  return attr;
}

::mlir::ArrayAttr EnqueueTPUEmbeddingRaggedTensorBatchOp::max_sequence_lengthsAttr() {
  return (*this)->getAttr(max_sequence_lengthsAttrName()).dyn_cast_or_null<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr EnqueueTPUEmbeddingRaggedTensorBatchOp::max_sequence_lengths() {
  auto attr = max_sequence_lengthsAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getI64ArrayAttr({});
  return attr;
}

::mlir::ArrayAttr EnqueueTPUEmbeddingRaggedTensorBatchOp::num_featuresAttr() {
  return (*this)->getAttr(num_featuresAttrName()).dyn_cast_or_null<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr EnqueueTPUEmbeddingRaggedTensorBatchOp::num_features() {
  auto attr = num_featuresAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getI64ArrayAttr({});
  return attr;
}

size_t EnqueueTPUEmbeddingRaggedTensorBatchOp::N() {
  auto range = getODSOperands(0);
return std::distance(range.begin(), range.end());
}

::mlir::Type EnqueueTPUEmbeddingRaggedTensorBatchOp::T1() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

::mlir::Type EnqueueTPUEmbeddingRaggedTensorBatchOp::T2() {
  return mlir::getElementTypeOrSelf(*getODSOperands(1).begin());
}

::mlir::Type EnqueueTPUEmbeddingRaggedTensorBatchOp::T3() {
  return mlir::getElementTypeOrSelf(*getODSOperands(2).begin());
}

bool EnqueueTPUEmbeddingRaggedTensorBatchOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "N") return true;
  if (name == "T1") return true;
  if (name == "T2") return true;
  if (name == "T3") return true;
 return false;
}

::mlir::DictionaryAttr EnqueueTPUEmbeddingRaggedTensorBatchOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {NAttrName(),
odsBuilder.getI64IntegerAttr(N())},
    {T1AttrName(),
::mlir::TypeAttr::get(T1())},
    {T2AttrName(),
::mlir::TypeAttr::get(T2())},
    {T3AttrName(),
::mlir::TypeAttr::get(T3())}});
}

void EnqueueTPUEmbeddingRaggedTensorBatchOp::device_ordinalAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(device_ordinalAttrName(), attr);
}

void EnqueueTPUEmbeddingRaggedTensorBatchOp::combinersAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(combinersAttrName(), attr);
}

void EnqueueTPUEmbeddingRaggedTensorBatchOp::table_idsAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(table_idsAttrName(), attr);
}

void EnqueueTPUEmbeddingRaggedTensorBatchOp::max_sequence_lengthsAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(max_sequence_lengthsAttrName(), attr);
}

void EnqueueTPUEmbeddingRaggedTensorBatchOp::num_featuresAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(num_featuresAttrName(), attr);
}

void EnqueueTPUEmbeddingRaggedTensorBatchOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange sample_splits, ::mlir::ValueRange embedding_indices, ::mlir::ValueRange aggregation_weights, ::mlir::Value mode_override, ::mlir::IntegerAttr device_ordinal, ::mlir::ArrayAttr combiners, ::mlir::ArrayAttr table_ids, ::mlir::ArrayAttr max_sequence_lengths, ::mlir::ArrayAttr num_features) {
  odsState.addOperands(sample_splits);
  odsState.addOperands(embedding_indices);
  odsState.addOperands(aggregation_weights);
  odsState.addOperands(mode_override);
  odsState.addAttribute(device_ordinalAttrName(odsState.name), device_ordinal);
  odsState.addAttribute(combinersAttrName(odsState.name), combiners);
  odsState.addAttribute(table_idsAttrName(odsState.name), table_ids);
  odsState.addAttribute(max_sequence_lengthsAttrName(odsState.name), max_sequence_lengths);
  odsState.addAttribute(num_featuresAttrName(odsState.name), num_features);
}

void EnqueueTPUEmbeddingRaggedTensorBatchOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange sample_splits, ::mlir::ValueRange embedding_indices, ::mlir::ValueRange aggregation_weights, ::mlir::Value mode_override, ::mlir::IntegerAttr device_ordinal, ::mlir::ArrayAttr combiners, ::mlir::ArrayAttr table_ids, ::mlir::ArrayAttr max_sequence_lengths, ::mlir::ArrayAttr num_features) {
  odsState.addOperands(sample_splits);
  odsState.addOperands(embedding_indices);
  odsState.addOperands(aggregation_weights);
  odsState.addOperands(mode_override);
  odsState.addAttribute(device_ordinalAttrName(odsState.name), device_ordinal);
  odsState.addAttribute(combinersAttrName(odsState.name), combiners);
  odsState.addAttribute(table_idsAttrName(odsState.name), table_ids);
  odsState.addAttribute(max_sequence_lengthsAttrName(odsState.name), max_sequence_lengths);
  odsState.addAttribute(num_featuresAttrName(odsState.name), num_features);
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void EnqueueTPUEmbeddingRaggedTensorBatchOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange sample_splits, ::mlir::ValueRange embedding_indices, ::mlir::ValueRange aggregation_weights, ::mlir::Value mode_override, uint64_t device_ordinal, ::mlir::ArrayAttr combiners, ::mlir::ArrayAttr table_ids, ::mlir::ArrayAttr max_sequence_lengths, ::mlir::ArrayAttr num_features) {
  odsState.addOperands(sample_splits);
  odsState.addOperands(embedding_indices);
  odsState.addOperands(aggregation_weights);
  odsState.addOperands(mode_override);
  odsState.addAttribute(device_ordinalAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), device_ordinal));
  odsState.addAttribute(combinersAttrName(odsState.name), combiners);
  odsState.addAttribute(table_idsAttrName(odsState.name), table_ids);
  odsState.addAttribute(max_sequence_lengthsAttrName(odsState.name), max_sequence_lengths);
  odsState.addAttribute(num_featuresAttrName(odsState.name), num_features);
}

void EnqueueTPUEmbeddingRaggedTensorBatchOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange sample_splits, ::mlir::ValueRange embedding_indices, ::mlir::ValueRange aggregation_weights, ::mlir::Value mode_override, uint64_t device_ordinal, ::mlir::ArrayAttr combiners, ::mlir::ArrayAttr table_ids, ::mlir::ArrayAttr max_sequence_lengths, ::mlir::ArrayAttr num_features) {
  odsState.addOperands(sample_splits);
  odsState.addOperands(embedding_indices);
  odsState.addOperands(aggregation_weights);
  odsState.addOperands(mode_override);
  odsState.addAttribute(device_ordinalAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), device_ordinal));
  odsState.addAttribute(combinersAttrName(odsState.name), combiners);
  odsState.addAttribute(table_idsAttrName(odsState.name), table_ids);
  odsState.addAttribute(max_sequence_lengthsAttrName(odsState.name), max_sequence_lengths);
  odsState.addAttribute(num_featuresAttrName(odsState.name), num_features);
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void EnqueueTPUEmbeddingRaggedTensorBatchOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() >= 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 0u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult EnqueueTPUEmbeddingRaggedTensorBatchOp::verify() {
  {
    auto tblgen_device_ordinal = (*this)->getAttr(device_ordinalAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_device_ordinal, "device_ordinal")))
      return ::mlir::failure();
  }
  {
    auto tblgen_combiners = (*this)->getAttr(combinersAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops22(*this, tblgen_combiners, "combiners")))
      return ::mlir::failure();
  }
  {
    auto tblgen_table_ids = (*this)->getAttr(table_idsAttrName());
    if (!tblgen_table_ids)
      return emitOpError("requires attribute 'table_ids'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops13(*this, tblgen_table_ids, "table_ids")))
      return ::mlir::failure();
  }
  {
    auto tblgen_max_sequence_lengths = (*this)->getAttr(max_sequence_lengthsAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops13(*this, tblgen_max_sequence_lengths, "max_sequence_lengths")))
      return ::mlir::failure();
  }
  {
    auto tblgen_num_features = (*this)->getAttr(num_featuresAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops13(*this, tblgen_num_features, "num_features")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops13(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup3 = getODSOperands(3);

    for (auto v : valueGroup3) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops19(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void EnqueueTPUEmbeddingRaggedTensorBatchOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  effects.emplace_back(::mlir::MemoryEffects::Write::get(), ::mlir::TF::ResourceEffects::TPUEmbedding::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::EnqueueTPUEmbeddingRaggedTensorBatchOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::EnqueueTPUEmbeddingSparseBatchOp definitions
//===----------------------------------------------------------------------===//

EnqueueTPUEmbeddingSparseBatchOpAdaptor::EnqueueTPUEmbeddingSparseBatchOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

EnqueueTPUEmbeddingSparseBatchOpAdaptor::EnqueueTPUEmbeddingSparseBatchOpAdaptor(EnqueueTPUEmbeddingSparseBatchOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange EnqueueTPUEmbeddingSparseBatchOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> EnqueueTPUEmbeddingSparseBatchOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  bool isVariadic[] = {true, true, true, false};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (odsOperands.size() - 1) / 3;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::ValueRange EnqueueTPUEmbeddingSparseBatchOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::ValueRange EnqueueTPUEmbeddingSparseBatchOpAdaptor::sample_indices() {
  return getODSOperands(0);
}

::mlir::ValueRange EnqueueTPUEmbeddingSparseBatchOpAdaptor::embedding_indices() {
  return getODSOperands(1);
}

::mlir::ValueRange EnqueueTPUEmbeddingSparseBatchOpAdaptor::aggregation_weights() {
  return getODSOperands(2);
}

::mlir::Value EnqueueTPUEmbeddingSparseBatchOpAdaptor::mode_override() {
  return *getODSOperands(3).begin();
}

::mlir::DictionaryAttr EnqueueTPUEmbeddingSparseBatchOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::IntegerAttr EnqueueTPUEmbeddingSparseBatchOpAdaptor::device_ordinal() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("device_ordinal").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), -1);
  return attr;
}

::mlir::ArrayAttr EnqueueTPUEmbeddingSparseBatchOpAdaptor::combiners() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("combiners").dyn_cast_or_null<::mlir::ArrayAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStrArrayAttr({});
  return attr;
}

::mlir::LogicalResult EnqueueTPUEmbeddingSparseBatchOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_device_ordinal = odsAttrs.get("device_ordinal");
    if (tblgen_device_ordinal && !(((tblgen_device_ordinal.isa<::mlir::IntegerAttr>())) && ((tblgen_device_ordinal.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.EnqueueTPUEmbeddingSparseBatch' op ""attribute 'device_ordinal' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_combiners = odsAttrs.get("combiners");
    if (tblgen_combiners && !(((tblgen_combiners.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_combiners.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return (attr.isa<::mlir::StringAttr>()); }))))
      return emitError(loc, "'tf.EnqueueTPUEmbeddingSparseBatch' op ""attribute 'combiners' failed to satisfy constraint: string array attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> EnqueueTPUEmbeddingSparseBatchOp::getODSOperandIndexAndLength(unsigned index) {
  bool isVariadic[] = {true, true, true, false};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (getOperation()->getNumOperands() - 1) / 3;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::Operation::operand_range EnqueueTPUEmbeddingSparseBatchOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Operation::operand_range EnqueueTPUEmbeddingSparseBatchOp::sample_indices() {
  return getODSOperands(0);
}

::mlir::Operation::operand_range EnqueueTPUEmbeddingSparseBatchOp::embedding_indices() {
  return getODSOperands(1);
}

::mlir::Operation::operand_range EnqueueTPUEmbeddingSparseBatchOp::aggregation_weights() {
  return getODSOperands(2);
}

::mlir::Value EnqueueTPUEmbeddingSparseBatchOp::mode_override() {
  return *getODSOperands(3).begin();
}

::mlir::MutableOperandRange EnqueueTPUEmbeddingSparseBatchOp::sample_indicesMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange EnqueueTPUEmbeddingSparseBatchOp::embedding_indicesMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange EnqueueTPUEmbeddingSparseBatchOp::aggregation_weightsMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange EnqueueTPUEmbeddingSparseBatchOp::mode_overrideMutable() {
  auto range = getODSOperandIndexAndLength(3);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> EnqueueTPUEmbeddingSparseBatchOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range EnqueueTPUEmbeddingSparseBatchOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::IntegerAttr EnqueueTPUEmbeddingSparseBatchOp::device_ordinalAttr() {
  return (*this)->getAttr(device_ordinalAttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t EnqueueTPUEmbeddingSparseBatchOp::device_ordinal() {
  auto attr = device_ordinalAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), -1).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

::mlir::ArrayAttr EnqueueTPUEmbeddingSparseBatchOp::combinersAttr() {
  return (*this)->getAttr(combinersAttrName()).dyn_cast_or_null<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr EnqueueTPUEmbeddingSparseBatchOp::combiners() {
  auto attr = combinersAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStrArrayAttr({});
  return attr;
}

size_t EnqueueTPUEmbeddingSparseBatchOp::N() {
  auto range = getODSOperands(0);
return std::distance(range.begin(), range.end());
}

::mlir::Type EnqueueTPUEmbeddingSparseBatchOp::T1() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

::mlir::Type EnqueueTPUEmbeddingSparseBatchOp::T2() {
  return mlir::getElementTypeOrSelf(*getODSOperands(1).begin());
}

::mlir::Type EnqueueTPUEmbeddingSparseBatchOp::T3() {
  return mlir::getElementTypeOrSelf(*getODSOperands(2).begin());
}

bool EnqueueTPUEmbeddingSparseBatchOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "N") return true;
  if (name == "T1") return true;
  if (name == "T2") return true;
  if (name == "T3") return true;
 return false;
}

::mlir::DictionaryAttr EnqueueTPUEmbeddingSparseBatchOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {NAttrName(),
odsBuilder.getI64IntegerAttr(N())},
    {T1AttrName(),
::mlir::TypeAttr::get(T1())},
    {T2AttrName(),
::mlir::TypeAttr::get(T2())},
    {T3AttrName(),
::mlir::TypeAttr::get(T3())}});
}

void EnqueueTPUEmbeddingSparseBatchOp::device_ordinalAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(device_ordinalAttrName(), attr);
}

void EnqueueTPUEmbeddingSparseBatchOp::combinersAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(combinersAttrName(), attr);
}

void EnqueueTPUEmbeddingSparseBatchOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange sample_indices, ::mlir::ValueRange embedding_indices, ::mlir::ValueRange aggregation_weights, ::mlir::Value mode_override, ::mlir::IntegerAttr device_ordinal, ::mlir::ArrayAttr combiners) {
  odsState.addOperands(sample_indices);
  odsState.addOperands(embedding_indices);
  odsState.addOperands(aggregation_weights);
  odsState.addOperands(mode_override);
  odsState.addAttribute(device_ordinalAttrName(odsState.name), device_ordinal);
  odsState.addAttribute(combinersAttrName(odsState.name), combiners);
}

void EnqueueTPUEmbeddingSparseBatchOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange sample_indices, ::mlir::ValueRange embedding_indices, ::mlir::ValueRange aggregation_weights, ::mlir::Value mode_override, ::mlir::IntegerAttr device_ordinal, ::mlir::ArrayAttr combiners) {
  odsState.addOperands(sample_indices);
  odsState.addOperands(embedding_indices);
  odsState.addOperands(aggregation_weights);
  odsState.addOperands(mode_override);
  odsState.addAttribute(device_ordinalAttrName(odsState.name), device_ordinal);
  odsState.addAttribute(combinersAttrName(odsState.name), combiners);
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void EnqueueTPUEmbeddingSparseBatchOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange sample_indices, ::mlir::ValueRange embedding_indices, ::mlir::ValueRange aggregation_weights, ::mlir::Value mode_override, uint64_t device_ordinal, ::mlir::ArrayAttr combiners) {
  odsState.addOperands(sample_indices);
  odsState.addOperands(embedding_indices);
  odsState.addOperands(aggregation_weights);
  odsState.addOperands(mode_override);
  odsState.addAttribute(device_ordinalAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), device_ordinal));
  odsState.addAttribute(combinersAttrName(odsState.name), combiners);
}

void EnqueueTPUEmbeddingSparseBatchOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange sample_indices, ::mlir::ValueRange embedding_indices, ::mlir::ValueRange aggregation_weights, ::mlir::Value mode_override, uint64_t device_ordinal, ::mlir::ArrayAttr combiners) {
  odsState.addOperands(sample_indices);
  odsState.addOperands(embedding_indices);
  odsState.addOperands(aggregation_weights);
  odsState.addOperands(mode_override);
  odsState.addAttribute(device_ordinalAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), device_ordinal));
  odsState.addAttribute(combinersAttrName(odsState.name), combiners);
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void EnqueueTPUEmbeddingSparseBatchOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() >= 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 0u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult EnqueueTPUEmbeddingSparseBatchOp::verify() {
  {
    auto tblgen_device_ordinal = (*this)->getAttr(device_ordinalAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_device_ordinal, "device_ordinal")))
      return ::mlir::failure();
  }
  {
    auto tblgen_combiners = (*this)->getAttr(combinersAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops22(*this, tblgen_combiners, "combiners")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops13(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup3 = getODSOperands(3);

    for (auto v : valueGroup3) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops19(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void EnqueueTPUEmbeddingSparseBatchOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  effects.emplace_back(::mlir::MemoryEffects::Write::get(), ::mlir::TF::ResourceEffects::TPUEmbedding::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::EnqueueTPUEmbeddingSparseBatchOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::EnqueueTPUEmbeddingSparseTensorBatchOp definitions
//===----------------------------------------------------------------------===//

EnqueueTPUEmbeddingSparseTensorBatchOpAdaptor::EnqueueTPUEmbeddingSparseTensorBatchOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

EnqueueTPUEmbeddingSparseTensorBatchOpAdaptor::EnqueueTPUEmbeddingSparseTensorBatchOpAdaptor(EnqueueTPUEmbeddingSparseTensorBatchOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange EnqueueTPUEmbeddingSparseTensorBatchOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> EnqueueTPUEmbeddingSparseTensorBatchOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  bool isVariadic[] = {true, true, true, false};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (odsOperands.size() - 1) / 3;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::ValueRange EnqueueTPUEmbeddingSparseTensorBatchOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::ValueRange EnqueueTPUEmbeddingSparseTensorBatchOpAdaptor::sample_indices() {
  return getODSOperands(0);
}

::mlir::ValueRange EnqueueTPUEmbeddingSparseTensorBatchOpAdaptor::embedding_indices() {
  return getODSOperands(1);
}

::mlir::ValueRange EnqueueTPUEmbeddingSparseTensorBatchOpAdaptor::aggregation_weights() {
  return getODSOperands(2);
}

::mlir::Value EnqueueTPUEmbeddingSparseTensorBatchOpAdaptor::mode_override() {
  return *getODSOperands(3).begin();
}

::mlir::DictionaryAttr EnqueueTPUEmbeddingSparseTensorBatchOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::IntegerAttr EnqueueTPUEmbeddingSparseTensorBatchOpAdaptor::device_ordinal() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("device_ordinal").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), -1);
  return attr;
}

::mlir::ArrayAttr EnqueueTPUEmbeddingSparseTensorBatchOpAdaptor::combiners() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("combiners").dyn_cast_or_null<::mlir::ArrayAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStrArrayAttr({});
  return attr;
}

::mlir::ArrayAttr EnqueueTPUEmbeddingSparseTensorBatchOpAdaptor::table_ids() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("table_ids").cast<::mlir::ArrayAttr>();
  return attr;
}

::mlir::ArrayAttr EnqueueTPUEmbeddingSparseTensorBatchOpAdaptor::max_sequence_lengths() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("max_sequence_lengths").dyn_cast_or_null<::mlir::ArrayAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getI64ArrayAttr({});
  return attr;
}

::mlir::ArrayAttr EnqueueTPUEmbeddingSparseTensorBatchOpAdaptor::num_features() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("num_features").dyn_cast_or_null<::mlir::ArrayAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getI64ArrayAttr({});
  return attr;
}

::mlir::LogicalResult EnqueueTPUEmbeddingSparseTensorBatchOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_device_ordinal = odsAttrs.get("device_ordinal");
    if (tblgen_device_ordinal && !(((tblgen_device_ordinal.isa<::mlir::IntegerAttr>())) && ((tblgen_device_ordinal.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.EnqueueTPUEmbeddingSparseTensorBatch' op ""attribute 'device_ordinal' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_combiners = odsAttrs.get("combiners");
    if (tblgen_combiners && !(((tblgen_combiners.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_combiners.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return (attr.isa<::mlir::StringAttr>()); }))))
      return emitError(loc, "'tf.EnqueueTPUEmbeddingSparseTensorBatch' op ""attribute 'combiners' failed to satisfy constraint: string array attribute");
  }
  {
    auto tblgen_table_ids = odsAttrs.get("table_ids");
    if (!tblgen_table_ids)
      return emitError(loc, "'tf.EnqueueTPUEmbeddingSparseTensorBatch' op ""requires attribute 'table_ids'");

    if (tblgen_table_ids && !(((tblgen_table_ids.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_table_ids.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return ((attr.isa<::mlir::IntegerAttr>())) && ((attr.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64))); }))))
      return emitError(loc, "'tf.EnqueueTPUEmbeddingSparseTensorBatch' op ""attribute 'table_ids' failed to satisfy constraint: 64-bit integer array attribute");
  }
  {
    auto tblgen_max_sequence_lengths = odsAttrs.get("max_sequence_lengths");
    if (tblgen_max_sequence_lengths && !(((tblgen_max_sequence_lengths.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_max_sequence_lengths.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return ((attr.isa<::mlir::IntegerAttr>())) && ((attr.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64))); }))))
      return emitError(loc, "'tf.EnqueueTPUEmbeddingSparseTensorBatch' op ""attribute 'max_sequence_lengths' failed to satisfy constraint: 64-bit integer array attribute");
  }
  {
    auto tblgen_num_features = odsAttrs.get("num_features");
    if (tblgen_num_features && !(((tblgen_num_features.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_num_features.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return ((attr.isa<::mlir::IntegerAttr>())) && ((attr.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64))); }))))
      return emitError(loc, "'tf.EnqueueTPUEmbeddingSparseTensorBatch' op ""attribute 'num_features' failed to satisfy constraint: 64-bit integer array attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> EnqueueTPUEmbeddingSparseTensorBatchOp::getODSOperandIndexAndLength(unsigned index) {
  bool isVariadic[] = {true, true, true, false};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (getOperation()->getNumOperands() - 1) / 3;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::Operation::operand_range EnqueueTPUEmbeddingSparseTensorBatchOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Operation::operand_range EnqueueTPUEmbeddingSparseTensorBatchOp::sample_indices() {
  return getODSOperands(0);
}

::mlir::Operation::operand_range EnqueueTPUEmbeddingSparseTensorBatchOp::embedding_indices() {
  return getODSOperands(1);
}

::mlir::Operation::operand_range EnqueueTPUEmbeddingSparseTensorBatchOp::aggregation_weights() {
  return getODSOperands(2);
}

::mlir::Value EnqueueTPUEmbeddingSparseTensorBatchOp::mode_override() {
  return *getODSOperands(3).begin();
}

::mlir::MutableOperandRange EnqueueTPUEmbeddingSparseTensorBatchOp::sample_indicesMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange EnqueueTPUEmbeddingSparseTensorBatchOp::embedding_indicesMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange EnqueueTPUEmbeddingSparseTensorBatchOp::aggregation_weightsMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange EnqueueTPUEmbeddingSparseTensorBatchOp::mode_overrideMutable() {
  auto range = getODSOperandIndexAndLength(3);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> EnqueueTPUEmbeddingSparseTensorBatchOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range EnqueueTPUEmbeddingSparseTensorBatchOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::IntegerAttr EnqueueTPUEmbeddingSparseTensorBatchOp::device_ordinalAttr() {
  return (*this)->getAttr(device_ordinalAttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t EnqueueTPUEmbeddingSparseTensorBatchOp::device_ordinal() {
  auto attr = device_ordinalAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), -1).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

::mlir::ArrayAttr EnqueueTPUEmbeddingSparseTensorBatchOp::combinersAttr() {
  return (*this)->getAttr(combinersAttrName()).dyn_cast_or_null<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr EnqueueTPUEmbeddingSparseTensorBatchOp::combiners() {
  auto attr = combinersAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStrArrayAttr({});
  return attr;
}

::mlir::ArrayAttr EnqueueTPUEmbeddingSparseTensorBatchOp::table_idsAttr() {
  return (*this)->getAttr(table_idsAttrName()).cast<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr EnqueueTPUEmbeddingSparseTensorBatchOp::table_ids() {
  auto attr = table_idsAttr();
  return attr;
}

::mlir::ArrayAttr EnqueueTPUEmbeddingSparseTensorBatchOp::max_sequence_lengthsAttr() {
  return (*this)->getAttr(max_sequence_lengthsAttrName()).dyn_cast_or_null<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr EnqueueTPUEmbeddingSparseTensorBatchOp::max_sequence_lengths() {
  auto attr = max_sequence_lengthsAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getI64ArrayAttr({});
  return attr;
}

::mlir::ArrayAttr EnqueueTPUEmbeddingSparseTensorBatchOp::num_featuresAttr() {
  return (*this)->getAttr(num_featuresAttrName()).dyn_cast_or_null<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr EnqueueTPUEmbeddingSparseTensorBatchOp::num_features() {
  auto attr = num_featuresAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getI64ArrayAttr({});
  return attr;
}

size_t EnqueueTPUEmbeddingSparseTensorBatchOp::N() {
  auto range = getODSOperands(0);
return std::distance(range.begin(), range.end());
}

::mlir::Type EnqueueTPUEmbeddingSparseTensorBatchOp::T1() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

::mlir::Type EnqueueTPUEmbeddingSparseTensorBatchOp::T2() {
  return mlir::getElementTypeOrSelf(*getODSOperands(1).begin());
}

::mlir::Type EnqueueTPUEmbeddingSparseTensorBatchOp::T3() {
  return mlir::getElementTypeOrSelf(*getODSOperands(2).begin());
}

bool EnqueueTPUEmbeddingSparseTensorBatchOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "N") return true;
  if (name == "T1") return true;
  if (name == "T2") return true;
  if (name == "T3") return true;
 return false;
}

::mlir::DictionaryAttr EnqueueTPUEmbeddingSparseTensorBatchOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {NAttrName(),
odsBuilder.getI64IntegerAttr(N())},
    {T1AttrName(),
::mlir::TypeAttr::get(T1())},
    {T2AttrName(),
::mlir::TypeAttr::get(T2())},
    {T3AttrName(),
::mlir::TypeAttr::get(T3())}});
}

void EnqueueTPUEmbeddingSparseTensorBatchOp::device_ordinalAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(device_ordinalAttrName(), attr);
}

void EnqueueTPUEmbeddingSparseTensorBatchOp::combinersAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(combinersAttrName(), attr);
}

void EnqueueTPUEmbeddingSparseTensorBatchOp::table_idsAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(table_idsAttrName(), attr);
}

void EnqueueTPUEmbeddingSparseTensorBatchOp::max_sequence_lengthsAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(max_sequence_lengthsAttrName(), attr);
}

void EnqueueTPUEmbeddingSparseTensorBatchOp::num_featuresAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(num_featuresAttrName(), attr);
}

void EnqueueTPUEmbeddingSparseTensorBatchOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange sample_indices, ::mlir::ValueRange embedding_indices, ::mlir::ValueRange aggregation_weights, ::mlir::Value mode_override, ::mlir::IntegerAttr device_ordinal, ::mlir::ArrayAttr combiners, ::mlir::ArrayAttr table_ids, ::mlir::ArrayAttr max_sequence_lengths, ::mlir::ArrayAttr num_features) {
  odsState.addOperands(sample_indices);
  odsState.addOperands(embedding_indices);
  odsState.addOperands(aggregation_weights);
  odsState.addOperands(mode_override);
  odsState.addAttribute(device_ordinalAttrName(odsState.name), device_ordinal);
  odsState.addAttribute(combinersAttrName(odsState.name), combiners);
  odsState.addAttribute(table_idsAttrName(odsState.name), table_ids);
  odsState.addAttribute(max_sequence_lengthsAttrName(odsState.name), max_sequence_lengths);
  odsState.addAttribute(num_featuresAttrName(odsState.name), num_features);
}

void EnqueueTPUEmbeddingSparseTensorBatchOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange sample_indices, ::mlir::ValueRange embedding_indices, ::mlir::ValueRange aggregation_weights, ::mlir::Value mode_override, ::mlir::IntegerAttr device_ordinal, ::mlir::ArrayAttr combiners, ::mlir::ArrayAttr table_ids, ::mlir::ArrayAttr max_sequence_lengths, ::mlir::ArrayAttr num_features) {
  odsState.addOperands(sample_indices);
  odsState.addOperands(embedding_indices);
  odsState.addOperands(aggregation_weights);
  odsState.addOperands(mode_override);
  odsState.addAttribute(device_ordinalAttrName(odsState.name), device_ordinal);
  odsState.addAttribute(combinersAttrName(odsState.name), combiners);
  odsState.addAttribute(table_idsAttrName(odsState.name), table_ids);
  odsState.addAttribute(max_sequence_lengthsAttrName(odsState.name), max_sequence_lengths);
  odsState.addAttribute(num_featuresAttrName(odsState.name), num_features);
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void EnqueueTPUEmbeddingSparseTensorBatchOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange sample_indices, ::mlir::ValueRange embedding_indices, ::mlir::ValueRange aggregation_weights, ::mlir::Value mode_override, uint64_t device_ordinal, ::mlir::ArrayAttr combiners, ::mlir::ArrayAttr table_ids, ::mlir::ArrayAttr max_sequence_lengths, ::mlir::ArrayAttr num_features) {
  odsState.addOperands(sample_indices);
  odsState.addOperands(embedding_indices);
  odsState.addOperands(aggregation_weights);
  odsState.addOperands(mode_override);
  odsState.addAttribute(device_ordinalAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), device_ordinal));
  odsState.addAttribute(combinersAttrName(odsState.name), combiners);
  odsState.addAttribute(table_idsAttrName(odsState.name), table_ids);
  odsState.addAttribute(max_sequence_lengthsAttrName(odsState.name), max_sequence_lengths);
  odsState.addAttribute(num_featuresAttrName(odsState.name), num_features);
}

void EnqueueTPUEmbeddingSparseTensorBatchOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange sample_indices, ::mlir::ValueRange embedding_indices, ::mlir::ValueRange aggregation_weights, ::mlir::Value mode_override, uint64_t device_ordinal, ::mlir::ArrayAttr combiners, ::mlir::ArrayAttr table_ids, ::mlir::ArrayAttr max_sequence_lengths, ::mlir::ArrayAttr num_features) {
  odsState.addOperands(sample_indices);
  odsState.addOperands(embedding_indices);
  odsState.addOperands(aggregation_weights);
  odsState.addOperands(mode_override);
  odsState.addAttribute(device_ordinalAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), device_ordinal));
  odsState.addAttribute(combinersAttrName(odsState.name), combiners);
  odsState.addAttribute(table_idsAttrName(odsState.name), table_ids);
  odsState.addAttribute(max_sequence_lengthsAttrName(odsState.name), max_sequence_lengths);
  odsState.addAttribute(num_featuresAttrName(odsState.name), num_features);
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void EnqueueTPUEmbeddingSparseTensorBatchOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() >= 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 0u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult EnqueueTPUEmbeddingSparseTensorBatchOp::verify() {
  {
    auto tblgen_device_ordinal = (*this)->getAttr(device_ordinalAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_device_ordinal, "device_ordinal")))
      return ::mlir::failure();
  }
  {
    auto tblgen_combiners = (*this)->getAttr(combinersAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops22(*this, tblgen_combiners, "combiners")))
      return ::mlir::failure();
  }
  {
    auto tblgen_table_ids = (*this)->getAttr(table_idsAttrName());
    if (!tblgen_table_ids)
      return emitOpError("requires attribute 'table_ids'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops13(*this, tblgen_table_ids, "table_ids")))
      return ::mlir::failure();
  }
  {
    auto tblgen_max_sequence_lengths = (*this)->getAttr(max_sequence_lengthsAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops13(*this, tblgen_max_sequence_lengths, "max_sequence_lengths")))
      return ::mlir::failure();
  }
  {
    auto tblgen_num_features = (*this)->getAttr(num_featuresAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops13(*this, tblgen_num_features, "num_features")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops13(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup3 = getODSOperands(3);

    for (auto v : valueGroup3) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops19(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void EnqueueTPUEmbeddingSparseTensorBatchOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  effects.emplace_back(::mlir::MemoryEffects::Write::get(), ::mlir::TF::ResourceEffects::TPUEmbedding::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::EnqueueTPUEmbeddingSparseTensorBatchOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::EnsureShapeOp definitions
//===----------------------------------------------------------------------===//

EnsureShapeOpAdaptor::EnsureShapeOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

EnsureShapeOpAdaptor::EnsureShapeOpAdaptor(EnsureShapeOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange EnsureShapeOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> EnsureShapeOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange EnsureShapeOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value EnsureShapeOpAdaptor::input() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr EnsureShapeOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::Attribute EnsureShapeOpAdaptor::shape() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::Attribute attr = odsAttrs.get("shape").cast<::mlir::Attribute>();
  return attr;
}

::mlir::LogicalResult EnsureShapeOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_shape = odsAttrs.get("shape");
    if (!tblgen_shape)
      return emitError(loc, "'tf.EnsureShape' op ""requires attribute 'shape'");

    if (tblgen_shape && !((tblgen_shape.isa<mlir::TF::ShapeAttr>())))
      return emitError(loc, "'tf.EnsureShape' op ""attribute 'shape' failed to satisfy constraint: TensorFlow shape attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> EnsureShapeOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range EnsureShapeOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value EnsureShapeOp::input() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange EnsureShapeOp::inputMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> EnsureShapeOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range EnsureShapeOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value EnsureShapeOp::output() {
  return *getODSResults(0).begin();
}

::mlir::Attribute EnsureShapeOp::shapeAttr() {
  return (*this)->getAttr(shapeAttrName()).cast<::mlir::Attribute>();
}

llvm::Optional<llvm::ArrayRef<int64_t>> EnsureShapeOp::shape() {
  auto attr = shapeAttr();
  return attr.cast<mlir::TF::ShapeAttr>().getValue();
}

::mlir::Type EnsureShapeOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool EnsureShapeOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr EnsureShapeOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void EnsureShapeOp::shapeAttr(::mlir::Attribute attr) {
  (*this)->setAttr(shapeAttrName(), attr);
}

void EnsureShapeOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input, ::mlir::Attribute shape) {
  odsState.addOperands(input);
  odsState.addAttribute(shapeAttrName(odsState.name), shape);
  odsState.addTypes(output);
}

void EnsureShapeOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::Attribute shape) {
  odsState.addOperands(input);
  odsState.addAttribute(shapeAttrName(odsState.name), shape);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void EnsureShapeOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input, llvm::Optional<llvm::ArrayRef<int64_t>> shape) {
  odsState.addOperands(input);
  odsState.addAttribute(shapeAttrName(odsState.name), mlir::TF::ShapeAttr::get(odsBuilder.getContext(), shape));
  odsState.addTypes(output);
}

void EnsureShapeOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, llvm::Optional<llvm::ArrayRef<int64_t>> shape) {
  odsState.addOperands(input);
  odsState.addAttribute(shapeAttrName(odsState.name), mlir::TF::ShapeAttr::get(odsBuilder.getContext(), shape));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void EnsureShapeOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult EnsureShapeOp::verify() {
  {
    auto tblgen_shape = (*this)->getAttr(shapeAttrName());
    if (!tblgen_shape)
      return emitOpError("requires attribute 'shape'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops17(*this, tblgen_shape, "shape")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void EnsureShapeOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::EnsureShapeOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::EqualOp definitions
//===----------------------------------------------------------------------===//

EqualOpAdaptor::EqualOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

EqualOpAdaptor::EqualOpAdaptor(EqualOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange EqualOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> EqualOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange EqualOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value EqualOpAdaptor::x() {
  return *getODSOperands(0).begin();
}

::mlir::Value EqualOpAdaptor::y() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr EqualOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::BoolAttr EqualOpAdaptor::incompatible_shape_error() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("incompatible_shape_error").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(true);
  return attr;
}

::mlir::LogicalResult EqualOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_incompatible_shape_error = odsAttrs.get("incompatible_shape_error");
    if (tblgen_incompatible_shape_error && !((tblgen_incompatible_shape_error.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.Equal' op ""attribute 'incompatible_shape_error' failed to satisfy constraint: bool attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> EqualOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range EqualOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value EqualOp::x() {
  return *getODSOperands(0).begin();
}

::mlir::Value EqualOp::y() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange EqualOp::xMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange EqualOp::yMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> EqualOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range EqualOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value EqualOp::z() {
  return *getODSResults(0).begin();
}

::mlir::BoolAttr EqualOp::incompatible_shape_errorAttr() {
  return (*this)->getAttr(incompatible_shape_errorAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool EqualOp::incompatible_shape_error() {
  auto attr = incompatible_shape_errorAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(true).getValue();
  return attr.getValue();
}

::mlir::Type EqualOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool EqualOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr EqualOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void EqualOp::incompatible_shape_errorAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(incompatible_shape_errorAttrName(), attr);
}

void EqualOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type z, ::mlir::Value x, ::mlir::Value y, ::mlir::BoolAttr incompatible_shape_error) {
  odsState.addOperands(x);
  odsState.addOperands(y);
  odsState.addAttribute(incompatible_shape_errorAttrName(odsState.name), incompatible_shape_error);
  odsState.addTypes(z);
}

void EqualOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value x, ::mlir::Value y, ::mlir::BoolAttr incompatible_shape_error) {
  odsState.addOperands(x);
  odsState.addOperands(y);
  odsState.addAttribute(incompatible_shape_errorAttrName(odsState.name), incompatible_shape_error);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void EqualOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type z, ::mlir::Value x, ::mlir::Value y, bool incompatible_shape_error) {
  odsState.addOperands(x);
  odsState.addOperands(y);
  odsState.addAttribute(incompatible_shape_errorAttrName(odsState.name), odsBuilder.getBoolAttr(incompatible_shape_error));
  odsState.addTypes(z);
}

void EqualOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value x, ::mlir::Value y, bool incompatible_shape_error) {
  odsState.addOperands(x);
  odsState.addOperands(y);
  odsState.addAttribute(incompatible_shape_errorAttrName(odsState.name), odsBuilder.getBoolAttr(incompatible_shape_error));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void EqualOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult EqualOp::verify() {
  {
    auto tblgen_incompatible_shape_error = (*this)->getAttr(incompatible_shape_errorAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_incompatible_shape_error, "incompatible_shape_error")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops8(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return Verify(*this);
}

void EqualOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::EqualOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::ErfOp definitions
//===----------------------------------------------------------------------===//

ErfOpAdaptor::ErfOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

ErfOpAdaptor::ErfOpAdaptor(ErfOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange ErfOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> ErfOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange ErfOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ErfOpAdaptor::x() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr ErfOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult ErfOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> ErfOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range ErfOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ErfOp::x() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange ErfOp::xMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> ErfOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range ErfOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ErfOp::y() {
  return *getODSResults(0).begin();
}

::mlir::Type ErfOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool ErfOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr ErfOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void ErfOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type y, ::mlir::Value x) {
  odsState.addOperands(x);
  odsState.addTypes(y);
}

void ErfOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value x) {
  odsState.addOperands(x);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void ErfOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult ErfOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void ErfOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::ErfOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::ErfcOp definitions
//===----------------------------------------------------------------------===//

ErfcOpAdaptor::ErfcOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

ErfcOpAdaptor::ErfcOpAdaptor(ErfcOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange ErfcOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> ErfcOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange ErfcOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ErfcOpAdaptor::x() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr ErfcOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult ErfcOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> ErfcOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range ErfcOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ErfcOp::x() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange ErfcOp::xMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> ErfcOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range ErfcOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ErfcOp::y() {
  return *getODSResults(0).begin();
}

::mlir::Type ErfcOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool ErfcOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr ErfcOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void ErfcOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type y, ::mlir::Value x) {
  odsState.addOperands(x);
  odsState.addTypes(y);
}

void ErfcOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value x) {
  odsState.addOperands(x);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void ErfcOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult ErfcOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void ErfcOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::ErfcOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::ErfinvOp definitions
//===----------------------------------------------------------------------===//

ErfinvOpAdaptor::ErfinvOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

ErfinvOpAdaptor::ErfinvOpAdaptor(ErfinvOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange ErfinvOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> ErfinvOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange ErfinvOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ErfinvOpAdaptor::x() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr ErfinvOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult ErfinvOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> ErfinvOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range ErfinvOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ErfinvOp::x() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange ErfinvOp::xMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> ErfinvOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range ErfinvOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ErfinvOp::y() {
  return *getODSResults(0).begin();
}

::mlir::Type ErfinvOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool ErfinvOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr ErfinvOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void ErfinvOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type y, ::mlir::Value x) {
  odsState.addOperands(x);
  odsState.addTypes(y);
}

void ErfinvOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value x) {
  odsState.addOperands(x);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void ErfinvOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult ErfinvOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void ErfinvOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::ErfinvOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::ExpOp definitions
//===----------------------------------------------------------------------===//

ExpOpAdaptor::ExpOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

ExpOpAdaptor::ExpOpAdaptor(ExpOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange ExpOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> ExpOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange ExpOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ExpOpAdaptor::x() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr ExpOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult ExpOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> ExpOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range ExpOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ExpOp::x() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange ExpOp::xMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> ExpOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range ExpOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ExpOp::y() {
  return *getODSResults(0).begin();
}

::mlir::Type ExpOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool ExpOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr ExpOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void ExpOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type y, ::mlir::Value x) {
  odsState.addOperands(x);
  odsState.addTypes(y);
}

void ExpOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value x) {
  odsState.addOperands(x);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void ExpOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

void ExpOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value x) {
  odsState.addOperands(x);
  odsState.addTypes({x.getType()});

}

void ExpOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  odsState.addTypes({operands[0].getType()});

}

::mlir::LogicalResult ExpOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops2(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops2(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void ExpOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::ExpOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::ExpandDimsOp definitions
//===----------------------------------------------------------------------===//

ExpandDimsOpAdaptor::ExpandDimsOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

ExpandDimsOpAdaptor::ExpandDimsOpAdaptor(ExpandDimsOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange ExpandDimsOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> ExpandDimsOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange ExpandDimsOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ExpandDimsOpAdaptor::input() {
  return *getODSOperands(0).begin();
}

::mlir::Value ExpandDimsOpAdaptor::dim() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr ExpandDimsOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult ExpandDimsOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> ExpandDimsOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range ExpandDimsOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ExpandDimsOp::input() {
  return *getODSOperands(0).begin();
}

::mlir::Value ExpandDimsOp::dim() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange ExpandDimsOp::inputMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ExpandDimsOp::dimMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> ExpandDimsOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range ExpandDimsOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ExpandDimsOp::output() {
  return *getODSResults(0).begin();
}

::mlir::Type ExpandDimsOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

::mlir::Type ExpandDimsOp::Tdim() {
  return mlir::getElementTypeOrSelf(*getODSOperands(1).begin());
}

bool ExpandDimsOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
  if (name == "Tdim") return true;
 return false;
}

::mlir::DictionaryAttr ExpandDimsOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())},
    {TdimAttrName(),
::mlir::TypeAttr::get(Tdim())}});
}

void ExpandDimsOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input, ::mlir::Value dim) {
  odsState.addOperands(input);
  odsState.addOperands(dim);
  odsState.addTypes(output);
}

void ExpandDimsOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::Value dim) {
  odsState.addOperands(input);
  odsState.addOperands(dim);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void ExpandDimsOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult ExpandDimsOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void ExpandDimsOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::ExpandDimsOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::Expm1Op definitions
//===----------------------------------------------------------------------===//

Expm1OpAdaptor::Expm1OpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

Expm1OpAdaptor::Expm1OpAdaptor(Expm1Op &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange Expm1OpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> Expm1OpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange Expm1OpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value Expm1OpAdaptor::x() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr Expm1OpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult Expm1OpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> Expm1Op::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range Expm1Op::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value Expm1Op::x() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange Expm1Op::xMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> Expm1Op::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range Expm1Op::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value Expm1Op::y() {
  return *getODSResults(0).begin();
}

::mlir::Type Expm1Op::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool Expm1Op::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr Expm1Op::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void Expm1Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type y, ::mlir::Value x) {
  odsState.addOperands(x);
  odsState.addTypes(y);
}

void Expm1Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value x) {
  odsState.addOperands(x);

        ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
        if (::mlir::succeeded(Expm1Op::inferReturnTypes(odsBuilder.getContext(),
                      odsState.location, odsState.operands,
                      odsState.attributes.getDictionary(odsState.getContext()),
                      /*regions=*/{}, inferredReturnTypes)))
          odsState.addTypes(inferredReturnTypes);
        else
          ::llvm::report_fatal_error("Failed to infer result type(s).");
}

void Expm1Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value x) {
  odsState.addOperands(x);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void Expm1Op::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

void Expm1Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);

  ::mlir::SmallVector<::mlir::Type, 2> inferredReturnTypes;
  if (::mlir::succeeded(Expm1Op::inferReturnTypes(odsBuilder.getContext(),
          odsState.location, operands,
          odsState.attributes.getDictionary(odsState.getContext()),
          odsState.regions, inferredReturnTypes))) {
    assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
    odsState.addTypes(inferredReturnTypes);
  } else {
    ::llvm::report_fatal_error("Failed to infer result type(s).");
  }
}

::mlir::LogicalResult Expm1Op::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops2(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops2(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void Expm1Op::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::Expm1Op)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::ExtractImagePatchesOp definitions
//===----------------------------------------------------------------------===//

ExtractImagePatchesOpAdaptor::ExtractImagePatchesOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

ExtractImagePatchesOpAdaptor::ExtractImagePatchesOpAdaptor(ExtractImagePatchesOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange ExtractImagePatchesOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> ExtractImagePatchesOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange ExtractImagePatchesOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ExtractImagePatchesOpAdaptor::images() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr ExtractImagePatchesOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::ArrayAttr ExtractImagePatchesOpAdaptor::ksizes() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("ksizes").cast<::mlir::ArrayAttr>();
  return attr;
}

::mlir::ArrayAttr ExtractImagePatchesOpAdaptor::strides() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("strides").cast<::mlir::ArrayAttr>();
  return attr;
}

::mlir::ArrayAttr ExtractImagePatchesOpAdaptor::rates() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("rates").cast<::mlir::ArrayAttr>();
  return attr;
}

::mlir::StringAttr ExtractImagePatchesOpAdaptor::padding() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("padding").cast<::mlir::StringAttr>();
  return attr;
}

::mlir::LogicalResult ExtractImagePatchesOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_ksizes = odsAttrs.get("ksizes");
    if (!tblgen_ksizes)
      return emitError(loc, "'tf.ExtractImagePatches' op ""requires attribute 'ksizes'");

    if (tblgen_ksizes && !((((tblgen_ksizes.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_ksizes.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return ((attr.isa<::mlir::IntegerAttr>())) && ((attr.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64))); }))) && ((tblgen_ksizes.cast<::mlir::ArrayAttr>().size() >= 4))))
      return emitError(loc, "'tf.ExtractImagePatches' op ""attribute 'ksizes' failed to satisfy constraint: 64-bit integer array attribute with at least 4 elements");
  }
  {
    auto tblgen_strides = odsAttrs.get("strides");
    if (!tblgen_strides)
      return emitError(loc, "'tf.ExtractImagePatches' op ""requires attribute 'strides'");

    if (tblgen_strides && !((((tblgen_strides.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_strides.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return ((attr.isa<::mlir::IntegerAttr>())) && ((attr.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64))); }))) && ((tblgen_strides.cast<::mlir::ArrayAttr>().size() >= 4))))
      return emitError(loc, "'tf.ExtractImagePatches' op ""attribute 'strides' failed to satisfy constraint: 64-bit integer array attribute with at least 4 elements");
  }
  {
    auto tblgen_rates = odsAttrs.get("rates");
    if (!tblgen_rates)
      return emitError(loc, "'tf.ExtractImagePatches' op ""requires attribute 'rates'");

    if (tblgen_rates && !((((tblgen_rates.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_rates.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return ((attr.isa<::mlir::IntegerAttr>())) && ((attr.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64))); }))) && ((tblgen_rates.cast<::mlir::ArrayAttr>().size() >= 4))))
      return emitError(loc, "'tf.ExtractImagePatches' op ""attribute 'rates' failed to satisfy constraint: 64-bit integer array attribute with at least 4 elements");
  }
  {
    auto tblgen_padding = odsAttrs.get("padding");
    if (!tblgen_padding)
      return emitError(loc, "'tf.ExtractImagePatches' op ""requires attribute 'padding'");

    if (tblgen_padding && !((tblgen_padding.cast<StringAttr>().getValue() == "SAME" || tblgen_padding.cast<StringAttr>().getValue() == "VALID")))
      return emitError(loc, "'tf.ExtractImagePatches' op ""attribute 'padding' failed to satisfy constraint: string attribute whose value is SAME, or VALID");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> ExtractImagePatchesOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range ExtractImagePatchesOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ExtractImagePatchesOp::images() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange ExtractImagePatchesOp::imagesMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> ExtractImagePatchesOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range ExtractImagePatchesOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ExtractImagePatchesOp::patches() {
  return *getODSResults(0).begin();
}

::mlir::ArrayAttr ExtractImagePatchesOp::ksizesAttr() {
  return (*this)->getAttr(ksizesAttrName()).cast<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr ExtractImagePatchesOp::ksizes() {
  auto attr = ksizesAttr();
  return attr;
}

::mlir::ArrayAttr ExtractImagePatchesOp::stridesAttr() {
  return (*this)->getAttr(stridesAttrName()).cast<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr ExtractImagePatchesOp::strides() {
  auto attr = stridesAttr();
  return attr;
}

::mlir::ArrayAttr ExtractImagePatchesOp::ratesAttr() {
  return (*this)->getAttr(ratesAttrName()).cast<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr ExtractImagePatchesOp::rates() {
  auto attr = ratesAttr();
  return attr;
}

::mlir::StringAttr ExtractImagePatchesOp::paddingAttr() {
  return (*this)->getAttr(paddingAttrName()).cast<::mlir::StringAttr>();
}

::llvm::StringRef ExtractImagePatchesOp::padding() {
  auto attr = paddingAttr();
  return attr.getValue();
}

::mlir::Type ExtractImagePatchesOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool ExtractImagePatchesOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr ExtractImagePatchesOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void ExtractImagePatchesOp::ksizesAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(ksizesAttrName(), attr);
}

void ExtractImagePatchesOp::stridesAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(stridesAttrName(), attr);
}

void ExtractImagePatchesOp::ratesAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(ratesAttrName(), attr);
}

void ExtractImagePatchesOp::paddingAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(paddingAttrName(), attr);
}

void ExtractImagePatchesOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type patches, ::mlir::Value images, ::mlir::ArrayAttr ksizes, ::mlir::ArrayAttr strides, ::mlir::ArrayAttr rates, ::mlir::StringAttr padding) {
  odsState.addOperands(images);
  odsState.addAttribute(ksizesAttrName(odsState.name), ksizes);
  odsState.addAttribute(stridesAttrName(odsState.name), strides);
  odsState.addAttribute(ratesAttrName(odsState.name), rates);
  odsState.addAttribute(paddingAttrName(odsState.name), padding);
  odsState.addTypes(patches);
}

void ExtractImagePatchesOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value images, ::mlir::ArrayAttr ksizes, ::mlir::ArrayAttr strides, ::mlir::ArrayAttr rates, ::mlir::StringAttr padding) {
  odsState.addOperands(images);
  odsState.addAttribute(ksizesAttrName(odsState.name), ksizes);
  odsState.addAttribute(stridesAttrName(odsState.name), strides);
  odsState.addAttribute(ratesAttrName(odsState.name), rates);
  odsState.addAttribute(paddingAttrName(odsState.name), padding);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void ExtractImagePatchesOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type patches, ::mlir::Value images, ::mlir::ArrayAttr ksizes, ::mlir::ArrayAttr strides, ::mlir::ArrayAttr rates, ::llvm::StringRef padding) {
  odsState.addOperands(images);
  odsState.addAttribute(ksizesAttrName(odsState.name), ksizes);
  odsState.addAttribute(stridesAttrName(odsState.name), strides);
  odsState.addAttribute(ratesAttrName(odsState.name), rates);
  odsState.addAttribute(paddingAttrName(odsState.name), odsBuilder.getStringAttr(padding));
  odsState.addTypes(patches);
}

void ExtractImagePatchesOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value images, ::mlir::ArrayAttr ksizes, ::mlir::ArrayAttr strides, ::mlir::ArrayAttr rates, ::llvm::StringRef padding) {
  odsState.addOperands(images);
  odsState.addAttribute(ksizesAttrName(odsState.name), ksizes);
  odsState.addAttribute(stridesAttrName(odsState.name), strides);
  odsState.addAttribute(ratesAttrName(odsState.name), rates);
  odsState.addAttribute(paddingAttrName(odsState.name), odsBuilder.getStringAttr(padding));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void ExtractImagePatchesOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult ExtractImagePatchesOp::verify() {
  {
    auto tblgen_ksizes = (*this)->getAttr(ksizesAttrName());
    if (!tblgen_ksizes)
      return emitOpError("requires attribute 'ksizes'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops10(*this, tblgen_ksizes, "ksizes")))
      return ::mlir::failure();
  }
  {
    auto tblgen_strides = (*this)->getAttr(stridesAttrName());
    if (!tblgen_strides)
      return emitOpError("requires attribute 'strides'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops10(*this, tblgen_strides, "strides")))
      return ::mlir::failure();
  }
  {
    auto tblgen_rates = (*this)->getAttr(ratesAttrName());
    if (!tblgen_rates)
      return emitOpError("requires attribute 'rates'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops10(*this, tblgen_rates, "rates")))
      return ::mlir::failure();
  }
  {
    auto tblgen_padding = (*this)->getAttr(paddingAttrName());
    if (!tblgen_padding)
      return emitOpError("requires attribute 'padding'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops8(*this, tblgen_padding, "padding")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops43(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops43(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void ExtractImagePatchesOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::ExtractImagePatchesOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::FFT2DOp definitions
//===----------------------------------------------------------------------===//

FFT2DOpAdaptor::FFT2DOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

FFT2DOpAdaptor::FFT2DOpAdaptor(FFT2DOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange FFT2DOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> FFT2DOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange FFT2DOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value FFT2DOpAdaptor::input() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr FFT2DOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult FFT2DOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> FFT2DOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range FFT2DOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value FFT2DOp::input() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange FFT2DOp::inputMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> FFT2DOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range FFT2DOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value FFT2DOp::output() {
  return *getODSResults(0).begin();
}

::mlir::Type FFT2DOp::Tcomplex() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool FFT2DOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "Tcomplex") return true;
 return false;
}

::mlir::DictionaryAttr FFT2DOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TcomplexAttrName(),
::mlir::TypeAttr::get(Tcomplex())}});
}

void FFT2DOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input) {
  odsState.addOperands(input);
  odsState.addTypes(output);
}

void FFT2DOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input) {
  odsState.addOperands(input);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void FFT2DOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult FFT2DOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops12(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops12(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void FFT2DOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::FFT2DOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::FFT3DOp definitions
//===----------------------------------------------------------------------===//

FFT3DOpAdaptor::FFT3DOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

FFT3DOpAdaptor::FFT3DOpAdaptor(FFT3DOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange FFT3DOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> FFT3DOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange FFT3DOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value FFT3DOpAdaptor::input() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr FFT3DOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult FFT3DOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> FFT3DOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range FFT3DOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value FFT3DOp::input() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange FFT3DOp::inputMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> FFT3DOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range FFT3DOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value FFT3DOp::output() {
  return *getODSResults(0).begin();
}

::mlir::Type FFT3DOp::Tcomplex() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool FFT3DOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "Tcomplex") return true;
 return false;
}

::mlir::DictionaryAttr FFT3DOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TcomplexAttrName(),
::mlir::TypeAttr::get(Tcomplex())}});
}

void FFT3DOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input) {
  odsState.addOperands(input);
  odsState.addTypes(output);
}

void FFT3DOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input) {
  odsState.addOperands(input);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void FFT3DOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult FFT3DOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops12(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops12(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void FFT3DOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::FFT3DOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::FFTOp definitions
//===----------------------------------------------------------------------===//

FFTOpAdaptor::FFTOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

FFTOpAdaptor::FFTOpAdaptor(FFTOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange FFTOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> FFTOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange FFTOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value FFTOpAdaptor::input() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr FFTOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult FFTOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> FFTOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range FFTOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value FFTOp::input() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange FFTOp::inputMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> FFTOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range FFTOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value FFTOp::output() {
  return *getODSResults(0).begin();
}

::mlir::Type FFTOp::Tcomplex() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool FFTOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "Tcomplex") return true;
 return false;
}

::mlir::DictionaryAttr FFTOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TcomplexAttrName(),
::mlir::TypeAttr::get(Tcomplex())}});
}

void FFTOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input) {
  odsState.addOperands(input);
  odsState.addTypes(output);
}

void FFTOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input) {
  odsState.addOperands(input);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void FFTOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult FFTOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops12(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops12(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void FFTOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::FFTOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::FakeParamOp definitions
//===----------------------------------------------------------------------===//

FakeParamOpAdaptor::FakeParamOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

FakeParamOpAdaptor::FakeParamOpAdaptor(FakeParamOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange FakeParamOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> FakeParamOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange FakeParamOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::DictionaryAttr FakeParamOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::Attribute FakeParamOpAdaptor::shape() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::Attribute attr = odsAttrs.get("shape").cast<::mlir::Attribute>();
  return attr;
}

::mlir::LogicalResult FakeParamOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_shape = odsAttrs.get("shape");
    if (!tblgen_shape)
      return emitError(loc, "'tf.FakeParam' op ""requires attribute 'shape'");

    if (tblgen_shape && !((tblgen_shape.isa<mlir::TF::ShapeAttr>())))
      return emitError(loc, "'tf.FakeParam' op ""attribute 'shape' failed to satisfy constraint: TensorFlow shape attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> FakeParamOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range FakeParamOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

std::pair<unsigned, unsigned> FakeParamOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range FakeParamOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value FakeParamOp::output() {
  return *getODSResults(0).begin();
}

::mlir::Attribute FakeParamOp::shapeAttr() {
  return (*this)->getAttr(shapeAttrName()).cast<::mlir::Attribute>();
}

llvm::Optional<llvm::ArrayRef<int64_t>> FakeParamOp::shape() {
  auto attr = shapeAttr();
  return attr.cast<mlir::TF::ShapeAttr>().getValue();
}

::mlir::Type FakeParamOp::dtype() {
  return mlir::getElementTypeOrSelf(*getODSResults(0).begin());
}

bool FakeParamOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "dtype") return true;
 return false;
}

::mlir::DictionaryAttr FakeParamOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {dtypeAttrName(),
::mlir::TypeAttr::get(dtype())}});
}

void FakeParamOp::shapeAttr(::mlir::Attribute attr) {
  (*this)->setAttr(shapeAttrName(), attr);
}

void FakeParamOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Attribute shape) {
  odsState.addAttribute(shapeAttrName(odsState.name), shape);
  odsState.addTypes(output);
}

void FakeParamOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Attribute shape) {
  odsState.addAttribute(shapeAttrName(odsState.name), shape);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void FakeParamOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, llvm::Optional<llvm::ArrayRef<int64_t>> shape) {
  odsState.addAttribute(shapeAttrName(odsState.name), mlir::TF::ShapeAttr::get(odsBuilder.getContext(), shape));
  odsState.addTypes(output);
}

void FakeParamOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, llvm::Optional<llvm::ArrayRef<int64_t>> shape) {
  odsState.addAttribute(shapeAttrName(odsState.name), mlir::TF::ShapeAttr::get(odsBuilder.getContext(), shape));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void FakeParamOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 0u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult FakeParamOp::verify() {
  {
    auto tblgen_shape = (*this)->getAttr(shapeAttrName());
    if (!tblgen_shape)
      return emitOpError("requires attribute 'shape'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops17(*this, tblgen_shape, "shape")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void FakeParamOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::FakeParamOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::FakeQuantWithMinMaxArgsGradientOp definitions
//===----------------------------------------------------------------------===//

FakeQuantWithMinMaxArgsGradientOpAdaptor::FakeQuantWithMinMaxArgsGradientOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

FakeQuantWithMinMaxArgsGradientOpAdaptor::FakeQuantWithMinMaxArgsGradientOpAdaptor(FakeQuantWithMinMaxArgsGradientOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange FakeQuantWithMinMaxArgsGradientOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> FakeQuantWithMinMaxArgsGradientOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange FakeQuantWithMinMaxArgsGradientOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value FakeQuantWithMinMaxArgsGradientOpAdaptor::gradients() {
  return *getODSOperands(0).begin();
}

::mlir::Value FakeQuantWithMinMaxArgsGradientOpAdaptor::inputs() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr FakeQuantWithMinMaxArgsGradientOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::FloatAttr FakeQuantWithMinMaxArgsGradientOpAdaptor::min() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::FloatAttr attr = odsAttrs.get("min").dyn_cast_or_null<::mlir::FloatAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getFloatAttr(::mlir::Builder(odsAttrs.getContext()).getF32Type(), -6.0f);
  return attr;
}

::mlir::FloatAttr FakeQuantWithMinMaxArgsGradientOpAdaptor::max() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::FloatAttr attr = odsAttrs.get("max").dyn_cast_or_null<::mlir::FloatAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getFloatAttr(::mlir::Builder(odsAttrs.getContext()).getF32Type(), 6.0f);
  return attr;
}

::mlir::IntegerAttr FakeQuantWithMinMaxArgsGradientOpAdaptor::num_bits() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("num_bits").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), 8);
  return attr;
}

::mlir::BoolAttr FakeQuantWithMinMaxArgsGradientOpAdaptor::narrow_range() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("narrow_range").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(false);
  return attr;
}

::mlir::LogicalResult FakeQuantWithMinMaxArgsGradientOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_min = odsAttrs.get("min");
    if (tblgen_min && !(((tblgen_min.isa<::mlir::FloatAttr>())) && ((tblgen_min.cast<::mlir::FloatAttr>().getType().isF32()))))
      return emitError(loc, "'tf.FakeQuantWithMinMaxArgsGradient' op ""attribute 'min' failed to satisfy constraint: 32-bit float attribute");
  }
  {
    auto tblgen_max = odsAttrs.get("max");
    if (tblgen_max && !(((tblgen_max.isa<::mlir::FloatAttr>())) && ((tblgen_max.cast<::mlir::FloatAttr>().getType().isF32()))))
      return emitError(loc, "'tf.FakeQuantWithMinMaxArgsGradient' op ""attribute 'max' failed to satisfy constraint: 32-bit float attribute");
  }
  {
    auto tblgen_num_bits = odsAttrs.get("num_bits");
    if (tblgen_num_bits && !(((tblgen_num_bits.isa<::mlir::IntegerAttr>())) && ((tblgen_num_bits.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.FakeQuantWithMinMaxArgsGradient' op ""attribute 'num_bits' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_narrow_range = odsAttrs.get("narrow_range");
    if (tblgen_narrow_range && !((tblgen_narrow_range.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.FakeQuantWithMinMaxArgsGradient' op ""attribute 'narrow_range' failed to satisfy constraint: bool attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> FakeQuantWithMinMaxArgsGradientOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range FakeQuantWithMinMaxArgsGradientOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value FakeQuantWithMinMaxArgsGradientOp::gradients() {
  return *getODSOperands(0).begin();
}

::mlir::Value FakeQuantWithMinMaxArgsGradientOp::inputs() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange FakeQuantWithMinMaxArgsGradientOp::gradientsMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange FakeQuantWithMinMaxArgsGradientOp::inputsMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> FakeQuantWithMinMaxArgsGradientOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range FakeQuantWithMinMaxArgsGradientOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value FakeQuantWithMinMaxArgsGradientOp::backprops() {
  return *getODSResults(0).begin();
}

::mlir::FloatAttr FakeQuantWithMinMaxArgsGradientOp::minAttr() {
  return (*this)->getAttr(minAttrName()).dyn_cast_or_null<::mlir::FloatAttr>();
}

::llvm::APFloat FakeQuantWithMinMaxArgsGradientOp::min() {
  auto attr = minAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getFloatAttr(::mlir::Builder((*this)->getContext()).getF32Type(), -6.0f).getValue();
  return attr.getValue();
}

::mlir::FloatAttr FakeQuantWithMinMaxArgsGradientOp::maxAttr() {
  return (*this)->getAttr(maxAttrName()).dyn_cast_or_null<::mlir::FloatAttr>();
}

::llvm::APFloat FakeQuantWithMinMaxArgsGradientOp::max() {
  auto attr = maxAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getFloatAttr(::mlir::Builder((*this)->getContext()).getF32Type(), 6.0f).getValue();
  return attr.getValue();
}

::mlir::IntegerAttr FakeQuantWithMinMaxArgsGradientOp::num_bitsAttr() {
  return (*this)->getAttr(num_bitsAttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t FakeQuantWithMinMaxArgsGradientOp::num_bits() {
  auto attr = num_bitsAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), 8).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

::mlir::BoolAttr FakeQuantWithMinMaxArgsGradientOp::narrow_rangeAttr() {
  return (*this)->getAttr(narrow_rangeAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool FakeQuantWithMinMaxArgsGradientOp::narrow_range() {
  auto attr = narrow_rangeAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(false).getValue();
  return attr.getValue();
}

void FakeQuantWithMinMaxArgsGradientOp::minAttr(::mlir::FloatAttr attr) {
  (*this)->setAttr(minAttrName(), attr);
}

void FakeQuantWithMinMaxArgsGradientOp::maxAttr(::mlir::FloatAttr attr) {
  (*this)->setAttr(maxAttrName(), attr);
}

void FakeQuantWithMinMaxArgsGradientOp::num_bitsAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(num_bitsAttrName(), attr);
}

void FakeQuantWithMinMaxArgsGradientOp::narrow_rangeAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(narrow_rangeAttrName(), attr);
}

void FakeQuantWithMinMaxArgsGradientOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type backprops, ::mlir::Value gradients, ::mlir::Value inputs, ::mlir::FloatAttr min, ::mlir::FloatAttr max, ::mlir::IntegerAttr num_bits, ::mlir::BoolAttr narrow_range) {
  odsState.addOperands(gradients);
  odsState.addOperands(inputs);
  odsState.addAttribute(minAttrName(odsState.name), min);
  odsState.addAttribute(maxAttrName(odsState.name), max);
  odsState.addAttribute(num_bitsAttrName(odsState.name), num_bits);
  odsState.addAttribute(narrow_rangeAttrName(odsState.name), narrow_range);
  odsState.addTypes(backprops);
}

void FakeQuantWithMinMaxArgsGradientOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value gradients, ::mlir::Value inputs, ::mlir::FloatAttr min, ::mlir::FloatAttr max, ::mlir::IntegerAttr num_bits, ::mlir::BoolAttr narrow_range) {
  odsState.addOperands(gradients);
  odsState.addOperands(inputs);
  odsState.addAttribute(minAttrName(odsState.name), min);
  odsState.addAttribute(maxAttrName(odsState.name), max);
  odsState.addAttribute(num_bitsAttrName(odsState.name), num_bits);
  odsState.addAttribute(narrow_rangeAttrName(odsState.name), narrow_range);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void FakeQuantWithMinMaxArgsGradientOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type backprops, ::mlir::Value gradients, ::mlir::Value inputs, ::llvm::APFloat min, ::llvm::APFloat max, uint64_t num_bits, bool narrow_range) {
  odsState.addOperands(gradients);
  odsState.addOperands(inputs);
  odsState.addAttribute(minAttrName(odsState.name), odsBuilder.getFloatAttr(odsBuilder.getF32Type(), min));
  odsState.addAttribute(maxAttrName(odsState.name), odsBuilder.getFloatAttr(odsBuilder.getF32Type(), max));
  odsState.addAttribute(num_bitsAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), num_bits));
  odsState.addAttribute(narrow_rangeAttrName(odsState.name), odsBuilder.getBoolAttr(narrow_range));
  odsState.addTypes(backprops);
}

void FakeQuantWithMinMaxArgsGradientOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value gradients, ::mlir::Value inputs, ::llvm::APFloat min, ::llvm::APFloat max, uint64_t num_bits, bool narrow_range) {
  odsState.addOperands(gradients);
  odsState.addOperands(inputs);
  odsState.addAttribute(minAttrName(odsState.name), odsBuilder.getFloatAttr(odsBuilder.getF32Type(), min));
  odsState.addAttribute(maxAttrName(odsState.name), odsBuilder.getFloatAttr(odsBuilder.getF32Type(), max));
  odsState.addAttribute(num_bitsAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), num_bits));
  odsState.addAttribute(narrow_rangeAttrName(odsState.name), odsBuilder.getBoolAttr(narrow_range));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void FakeQuantWithMinMaxArgsGradientOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult FakeQuantWithMinMaxArgsGradientOp::verify() {
  {
    auto tblgen_min = (*this)->getAttr(minAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops5(*this, tblgen_min, "min")))
      return ::mlir::failure();
  }
  {
    auto tblgen_max = (*this)->getAttr(maxAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops5(*this, tblgen_max, "max")))
      return ::mlir::failure();
  }
  {
    auto tblgen_num_bits = (*this)->getAttr(num_bitsAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_num_bits, "num_bits")))
      return ::mlir::failure();
  }
  {
    auto tblgen_narrow_range = (*this)->getAttr(narrow_rangeAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_narrow_range, "narrow_range")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void FakeQuantWithMinMaxArgsGradientOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::FakeQuantWithMinMaxArgsGradientOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::FakeQuantWithMinMaxArgsOp definitions
//===----------------------------------------------------------------------===//

FakeQuantWithMinMaxArgsOpAdaptor::FakeQuantWithMinMaxArgsOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

FakeQuantWithMinMaxArgsOpAdaptor::FakeQuantWithMinMaxArgsOpAdaptor(FakeQuantWithMinMaxArgsOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange FakeQuantWithMinMaxArgsOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> FakeQuantWithMinMaxArgsOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange FakeQuantWithMinMaxArgsOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value FakeQuantWithMinMaxArgsOpAdaptor::inputs() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr FakeQuantWithMinMaxArgsOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::FloatAttr FakeQuantWithMinMaxArgsOpAdaptor::min() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::FloatAttr attr = odsAttrs.get("min").dyn_cast_or_null<::mlir::FloatAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getFloatAttr(::mlir::Builder(odsAttrs.getContext()).getF32Type(), -6.0f);
  return attr;
}

::mlir::FloatAttr FakeQuantWithMinMaxArgsOpAdaptor::max() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::FloatAttr attr = odsAttrs.get("max").dyn_cast_or_null<::mlir::FloatAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getFloatAttr(::mlir::Builder(odsAttrs.getContext()).getF32Type(), 6.0f);
  return attr;
}

::mlir::IntegerAttr FakeQuantWithMinMaxArgsOpAdaptor::num_bits() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("num_bits").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), 8);
  return attr;
}

::mlir::BoolAttr FakeQuantWithMinMaxArgsOpAdaptor::narrow_range() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("narrow_range").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(false);
  return attr;
}

::mlir::LogicalResult FakeQuantWithMinMaxArgsOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_min = odsAttrs.get("min");
    if (tblgen_min && !(((tblgen_min.isa<::mlir::FloatAttr>())) && ((tblgen_min.cast<::mlir::FloatAttr>().getType().isF32()))))
      return emitError(loc, "'tf.FakeQuantWithMinMaxArgs' op ""attribute 'min' failed to satisfy constraint: 32-bit float attribute");
  }
  {
    auto tblgen_max = odsAttrs.get("max");
    if (tblgen_max && !(((tblgen_max.isa<::mlir::FloatAttr>())) && ((tblgen_max.cast<::mlir::FloatAttr>().getType().isF32()))))
      return emitError(loc, "'tf.FakeQuantWithMinMaxArgs' op ""attribute 'max' failed to satisfy constraint: 32-bit float attribute");
  }
  {
    auto tblgen_num_bits = odsAttrs.get("num_bits");
    if (tblgen_num_bits && !(((tblgen_num_bits.isa<::mlir::IntegerAttr>())) && ((tblgen_num_bits.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.FakeQuantWithMinMaxArgs' op ""attribute 'num_bits' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_narrow_range = odsAttrs.get("narrow_range");
    if (tblgen_narrow_range && !((tblgen_narrow_range.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.FakeQuantWithMinMaxArgs' op ""attribute 'narrow_range' failed to satisfy constraint: bool attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> FakeQuantWithMinMaxArgsOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range FakeQuantWithMinMaxArgsOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value FakeQuantWithMinMaxArgsOp::inputs() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange FakeQuantWithMinMaxArgsOp::inputsMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> FakeQuantWithMinMaxArgsOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range FakeQuantWithMinMaxArgsOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value FakeQuantWithMinMaxArgsOp::outputs() {
  return *getODSResults(0).begin();
}

::mlir::FloatAttr FakeQuantWithMinMaxArgsOp::minAttr() {
  return (*this)->getAttr(minAttrName()).dyn_cast_or_null<::mlir::FloatAttr>();
}

::llvm::APFloat FakeQuantWithMinMaxArgsOp::min() {
  auto attr = minAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getFloatAttr(::mlir::Builder((*this)->getContext()).getF32Type(), -6.0f).getValue();
  return attr.getValue();
}

::mlir::FloatAttr FakeQuantWithMinMaxArgsOp::maxAttr() {
  return (*this)->getAttr(maxAttrName()).dyn_cast_or_null<::mlir::FloatAttr>();
}

::llvm::APFloat FakeQuantWithMinMaxArgsOp::max() {
  auto attr = maxAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getFloatAttr(::mlir::Builder((*this)->getContext()).getF32Type(), 6.0f).getValue();
  return attr.getValue();
}

::mlir::IntegerAttr FakeQuantWithMinMaxArgsOp::num_bitsAttr() {
  return (*this)->getAttr(num_bitsAttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t FakeQuantWithMinMaxArgsOp::num_bits() {
  auto attr = num_bitsAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), 8).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

::mlir::BoolAttr FakeQuantWithMinMaxArgsOp::narrow_rangeAttr() {
  return (*this)->getAttr(narrow_rangeAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool FakeQuantWithMinMaxArgsOp::narrow_range() {
  auto attr = narrow_rangeAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(false).getValue();
  return attr.getValue();
}

void FakeQuantWithMinMaxArgsOp::minAttr(::mlir::FloatAttr attr) {
  (*this)->setAttr(minAttrName(), attr);
}

void FakeQuantWithMinMaxArgsOp::maxAttr(::mlir::FloatAttr attr) {
  (*this)->setAttr(maxAttrName(), attr);
}

void FakeQuantWithMinMaxArgsOp::num_bitsAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(num_bitsAttrName(), attr);
}

void FakeQuantWithMinMaxArgsOp::narrow_rangeAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(narrow_rangeAttrName(), attr);
}

void FakeQuantWithMinMaxArgsOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type outputs, ::mlir::Value inputs, ::mlir::FloatAttr min, ::mlir::FloatAttr max, ::mlir::IntegerAttr num_bits, ::mlir::BoolAttr narrow_range) {
  odsState.addOperands(inputs);
  odsState.addAttribute(minAttrName(odsState.name), min);
  odsState.addAttribute(maxAttrName(odsState.name), max);
  odsState.addAttribute(num_bitsAttrName(odsState.name), num_bits);
  odsState.addAttribute(narrow_rangeAttrName(odsState.name), narrow_range);
  odsState.addTypes(outputs);
}

void FakeQuantWithMinMaxArgsOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value inputs, ::mlir::FloatAttr min, ::mlir::FloatAttr max, ::mlir::IntegerAttr num_bits, ::mlir::BoolAttr narrow_range) {
  odsState.addOperands(inputs);
  odsState.addAttribute(minAttrName(odsState.name), min);
  odsState.addAttribute(maxAttrName(odsState.name), max);
  odsState.addAttribute(num_bitsAttrName(odsState.name), num_bits);
  odsState.addAttribute(narrow_rangeAttrName(odsState.name), narrow_range);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void FakeQuantWithMinMaxArgsOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type outputs, ::mlir::Value inputs, ::llvm::APFloat min, ::llvm::APFloat max, uint64_t num_bits, bool narrow_range) {
  odsState.addOperands(inputs);
  odsState.addAttribute(minAttrName(odsState.name), odsBuilder.getFloatAttr(odsBuilder.getF32Type(), min));
  odsState.addAttribute(maxAttrName(odsState.name), odsBuilder.getFloatAttr(odsBuilder.getF32Type(), max));
  odsState.addAttribute(num_bitsAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), num_bits));
  odsState.addAttribute(narrow_rangeAttrName(odsState.name), odsBuilder.getBoolAttr(narrow_range));
  odsState.addTypes(outputs);
}

void FakeQuantWithMinMaxArgsOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value inputs, ::llvm::APFloat min, ::llvm::APFloat max, uint64_t num_bits, bool narrow_range) {
  odsState.addOperands(inputs);
  odsState.addAttribute(minAttrName(odsState.name), odsBuilder.getFloatAttr(odsBuilder.getF32Type(), min));
  odsState.addAttribute(maxAttrName(odsState.name), odsBuilder.getFloatAttr(odsBuilder.getF32Type(), max));
  odsState.addAttribute(num_bitsAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), num_bits));
  odsState.addAttribute(narrow_rangeAttrName(odsState.name), odsBuilder.getBoolAttr(narrow_range));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void FakeQuantWithMinMaxArgsOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult FakeQuantWithMinMaxArgsOp::verify() {
  {
    auto tblgen_min = (*this)->getAttr(minAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops5(*this, tblgen_min, "min")))
      return ::mlir::failure();
  }
  {
    auto tblgen_max = (*this)->getAttr(maxAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops5(*this, tblgen_max, "max")))
      return ::mlir::failure();
  }
  {
    auto tblgen_num_bits = (*this)->getAttr(num_bitsAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_num_bits, "num_bits")))
      return ::mlir::failure();
  }
  {
    auto tblgen_narrow_range = (*this)->getAttr(narrow_rangeAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_narrow_range, "narrow_range")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return Verify(*this);
}

void FakeQuantWithMinMaxArgsOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::FakeQuantWithMinMaxArgsOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::FakeQuantWithMinMaxVarsGradientOp definitions
//===----------------------------------------------------------------------===//

FakeQuantWithMinMaxVarsGradientOpAdaptor::FakeQuantWithMinMaxVarsGradientOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

FakeQuantWithMinMaxVarsGradientOpAdaptor::FakeQuantWithMinMaxVarsGradientOpAdaptor(FakeQuantWithMinMaxVarsGradientOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange FakeQuantWithMinMaxVarsGradientOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> FakeQuantWithMinMaxVarsGradientOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange FakeQuantWithMinMaxVarsGradientOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value FakeQuantWithMinMaxVarsGradientOpAdaptor::gradients() {
  return *getODSOperands(0).begin();
}

::mlir::Value FakeQuantWithMinMaxVarsGradientOpAdaptor::inputs() {
  return *getODSOperands(1).begin();
}

::mlir::Value FakeQuantWithMinMaxVarsGradientOpAdaptor::min() {
  return *getODSOperands(2).begin();
}

::mlir::Value FakeQuantWithMinMaxVarsGradientOpAdaptor::max() {
  return *getODSOperands(3).begin();
}

::mlir::DictionaryAttr FakeQuantWithMinMaxVarsGradientOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::IntegerAttr FakeQuantWithMinMaxVarsGradientOpAdaptor::num_bits() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("num_bits").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), 8);
  return attr;
}

::mlir::BoolAttr FakeQuantWithMinMaxVarsGradientOpAdaptor::narrow_range() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("narrow_range").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(false);
  return attr;
}

::mlir::LogicalResult FakeQuantWithMinMaxVarsGradientOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_num_bits = odsAttrs.get("num_bits");
    if (tblgen_num_bits && !(((tblgen_num_bits.isa<::mlir::IntegerAttr>())) && ((tblgen_num_bits.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.FakeQuantWithMinMaxVarsGradient' op ""attribute 'num_bits' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_narrow_range = odsAttrs.get("narrow_range");
    if (tblgen_narrow_range && !((tblgen_narrow_range.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.FakeQuantWithMinMaxVarsGradient' op ""attribute 'narrow_range' failed to satisfy constraint: bool attribute");
  }
  return ::mlir::success();
}

void FakeQuantWithMinMaxVarsGradientOp::getAsmResultNames(::mlir::OpAsmSetValueNameFn setNameFn) {
  auto resultGroup0 = getODSResults(0);
  if (!llvm::empty(resultGroup0))
    setNameFn(*resultGroup0.begin(), "backprops_wrt_input");
  auto resultGroup1 = getODSResults(1);
  if (!llvm::empty(resultGroup1))
    setNameFn(*resultGroup1.begin(), "backprop_wrt_min");
  auto resultGroup2 = getODSResults(2);
  if (!llvm::empty(resultGroup2))
    setNameFn(*resultGroup2.begin(), "backprop_wrt_max");
}

std::pair<unsigned, unsigned> FakeQuantWithMinMaxVarsGradientOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range FakeQuantWithMinMaxVarsGradientOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value FakeQuantWithMinMaxVarsGradientOp::gradients() {
  return *getODSOperands(0).begin();
}

::mlir::Value FakeQuantWithMinMaxVarsGradientOp::inputs() {
  return *getODSOperands(1).begin();
}

::mlir::Value FakeQuantWithMinMaxVarsGradientOp::min() {
  return *getODSOperands(2).begin();
}

::mlir::Value FakeQuantWithMinMaxVarsGradientOp::max() {
  return *getODSOperands(3).begin();
}

::mlir::MutableOperandRange FakeQuantWithMinMaxVarsGradientOp::gradientsMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange FakeQuantWithMinMaxVarsGradientOp::inputsMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange FakeQuantWithMinMaxVarsGradientOp::minMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange FakeQuantWithMinMaxVarsGradientOp::maxMutable() {
  auto range = getODSOperandIndexAndLength(3);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> FakeQuantWithMinMaxVarsGradientOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range FakeQuantWithMinMaxVarsGradientOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value FakeQuantWithMinMaxVarsGradientOp::backprops_wrt_input() {
  return *getODSResults(0).begin();
}

::mlir::Value FakeQuantWithMinMaxVarsGradientOp::backprop_wrt_min() {
  return *getODSResults(1).begin();
}

::mlir::Value FakeQuantWithMinMaxVarsGradientOp::backprop_wrt_max() {
  return *getODSResults(2).begin();
}

::mlir::IntegerAttr FakeQuantWithMinMaxVarsGradientOp::num_bitsAttr() {
  return (*this)->getAttr(num_bitsAttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t FakeQuantWithMinMaxVarsGradientOp::num_bits() {
  auto attr = num_bitsAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), 8).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

::mlir::BoolAttr FakeQuantWithMinMaxVarsGradientOp::narrow_rangeAttr() {
  return (*this)->getAttr(narrow_rangeAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool FakeQuantWithMinMaxVarsGradientOp::narrow_range() {
  auto attr = narrow_rangeAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(false).getValue();
  return attr.getValue();
}

void FakeQuantWithMinMaxVarsGradientOp::num_bitsAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(num_bitsAttrName(), attr);
}

void FakeQuantWithMinMaxVarsGradientOp::narrow_rangeAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(narrow_rangeAttrName(), attr);
}

void FakeQuantWithMinMaxVarsGradientOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type backprops_wrt_input, ::mlir::Type backprop_wrt_min, ::mlir::Type backprop_wrt_max, ::mlir::Value gradients, ::mlir::Value inputs, ::mlir::Value min, ::mlir::Value max, ::mlir::IntegerAttr num_bits, ::mlir::BoolAttr narrow_range) {
  odsState.addOperands(gradients);
  odsState.addOperands(inputs);
  odsState.addOperands(min);
  odsState.addOperands(max);
  odsState.addAttribute(num_bitsAttrName(odsState.name), num_bits);
  odsState.addAttribute(narrow_rangeAttrName(odsState.name), narrow_range);
  odsState.addTypes(backprops_wrt_input);
  odsState.addTypes(backprop_wrt_min);
  odsState.addTypes(backprop_wrt_max);
}

void FakeQuantWithMinMaxVarsGradientOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value gradients, ::mlir::Value inputs, ::mlir::Value min, ::mlir::Value max, ::mlir::IntegerAttr num_bits, ::mlir::BoolAttr narrow_range) {
  odsState.addOperands(gradients);
  odsState.addOperands(inputs);
  odsState.addOperands(min);
  odsState.addOperands(max);
  odsState.addAttribute(num_bitsAttrName(odsState.name), num_bits);
  odsState.addAttribute(narrow_rangeAttrName(odsState.name), narrow_range);
  assert(resultTypes.size() == 3u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void FakeQuantWithMinMaxVarsGradientOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type backprops_wrt_input, ::mlir::Type backprop_wrt_min, ::mlir::Type backprop_wrt_max, ::mlir::Value gradients, ::mlir::Value inputs, ::mlir::Value min, ::mlir::Value max, uint64_t num_bits, bool narrow_range) {
  odsState.addOperands(gradients);
  odsState.addOperands(inputs);
  odsState.addOperands(min);
  odsState.addOperands(max);
  odsState.addAttribute(num_bitsAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), num_bits));
  odsState.addAttribute(narrow_rangeAttrName(odsState.name), odsBuilder.getBoolAttr(narrow_range));
  odsState.addTypes(backprops_wrt_input);
  odsState.addTypes(backprop_wrt_min);
  odsState.addTypes(backprop_wrt_max);
}

void FakeQuantWithMinMaxVarsGradientOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value gradients, ::mlir::Value inputs, ::mlir::Value min, ::mlir::Value max, uint64_t num_bits, bool narrow_range) {
  odsState.addOperands(gradients);
  odsState.addOperands(inputs);
  odsState.addOperands(min);
  odsState.addOperands(max);
  odsState.addAttribute(num_bitsAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), num_bits));
  odsState.addAttribute(narrow_rangeAttrName(odsState.name), odsBuilder.getBoolAttr(narrow_range));
  assert(resultTypes.size() == 3u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void FakeQuantWithMinMaxVarsGradientOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 4u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 3u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult FakeQuantWithMinMaxVarsGradientOp::verify() {
  {
    auto tblgen_num_bits = (*this)->getAttr(num_bitsAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_num_bits, "num_bits")))
      return ::mlir::failure();
  }
  {
    auto tblgen_narrow_range = (*this)->getAttr(narrow_rangeAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_narrow_range, "narrow_range")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup3 = getODSOperands(3);

    for (auto v : valueGroup3) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSResults(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSResults(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void FakeQuantWithMinMaxVarsGradientOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::FakeQuantWithMinMaxVarsGradientOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::FakeQuantWithMinMaxVarsOp definitions
//===----------------------------------------------------------------------===//

FakeQuantWithMinMaxVarsOpAdaptor::FakeQuantWithMinMaxVarsOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

FakeQuantWithMinMaxVarsOpAdaptor::FakeQuantWithMinMaxVarsOpAdaptor(FakeQuantWithMinMaxVarsOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange FakeQuantWithMinMaxVarsOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> FakeQuantWithMinMaxVarsOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange FakeQuantWithMinMaxVarsOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value FakeQuantWithMinMaxVarsOpAdaptor::inputs() {
  return *getODSOperands(0).begin();
}

::mlir::Value FakeQuantWithMinMaxVarsOpAdaptor::min() {
  return *getODSOperands(1).begin();
}

::mlir::Value FakeQuantWithMinMaxVarsOpAdaptor::max() {
  return *getODSOperands(2).begin();
}

::mlir::DictionaryAttr FakeQuantWithMinMaxVarsOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::IntegerAttr FakeQuantWithMinMaxVarsOpAdaptor::num_bits() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("num_bits").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), 8);
  return attr;
}

::mlir::BoolAttr FakeQuantWithMinMaxVarsOpAdaptor::narrow_range() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("narrow_range").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(false);
  return attr;
}

::mlir::LogicalResult FakeQuantWithMinMaxVarsOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_num_bits = odsAttrs.get("num_bits");
    if (tblgen_num_bits && !(((tblgen_num_bits.isa<::mlir::IntegerAttr>())) && ((tblgen_num_bits.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.FakeQuantWithMinMaxVars' op ""attribute 'num_bits' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_narrow_range = odsAttrs.get("narrow_range");
    if (tblgen_narrow_range && !((tblgen_narrow_range.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.FakeQuantWithMinMaxVars' op ""attribute 'narrow_range' failed to satisfy constraint: bool attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> FakeQuantWithMinMaxVarsOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range FakeQuantWithMinMaxVarsOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value FakeQuantWithMinMaxVarsOp::inputs() {
  return *getODSOperands(0).begin();
}

::mlir::Value FakeQuantWithMinMaxVarsOp::min() {
  return *getODSOperands(1).begin();
}

::mlir::Value FakeQuantWithMinMaxVarsOp::max() {
  return *getODSOperands(2).begin();
}

::mlir::MutableOperandRange FakeQuantWithMinMaxVarsOp::inputsMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange FakeQuantWithMinMaxVarsOp::minMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange FakeQuantWithMinMaxVarsOp::maxMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> FakeQuantWithMinMaxVarsOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range FakeQuantWithMinMaxVarsOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value FakeQuantWithMinMaxVarsOp::outputs() {
  return *getODSResults(0).begin();
}

::mlir::IntegerAttr FakeQuantWithMinMaxVarsOp::num_bitsAttr() {
  return (*this)->getAttr(num_bitsAttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t FakeQuantWithMinMaxVarsOp::num_bits() {
  auto attr = num_bitsAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), 8).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

::mlir::BoolAttr FakeQuantWithMinMaxVarsOp::narrow_rangeAttr() {
  return (*this)->getAttr(narrow_rangeAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool FakeQuantWithMinMaxVarsOp::narrow_range() {
  auto attr = narrow_rangeAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(false).getValue();
  return attr.getValue();
}

void FakeQuantWithMinMaxVarsOp::num_bitsAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(num_bitsAttrName(), attr);
}

void FakeQuantWithMinMaxVarsOp::narrow_rangeAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(narrow_rangeAttrName(), attr);
}

void FakeQuantWithMinMaxVarsOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type outputs, ::mlir::Value inputs, ::mlir::Value min, ::mlir::Value max, ::mlir::IntegerAttr num_bits, ::mlir::BoolAttr narrow_range) {
  odsState.addOperands(inputs);
  odsState.addOperands(min);
  odsState.addOperands(max);
  odsState.addAttribute(num_bitsAttrName(odsState.name), num_bits);
  odsState.addAttribute(narrow_rangeAttrName(odsState.name), narrow_range);
  odsState.addTypes(outputs);
}

void FakeQuantWithMinMaxVarsOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value inputs, ::mlir::Value min, ::mlir::Value max, ::mlir::IntegerAttr num_bits, ::mlir::BoolAttr narrow_range) {
  odsState.addOperands(inputs);
  odsState.addOperands(min);
  odsState.addOperands(max);
  odsState.addAttribute(num_bitsAttrName(odsState.name), num_bits);
  odsState.addAttribute(narrow_rangeAttrName(odsState.name), narrow_range);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void FakeQuantWithMinMaxVarsOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type outputs, ::mlir::Value inputs, ::mlir::Value min, ::mlir::Value max, uint64_t num_bits, bool narrow_range) {
  odsState.addOperands(inputs);
  odsState.addOperands(min);
  odsState.addOperands(max);
  odsState.addAttribute(num_bitsAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), num_bits));
  odsState.addAttribute(narrow_rangeAttrName(odsState.name), odsBuilder.getBoolAttr(narrow_range));
  odsState.addTypes(outputs);
}

void FakeQuantWithMinMaxVarsOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value inputs, ::mlir::Value min, ::mlir::Value max, uint64_t num_bits, bool narrow_range) {
  odsState.addOperands(inputs);
  odsState.addOperands(min);
  odsState.addOperands(max);
  odsState.addAttribute(num_bitsAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), num_bits));
  odsState.addAttribute(narrow_rangeAttrName(odsState.name), odsBuilder.getBoolAttr(narrow_range));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void FakeQuantWithMinMaxVarsOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 3u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult FakeQuantWithMinMaxVarsOp::verify() {
  {
    auto tblgen_num_bits = (*this)->getAttr(num_bitsAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_num_bits, "num_bits")))
      return ::mlir::failure();
  }
  {
    auto tblgen_narrow_range = (*this)->getAttr(narrow_rangeAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_narrow_range, "narrow_range")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return Verify(*this);
}

void FakeQuantWithMinMaxVarsOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::FakeQuantWithMinMaxVarsOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::FakeQuantWithMinMaxVarsPerChannelGradientOp definitions
//===----------------------------------------------------------------------===//

FakeQuantWithMinMaxVarsPerChannelGradientOpAdaptor::FakeQuantWithMinMaxVarsPerChannelGradientOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

FakeQuantWithMinMaxVarsPerChannelGradientOpAdaptor::FakeQuantWithMinMaxVarsPerChannelGradientOpAdaptor(FakeQuantWithMinMaxVarsPerChannelGradientOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange FakeQuantWithMinMaxVarsPerChannelGradientOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> FakeQuantWithMinMaxVarsPerChannelGradientOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange FakeQuantWithMinMaxVarsPerChannelGradientOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value FakeQuantWithMinMaxVarsPerChannelGradientOpAdaptor::gradients() {
  return *getODSOperands(0).begin();
}

::mlir::Value FakeQuantWithMinMaxVarsPerChannelGradientOpAdaptor::inputs() {
  return *getODSOperands(1).begin();
}

::mlir::Value FakeQuantWithMinMaxVarsPerChannelGradientOpAdaptor::min() {
  return *getODSOperands(2).begin();
}

::mlir::Value FakeQuantWithMinMaxVarsPerChannelGradientOpAdaptor::max() {
  return *getODSOperands(3).begin();
}

::mlir::DictionaryAttr FakeQuantWithMinMaxVarsPerChannelGradientOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::IntegerAttr FakeQuantWithMinMaxVarsPerChannelGradientOpAdaptor::num_bits() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("num_bits").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), 8);
  return attr;
}

::mlir::BoolAttr FakeQuantWithMinMaxVarsPerChannelGradientOpAdaptor::narrow_range() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("narrow_range").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(false);
  return attr;
}

::mlir::LogicalResult FakeQuantWithMinMaxVarsPerChannelGradientOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_num_bits = odsAttrs.get("num_bits");
    if (tblgen_num_bits && !(((tblgen_num_bits.isa<::mlir::IntegerAttr>())) && ((tblgen_num_bits.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.FakeQuantWithMinMaxVarsPerChannelGradient' op ""attribute 'num_bits' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_narrow_range = odsAttrs.get("narrow_range");
    if (tblgen_narrow_range && !((tblgen_narrow_range.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.FakeQuantWithMinMaxVarsPerChannelGradient' op ""attribute 'narrow_range' failed to satisfy constraint: bool attribute");
  }
  return ::mlir::success();
}

void FakeQuantWithMinMaxVarsPerChannelGradientOp::getAsmResultNames(::mlir::OpAsmSetValueNameFn setNameFn) {
  auto resultGroup0 = getODSResults(0);
  if (!llvm::empty(resultGroup0))
    setNameFn(*resultGroup0.begin(), "backprops_wrt_input");
  auto resultGroup1 = getODSResults(1);
  if (!llvm::empty(resultGroup1))
    setNameFn(*resultGroup1.begin(), "backprop_wrt_min");
  auto resultGroup2 = getODSResults(2);
  if (!llvm::empty(resultGroup2))
    setNameFn(*resultGroup2.begin(), "backprop_wrt_max");
}

std::pair<unsigned, unsigned> FakeQuantWithMinMaxVarsPerChannelGradientOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range FakeQuantWithMinMaxVarsPerChannelGradientOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value FakeQuantWithMinMaxVarsPerChannelGradientOp::gradients() {
  return *getODSOperands(0).begin();
}

::mlir::Value FakeQuantWithMinMaxVarsPerChannelGradientOp::inputs() {
  return *getODSOperands(1).begin();
}

::mlir::Value FakeQuantWithMinMaxVarsPerChannelGradientOp::min() {
  return *getODSOperands(2).begin();
}

::mlir::Value FakeQuantWithMinMaxVarsPerChannelGradientOp::max() {
  return *getODSOperands(3).begin();
}

::mlir::MutableOperandRange FakeQuantWithMinMaxVarsPerChannelGradientOp::gradientsMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange FakeQuantWithMinMaxVarsPerChannelGradientOp::inputsMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange FakeQuantWithMinMaxVarsPerChannelGradientOp::minMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange FakeQuantWithMinMaxVarsPerChannelGradientOp::maxMutable() {
  auto range = getODSOperandIndexAndLength(3);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> FakeQuantWithMinMaxVarsPerChannelGradientOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range FakeQuantWithMinMaxVarsPerChannelGradientOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value FakeQuantWithMinMaxVarsPerChannelGradientOp::backprops_wrt_input() {
  return *getODSResults(0).begin();
}

::mlir::Value FakeQuantWithMinMaxVarsPerChannelGradientOp::backprop_wrt_min() {
  return *getODSResults(1).begin();
}

::mlir::Value FakeQuantWithMinMaxVarsPerChannelGradientOp::backprop_wrt_max() {
  return *getODSResults(2).begin();
}

::mlir::IntegerAttr FakeQuantWithMinMaxVarsPerChannelGradientOp::num_bitsAttr() {
  return (*this)->getAttr(num_bitsAttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t FakeQuantWithMinMaxVarsPerChannelGradientOp::num_bits() {
  auto attr = num_bitsAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), 8).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

::mlir::BoolAttr FakeQuantWithMinMaxVarsPerChannelGradientOp::narrow_rangeAttr() {
  return (*this)->getAttr(narrow_rangeAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool FakeQuantWithMinMaxVarsPerChannelGradientOp::narrow_range() {
  auto attr = narrow_rangeAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(false).getValue();
  return attr.getValue();
}

void FakeQuantWithMinMaxVarsPerChannelGradientOp::num_bitsAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(num_bitsAttrName(), attr);
}

void FakeQuantWithMinMaxVarsPerChannelGradientOp::narrow_rangeAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(narrow_rangeAttrName(), attr);
}

void FakeQuantWithMinMaxVarsPerChannelGradientOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type backprops_wrt_input, ::mlir::Type backprop_wrt_min, ::mlir::Type backprop_wrt_max, ::mlir::Value gradients, ::mlir::Value inputs, ::mlir::Value min, ::mlir::Value max, ::mlir::IntegerAttr num_bits, ::mlir::BoolAttr narrow_range) {
  odsState.addOperands(gradients);
  odsState.addOperands(inputs);
  odsState.addOperands(min);
  odsState.addOperands(max);
  odsState.addAttribute(num_bitsAttrName(odsState.name), num_bits);
  odsState.addAttribute(narrow_rangeAttrName(odsState.name), narrow_range);
  odsState.addTypes(backprops_wrt_input);
  odsState.addTypes(backprop_wrt_min);
  odsState.addTypes(backprop_wrt_max);
}

void FakeQuantWithMinMaxVarsPerChannelGradientOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value gradients, ::mlir::Value inputs, ::mlir::Value min, ::mlir::Value max, ::mlir::IntegerAttr num_bits, ::mlir::BoolAttr narrow_range) {
  odsState.addOperands(gradients);
  odsState.addOperands(inputs);
  odsState.addOperands(min);
  odsState.addOperands(max);
  odsState.addAttribute(num_bitsAttrName(odsState.name), num_bits);
  odsState.addAttribute(narrow_rangeAttrName(odsState.name), narrow_range);
  assert(resultTypes.size() == 3u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void FakeQuantWithMinMaxVarsPerChannelGradientOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type backprops_wrt_input, ::mlir::Type backprop_wrt_min, ::mlir::Type backprop_wrt_max, ::mlir::Value gradients, ::mlir::Value inputs, ::mlir::Value min, ::mlir::Value max, uint64_t num_bits, bool narrow_range) {
  odsState.addOperands(gradients);
  odsState.addOperands(inputs);
  odsState.addOperands(min);
  odsState.addOperands(max);
  odsState.addAttribute(num_bitsAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), num_bits));
  odsState.addAttribute(narrow_rangeAttrName(odsState.name), odsBuilder.getBoolAttr(narrow_range));
  odsState.addTypes(backprops_wrt_input);
  odsState.addTypes(backprop_wrt_min);
  odsState.addTypes(backprop_wrt_max);
}

void FakeQuantWithMinMaxVarsPerChannelGradientOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value gradients, ::mlir::Value inputs, ::mlir::Value min, ::mlir::Value max, uint64_t num_bits, bool narrow_range) {
  odsState.addOperands(gradients);
  odsState.addOperands(inputs);
  odsState.addOperands(min);
  odsState.addOperands(max);
  odsState.addAttribute(num_bitsAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), num_bits));
  odsState.addAttribute(narrow_rangeAttrName(odsState.name), odsBuilder.getBoolAttr(narrow_range));
  assert(resultTypes.size() == 3u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void FakeQuantWithMinMaxVarsPerChannelGradientOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 4u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 3u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult FakeQuantWithMinMaxVarsPerChannelGradientOp::verify() {
  {
    auto tblgen_num_bits = (*this)->getAttr(num_bitsAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_num_bits, "num_bits")))
      return ::mlir::failure();
  }
  {
    auto tblgen_narrow_range = (*this)->getAttr(narrow_rangeAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_narrow_range, "narrow_range")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup3 = getODSOperands(3);

    for (auto v : valueGroup3) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSResults(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSResults(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void FakeQuantWithMinMaxVarsPerChannelGradientOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::FakeQuantWithMinMaxVarsPerChannelGradientOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::FakeQuantWithMinMaxVarsPerChannelOp definitions
//===----------------------------------------------------------------------===//

FakeQuantWithMinMaxVarsPerChannelOpAdaptor::FakeQuantWithMinMaxVarsPerChannelOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

FakeQuantWithMinMaxVarsPerChannelOpAdaptor::FakeQuantWithMinMaxVarsPerChannelOpAdaptor(FakeQuantWithMinMaxVarsPerChannelOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange FakeQuantWithMinMaxVarsPerChannelOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> FakeQuantWithMinMaxVarsPerChannelOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange FakeQuantWithMinMaxVarsPerChannelOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value FakeQuantWithMinMaxVarsPerChannelOpAdaptor::inputs() {
  return *getODSOperands(0).begin();
}

::mlir::Value FakeQuantWithMinMaxVarsPerChannelOpAdaptor::min() {
  return *getODSOperands(1).begin();
}

::mlir::Value FakeQuantWithMinMaxVarsPerChannelOpAdaptor::max() {
  return *getODSOperands(2).begin();
}

::mlir::DictionaryAttr FakeQuantWithMinMaxVarsPerChannelOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::IntegerAttr FakeQuantWithMinMaxVarsPerChannelOpAdaptor::num_bits() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("num_bits").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), 8);
  return attr;
}

::mlir::BoolAttr FakeQuantWithMinMaxVarsPerChannelOpAdaptor::narrow_range() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("narrow_range").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(false);
  return attr;
}

::mlir::LogicalResult FakeQuantWithMinMaxVarsPerChannelOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_num_bits = odsAttrs.get("num_bits");
    if (tblgen_num_bits && !(((tblgen_num_bits.isa<::mlir::IntegerAttr>())) && ((tblgen_num_bits.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.FakeQuantWithMinMaxVarsPerChannel' op ""attribute 'num_bits' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_narrow_range = odsAttrs.get("narrow_range");
    if (tblgen_narrow_range && !((tblgen_narrow_range.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.FakeQuantWithMinMaxVarsPerChannel' op ""attribute 'narrow_range' failed to satisfy constraint: bool attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> FakeQuantWithMinMaxVarsPerChannelOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range FakeQuantWithMinMaxVarsPerChannelOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value FakeQuantWithMinMaxVarsPerChannelOp::inputs() {
  return *getODSOperands(0).begin();
}

::mlir::Value FakeQuantWithMinMaxVarsPerChannelOp::min() {
  return *getODSOperands(1).begin();
}

::mlir::Value FakeQuantWithMinMaxVarsPerChannelOp::max() {
  return *getODSOperands(2).begin();
}

::mlir::MutableOperandRange FakeQuantWithMinMaxVarsPerChannelOp::inputsMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange FakeQuantWithMinMaxVarsPerChannelOp::minMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange FakeQuantWithMinMaxVarsPerChannelOp::maxMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> FakeQuantWithMinMaxVarsPerChannelOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range FakeQuantWithMinMaxVarsPerChannelOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value FakeQuantWithMinMaxVarsPerChannelOp::outputs() {
  return *getODSResults(0).begin();
}

::mlir::IntegerAttr FakeQuantWithMinMaxVarsPerChannelOp::num_bitsAttr() {
  return (*this)->getAttr(num_bitsAttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t FakeQuantWithMinMaxVarsPerChannelOp::num_bits() {
  auto attr = num_bitsAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), 8).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

::mlir::BoolAttr FakeQuantWithMinMaxVarsPerChannelOp::narrow_rangeAttr() {
  return (*this)->getAttr(narrow_rangeAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool FakeQuantWithMinMaxVarsPerChannelOp::narrow_range() {
  auto attr = narrow_rangeAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(false).getValue();
  return attr.getValue();
}

void FakeQuantWithMinMaxVarsPerChannelOp::num_bitsAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(num_bitsAttrName(), attr);
}

void FakeQuantWithMinMaxVarsPerChannelOp::narrow_rangeAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(narrow_rangeAttrName(), attr);
}

void FakeQuantWithMinMaxVarsPerChannelOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type outputs, ::mlir::Value inputs, ::mlir::Value min, ::mlir::Value max, ::mlir::IntegerAttr num_bits, ::mlir::BoolAttr narrow_range) {
  odsState.addOperands(inputs);
  odsState.addOperands(min);
  odsState.addOperands(max);
  odsState.addAttribute(num_bitsAttrName(odsState.name), num_bits);
  odsState.addAttribute(narrow_rangeAttrName(odsState.name), narrow_range);
  odsState.addTypes(outputs);
}

void FakeQuantWithMinMaxVarsPerChannelOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value inputs, ::mlir::Value min, ::mlir::Value max, ::mlir::IntegerAttr num_bits, ::mlir::BoolAttr narrow_range) {
  odsState.addOperands(inputs);
  odsState.addOperands(min);
  odsState.addOperands(max);
  odsState.addAttribute(num_bitsAttrName(odsState.name), num_bits);
  odsState.addAttribute(narrow_rangeAttrName(odsState.name), narrow_range);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void FakeQuantWithMinMaxVarsPerChannelOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type outputs, ::mlir::Value inputs, ::mlir::Value min, ::mlir::Value max, uint64_t num_bits, bool narrow_range) {
  odsState.addOperands(inputs);
  odsState.addOperands(min);
  odsState.addOperands(max);
  odsState.addAttribute(num_bitsAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), num_bits));
  odsState.addAttribute(narrow_rangeAttrName(odsState.name), odsBuilder.getBoolAttr(narrow_range));
  odsState.addTypes(outputs);
}

void FakeQuantWithMinMaxVarsPerChannelOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value inputs, ::mlir::Value min, ::mlir::Value max, uint64_t num_bits, bool narrow_range) {
  odsState.addOperands(inputs);
  odsState.addOperands(min);
  odsState.addOperands(max);
  odsState.addAttribute(num_bitsAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), num_bits));
  odsState.addAttribute(narrow_rangeAttrName(odsState.name), odsBuilder.getBoolAttr(narrow_range));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void FakeQuantWithMinMaxVarsPerChannelOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 3u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult FakeQuantWithMinMaxVarsPerChannelOp::verify() {
  {
    auto tblgen_num_bits = (*this)->getAttr(num_bitsAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_num_bits, "num_bits")))
      return ::mlir::failure();
  }
  {
    auto tblgen_narrow_range = (*this)->getAttr(narrow_rangeAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_narrow_range, "narrow_range")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return Verify(*this);
}

void FakeQuantWithMinMaxVarsPerChannelOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::FakeQuantWithMinMaxVarsPerChannelOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::FillOp definitions
//===----------------------------------------------------------------------===//

FillOpAdaptor::FillOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

FillOpAdaptor::FillOpAdaptor(FillOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange FillOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> FillOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange FillOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value FillOpAdaptor::dims() {
  return *getODSOperands(0).begin();
}

::mlir::Value FillOpAdaptor::value() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr FillOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult FillOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> FillOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range FillOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value FillOp::dims() {
  return *getODSOperands(0).begin();
}

::mlir::Value FillOp::value() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange FillOp::dimsMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange FillOp::valueMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> FillOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range FillOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value FillOp::output() {
  return *getODSResults(0).begin();
}

::mlir::Type FillOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(1).begin());
}

::mlir::Type FillOp::index_type() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool FillOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
  if (name == "index_type") return true;
 return false;
}

::mlir::DictionaryAttr FillOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())},
    {index_typeAttrName(),
::mlir::TypeAttr::get(index_type())}});
}

void FillOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value dims, ::mlir::Value value) {
  odsState.addOperands(dims);
  odsState.addOperands(value);
  odsState.addTypes(output);
}

void FillOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value dims, ::mlir::Value value) {
  odsState.addOperands(dims);
  odsState.addOperands(value);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void FillOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult FillOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return Verify(*this);
}

void FillOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::FillOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::FinalizeDatasetOp definitions
//===----------------------------------------------------------------------===//

FinalizeDatasetOpAdaptor::FinalizeDatasetOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

FinalizeDatasetOpAdaptor::FinalizeDatasetOpAdaptor(FinalizeDatasetOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange FinalizeDatasetOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> FinalizeDatasetOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange FinalizeDatasetOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value FinalizeDatasetOpAdaptor::input_dataset() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr FinalizeDatasetOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::BoolAttr FinalizeDatasetOpAdaptor::has_captured_ref() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("has_captured_ref").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(false);
  return attr;
}

::mlir::ArrayAttr FinalizeDatasetOpAdaptor::output_types() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("output_types").cast<::mlir::ArrayAttr>();
  return attr;
}

::mlir::ArrayAttr FinalizeDatasetOpAdaptor::output_shapes() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("output_shapes").cast<::mlir::ArrayAttr>();
  return attr;
}

::mlir::LogicalResult FinalizeDatasetOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_has_captured_ref = odsAttrs.get("has_captured_ref");
    if (tblgen_has_captured_ref && !((tblgen_has_captured_ref.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.FinalizeDataset' op ""attribute 'has_captured_ref' failed to satisfy constraint: bool attribute");
  }
  {
    auto tblgen_output_types = odsAttrs.get("output_types");
    if (!tblgen_output_types)
      return emitError(loc, "'tf.FinalizeDataset' op ""requires attribute 'output_types'");

    if (tblgen_output_types && !((((tblgen_output_types.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_output_types.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return ((attr.isa<::mlir::TypeAttr>())) && ((attr.cast<::mlir::TypeAttr>().getValue().isa<::mlir::Type>())); }))) && ((tblgen_output_types.cast<::mlir::ArrayAttr>().size() >= 1))))
      return emitError(loc, "'tf.FinalizeDataset' op ""attribute 'output_types' failed to satisfy constraint: type array attribute with at least 1 elements");
  }
  {
    auto tblgen_output_shapes = odsAttrs.get("output_shapes");
    if (!tblgen_output_shapes)
      return emitError(loc, "'tf.FinalizeDataset' op ""requires attribute 'output_shapes'");

    if (tblgen_output_shapes && !((((tblgen_output_shapes.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_output_shapes.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return (attr.isa<mlir::TF::ShapeAttr>()); }))) && ((tblgen_output_shapes.cast<::mlir::ArrayAttr>().size() >= 1))))
      return emitError(loc, "'tf.FinalizeDataset' op ""attribute 'output_shapes' failed to satisfy constraint: tensorflow shape attribute array with at least 1 elements");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> FinalizeDatasetOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range FinalizeDatasetOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value FinalizeDatasetOp::input_dataset() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange FinalizeDatasetOp::input_datasetMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> FinalizeDatasetOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range FinalizeDatasetOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value FinalizeDatasetOp::handle() {
  return *getODSResults(0).begin();
}

::mlir::BoolAttr FinalizeDatasetOp::has_captured_refAttr() {
  return (*this)->getAttr(has_captured_refAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool FinalizeDatasetOp::has_captured_ref() {
  auto attr = has_captured_refAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(false).getValue();
  return attr.getValue();
}

::mlir::ArrayAttr FinalizeDatasetOp::output_typesAttr() {
  return (*this)->getAttr(output_typesAttrName()).cast<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr FinalizeDatasetOp::output_types() {
  auto attr = output_typesAttr();
  return attr;
}

::mlir::ArrayAttr FinalizeDatasetOp::output_shapesAttr() {
  return (*this)->getAttr(output_shapesAttrName()).cast<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr FinalizeDatasetOp::output_shapes() {
  auto attr = output_shapesAttr();
  return attr;
}

void FinalizeDatasetOp::has_captured_refAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(has_captured_refAttrName(), attr);
}

void FinalizeDatasetOp::output_typesAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(output_typesAttrName(), attr);
}

void FinalizeDatasetOp::output_shapesAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(output_shapesAttrName(), attr);
}

void FinalizeDatasetOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type handle, ::mlir::Value input_dataset, ::mlir::BoolAttr has_captured_ref, ::mlir::ArrayAttr output_types, ::mlir::ArrayAttr output_shapes) {
  odsState.addOperands(input_dataset);
  odsState.addAttribute(has_captured_refAttrName(odsState.name), has_captured_ref);
  odsState.addAttribute(output_typesAttrName(odsState.name), output_types);
  odsState.addAttribute(output_shapesAttrName(odsState.name), output_shapes);
  odsState.addTypes(handle);
}

void FinalizeDatasetOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input_dataset, ::mlir::BoolAttr has_captured_ref, ::mlir::ArrayAttr output_types, ::mlir::ArrayAttr output_shapes) {
  odsState.addOperands(input_dataset);
  odsState.addAttribute(has_captured_refAttrName(odsState.name), has_captured_ref);
  odsState.addAttribute(output_typesAttrName(odsState.name), output_types);
  odsState.addAttribute(output_shapesAttrName(odsState.name), output_shapes);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void FinalizeDatasetOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type handle, ::mlir::Value input_dataset, bool has_captured_ref, ::mlir::ArrayAttr output_types, ::mlir::ArrayAttr output_shapes) {
  odsState.addOperands(input_dataset);
  odsState.addAttribute(has_captured_refAttrName(odsState.name), odsBuilder.getBoolAttr(has_captured_ref));
  odsState.addAttribute(output_typesAttrName(odsState.name), output_types);
  odsState.addAttribute(output_shapesAttrName(odsState.name), output_shapes);
  odsState.addTypes(handle);
}

void FinalizeDatasetOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input_dataset, bool has_captured_ref, ::mlir::ArrayAttr output_types, ::mlir::ArrayAttr output_shapes) {
  odsState.addOperands(input_dataset);
  odsState.addAttribute(has_captured_refAttrName(odsState.name), odsBuilder.getBoolAttr(has_captured_ref));
  odsState.addAttribute(output_typesAttrName(odsState.name), output_types);
  odsState.addAttribute(output_shapesAttrName(odsState.name), output_shapes);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void FinalizeDatasetOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult FinalizeDatasetOp::verify() {
  {
    auto tblgen_has_captured_ref = (*this)->getAttr(has_captured_refAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_has_captured_ref, "has_captured_ref")))
      return ::mlir::failure();
  }
  {
    auto tblgen_output_types = (*this)->getAttr(output_typesAttrName());
    if (!tblgen_output_types)
      return emitOpError("requires attribute 'output_types'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops2(*this, tblgen_output_types, "output_types")))
      return ::mlir::failure();
  }
  {
    auto tblgen_output_shapes = (*this)->getAttr(output_shapesAttrName());
    if (!tblgen_output_shapes)
      return emitOpError("requires attribute 'output_shapes'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops3(*this, tblgen_output_shapes, "output_shapes")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops15(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops15(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void FinalizeDatasetOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::FinalizeDatasetOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::FlatMapDatasetOp definitions
//===----------------------------------------------------------------------===//

FlatMapDatasetOpAdaptor::FlatMapDatasetOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

FlatMapDatasetOpAdaptor::FlatMapDatasetOpAdaptor(FlatMapDatasetOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange FlatMapDatasetOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> FlatMapDatasetOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  bool isVariadic[] = {false, true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (odsOperands.size() - 1) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::ValueRange FlatMapDatasetOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value FlatMapDatasetOpAdaptor::input_dataset() {
  return *getODSOperands(0).begin();
}

::mlir::ValueRange FlatMapDatasetOpAdaptor::other_arguments() {
  return getODSOperands(1);
}

::mlir::DictionaryAttr FlatMapDatasetOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::SymbolRefAttr FlatMapDatasetOpAdaptor::f() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::SymbolRefAttr attr = odsAttrs.get("f").cast<::mlir::SymbolRefAttr>();
  return attr;
}

::mlir::ArrayAttr FlatMapDatasetOpAdaptor::output_types() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("output_types").cast<::mlir::ArrayAttr>();
  return attr;
}

::mlir::ArrayAttr FlatMapDatasetOpAdaptor::output_shapes() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("output_shapes").cast<::mlir::ArrayAttr>();
  return attr;
}

::mlir::StringAttr FlatMapDatasetOpAdaptor::metadata() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("metadata").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("");
  return attr;
}

::mlir::LogicalResult FlatMapDatasetOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_f = odsAttrs.get("f");
    if (!tblgen_f)
      return emitError(loc, "'tf.FlatMapDataset' op ""requires attribute 'f'");

    if (tblgen_f && !((tblgen_f.isa<::mlir::SymbolRefAttr>())))
      return emitError(loc, "'tf.FlatMapDataset' op ""attribute 'f' failed to satisfy constraint: symbol reference attribute");
  }
  {
    auto tblgen_output_types = odsAttrs.get("output_types");
    if (!tblgen_output_types)
      return emitError(loc, "'tf.FlatMapDataset' op ""requires attribute 'output_types'");

    if (tblgen_output_types && !((((tblgen_output_types.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_output_types.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return ((attr.isa<::mlir::TypeAttr>())) && ((attr.cast<::mlir::TypeAttr>().getValue().isa<::mlir::Type>())); }))) && ((tblgen_output_types.cast<::mlir::ArrayAttr>().size() >= 1))))
      return emitError(loc, "'tf.FlatMapDataset' op ""attribute 'output_types' failed to satisfy constraint: type array attribute with at least 1 elements");
  }
  {
    auto tblgen_output_shapes = odsAttrs.get("output_shapes");
    if (!tblgen_output_shapes)
      return emitError(loc, "'tf.FlatMapDataset' op ""requires attribute 'output_shapes'");

    if (tblgen_output_shapes && !((((tblgen_output_shapes.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_output_shapes.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return (attr.isa<mlir::TF::ShapeAttr>()); }))) && ((tblgen_output_shapes.cast<::mlir::ArrayAttr>().size() >= 1))))
      return emitError(loc, "'tf.FlatMapDataset' op ""attribute 'output_shapes' failed to satisfy constraint: tensorflow shape attribute array with at least 1 elements");
  }
  {
    auto tblgen_metadata = odsAttrs.get("metadata");
    if (tblgen_metadata && !((tblgen_metadata.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.FlatMapDataset' op ""attribute 'metadata' failed to satisfy constraint: string attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> FlatMapDatasetOp::getODSOperandIndexAndLength(unsigned index) {
  bool isVariadic[] = {false, true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (getOperation()->getNumOperands() - 1) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::Operation::operand_range FlatMapDatasetOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value FlatMapDatasetOp::input_dataset() {
  return *getODSOperands(0).begin();
}

::mlir::Operation::operand_range FlatMapDatasetOp::other_arguments() {
  return getODSOperands(1);
}

::mlir::MutableOperandRange FlatMapDatasetOp::input_datasetMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange FlatMapDatasetOp::other_argumentsMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> FlatMapDatasetOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range FlatMapDatasetOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value FlatMapDatasetOp::handle() {
  return *getODSResults(0).begin();
}

::mlir::SymbolRefAttr FlatMapDatasetOp::fAttr() {
  return (*this)->getAttr(fAttrName()).cast<::mlir::SymbolRefAttr>();
}

::mlir::SymbolRefAttr FlatMapDatasetOp::f() {
  auto attr = fAttr();
  return attr;
}

::mlir::ArrayAttr FlatMapDatasetOp::output_typesAttr() {
  return (*this)->getAttr(output_typesAttrName()).cast<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr FlatMapDatasetOp::output_types() {
  auto attr = output_typesAttr();
  return attr;
}

::mlir::ArrayAttr FlatMapDatasetOp::output_shapesAttr() {
  return (*this)->getAttr(output_shapesAttrName()).cast<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr FlatMapDatasetOp::output_shapes() {
  auto attr = output_shapesAttr();
  return attr;
}

::mlir::StringAttr FlatMapDatasetOp::metadataAttr() {
  return (*this)->getAttr(metadataAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef FlatMapDatasetOp::metadata() {
  auto attr = metadataAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("").getValue();
  return attr.getValue();
}

mlir::OperandElementTypeRange FlatMapDatasetOp::Targuments() {
  auto values = getODSOperands(1);
return {mlir::OperandElementTypeIterator(values.begin()), mlir::OperandElementTypeIterator(values.end())};
}

bool FlatMapDatasetOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "Targuments") return true;
 return false;
}

::mlir::DictionaryAttr FlatMapDatasetOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TargumentsAttrName(),
ArrayAttr::get(ctx, 
    [&]() {
      llvm::SmallVector<Attribute, 4> ret;
      for (auto t : Targuments())
        ret.push_back(TypeAttr::get(t));
      return ret;
    }())}});
}

void FlatMapDatasetOp::fAttr(::mlir::SymbolRefAttr attr) {
  (*this)->setAttr(fAttrName(), attr);
}

void FlatMapDatasetOp::output_typesAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(output_typesAttrName(), attr);
}

void FlatMapDatasetOp::output_shapesAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(output_shapesAttrName(), attr);
}

void FlatMapDatasetOp::metadataAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(metadataAttrName(), attr);
}

void FlatMapDatasetOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type handle, ::mlir::Value input_dataset, ::mlir::ValueRange other_arguments, ::mlir::SymbolRefAttr f, ::mlir::ArrayAttr output_types, ::mlir::ArrayAttr output_shapes, ::mlir::StringAttr metadata) {
  odsState.addOperands(input_dataset);
  odsState.addOperands(other_arguments);
  odsState.addAttribute(fAttrName(odsState.name), f);
  odsState.addAttribute(output_typesAttrName(odsState.name), output_types);
  odsState.addAttribute(output_shapesAttrName(odsState.name), output_shapes);
  odsState.addAttribute(metadataAttrName(odsState.name), metadata);
  odsState.addTypes(handle);
}

void FlatMapDatasetOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input_dataset, ::mlir::ValueRange other_arguments, ::mlir::SymbolRefAttr f, ::mlir::ArrayAttr output_types, ::mlir::ArrayAttr output_shapes, ::mlir::StringAttr metadata) {
  odsState.addOperands(input_dataset);
  odsState.addOperands(other_arguments);
  odsState.addAttribute(fAttrName(odsState.name), f);
  odsState.addAttribute(output_typesAttrName(odsState.name), output_types);
  odsState.addAttribute(output_shapesAttrName(odsState.name), output_shapes);
  odsState.addAttribute(metadataAttrName(odsState.name), metadata);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void FlatMapDatasetOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type handle, ::mlir::Value input_dataset, ::mlir::ValueRange other_arguments, ::mlir::SymbolRefAttr f, ::mlir::ArrayAttr output_types, ::mlir::ArrayAttr output_shapes, ::llvm::StringRef metadata) {
  odsState.addOperands(input_dataset);
  odsState.addOperands(other_arguments);
  odsState.addAttribute(fAttrName(odsState.name), f);
  odsState.addAttribute(output_typesAttrName(odsState.name), output_types);
  odsState.addAttribute(output_shapesAttrName(odsState.name), output_shapes);
  odsState.addAttribute(metadataAttrName(odsState.name), odsBuilder.getStringAttr(metadata));
  odsState.addTypes(handle);
}

void FlatMapDatasetOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input_dataset, ::mlir::ValueRange other_arguments, ::mlir::SymbolRefAttr f, ::mlir::ArrayAttr output_types, ::mlir::ArrayAttr output_shapes, ::llvm::StringRef metadata) {
  odsState.addOperands(input_dataset);
  odsState.addOperands(other_arguments);
  odsState.addAttribute(fAttrName(odsState.name), f);
  odsState.addAttribute(output_typesAttrName(odsState.name), output_types);
  odsState.addAttribute(output_shapesAttrName(odsState.name), output_shapes);
  odsState.addAttribute(metadataAttrName(odsState.name), odsBuilder.getStringAttr(metadata));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void FlatMapDatasetOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() >= 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult FlatMapDatasetOp::verify() {
  {
    auto tblgen_f = (*this)->getAttr(fAttrName());
    if (!tblgen_f)
      return emitOpError("requires attribute 'f'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops12(*this, tblgen_f, "f")))
      return ::mlir::failure();
  }
  {
    auto tblgen_output_types = (*this)->getAttr(output_typesAttrName());
    if (!tblgen_output_types)
      return emitOpError("requires attribute 'output_types'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops2(*this, tblgen_output_types, "output_types")))
      return ::mlir::failure();
  }
  {
    auto tblgen_output_shapes = (*this)->getAttr(output_shapesAttrName());
    if (!tblgen_output_shapes)
      return emitOpError("requires attribute 'output_shapes'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops3(*this, tblgen_output_shapes, "output_shapes")))
      return ::mlir::failure();
  }
  {
    auto tblgen_metadata = (*this)->getAttr(metadataAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_metadata, "metadata")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops15(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops15(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void FlatMapDatasetOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::FlatMapDatasetOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::FloorDivOp definitions
//===----------------------------------------------------------------------===//

FloorDivOpAdaptor::FloorDivOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

FloorDivOpAdaptor::FloorDivOpAdaptor(FloorDivOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange FloorDivOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> FloorDivOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange FloorDivOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value FloorDivOpAdaptor::x() {
  return *getODSOperands(0).begin();
}

::mlir::Value FloorDivOpAdaptor::y() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr FloorDivOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult FloorDivOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> FloorDivOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range FloorDivOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value FloorDivOp::x() {
  return *getODSOperands(0).begin();
}

::mlir::Value FloorDivOp::y() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange FloorDivOp::xMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange FloorDivOp::yMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> FloorDivOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range FloorDivOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value FloorDivOp::z() {
  return *getODSResults(0).begin();
}

::mlir::Type FloorDivOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool FloorDivOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr FloorDivOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void FloorDivOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, Value x, Value y) {
  auto resultType =
      OpTrait::util::getBroadcastedType(x.getType(), y.getType());
  if (!resultType)
    mlir::emitError(odsState.location, "non-broadcastable operands");
  return build(odsBuilder, odsState, resultType, x, y);
}

void FloorDivOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type z, ::mlir::Value x, ::mlir::Value y) {
  odsState.addOperands(x);
  odsState.addOperands(y);
  odsState.addTypes(z);
}

void FloorDivOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value x, ::mlir::Value y) {
  odsState.addOperands(x);
  odsState.addOperands(y);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void FloorDivOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult FloorDivOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops5(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops5(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops5(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void FloorDivOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::FloorDivOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::FloorModOp definitions
//===----------------------------------------------------------------------===//

FloorModOpAdaptor::FloorModOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

FloorModOpAdaptor::FloorModOpAdaptor(FloorModOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange FloorModOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> FloorModOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange FloorModOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value FloorModOpAdaptor::x() {
  return *getODSOperands(0).begin();
}

::mlir::Value FloorModOpAdaptor::y() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr FloorModOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult FloorModOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> FloorModOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range FloorModOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value FloorModOp::x() {
  return *getODSOperands(0).begin();
}

::mlir::Value FloorModOp::y() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange FloorModOp::xMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange FloorModOp::yMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> FloorModOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range FloorModOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value FloorModOp::z() {
  return *getODSResults(0).begin();
}

::mlir::Type FloorModOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool FloorModOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr FloorModOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void FloorModOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, Value x, Value y) {
  auto resultType =
      OpTrait::util::getBroadcastedType(x.getType(), y.getType());
  if (!resultType)
    mlir::emitError(odsState.location, "non-broadcastable operands");
  return build(odsBuilder, odsState, resultType, x, y);
}

void FloorModOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type z, ::mlir::Value x, ::mlir::Value y) {
  odsState.addOperands(x);
  odsState.addOperands(y);
  odsState.addTypes(z);
}

void FloorModOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value x, ::mlir::Value y) {
  odsState.addOperands(x);
  odsState.addOperands(y);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void FloorModOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult FloorModOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops35(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops35(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops35(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void FloorModOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::FloorModOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::FloorOp definitions
//===----------------------------------------------------------------------===//

FloorOpAdaptor::FloorOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

FloorOpAdaptor::FloorOpAdaptor(FloorOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange FloorOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> FloorOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange FloorOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value FloorOpAdaptor::x() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr FloorOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult FloorOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> FloorOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range FloorOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value FloorOp::x() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange FloorOp::xMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> FloorOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range FloorOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value FloorOp::y() {
  return *getODSResults(0).begin();
}

::mlir::Type FloorOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool FloorOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr FloorOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void FloorOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type y, ::mlir::Value x) {
  odsState.addOperands(x);
  odsState.addTypes(y);
}

void FloorOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value x) {
  odsState.addOperands(x);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void FloorOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

void FloorOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value x) {
  odsState.addOperands(x);
  odsState.addTypes({x.getType()});

}

void FloorOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  odsState.addTypes({operands[0].getType()});

}

::mlir::LogicalResult FloorOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void FloorOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::FloorOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::FlushSummaryWriterOp definitions
//===----------------------------------------------------------------------===//

FlushSummaryWriterOpAdaptor::FlushSummaryWriterOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

FlushSummaryWriterOpAdaptor::FlushSummaryWriterOpAdaptor(FlushSummaryWriterOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange FlushSummaryWriterOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> FlushSummaryWriterOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange FlushSummaryWriterOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value FlushSummaryWriterOpAdaptor::writer() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr FlushSummaryWriterOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult FlushSummaryWriterOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> FlushSummaryWriterOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range FlushSummaryWriterOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value FlushSummaryWriterOp::writer() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange FlushSummaryWriterOp::writerMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> FlushSummaryWriterOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range FlushSummaryWriterOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

void FlushSummaryWriterOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value writer) {
  odsState.addOperands(writer);
}

void FlushSummaryWriterOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value writer) {
  odsState.addOperands(writer);
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void FlushSummaryWriterOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 0u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult FlushSummaryWriterOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void FlushSummaryWriterOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  for (::mlir::Value value : getODSOperands(0))
    effects.emplace_back(::mlir::MemoryEffects::Write::get(), value, ::mlir::TF::ResourceEffects::Summary::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::FlushSummaryWriterOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::FusedBatchNormGradOp definitions
//===----------------------------------------------------------------------===//

FusedBatchNormGradOpAdaptor::FusedBatchNormGradOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

FusedBatchNormGradOpAdaptor::FusedBatchNormGradOpAdaptor(FusedBatchNormGradOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange FusedBatchNormGradOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> FusedBatchNormGradOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange FusedBatchNormGradOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value FusedBatchNormGradOpAdaptor::y_backprop() {
  return *getODSOperands(0).begin();
}

::mlir::Value FusedBatchNormGradOpAdaptor::x() {
  return *getODSOperands(1).begin();
}

::mlir::Value FusedBatchNormGradOpAdaptor::scale() {
  return *getODSOperands(2).begin();
}

::mlir::Value FusedBatchNormGradOpAdaptor::reserve_space_1() {
  return *getODSOperands(3).begin();
}

::mlir::Value FusedBatchNormGradOpAdaptor::reserve_space_2() {
  return *getODSOperands(4).begin();
}

::mlir::DictionaryAttr FusedBatchNormGradOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::FloatAttr FusedBatchNormGradOpAdaptor::epsilon() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::FloatAttr attr = odsAttrs.get("epsilon").dyn_cast_or_null<::mlir::FloatAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getFloatAttr(::mlir::Builder(odsAttrs.getContext()).getF32Type(), 0.0001f);
  return attr;
}

::mlir::StringAttr FusedBatchNormGradOpAdaptor::data_format() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("data_format").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("NHWC");
  return attr;
}

::mlir::BoolAttr FusedBatchNormGradOpAdaptor::is_training() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("is_training").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(true);
  return attr;
}

::mlir::LogicalResult FusedBatchNormGradOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_epsilon = odsAttrs.get("epsilon");
    if (tblgen_epsilon && !(((tblgen_epsilon.isa<::mlir::FloatAttr>())) && ((tblgen_epsilon.cast<::mlir::FloatAttr>().getType().isF32()))))
      return emitError(loc, "'tf.FusedBatchNormGrad' op ""attribute 'epsilon' failed to satisfy constraint: 32-bit float attribute");
  }
  {
    auto tblgen_data_format = odsAttrs.get("data_format");
    if (tblgen_data_format && !((tblgen_data_format.cast<StringAttr>().getValue() == "NHWC" || tblgen_data_format.cast<StringAttr>().getValue() == "NCHW")))
      return emitError(loc, "'tf.FusedBatchNormGrad' op ""attribute 'data_format' failed to satisfy constraint: 'NHWC' or 'NCHW' convnet data format");
  }
  {
    auto tblgen_is_training = odsAttrs.get("is_training");
    if (tblgen_is_training && !((tblgen_is_training.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.FusedBatchNormGrad' op ""attribute 'is_training' failed to satisfy constraint: bool attribute");
  }
  return ::mlir::success();
}

void FusedBatchNormGradOp::getAsmResultNames(::mlir::OpAsmSetValueNameFn setNameFn) {
  auto resultGroup0 = getODSResults(0);
  if (!llvm::empty(resultGroup0))
    setNameFn(*resultGroup0.begin(), "x_backprop");
  auto resultGroup1 = getODSResults(1);
  if (!llvm::empty(resultGroup1))
    setNameFn(*resultGroup1.begin(), "scale_backprop");
  auto resultGroup2 = getODSResults(2);
  if (!llvm::empty(resultGroup2))
    setNameFn(*resultGroup2.begin(), "offset_backprop");
  auto resultGroup3 = getODSResults(3);
  if (!llvm::empty(resultGroup3))
    setNameFn(*resultGroup3.begin(), "reserve_space_3");
  auto resultGroup4 = getODSResults(4);
  if (!llvm::empty(resultGroup4))
    setNameFn(*resultGroup4.begin(), "reserve_space_4");
}

std::pair<unsigned, unsigned> FusedBatchNormGradOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range FusedBatchNormGradOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value FusedBatchNormGradOp::y_backprop() {
  return *getODSOperands(0).begin();
}

::mlir::Value FusedBatchNormGradOp::x() {
  return *getODSOperands(1).begin();
}

::mlir::Value FusedBatchNormGradOp::scale() {
  return *getODSOperands(2).begin();
}

::mlir::Value FusedBatchNormGradOp::reserve_space_1() {
  return *getODSOperands(3).begin();
}

::mlir::Value FusedBatchNormGradOp::reserve_space_2() {
  return *getODSOperands(4).begin();
}

::mlir::MutableOperandRange FusedBatchNormGradOp::y_backpropMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange FusedBatchNormGradOp::xMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange FusedBatchNormGradOp::scaleMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange FusedBatchNormGradOp::reserve_space_1Mutable() {
  auto range = getODSOperandIndexAndLength(3);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange FusedBatchNormGradOp::reserve_space_2Mutable() {
  auto range = getODSOperandIndexAndLength(4);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> FusedBatchNormGradOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range FusedBatchNormGradOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value FusedBatchNormGradOp::x_backprop() {
  return *getODSResults(0).begin();
}

::mlir::Value FusedBatchNormGradOp::scale_backprop() {
  return *getODSResults(1).begin();
}

::mlir::Value FusedBatchNormGradOp::offset_backprop() {
  return *getODSResults(2).begin();
}

::mlir::Value FusedBatchNormGradOp::reserve_space_3() {
  return *getODSResults(3).begin();
}

::mlir::Value FusedBatchNormGradOp::reserve_space_4() {
  return *getODSResults(4).begin();
}

::mlir::FloatAttr FusedBatchNormGradOp::epsilonAttr() {
  return (*this)->getAttr(epsilonAttrName()).dyn_cast_or_null<::mlir::FloatAttr>();
}

::llvm::APFloat FusedBatchNormGradOp::epsilon() {
  auto attr = epsilonAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getFloatAttr(::mlir::Builder((*this)->getContext()).getF32Type(), 0.0001f).getValue();
  return attr.getValue();
}

::mlir::StringAttr FusedBatchNormGradOp::data_formatAttr() {
  return (*this)->getAttr(data_formatAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef FusedBatchNormGradOp::data_format() {
  auto attr = data_formatAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("NHWC").getValue();
  return attr.getValue();
}

::mlir::BoolAttr FusedBatchNormGradOp::is_trainingAttr() {
  return (*this)->getAttr(is_trainingAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool FusedBatchNormGradOp::is_training() {
  auto attr = is_trainingAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(true).getValue();
  return attr.getValue();
}

::mlir::Type FusedBatchNormGradOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool FusedBatchNormGradOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr FusedBatchNormGradOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void FusedBatchNormGradOp::epsilonAttr(::mlir::FloatAttr attr) {
  (*this)->setAttr(epsilonAttrName(), attr);
}

void FusedBatchNormGradOp::data_formatAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(data_formatAttrName(), attr);
}

void FusedBatchNormGradOp::is_trainingAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(is_trainingAttrName(), attr);
}

void FusedBatchNormGradOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type x_backprop, ::mlir::Type scale_backprop, ::mlir::Type offset_backprop, ::mlir::Type reserve_space_3, ::mlir::Type reserve_space_4, ::mlir::Value y_backprop, ::mlir::Value x, ::mlir::Value scale, ::mlir::Value reserve_space_1, ::mlir::Value reserve_space_2, ::mlir::FloatAttr epsilon, ::mlir::StringAttr data_format, ::mlir::BoolAttr is_training) {
  odsState.addOperands(y_backprop);
  odsState.addOperands(x);
  odsState.addOperands(scale);
  odsState.addOperands(reserve_space_1);
  odsState.addOperands(reserve_space_2);
  odsState.addAttribute(epsilonAttrName(odsState.name), epsilon);
  odsState.addAttribute(data_formatAttrName(odsState.name), data_format);
  odsState.addAttribute(is_trainingAttrName(odsState.name), is_training);
  odsState.addTypes(x_backprop);
  odsState.addTypes(scale_backprop);
  odsState.addTypes(offset_backprop);
  odsState.addTypes(reserve_space_3);
  odsState.addTypes(reserve_space_4);
}

void FusedBatchNormGradOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value y_backprop, ::mlir::Value x, ::mlir::Value scale, ::mlir::Value reserve_space_1, ::mlir::Value reserve_space_2, ::mlir::FloatAttr epsilon, ::mlir::StringAttr data_format, ::mlir::BoolAttr is_training) {
  odsState.addOperands(y_backprop);
  odsState.addOperands(x);
  odsState.addOperands(scale);
  odsState.addOperands(reserve_space_1);
  odsState.addOperands(reserve_space_2);
  odsState.addAttribute(epsilonAttrName(odsState.name), epsilon);
  odsState.addAttribute(data_formatAttrName(odsState.name), data_format);
  odsState.addAttribute(is_trainingAttrName(odsState.name), is_training);
  assert(resultTypes.size() == 5u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void FusedBatchNormGradOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type x_backprop, ::mlir::Type scale_backprop, ::mlir::Type offset_backprop, ::mlir::Type reserve_space_3, ::mlir::Type reserve_space_4, ::mlir::Value y_backprop, ::mlir::Value x, ::mlir::Value scale, ::mlir::Value reserve_space_1, ::mlir::Value reserve_space_2, ::llvm::APFloat epsilon, ::llvm::StringRef data_format, bool is_training) {
  odsState.addOperands(y_backprop);
  odsState.addOperands(x);
  odsState.addOperands(scale);
  odsState.addOperands(reserve_space_1);
  odsState.addOperands(reserve_space_2);
  odsState.addAttribute(epsilonAttrName(odsState.name), odsBuilder.getFloatAttr(odsBuilder.getF32Type(), epsilon));
  odsState.addAttribute(data_formatAttrName(odsState.name), odsBuilder.getStringAttr(data_format));
  odsState.addAttribute(is_trainingAttrName(odsState.name), odsBuilder.getBoolAttr(is_training));
  odsState.addTypes(x_backprop);
  odsState.addTypes(scale_backprop);
  odsState.addTypes(offset_backprop);
  odsState.addTypes(reserve_space_3);
  odsState.addTypes(reserve_space_4);
}

void FusedBatchNormGradOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value y_backprop, ::mlir::Value x, ::mlir::Value scale, ::mlir::Value reserve_space_1, ::mlir::Value reserve_space_2, ::llvm::APFloat epsilon, ::llvm::StringRef data_format, bool is_training) {
  odsState.addOperands(y_backprop);
  odsState.addOperands(x);
  odsState.addOperands(scale);
  odsState.addOperands(reserve_space_1);
  odsState.addOperands(reserve_space_2);
  odsState.addAttribute(epsilonAttrName(odsState.name), odsBuilder.getFloatAttr(odsBuilder.getF32Type(), epsilon));
  odsState.addAttribute(data_formatAttrName(odsState.name), odsBuilder.getStringAttr(data_format));
  odsState.addAttribute(is_trainingAttrName(odsState.name), odsBuilder.getBoolAttr(is_training));
  assert(resultTypes.size() == 5u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void FusedBatchNormGradOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 5u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 5u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult FusedBatchNormGradOp::verify() {
  {
    auto tblgen_epsilon = (*this)->getAttr(epsilonAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops5(*this, tblgen_epsilon, "epsilon")))
      return ::mlir::failure();
  }
  {
    auto tblgen_data_format = (*this)->getAttr(data_formatAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops11(*this, tblgen_data_format, "data_format")))
      return ::mlir::failure();
  }
  {
    auto tblgen_is_training = (*this)->getAttr(is_trainingAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_is_training, "is_training")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup3 = getODSOperands(3);

    for (auto v : valueGroup3) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup4 = getODSOperands(4);

    for (auto v : valueGroup4) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSResults(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSResults(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
    auto valueGroup3 = getODSResults(3);

    for (auto v : valueGroup3) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
    auto valueGroup4 = getODSResults(4);

    for (auto v : valueGroup4) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void FusedBatchNormGradOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::FusedBatchNormGradOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::FusedBatchNormGradV2Op definitions
//===----------------------------------------------------------------------===//

FusedBatchNormGradV2OpAdaptor::FusedBatchNormGradV2OpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

FusedBatchNormGradV2OpAdaptor::FusedBatchNormGradV2OpAdaptor(FusedBatchNormGradV2Op &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange FusedBatchNormGradV2OpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> FusedBatchNormGradV2OpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange FusedBatchNormGradV2OpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value FusedBatchNormGradV2OpAdaptor::y_backprop() {
  return *getODSOperands(0).begin();
}

::mlir::Value FusedBatchNormGradV2OpAdaptor::x() {
  return *getODSOperands(1).begin();
}

::mlir::Value FusedBatchNormGradV2OpAdaptor::scale() {
  return *getODSOperands(2).begin();
}

::mlir::Value FusedBatchNormGradV2OpAdaptor::reserve_space_1() {
  return *getODSOperands(3).begin();
}

::mlir::Value FusedBatchNormGradV2OpAdaptor::reserve_space_2() {
  return *getODSOperands(4).begin();
}

::mlir::DictionaryAttr FusedBatchNormGradV2OpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::FloatAttr FusedBatchNormGradV2OpAdaptor::epsilon() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::FloatAttr attr = odsAttrs.get("epsilon").dyn_cast_or_null<::mlir::FloatAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getFloatAttr(::mlir::Builder(odsAttrs.getContext()).getF32Type(), 0.0001f);
  return attr;
}

::mlir::StringAttr FusedBatchNormGradV2OpAdaptor::data_format() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("data_format").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("NHWC");
  return attr;
}

::mlir::BoolAttr FusedBatchNormGradV2OpAdaptor::is_training() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("is_training").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(true);
  return attr;
}

::mlir::LogicalResult FusedBatchNormGradV2OpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_epsilon = odsAttrs.get("epsilon");
    if (tblgen_epsilon && !(((tblgen_epsilon.isa<::mlir::FloatAttr>())) && ((tblgen_epsilon.cast<::mlir::FloatAttr>().getType().isF32()))))
      return emitError(loc, "'tf.FusedBatchNormGradV2' op ""attribute 'epsilon' failed to satisfy constraint: 32-bit float attribute");
  }
  {
    auto tblgen_data_format = odsAttrs.get("data_format");
    if (tblgen_data_format && !((tblgen_data_format.cast<StringAttr>().getValue() == "NHWC" || tblgen_data_format.cast<StringAttr>().getValue() == "NCHW")))
      return emitError(loc, "'tf.FusedBatchNormGradV2' op ""attribute 'data_format' failed to satisfy constraint: 'NHWC' or 'NCHW' convnet data format");
  }
  {
    auto tblgen_is_training = odsAttrs.get("is_training");
    if (tblgen_is_training && !((tblgen_is_training.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.FusedBatchNormGradV2' op ""attribute 'is_training' failed to satisfy constraint: bool attribute");
  }
  return ::mlir::success();
}

void FusedBatchNormGradV2Op::getAsmResultNames(::mlir::OpAsmSetValueNameFn setNameFn) {
  auto resultGroup0 = getODSResults(0);
  if (!llvm::empty(resultGroup0))
    setNameFn(*resultGroup0.begin(), "x_backprop");
  auto resultGroup1 = getODSResults(1);
  if (!llvm::empty(resultGroup1))
    setNameFn(*resultGroup1.begin(), "scale_backprop");
  auto resultGroup2 = getODSResults(2);
  if (!llvm::empty(resultGroup2))
    setNameFn(*resultGroup2.begin(), "offset_backprop");
  auto resultGroup3 = getODSResults(3);
  if (!llvm::empty(resultGroup3))
    setNameFn(*resultGroup3.begin(), "reserve_space_3");
  auto resultGroup4 = getODSResults(4);
  if (!llvm::empty(resultGroup4))
    setNameFn(*resultGroup4.begin(), "reserve_space_4");
}

std::pair<unsigned, unsigned> FusedBatchNormGradV2Op::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range FusedBatchNormGradV2Op::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value FusedBatchNormGradV2Op::y_backprop() {
  return *getODSOperands(0).begin();
}

::mlir::Value FusedBatchNormGradV2Op::x() {
  return *getODSOperands(1).begin();
}

::mlir::Value FusedBatchNormGradV2Op::scale() {
  return *getODSOperands(2).begin();
}

::mlir::Value FusedBatchNormGradV2Op::reserve_space_1() {
  return *getODSOperands(3).begin();
}

::mlir::Value FusedBatchNormGradV2Op::reserve_space_2() {
  return *getODSOperands(4).begin();
}

::mlir::MutableOperandRange FusedBatchNormGradV2Op::y_backpropMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange FusedBatchNormGradV2Op::xMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange FusedBatchNormGradV2Op::scaleMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange FusedBatchNormGradV2Op::reserve_space_1Mutable() {
  auto range = getODSOperandIndexAndLength(3);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange FusedBatchNormGradV2Op::reserve_space_2Mutable() {
  auto range = getODSOperandIndexAndLength(4);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> FusedBatchNormGradV2Op::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range FusedBatchNormGradV2Op::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value FusedBatchNormGradV2Op::x_backprop() {
  return *getODSResults(0).begin();
}

::mlir::Value FusedBatchNormGradV2Op::scale_backprop() {
  return *getODSResults(1).begin();
}

::mlir::Value FusedBatchNormGradV2Op::offset_backprop() {
  return *getODSResults(2).begin();
}

::mlir::Value FusedBatchNormGradV2Op::reserve_space_3() {
  return *getODSResults(3).begin();
}

::mlir::Value FusedBatchNormGradV2Op::reserve_space_4() {
  return *getODSResults(4).begin();
}

::mlir::FloatAttr FusedBatchNormGradV2Op::epsilonAttr() {
  return (*this)->getAttr(epsilonAttrName()).dyn_cast_or_null<::mlir::FloatAttr>();
}

::llvm::APFloat FusedBatchNormGradV2Op::epsilon() {
  auto attr = epsilonAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getFloatAttr(::mlir::Builder((*this)->getContext()).getF32Type(), 0.0001f).getValue();
  return attr.getValue();
}

::mlir::StringAttr FusedBatchNormGradV2Op::data_formatAttr() {
  return (*this)->getAttr(data_formatAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef FusedBatchNormGradV2Op::data_format() {
  auto attr = data_formatAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("NHWC").getValue();
  return attr.getValue();
}

::mlir::BoolAttr FusedBatchNormGradV2Op::is_trainingAttr() {
  return (*this)->getAttr(is_trainingAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool FusedBatchNormGradV2Op::is_training() {
  auto attr = is_trainingAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(true).getValue();
  return attr.getValue();
}

::mlir::Type FusedBatchNormGradV2Op::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

::mlir::Type FusedBatchNormGradV2Op::U() {
  return mlir::getElementTypeOrSelf(*getODSOperands(3).begin());
}

bool FusedBatchNormGradV2Op::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
  if (name == "U") return true;
 return false;
}

::mlir::DictionaryAttr FusedBatchNormGradV2Op::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())},
    {UAttrName(),
::mlir::TypeAttr::get(U())}});
}

void FusedBatchNormGradV2Op::epsilonAttr(::mlir::FloatAttr attr) {
  (*this)->setAttr(epsilonAttrName(), attr);
}

void FusedBatchNormGradV2Op::data_formatAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(data_formatAttrName(), attr);
}

void FusedBatchNormGradV2Op::is_trainingAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(is_trainingAttrName(), attr);
}

void FusedBatchNormGradV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type x_backprop, ::mlir::Type scale_backprop, ::mlir::Type offset_backprop, ::mlir::Type reserve_space_3, ::mlir::Type reserve_space_4, ::mlir::Value y_backprop, ::mlir::Value x, ::mlir::Value scale, ::mlir::Value reserve_space_1, ::mlir::Value reserve_space_2, ::mlir::FloatAttr epsilon, ::mlir::StringAttr data_format, ::mlir::BoolAttr is_training) {
  odsState.addOperands(y_backprop);
  odsState.addOperands(x);
  odsState.addOperands(scale);
  odsState.addOperands(reserve_space_1);
  odsState.addOperands(reserve_space_2);
  odsState.addAttribute(epsilonAttrName(odsState.name), epsilon);
  odsState.addAttribute(data_formatAttrName(odsState.name), data_format);
  odsState.addAttribute(is_trainingAttrName(odsState.name), is_training);
  odsState.addTypes(x_backprop);
  odsState.addTypes(scale_backprop);
  odsState.addTypes(offset_backprop);
  odsState.addTypes(reserve_space_3);
  odsState.addTypes(reserve_space_4);
}

void FusedBatchNormGradV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value y_backprop, ::mlir::Value x, ::mlir::Value scale, ::mlir::Value reserve_space_1, ::mlir::Value reserve_space_2, ::mlir::FloatAttr epsilon, ::mlir::StringAttr data_format, ::mlir::BoolAttr is_training) {
  odsState.addOperands(y_backprop);
  odsState.addOperands(x);
  odsState.addOperands(scale);
  odsState.addOperands(reserve_space_1);
  odsState.addOperands(reserve_space_2);
  odsState.addAttribute(epsilonAttrName(odsState.name), epsilon);
  odsState.addAttribute(data_formatAttrName(odsState.name), data_format);
  odsState.addAttribute(is_trainingAttrName(odsState.name), is_training);
  assert(resultTypes.size() == 5u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void FusedBatchNormGradV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type x_backprop, ::mlir::Type scale_backprop, ::mlir::Type offset_backprop, ::mlir::Type reserve_space_3, ::mlir::Type reserve_space_4, ::mlir::Value y_backprop, ::mlir::Value x, ::mlir::Value scale, ::mlir::Value reserve_space_1, ::mlir::Value reserve_space_2, ::llvm::APFloat epsilon, ::llvm::StringRef data_format, bool is_training) {
  odsState.addOperands(y_backprop);
  odsState.addOperands(x);
  odsState.addOperands(scale);
  odsState.addOperands(reserve_space_1);
  odsState.addOperands(reserve_space_2);
  odsState.addAttribute(epsilonAttrName(odsState.name), odsBuilder.getFloatAttr(odsBuilder.getF32Type(), epsilon));
  odsState.addAttribute(data_formatAttrName(odsState.name), odsBuilder.getStringAttr(data_format));
  odsState.addAttribute(is_trainingAttrName(odsState.name), odsBuilder.getBoolAttr(is_training));
  odsState.addTypes(x_backprop);
  odsState.addTypes(scale_backprop);
  odsState.addTypes(offset_backprop);
  odsState.addTypes(reserve_space_3);
  odsState.addTypes(reserve_space_4);
}

void FusedBatchNormGradV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value y_backprop, ::mlir::Value x, ::mlir::Value scale, ::mlir::Value reserve_space_1, ::mlir::Value reserve_space_2, ::llvm::APFloat epsilon, ::llvm::StringRef data_format, bool is_training) {
  odsState.addOperands(y_backprop);
  odsState.addOperands(x);
  odsState.addOperands(scale);
  odsState.addOperands(reserve_space_1);
  odsState.addOperands(reserve_space_2);
  odsState.addAttribute(epsilonAttrName(odsState.name), odsBuilder.getFloatAttr(odsBuilder.getF32Type(), epsilon));
  odsState.addAttribute(data_formatAttrName(odsState.name), odsBuilder.getStringAttr(data_format));
  odsState.addAttribute(is_trainingAttrName(odsState.name), odsBuilder.getBoolAttr(is_training));
  assert(resultTypes.size() == 5u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void FusedBatchNormGradV2Op::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 5u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 5u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult FusedBatchNormGradV2Op::verify() {
  {
    auto tblgen_epsilon = (*this)->getAttr(epsilonAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops5(*this, tblgen_epsilon, "epsilon")))
      return ::mlir::failure();
  }
  {
    auto tblgen_data_format = (*this)->getAttr(data_formatAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops11(*this, tblgen_data_format, "data_format")))
      return ::mlir::failure();
  }
  {
    auto tblgen_is_training = (*this)->getAttr(is_trainingAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_is_training, "is_training")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops44(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops44(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup3 = getODSOperands(3);

    for (auto v : valueGroup3) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup4 = getODSOperands(4);

    for (auto v : valueGroup4) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops44(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSResults(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSResults(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
    auto valueGroup3 = getODSResults(3);

    for (auto v : valueGroup3) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
    auto valueGroup4 = getODSResults(4);

    for (auto v : valueGroup4) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void FusedBatchNormGradV2Op::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::FusedBatchNormGradV2Op)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::FusedBatchNormGradV3Op definitions
//===----------------------------------------------------------------------===//

FusedBatchNormGradV3OpAdaptor::FusedBatchNormGradV3OpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

FusedBatchNormGradV3OpAdaptor::FusedBatchNormGradV3OpAdaptor(FusedBatchNormGradV3Op &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange FusedBatchNormGradV3OpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> FusedBatchNormGradV3OpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange FusedBatchNormGradV3OpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value FusedBatchNormGradV3OpAdaptor::y_backprop() {
  return *getODSOperands(0).begin();
}

::mlir::Value FusedBatchNormGradV3OpAdaptor::x() {
  return *getODSOperands(1).begin();
}

::mlir::Value FusedBatchNormGradV3OpAdaptor::scale() {
  return *getODSOperands(2).begin();
}

::mlir::Value FusedBatchNormGradV3OpAdaptor::reserve_space_1() {
  return *getODSOperands(3).begin();
}

::mlir::Value FusedBatchNormGradV3OpAdaptor::reserve_space_2() {
  return *getODSOperands(4).begin();
}

::mlir::Value FusedBatchNormGradV3OpAdaptor::reserve_space_3() {
  return *getODSOperands(5).begin();
}

::mlir::DictionaryAttr FusedBatchNormGradV3OpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::FloatAttr FusedBatchNormGradV3OpAdaptor::epsilon() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::FloatAttr attr = odsAttrs.get("epsilon").dyn_cast_or_null<::mlir::FloatAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getFloatAttr(::mlir::Builder(odsAttrs.getContext()).getF32Type(), 0.0001f);
  return attr;
}

::mlir::StringAttr FusedBatchNormGradV3OpAdaptor::data_format() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("data_format").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("NHWC");
  return attr;
}

::mlir::BoolAttr FusedBatchNormGradV3OpAdaptor::is_training() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("is_training").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(true);
  return attr;
}

::mlir::LogicalResult FusedBatchNormGradV3OpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_epsilon = odsAttrs.get("epsilon");
    if (tblgen_epsilon && !(((tblgen_epsilon.isa<::mlir::FloatAttr>())) && ((tblgen_epsilon.cast<::mlir::FloatAttr>().getType().isF32()))))
      return emitError(loc, "'tf.FusedBatchNormGradV3' op ""attribute 'epsilon' failed to satisfy constraint: 32-bit float attribute");
  }
  {
    auto tblgen_data_format = odsAttrs.get("data_format");
    if (tblgen_data_format && !((tblgen_data_format.cast<StringAttr>().getValue() == "NHWC" || tblgen_data_format.cast<StringAttr>().getValue() == "NCHW" || tblgen_data_format.cast<StringAttr>().getValue() == "NDHWC" || tblgen_data_format.cast<StringAttr>().getValue() == "NCDHW")))
      return emitError(loc, "'tf.FusedBatchNormGradV3' op ""attribute 'data_format' failed to satisfy constraint: string attribute whose value is NHWC, or NCHW, or NDHWC, or NCDHW");
  }
  {
    auto tblgen_is_training = odsAttrs.get("is_training");
    if (tblgen_is_training && !((tblgen_is_training.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.FusedBatchNormGradV3' op ""attribute 'is_training' failed to satisfy constraint: bool attribute");
  }
  return ::mlir::success();
}

void FusedBatchNormGradV3Op::getAsmResultNames(::mlir::OpAsmSetValueNameFn setNameFn) {
  auto resultGroup0 = getODSResults(0);
  if (!llvm::empty(resultGroup0))
    setNameFn(*resultGroup0.begin(), "x_backprop");
  auto resultGroup1 = getODSResults(1);
  if (!llvm::empty(resultGroup1))
    setNameFn(*resultGroup1.begin(), "scale_backprop");
  auto resultGroup2 = getODSResults(2);
  if (!llvm::empty(resultGroup2))
    setNameFn(*resultGroup2.begin(), "offset_backprop");
  auto resultGroup3 = getODSResults(3);
  if (!llvm::empty(resultGroup3))
    setNameFn(*resultGroup3.begin(), "reserve_space_4");
  auto resultGroup4 = getODSResults(4);
  if (!llvm::empty(resultGroup4))
    setNameFn(*resultGroup4.begin(), "reserve_space_5");
}

std::pair<unsigned, unsigned> FusedBatchNormGradV3Op::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range FusedBatchNormGradV3Op::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value FusedBatchNormGradV3Op::y_backprop() {
  return *getODSOperands(0).begin();
}

::mlir::Value FusedBatchNormGradV3Op::x() {
  return *getODSOperands(1).begin();
}

::mlir::Value FusedBatchNormGradV3Op::scale() {
  return *getODSOperands(2).begin();
}

::mlir::Value FusedBatchNormGradV3Op::reserve_space_1() {
  return *getODSOperands(3).begin();
}

::mlir::Value FusedBatchNormGradV3Op::reserve_space_2() {
  return *getODSOperands(4).begin();
}

::mlir::Value FusedBatchNormGradV3Op::reserve_space_3() {
  return *getODSOperands(5).begin();
}

::mlir::MutableOperandRange FusedBatchNormGradV3Op::y_backpropMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange FusedBatchNormGradV3Op::xMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange FusedBatchNormGradV3Op::scaleMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange FusedBatchNormGradV3Op::reserve_space_1Mutable() {
  auto range = getODSOperandIndexAndLength(3);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange FusedBatchNormGradV3Op::reserve_space_2Mutable() {
  auto range = getODSOperandIndexAndLength(4);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange FusedBatchNormGradV3Op::reserve_space_3Mutable() {
  auto range = getODSOperandIndexAndLength(5);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> FusedBatchNormGradV3Op::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range FusedBatchNormGradV3Op::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value FusedBatchNormGradV3Op::x_backprop() {
  return *getODSResults(0).begin();
}

::mlir::Value FusedBatchNormGradV3Op::scale_backprop() {
  return *getODSResults(1).begin();
}

::mlir::Value FusedBatchNormGradV3Op::offset_backprop() {
  return *getODSResults(2).begin();
}

::mlir::Value FusedBatchNormGradV3Op::reserve_space_4() {
  return *getODSResults(3).begin();
}

::mlir::Value FusedBatchNormGradV3Op::reserve_space_5() {
  return *getODSResults(4).begin();
}

::mlir::FloatAttr FusedBatchNormGradV3Op::epsilonAttr() {
  return (*this)->getAttr(epsilonAttrName()).dyn_cast_or_null<::mlir::FloatAttr>();
}

::llvm::APFloat FusedBatchNormGradV3Op::epsilon() {
  auto attr = epsilonAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getFloatAttr(::mlir::Builder((*this)->getContext()).getF32Type(), 0.0001f).getValue();
  return attr.getValue();
}

::mlir::StringAttr FusedBatchNormGradV3Op::data_formatAttr() {
  return (*this)->getAttr(data_formatAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef FusedBatchNormGradV3Op::data_format() {
  auto attr = data_formatAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("NHWC").getValue();
  return attr.getValue();
}

::mlir::BoolAttr FusedBatchNormGradV3Op::is_trainingAttr() {
  return (*this)->getAttr(is_trainingAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool FusedBatchNormGradV3Op::is_training() {
  auto attr = is_trainingAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(true).getValue();
  return attr.getValue();
}

::mlir::Type FusedBatchNormGradV3Op::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

::mlir::Type FusedBatchNormGradV3Op::U() {
  return mlir::getElementTypeOrSelf(*getODSOperands(3).begin());
}

bool FusedBatchNormGradV3Op::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
  if (name == "U") return true;
 return false;
}

::mlir::DictionaryAttr FusedBatchNormGradV3Op::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())},
    {UAttrName(),
::mlir::TypeAttr::get(U())}});
}

void FusedBatchNormGradV3Op::epsilonAttr(::mlir::FloatAttr attr) {
  (*this)->setAttr(epsilonAttrName(), attr);
}

void FusedBatchNormGradV3Op::data_formatAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(data_formatAttrName(), attr);
}

void FusedBatchNormGradV3Op::is_trainingAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(is_trainingAttrName(), attr);
}

void FusedBatchNormGradV3Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type x_backprop, ::mlir::Type scale_backprop, ::mlir::Type offset_backprop, ::mlir::Type reserve_space_4, ::mlir::Type reserve_space_5, ::mlir::Value y_backprop, ::mlir::Value x, ::mlir::Value scale, ::mlir::Value reserve_space_1, ::mlir::Value reserve_space_2, ::mlir::Value reserve_space_3, ::mlir::FloatAttr epsilon, ::mlir::StringAttr data_format, ::mlir::BoolAttr is_training) {
  odsState.addOperands(y_backprop);
  odsState.addOperands(x);
  odsState.addOperands(scale);
  odsState.addOperands(reserve_space_1);
  odsState.addOperands(reserve_space_2);
  odsState.addOperands(reserve_space_3);
  odsState.addAttribute(epsilonAttrName(odsState.name), epsilon);
  odsState.addAttribute(data_formatAttrName(odsState.name), data_format);
  odsState.addAttribute(is_trainingAttrName(odsState.name), is_training);
  odsState.addTypes(x_backprop);
  odsState.addTypes(scale_backprop);
  odsState.addTypes(offset_backprop);
  odsState.addTypes(reserve_space_4);
  odsState.addTypes(reserve_space_5);
}

void FusedBatchNormGradV3Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value y_backprop, ::mlir::Value x, ::mlir::Value scale, ::mlir::Value reserve_space_1, ::mlir::Value reserve_space_2, ::mlir::Value reserve_space_3, ::mlir::FloatAttr epsilon, ::mlir::StringAttr data_format, ::mlir::BoolAttr is_training) {
  odsState.addOperands(y_backprop);
  odsState.addOperands(x);
  odsState.addOperands(scale);
  odsState.addOperands(reserve_space_1);
  odsState.addOperands(reserve_space_2);
  odsState.addOperands(reserve_space_3);
  odsState.addAttribute(epsilonAttrName(odsState.name), epsilon);
  odsState.addAttribute(data_formatAttrName(odsState.name), data_format);
  odsState.addAttribute(is_trainingAttrName(odsState.name), is_training);
  assert(resultTypes.size() == 5u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void FusedBatchNormGradV3Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type x_backprop, ::mlir::Type scale_backprop, ::mlir::Type offset_backprop, ::mlir::Type reserve_space_4, ::mlir::Type reserve_space_5, ::mlir::Value y_backprop, ::mlir::Value x, ::mlir::Value scale, ::mlir::Value reserve_space_1, ::mlir::Value reserve_space_2, ::mlir::Value reserve_space_3, ::llvm::APFloat epsilon, ::llvm::StringRef data_format, bool is_training) {
  odsState.addOperands(y_backprop);
  odsState.addOperands(x);
  odsState.addOperands(scale);
  odsState.addOperands(reserve_space_1);
  odsState.addOperands(reserve_space_2);
  odsState.addOperands(reserve_space_3);
  odsState.addAttribute(epsilonAttrName(odsState.name), odsBuilder.getFloatAttr(odsBuilder.getF32Type(), epsilon));
  odsState.addAttribute(data_formatAttrName(odsState.name), odsBuilder.getStringAttr(data_format));
  odsState.addAttribute(is_trainingAttrName(odsState.name), odsBuilder.getBoolAttr(is_training));
  odsState.addTypes(x_backprop);
  odsState.addTypes(scale_backprop);
  odsState.addTypes(offset_backprop);
  odsState.addTypes(reserve_space_4);
  odsState.addTypes(reserve_space_5);
}

void FusedBatchNormGradV3Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value y_backprop, ::mlir::Value x, ::mlir::Value scale, ::mlir::Value reserve_space_1, ::mlir::Value reserve_space_2, ::mlir::Value reserve_space_3, ::llvm::APFloat epsilon, ::llvm::StringRef data_format, bool is_training) {
  odsState.addOperands(y_backprop);
  odsState.addOperands(x);
  odsState.addOperands(scale);
  odsState.addOperands(reserve_space_1);
  odsState.addOperands(reserve_space_2);
  odsState.addOperands(reserve_space_3);
  odsState.addAttribute(epsilonAttrName(odsState.name), odsBuilder.getFloatAttr(odsBuilder.getF32Type(), epsilon));
  odsState.addAttribute(data_formatAttrName(odsState.name), odsBuilder.getStringAttr(data_format));
  odsState.addAttribute(is_trainingAttrName(odsState.name), odsBuilder.getBoolAttr(is_training));
  assert(resultTypes.size() == 5u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void FusedBatchNormGradV3Op::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 6u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 5u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult FusedBatchNormGradV3Op::verify() {
  {
    auto tblgen_epsilon = (*this)->getAttr(epsilonAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops5(*this, tblgen_epsilon, "epsilon")))
      return ::mlir::failure();
  }
  {
    auto tblgen_data_format = (*this)->getAttr(data_formatAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops25(*this, tblgen_data_format, "data_format")))
      return ::mlir::failure();
  }
  {
    auto tblgen_is_training = (*this)->getAttr(is_trainingAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_is_training, "is_training")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops44(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops44(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup3 = getODSOperands(3);

    for (auto v : valueGroup3) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup4 = getODSOperands(4);

    for (auto v : valueGroup4) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup5 = getODSOperands(5);

    for (auto v : valueGroup5) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops44(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSResults(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSResults(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
    auto valueGroup3 = getODSResults(3);

    for (auto v : valueGroup3) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
    auto valueGroup4 = getODSResults(4);

    for (auto v : valueGroup4) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void FusedBatchNormGradV3Op::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::FusedBatchNormGradV3Op)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::FusedBatchNormOp definitions
//===----------------------------------------------------------------------===//

FusedBatchNormOpAdaptor::FusedBatchNormOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

FusedBatchNormOpAdaptor::FusedBatchNormOpAdaptor(FusedBatchNormOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange FusedBatchNormOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> FusedBatchNormOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange FusedBatchNormOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value FusedBatchNormOpAdaptor::x() {
  return *getODSOperands(0).begin();
}

::mlir::Value FusedBatchNormOpAdaptor::scale() {
  return *getODSOperands(1).begin();
}

::mlir::Value FusedBatchNormOpAdaptor::offset() {
  return *getODSOperands(2).begin();
}

::mlir::Value FusedBatchNormOpAdaptor::mean() {
  return *getODSOperands(3).begin();
}

::mlir::Value FusedBatchNormOpAdaptor::variance() {
  return *getODSOperands(4).begin();
}

::mlir::DictionaryAttr FusedBatchNormOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::FloatAttr FusedBatchNormOpAdaptor::epsilon() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::FloatAttr attr = odsAttrs.get("epsilon").dyn_cast_or_null<::mlir::FloatAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getFloatAttr(::mlir::Builder(odsAttrs.getContext()).getF32Type(), 0.0001f);
  return attr;
}

::mlir::FloatAttr FusedBatchNormOpAdaptor::exponential_avg_factor() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::FloatAttr attr = odsAttrs.get("exponential_avg_factor").dyn_cast_or_null<::mlir::FloatAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getFloatAttr(::mlir::Builder(odsAttrs.getContext()).getF32Type(), 1.0f);
  return attr;
}

::mlir::StringAttr FusedBatchNormOpAdaptor::data_format() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("data_format").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("NHWC");
  return attr;
}

::mlir::BoolAttr FusedBatchNormOpAdaptor::is_training() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("is_training").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(true);
  return attr;
}

::mlir::LogicalResult FusedBatchNormOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_epsilon = odsAttrs.get("epsilon");
    if (tblgen_epsilon && !(((tblgen_epsilon.isa<::mlir::FloatAttr>())) && ((tblgen_epsilon.cast<::mlir::FloatAttr>().getType().isF32()))))
      return emitError(loc, "'tf.FusedBatchNorm' op ""attribute 'epsilon' failed to satisfy constraint: 32-bit float attribute");
  }
  {
    auto tblgen_exponential_avg_factor = odsAttrs.get("exponential_avg_factor");
    if (tblgen_exponential_avg_factor && !(((tblgen_exponential_avg_factor.isa<::mlir::FloatAttr>())) && ((tblgen_exponential_avg_factor.cast<::mlir::FloatAttr>().getType().isF32()))))
      return emitError(loc, "'tf.FusedBatchNorm' op ""attribute 'exponential_avg_factor' failed to satisfy constraint: 32-bit float attribute");
  }
  {
    auto tblgen_data_format = odsAttrs.get("data_format");
    if (tblgen_data_format && !((tblgen_data_format.cast<StringAttr>().getValue() == "NHWC" || tblgen_data_format.cast<StringAttr>().getValue() == "NCHW")))
      return emitError(loc, "'tf.FusedBatchNorm' op ""attribute 'data_format' failed to satisfy constraint: 'NHWC' or 'NCHW' convnet data format");
  }
  {
    auto tblgen_is_training = odsAttrs.get("is_training");
    if (tblgen_is_training && !((tblgen_is_training.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.FusedBatchNorm' op ""attribute 'is_training' failed to satisfy constraint: bool attribute");
  }
  return ::mlir::success();
}

void FusedBatchNormOp::getAsmResultNames(::mlir::OpAsmSetValueNameFn setNameFn) {
  auto resultGroup0 = getODSResults(0);
  if (!llvm::empty(resultGroup0))
    setNameFn(*resultGroup0.begin(), "y");
  auto resultGroup1 = getODSResults(1);
  if (!llvm::empty(resultGroup1))
    setNameFn(*resultGroup1.begin(), "batch_mean");
  auto resultGroup2 = getODSResults(2);
  if (!llvm::empty(resultGroup2))
    setNameFn(*resultGroup2.begin(), "batch_variance");
  auto resultGroup3 = getODSResults(3);
  if (!llvm::empty(resultGroup3))
    setNameFn(*resultGroup3.begin(), "reserve_space_1");
  auto resultGroup4 = getODSResults(4);
  if (!llvm::empty(resultGroup4))
    setNameFn(*resultGroup4.begin(), "reserve_space_2");
}

std::pair<unsigned, unsigned> FusedBatchNormOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range FusedBatchNormOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value FusedBatchNormOp::x() {
  return *getODSOperands(0).begin();
}

::mlir::Value FusedBatchNormOp::scale() {
  return *getODSOperands(1).begin();
}

::mlir::Value FusedBatchNormOp::offset() {
  return *getODSOperands(2).begin();
}

::mlir::Value FusedBatchNormOp::mean() {
  return *getODSOperands(3).begin();
}

::mlir::Value FusedBatchNormOp::variance() {
  return *getODSOperands(4).begin();
}

::mlir::MutableOperandRange FusedBatchNormOp::xMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange FusedBatchNormOp::scaleMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange FusedBatchNormOp::offsetMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange FusedBatchNormOp::meanMutable() {
  auto range = getODSOperandIndexAndLength(3);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange FusedBatchNormOp::varianceMutable() {
  auto range = getODSOperandIndexAndLength(4);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> FusedBatchNormOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range FusedBatchNormOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value FusedBatchNormOp::y() {
  return *getODSResults(0).begin();
}

::mlir::Value FusedBatchNormOp::batch_mean() {
  return *getODSResults(1).begin();
}

::mlir::Value FusedBatchNormOp::batch_variance() {
  return *getODSResults(2).begin();
}

::mlir::Value FusedBatchNormOp::reserve_space_1() {
  return *getODSResults(3).begin();
}

::mlir::Value FusedBatchNormOp::reserve_space_2() {
  return *getODSResults(4).begin();
}

::mlir::FloatAttr FusedBatchNormOp::epsilonAttr() {
  return (*this)->getAttr(epsilonAttrName()).dyn_cast_or_null<::mlir::FloatAttr>();
}

::llvm::APFloat FusedBatchNormOp::epsilon() {
  auto attr = epsilonAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getFloatAttr(::mlir::Builder((*this)->getContext()).getF32Type(), 0.0001f).getValue();
  return attr.getValue();
}

::mlir::FloatAttr FusedBatchNormOp::exponential_avg_factorAttr() {
  return (*this)->getAttr(exponential_avg_factorAttrName()).dyn_cast_or_null<::mlir::FloatAttr>();
}

::llvm::APFloat FusedBatchNormOp::exponential_avg_factor() {
  auto attr = exponential_avg_factorAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getFloatAttr(::mlir::Builder((*this)->getContext()).getF32Type(), 1.0f).getValue();
  return attr.getValue();
}

::mlir::StringAttr FusedBatchNormOp::data_formatAttr() {
  return (*this)->getAttr(data_formatAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef FusedBatchNormOp::data_format() {
  auto attr = data_formatAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("NHWC").getValue();
  return attr.getValue();
}

::mlir::BoolAttr FusedBatchNormOp::is_trainingAttr() {
  return (*this)->getAttr(is_trainingAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool FusedBatchNormOp::is_training() {
  auto attr = is_trainingAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(true).getValue();
  return attr.getValue();
}

::mlir::Type FusedBatchNormOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool FusedBatchNormOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr FusedBatchNormOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void FusedBatchNormOp::epsilonAttr(::mlir::FloatAttr attr) {
  (*this)->setAttr(epsilonAttrName(), attr);
}

void FusedBatchNormOp::exponential_avg_factorAttr(::mlir::FloatAttr attr) {
  (*this)->setAttr(exponential_avg_factorAttrName(), attr);
}

void FusedBatchNormOp::data_formatAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(data_formatAttrName(), attr);
}

void FusedBatchNormOp::is_trainingAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(is_trainingAttrName(), attr);
}

void FusedBatchNormOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type y, ::mlir::Type batch_mean, ::mlir::Type batch_variance, ::mlir::Type reserve_space_1, ::mlir::Type reserve_space_2, ::mlir::Value x, ::mlir::Value scale, ::mlir::Value offset, ::mlir::Value mean, ::mlir::Value variance, ::mlir::FloatAttr epsilon, ::mlir::FloatAttr exponential_avg_factor, ::mlir::StringAttr data_format, ::mlir::BoolAttr is_training) {
  odsState.addOperands(x);
  odsState.addOperands(scale);
  odsState.addOperands(offset);
  odsState.addOperands(mean);
  odsState.addOperands(variance);
  odsState.addAttribute(epsilonAttrName(odsState.name), epsilon);
  odsState.addAttribute(exponential_avg_factorAttrName(odsState.name), exponential_avg_factor);
  odsState.addAttribute(data_formatAttrName(odsState.name), data_format);
  odsState.addAttribute(is_trainingAttrName(odsState.name), is_training);
  odsState.addTypes(y);
  odsState.addTypes(batch_mean);
  odsState.addTypes(batch_variance);
  odsState.addTypes(reserve_space_1);
  odsState.addTypes(reserve_space_2);
}

void FusedBatchNormOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value x, ::mlir::Value scale, ::mlir::Value offset, ::mlir::Value mean, ::mlir::Value variance, ::mlir::FloatAttr epsilon, ::mlir::FloatAttr exponential_avg_factor, ::mlir::StringAttr data_format, ::mlir::BoolAttr is_training) {
  odsState.addOperands(x);
  odsState.addOperands(scale);
  odsState.addOperands(offset);
  odsState.addOperands(mean);
  odsState.addOperands(variance);
  odsState.addAttribute(epsilonAttrName(odsState.name), epsilon);
  odsState.addAttribute(exponential_avg_factorAttrName(odsState.name), exponential_avg_factor);
  odsState.addAttribute(data_formatAttrName(odsState.name), data_format);
  odsState.addAttribute(is_trainingAttrName(odsState.name), is_training);
  assert(resultTypes.size() == 5u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void FusedBatchNormOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type y, ::mlir::Type batch_mean, ::mlir::Type batch_variance, ::mlir::Type reserve_space_1, ::mlir::Type reserve_space_2, ::mlir::Value x, ::mlir::Value scale, ::mlir::Value offset, ::mlir::Value mean, ::mlir::Value variance, ::llvm::APFloat epsilon, ::llvm::APFloat exponential_avg_factor, ::llvm::StringRef data_format, bool is_training) {
  odsState.addOperands(x);
  odsState.addOperands(scale);
  odsState.addOperands(offset);
  odsState.addOperands(mean);
  odsState.addOperands(variance);
  odsState.addAttribute(epsilonAttrName(odsState.name), odsBuilder.getFloatAttr(odsBuilder.getF32Type(), epsilon));
  odsState.addAttribute(exponential_avg_factorAttrName(odsState.name), odsBuilder.getFloatAttr(odsBuilder.getF32Type(), exponential_avg_factor));
  odsState.addAttribute(data_formatAttrName(odsState.name), odsBuilder.getStringAttr(data_format));
  odsState.addAttribute(is_trainingAttrName(odsState.name), odsBuilder.getBoolAttr(is_training));
  odsState.addTypes(y);
  odsState.addTypes(batch_mean);
  odsState.addTypes(batch_variance);
  odsState.addTypes(reserve_space_1);
  odsState.addTypes(reserve_space_2);
}

void FusedBatchNormOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value x, ::mlir::Value scale, ::mlir::Value offset, ::mlir::Value mean, ::mlir::Value variance, ::llvm::APFloat epsilon, ::llvm::APFloat exponential_avg_factor, ::llvm::StringRef data_format, bool is_training) {
  odsState.addOperands(x);
  odsState.addOperands(scale);
  odsState.addOperands(offset);
  odsState.addOperands(mean);
  odsState.addOperands(variance);
  odsState.addAttribute(epsilonAttrName(odsState.name), odsBuilder.getFloatAttr(odsBuilder.getF32Type(), epsilon));
  odsState.addAttribute(exponential_avg_factorAttrName(odsState.name), odsBuilder.getFloatAttr(odsBuilder.getF32Type(), exponential_avg_factor));
  odsState.addAttribute(data_formatAttrName(odsState.name), odsBuilder.getStringAttr(data_format));
  odsState.addAttribute(is_trainingAttrName(odsState.name), odsBuilder.getBoolAttr(is_training));
  assert(resultTypes.size() == 5u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void FusedBatchNormOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 5u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 5u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult FusedBatchNormOp::verify() {
  {
    auto tblgen_epsilon = (*this)->getAttr(epsilonAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops5(*this, tblgen_epsilon, "epsilon")))
      return ::mlir::failure();
  }
  {
    auto tblgen_exponential_avg_factor = (*this)->getAttr(exponential_avg_factorAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops5(*this, tblgen_exponential_avg_factor, "exponential_avg_factor")))
      return ::mlir::failure();
  }
  {
    auto tblgen_data_format = (*this)->getAttr(data_formatAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops11(*this, tblgen_data_format, "data_format")))
      return ::mlir::failure();
  }
  {
    auto tblgen_is_training = (*this)->getAttr(is_trainingAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_is_training, "is_training")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup3 = getODSOperands(3);

    for (auto v : valueGroup3) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup4 = getODSOperands(4);

    for (auto v : valueGroup4) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSResults(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSResults(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
    auto valueGroup3 = getODSResults(3);

    for (auto v : valueGroup3) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
    auto valueGroup4 = getODSResults(4);

    for (auto v : valueGroup4) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return Verify(*this);
}

void FusedBatchNormOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::FusedBatchNormOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::FusedBatchNormV2Op definitions
//===----------------------------------------------------------------------===//

FusedBatchNormV2OpAdaptor::FusedBatchNormV2OpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

FusedBatchNormV2OpAdaptor::FusedBatchNormV2OpAdaptor(FusedBatchNormV2Op &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange FusedBatchNormV2OpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> FusedBatchNormV2OpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange FusedBatchNormV2OpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value FusedBatchNormV2OpAdaptor::x() {
  return *getODSOperands(0).begin();
}

::mlir::Value FusedBatchNormV2OpAdaptor::scale() {
  return *getODSOperands(1).begin();
}

::mlir::Value FusedBatchNormV2OpAdaptor::offset() {
  return *getODSOperands(2).begin();
}

::mlir::Value FusedBatchNormV2OpAdaptor::mean() {
  return *getODSOperands(3).begin();
}

::mlir::Value FusedBatchNormV2OpAdaptor::variance() {
  return *getODSOperands(4).begin();
}

::mlir::DictionaryAttr FusedBatchNormV2OpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::FloatAttr FusedBatchNormV2OpAdaptor::epsilon() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::FloatAttr attr = odsAttrs.get("epsilon").dyn_cast_or_null<::mlir::FloatAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getFloatAttr(::mlir::Builder(odsAttrs.getContext()).getF32Type(), 0.0001f);
  return attr;
}

::mlir::FloatAttr FusedBatchNormV2OpAdaptor::exponential_avg_factor() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::FloatAttr attr = odsAttrs.get("exponential_avg_factor").dyn_cast_or_null<::mlir::FloatAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getFloatAttr(::mlir::Builder(odsAttrs.getContext()).getF32Type(), 1.0f);
  return attr;
}

::mlir::StringAttr FusedBatchNormV2OpAdaptor::data_format() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("data_format").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("NHWC");
  return attr;
}

::mlir::BoolAttr FusedBatchNormV2OpAdaptor::is_training() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("is_training").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(true);
  return attr;
}

::mlir::LogicalResult FusedBatchNormV2OpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_epsilon = odsAttrs.get("epsilon");
    if (tblgen_epsilon && !(((tblgen_epsilon.isa<::mlir::FloatAttr>())) && ((tblgen_epsilon.cast<::mlir::FloatAttr>().getType().isF32()))))
      return emitError(loc, "'tf.FusedBatchNormV2' op ""attribute 'epsilon' failed to satisfy constraint: 32-bit float attribute");
  }
  {
    auto tblgen_exponential_avg_factor = odsAttrs.get("exponential_avg_factor");
    if (tblgen_exponential_avg_factor && !(((tblgen_exponential_avg_factor.isa<::mlir::FloatAttr>())) && ((tblgen_exponential_avg_factor.cast<::mlir::FloatAttr>().getType().isF32()))))
      return emitError(loc, "'tf.FusedBatchNormV2' op ""attribute 'exponential_avg_factor' failed to satisfy constraint: 32-bit float attribute");
  }
  {
    auto tblgen_data_format = odsAttrs.get("data_format");
    if (tblgen_data_format && !((tblgen_data_format.cast<StringAttr>().getValue() == "NHWC" || tblgen_data_format.cast<StringAttr>().getValue() == "NCHW")))
      return emitError(loc, "'tf.FusedBatchNormV2' op ""attribute 'data_format' failed to satisfy constraint: 'NHWC' or 'NCHW' convnet data format");
  }
  {
    auto tblgen_is_training = odsAttrs.get("is_training");
    if (tblgen_is_training && !((tblgen_is_training.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.FusedBatchNormV2' op ""attribute 'is_training' failed to satisfy constraint: bool attribute");
  }
  return ::mlir::success();
}

void FusedBatchNormV2Op::getAsmResultNames(::mlir::OpAsmSetValueNameFn setNameFn) {
  auto resultGroup0 = getODSResults(0);
  if (!llvm::empty(resultGroup0))
    setNameFn(*resultGroup0.begin(), "y");
  auto resultGroup1 = getODSResults(1);
  if (!llvm::empty(resultGroup1))
    setNameFn(*resultGroup1.begin(), "batch_mean");
  auto resultGroup2 = getODSResults(2);
  if (!llvm::empty(resultGroup2))
    setNameFn(*resultGroup2.begin(), "batch_variance");
  auto resultGroup3 = getODSResults(3);
  if (!llvm::empty(resultGroup3))
    setNameFn(*resultGroup3.begin(), "reserve_space_1");
  auto resultGroup4 = getODSResults(4);
  if (!llvm::empty(resultGroup4))
    setNameFn(*resultGroup4.begin(), "reserve_space_2");
}

std::pair<unsigned, unsigned> FusedBatchNormV2Op::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range FusedBatchNormV2Op::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value FusedBatchNormV2Op::x() {
  return *getODSOperands(0).begin();
}

::mlir::Value FusedBatchNormV2Op::scale() {
  return *getODSOperands(1).begin();
}

::mlir::Value FusedBatchNormV2Op::offset() {
  return *getODSOperands(2).begin();
}

::mlir::Value FusedBatchNormV2Op::mean() {
  return *getODSOperands(3).begin();
}

::mlir::Value FusedBatchNormV2Op::variance() {
  return *getODSOperands(4).begin();
}

::mlir::MutableOperandRange FusedBatchNormV2Op::xMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange FusedBatchNormV2Op::scaleMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange FusedBatchNormV2Op::offsetMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange FusedBatchNormV2Op::meanMutable() {
  auto range = getODSOperandIndexAndLength(3);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange FusedBatchNormV2Op::varianceMutable() {
  auto range = getODSOperandIndexAndLength(4);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> FusedBatchNormV2Op::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range FusedBatchNormV2Op::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value FusedBatchNormV2Op::y() {
  return *getODSResults(0).begin();
}

::mlir::Value FusedBatchNormV2Op::batch_mean() {
  return *getODSResults(1).begin();
}

::mlir::Value FusedBatchNormV2Op::batch_variance() {
  return *getODSResults(2).begin();
}

::mlir::Value FusedBatchNormV2Op::reserve_space_1() {
  return *getODSResults(3).begin();
}

::mlir::Value FusedBatchNormV2Op::reserve_space_2() {
  return *getODSResults(4).begin();
}

::mlir::FloatAttr FusedBatchNormV2Op::epsilonAttr() {
  return (*this)->getAttr(epsilonAttrName()).dyn_cast_or_null<::mlir::FloatAttr>();
}

::llvm::APFloat FusedBatchNormV2Op::epsilon() {
  auto attr = epsilonAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getFloatAttr(::mlir::Builder((*this)->getContext()).getF32Type(), 0.0001f).getValue();
  return attr.getValue();
}

::mlir::FloatAttr FusedBatchNormV2Op::exponential_avg_factorAttr() {
  return (*this)->getAttr(exponential_avg_factorAttrName()).dyn_cast_or_null<::mlir::FloatAttr>();
}

::llvm::APFloat FusedBatchNormV2Op::exponential_avg_factor() {
  auto attr = exponential_avg_factorAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getFloatAttr(::mlir::Builder((*this)->getContext()).getF32Type(), 1.0f).getValue();
  return attr.getValue();
}

::mlir::StringAttr FusedBatchNormV2Op::data_formatAttr() {
  return (*this)->getAttr(data_formatAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef FusedBatchNormV2Op::data_format() {
  auto attr = data_formatAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("NHWC").getValue();
  return attr.getValue();
}

::mlir::BoolAttr FusedBatchNormV2Op::is_trainingAttr() {
  return (*this)->getAttr(is_trainingAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool FusedBatchNormV2Op::is_training() {
  auto attr = is_trainingAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(true).getValue();
  return attr.getValue();
}

::mlir::Type FusedBatchNormV2Op::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

::mlir::Type FusedBatchNormV2Op::U() {
  return mlir::getElementTypeOrSelf(*getODSOperands(1).begin());
}

bool FusedBatchNormV2Op::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
  if (name == "U") return true;
 return false;
}

::mlir::DictionaryAttr FusedBatchNormV2Op::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())},
    {UAttrName(),
::mlir::TypeAttr::get(U())}});
}

void FusedBatchNormV2Op::epsilonAttr(::mlir::FloatAttr attr) {
  (*this)->setAttr(epsilonAttrName(), attr);
}

void FusedBatchNormV2Op::exponential_avg_factorAttr(::mlir::FloatAttr attr) {
  (*this)->setAttr(exponential_avg_factorAttrName(), attr);
}

void FusedBatchNormV2Op::data_formatAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(data_formatAttrName(), attr);
}

void FusedBatchNormV2Op::is_trainingAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(is_trainingAttrName(), attr);
}

void FusedBatchNormV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type y, ::mlir::Type batch_mean, ::mlir::Type batch_variance, ::mlir::Type reserve_space_1, ::mlir::Type reserve_space_2, ::mlir::Value x, ::mlir::Value scale, ::mlir::Value offset, ::mlir::Value mean, ::mlir::Value variance, ::mlir::FloatAttr epsilon, ::mlir::FloatAttr exponential_avg_factor, ::mlir::StringAttr data_format, ::mlir::BoolAttr is_training) {
  odsState.addOperands(x);
  odsState.addOperands(scale);
  odsState.addOperands(offset);
  odsState.addOperands(mean);
  odsState.addOperands(variance);
  odsState.addAttribute(epsilonAttrName(odsState.name), epsilon);
  odsState.addAttribute(exponential_avg_factorAttrName(odsState.name), exponential_avg_factor);
  odsState.addAttribute(data_formatAttrName(odsState.name), data_format);
  odsState.addAttribute(is_trainingAttrName(odsState.name), is_training);
  odsState.addTypes(y);
  odsState.addTypes(batch_mean);
  odsState.addTypes(batch_variance);
  odsState.addTypes(reserve_space_1);
  odsState.addTypes(reserve_space_2);
}

void FusedBatchNormV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value x, ::mlir::Value scale, ::mlir::Value offset, ::mlir::Value mean, ::mlir::Value variance, ::mlir::FloatAttr epsilon, ::mlir::FloatAttr exponential_avg_factor, ::mlir::StringAttr data_format, ::mlir::BoolAttr is_training) {
  odsState.addOperands(x);
  odsState.addOperands(scale);
  odsState.addOperands(offset);
  odsState.addOperands(mean);
  odsState.addOperands(variance);
  odsState.addAttribute(epsilonAttrName(odsState.name), epsilon);
  odsState.addAttribute(exponential_avg_factorAttrName(odsState.name), exponential_avg_factor);
  odsState.addAttribute(data_formatAttrName(odsState.name), data_format);
  odsState.addAttribute(is_trainingAttrName(odsState.name), is_training);
  assert(resultTypes.size() == 5u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void FusedBatchNormV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type y, ::mlir::Type batch_mean, ::mlir::Type batch_variance, ::mlir::Type reserve_space_1, ::mlir::Type reserve_space_2, ::mlir::Value x, ::mlir::Value scale, ::mlir::Value offset, ::mlir::Value mean, ::mlir::Value variance, ::llvm::APFloat epsilon, ::llvm::APFloat exponential_avg_factor, ::llvm::StringRef data_format, bool is_training) {
  odsState.addOperands(x);
  odsState.addOperands(scale);
  odsState.addOperands(offset);
  odsState.addOperands(mean);
  odsState.addOperands(variance);
  odsState.addAttribute(epsilonAttrName(odsState.name), odsBuilder.getFloatAttr(odsBuilder.getF32Type(), epsilon));
  odsState.addAttribute(exponential_avg_factorAttrName(odsState.name), odsBuilder.getFloatAttr(odsBuilder.getF32Type(), exponential_avg_factor));
  odsState.addAttribute(data_formatAttrName(odsState.name), odsBuilder.getStringAttr(data_format));
  odsState.addAttribute(is_trainingAttrName(odsState.name), odsBuilder.getBoolAttr(is_training));
  odsState.addTypes(y);
  odsState.addTypes(batch_mean);
  odsState.addTypes(batch_variance);
  odsState.addTypes(reserve_space_1);
  odsState.addTypes(reserve_space_2);
}

void FusedBatchNormV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value x, ::mlir::Value scale, ::mlir::Value offset, ::mlir::Value mean, ::mlir::Value variance, ::llvm::APFloat epsilon, ::llvm::APFloat exponential_avg_factor, ::llvm::StringRef data_format, bool is_training) {
  odsState.addOperands(x);
  odsState.addOperands(scale);
  odsState.addOperands(offset);
  odsState.addOperands(mean);
  odsState.addOperands(variance);
  odsState.addAttribute(epsilonAttrName(odsState.name), odsBuilder.getFloatAttr(odsBuilder.getF32Type(), epsilon));
  odsState.addAttribute(exponential_avg_factorAttrName(odsState.name), odsBuilder.getFloatAttr(odsBuilder.getF32Type(), exponential_avg_factor));
  odsState.addAttribute(data_formatAttrName(odsState.name), odsBuilder.getStringAttr(data_format));
  odsState.addAttribute(is_trainingAttrName(odsState.name), odsBuilder.getBoolAttr(is_training));
  assert(resultTypes.size() == 5u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void FusedBatchNormV2Op::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 5u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 5u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult FusedBatchNormV2Op::verify() {
  {
    auto tblgen_epsilon = (*this)->getAttr(epsilonAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops5(*this, tblgen_epsilon, "epsilon")))
      return ::mlir::failure();
  }
  {
    auto tblgen_exponential_avg_factor = (*this)->getAttr(exponential_avg_factorAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops5(*this, tblgen_exponential_avg_factor, "exponential_avg_factor")))
      return ::mlir::failure();
  }
  {
    auto tblgen_data_format = (*this)->getAttr(data_formatAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops11(*this, tblgen_data_format, "data_format")))
      return ::mlir::failure();
  }
  {
    auto tblgen_is_training = (*this)->getAttr(is_trainingAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_is_training, "is_training")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops44(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup3 = getODSOperands(3);

    for (auto v : valueGroup3) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup4 = getODSOperands(4);

    for (auto v : valueGroup4) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops44(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSResults(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSResults(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
    auto valueGroup3 = getODSResults(3);

    for (auto v : valueGroup3) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
    auto valueGroup4 = getODSResults(4);

    for (auto v : valueGroup4) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void FusedBatchNormV2Op::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::FusedBatchNormV2Op)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::FusedBatchNormV3Op definitions
//===----------------------------------------------------------------------===//

FusedBatchNormV3OpAdaptor::FusedBatchNormV3OpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

FusedBatchNormV3OpAdaptor::FusedBatchNormV3OpAdaptor(FusedBatchNormV3Op &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange FusedBatchNormV3OpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> FusedBatchNormV3OpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange FusedBatchNormV3OpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value FusedBatchNormV3OpAdaptor::x() {
  return *getODSOperands(0).begin();
}

::mlir::Value FusedBatchNormV3OpAdaptor::scale() {
  return *getODSOperands(1).begin();
}

::mlir::Value FusedBatchNormV3OpAdaptor::offset() {
  return *getODSOperands(2).begin();
}

::mlir::Value FusedBatchNormV3OpAdaptor::mean() {
  return *getODSOperands(3).begin();
}

::mlir::Value FusedBatchNormV3OpAdaptor::variance() {
  return *getODSOperands(4).begin();
}

::mlir::DictionaryAttr FusedBatchNormV3OpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::FloatAttr FusedBatchNormV3OpAdaptor::epsilon() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::FloatAttr attr = odsAttrs.get("epsilon").dyn_cast_or_null<::mlir::FloatAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getFloatAttr(::mlir::Builder(odsAttrs.getContext()).getF32Type(), 0.0001f);
  return attr;
}

::mlir::FloatAttr FusedBatchNormV3OpAdaptor::exponential_avg_factor() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::FloatAttr attr = odsAttrs.get("exponential_avg_factor").dyn_cast_or_null<::mlir::FloatAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getFloatAttr(::mlir::Builder(odsAttrs.getContext()).getF32Type(), 1.0f);
  return attr;
}

::mlir::StringAttr FusedBatchNormV3OpAdaptor::data_format() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("data_format").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("NHWC");
  return attr;
}

::mlir::BoolAttr FusedBatchNormV3OpAdaptor::is_training() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("is_training").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(true);
  return attr;
}

::mlir::LogicalResult FusedBatchNormV3OpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_epsilon = odsAttrs.get("epsilon");
    if (tblgen_epsilon && !(((tblgen_epsilon.isa<::mlir::FloatAttr>())) && ((tblgen_epsilon.cast<::mlir::FloatAttr>().getType().isF32()))))
      return emitError(loc, "'tf.FusedBatchNormV3' op ""attribute 'epsilon' failed to satisfy constraint: 32-bit float attribute");
  }
  {
    auto tblgen_exponential_avg_factor = odsAttrs.get("exponential_avg_factor");
    if (tblgen_exponential_avg_factor && !(((tblgen_exponential_avg_factor.isa<::mlir::FloatAttr>())) && ((tblgen_exponential_avg_factor.cast<::mlir::FloatAttr>().getType().isF32()))))
      return emitError(loc, "'tf.FusedBatchNormV3' op ""attribute 'exponential_avg_factor' failed to satisfy constraint: 32-bit float attribute");
  }
  {
    auto tblgen_data_format = odsAttrs.get("data_format");
    if (tblgen_data_format && !((tblgen_data_format.cast<StringAttr>().getValue() == "NHWC" || tblgen_data_format.cast<StringAttr>().getValue() == "NCHW" || tblgen_data_format.cast<StringAttr>().getValue() == "NDHWC" || tblgen_data_format.cast<StringAttr>().getValue() == "NCDHW")))
      return emitError(loc, "'tf.FusedBatchNormV3' op ""attribute 'data_format' failed to satisfy constraint: string attribute whose value is NHWC, or NCHW, or NDHWC, or NCDHW");
  }
  {
    auto tblgen_is_training = odsAttrs.get("is_training");
    if (tblgen_is_training && !((tblgen_is_training.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.FusedBatchNormV3' op ""attribute 'is_training' failed to satisfy constraint: bool attribute");
  }
  return ::mlir::success();
}

void FusedBatchNormV3Op::getAsmResultNames(::mlir::OpAsmSetValueNameFn setNameFn) {
  auto resultGroup0 = getODSResults(0);
  if (!llvm::empty(resultGroup0))
    setNameFn(*resultGroup0.begin(), "y");
  auto resultGroup1 = getODSResults(1);
  if (!llvm::empty(resultGroup1))
    setNameFn(*resultGroup1.begin(), "batch_mean");
  auto resultGroup2 = getODSResults(2);
  if (!llvm::empty(resultGroup2))
    setNameFn(*resultGroup2.begin(), "batch_variance");
  auto resultGroup3 = getODSResults(3);
  if (!llvm::empty(resultGroup3))
    setNameFn(*resultGroup3.begin(), "reserve_space_1");
  auto resultGroup4 = getODSResults(4);
  if (!llvm::empty(resultGroup4))
    setNameFn(*resultGroup4.begin(), "reserve_space_2");
  auto resultGroup5 = getODSResults(5);
  if (!llvm::empty(resultGroup5))
    setNameFn(*resultGroup5.begin(), "reserve_space_3");
}

std::pair<unsigned, unsigned> FusedBatchNormV3Op::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range FusedBatchNormV3Op::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value FusedBatchNormV3Op::x() {
  return *getODSOperands(0).begin();
}

::mlir::Value FusedBatchNormV3Op::scale() {
  return *getODSOperands(1).begin();
}

::mlir::Value FusedBatchNormV3Op::offset() {
  return *getODSOperands(2).begin();
}

::mlir::Value FusedBatchNormV3Op::mean() {
  return *getODSOperands(3).begin();
}

::mlir::Value FusedBatchNormV3Op::variance() {
  return *getODSOperands(4).begin();
}

::mlir::MutableOperandRange FusedBatchNormV3Op::xMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange FusedBatchNormV3Op::scaleMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange FusedBatchNormV3Op::offsetMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange FusedBatchNormV3Op::meanMutable() {
  auto range = getODSOperandIndexAndLength(3);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange FusedBatchNormV3Op::varianceMutable() {
  auto range = getODSOperandIndexAndLength(4);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> FusedBatchNormV3Op::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range FusedBatchNormV3Op::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value FusedBatchNormV3Op::y() {
  return *getODSResults(0).begin();
}

::mlir::Value FusedBatchNormV3Op::batch_mean() {
  return *getODSResults(1).begin();
}

::mlir::Value FusedBatchNormV3Op::batch_variance() {
  return *getODSResults(2).begin();
}

::mlir::Value FusedBatchNormV3Op::reserve_space_1() {
  return *getODSResults(3).begin();
}

::mlir::Value FusedBatchNormV3Op::reserve_space_2() {
  return *getODSResults(4).begin();
}

::mlir::Value FusedBatchNormV3Op::reserve_space_3() {
  return *getODSResults(5).begin();
}

::mlir::FloatAttr FusedBatchNormV3Op::epsilonAttr() {
  return (*this)->getAttr(epsilonAttrName()).dyn_cast_or_null<::mlir::FloatAttr>();
}

::llvm::APFloat FusedBatchNormV3Op::epsilon() {
  auto attr = epsilonAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getFloatAttr(::mlir::Builder((*this)->getContext()).getF32Type(), 0.0001f).getValue();
  return attr.getValue();
}

::mlir::FloatAttr FusedBatchNormV3Op::exponential_avg_factorAttr() {
  return (*this)->getAttr(exponential_avg_factorAttrName()).dyn_cast_or_null<::mlir::FloatAttr>();
}

::llvm::APFloat FusedBatchNormV3Op::exponential_avg_factor() {
  auto attr = exponential_avg_factorAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getFloatAttr(::mlir::Builder((*this)->getContext()).getF32Type(), 1.0f).getValue();
  return attr.getValue();
}

::mlir::StringAttr FusedBatchNormV3Op::data_formatAttr() {
  return (*this)->getAttr(data_formatAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef FusedBatchNormV3Op::data_format() {
  auto attr = data_formatAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("NHWC").getValue();
  return attr.getValue();
}

::mlir::BoolAttr FusedBatchNormV3Op::is_trainingAttr() {
  return (*this)->getAttr(is_trainingAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool FusedBatchNormV3Op::is_training() {
  auto attr = is_trainingAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(true).getValue();
  return attr.getValue();
}

::mlir::Type FusedBatchNormV3Op::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

::mlir::Type FusedBatchNormV3Op::U() {
  return mlir::getElementTypeOrSelf(*getODSOperands(1).begin());
}

bool FusedBatchNormV3Op::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
  if (name == "U") return true;
 return false;
}

::mlir::DictionaryAttr FusedBatchNormV3Op::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())},
    {UAttrName(),
::mlir::TypeAttr::get(U())}});
}

void FusedBatchNormV3Op::epsilonAttr(::mlir::FloatAttr attr) {
  (*this)->setAttr(epsilonAttrName(), attr);
}

void FusedBatchNormV3Op::exponential_avg_factorAttr(::mlir::FloatAttr attr) {
  (*this)->setAttr(exponential_avg_factorAttrName(), attr);
}

void FusedBatchNormV3Op::data_formatAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(data_formatAttrName(), attr);
}

void FusedBatchNormV3Op::is_trainingAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(is_trainingAttrName(), attr);
}

void FusedBatchNormV3Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type y, ::mlir::Type batch_mean, ::mlir::Type batch_variance, ::mlir::Type reserve_space_1, ::mlir::Type reserve_space_2, ::mlir::Type reserve_space_3, ::mlir::Value x, ::mlir::Value scale, ::mlir::Value offset, ::mlir::Value mean, ::mlir::Value variance, ::mlir::FloatAttr epsilon, ::mlir::FloatAttr exponential_avg_factor, ::mlir::StringAttr data_format, ::mlir::BoolAttr is_training) {
  odsState.addOperands(x);
  odsState.addOperands(scale);
  odsState.addOperands(offset);
  odsState.addOperands(mean);
  odsState.addOperands(variance);
  odsState.addAttribute(epsilonAttrName(odsState.name), epsilon);
  odsState.addAttribute(exponential_avg_factorAttrName(odsState.name), exponential_avg_factor);
  odsState.addAttribute(data_formatAttrName(odsState.name), data_format);
  odsState.addAttribute(is_trainingAttrName(odsState.name), is_training);
  odsState.addTypes(y);
  odsState.addTypes(batch_mean);
  odsState.addTypes(batch_variance);
  odsState.addTypes(reserve_space_1);
  odsState.addTypes(reserve_space_2);
  odsState.addTypes(reserve_space_3);
}

void FusedBatchNormV3Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value x, ::mlir::Value scale, ::mlir::Value offset, ::mlir::Value mean, ::mlir::Value variance, ::mlir::FloatAttr epsilon, ::mlir::FloatAttr exponential_avg_factor, ::mlir::StringAttr data_format, ::mlir::BoolAttr is_training) {
  odsState.addOperands(x);
  odsState.addOperands(scale);
  odsState.addOperands(offset);
  odsState.addOperands(mean);
  odsState.addOperands(variance);
  odsState.addAttribute(epsilonAttrName(odsState.name), epsilon);
  odsState.addAttribute(exponential_avg_factorAttrName(odsState.name), exponential_avg_factor);
  odsState.addAttribute(data_formatAttrName(odsState.name), data_format);
  odsState.addAttribute(is_trainingAttrName(odsState.name), is_training);
  assert(resultTypes.size() == 6u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void FusedBatchNormV3Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type y, ::mlir::Type batch_mean, ::mlir::Type batch_variance, ::mlir::Type reserve_space_1, ::mlir::Type reserve_space_2, ::mlir::Type reserve_space_3, ::mlir::Value x, ::mlir::Value scale, ::mlir::Value offset, ::mlir::Value mean, ::mlir::Value variance, ::llvm::APFloat epsilon, ::llvm::APFloat exponential_avg_factor, ::llvm::StringRef data_format, bool is_training) {
  odsState.addOperands(x);
  odsState.addOperands(scale);
  odsState.addOperands(offset);
  odsState.addOperands(mean);
  odsState.addOperands(variance);
  odsState.addAttribute(epsilonAttrName(odsState.name), odsBuilder.getFloatAttr(odsBuilder.getF32Type(), epsilon));
  odsState.addAttribute(exponential_avg_factorAttrName(odsState.name), odsBuilder.getFloatAttr(odsBuilder.getF32Type(), exponential_avg_factor));
  odsState.addAttribute(data_formatAttrName(odsState.name), odsBuilder.getStringAttr(data_format));
  odsState.addAttribute(is_trainingAttrName(odsState.name), odsBuilder.getBoolAttr(is_training));
  odsState.addTypes(y);
  odsState.addTypes(batch_mean);
  odsState.addTypes(batch_variance);
  odsState.addTypes(reserve_space_1);
  odsState.addTypes(reserve_space_2);
  odsState.addTypes(reserve_space_3);
}

void FusedBatchNormV3Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value x, ::mlir::Value scale, ::mlir::Value offset, ::mlir::Value mean, ::mlir::Value variance, ::llvm::APFloat epsilon, ::llvm::APFloat exponential_avg_factor, ::llvm::StringRef data_format, bool is_training) {
  odsState.addOperands(x);
  odsState.addOperands(scale);
  odsState.addOperands(offset);
  odsState.addOperands(mean);
  odsState.addOperands(variance);
  odsState.addAttribute(epsilonAttrName(odsState.name), odsBuilder.getFloatAttr(odsBuilder.getF32Type(), epsilon));
  odsState.addAttribute(exponential_avg_factorAttrName(odsState.name), odsBuilder.getFloatAttr(odsBuilder.getF32Type(), exponential_avg_factor));
  odsState.addAttribute(data_formatAttrName(odsState.name), odsBuilder.getStringAttr(data_format));
  odsState.addAttribute(is_trainingAttrName(odsState.name), odsBuilder.getBoolAttr(is_training));
  assert(resultTypes.size() == 6u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void FusedBatchNormV3Op::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 5u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 6u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult FusedBatchNormV3Op::verify() {
  {
    auto tblgen_epsilon = (*this)->getAttr(epsilonAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops5(*this, tblgen_epsilon, "epsilon")))
      return ::mlir::failure();
  }
  {
    auto tblgen_exponential_avg_factor = (*this)->getAttr(exponential_avg_factorAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops5(*this, tblgen_exponential_avg_factor, "exponential_avg_factor")))
      return ::mlir::failure();
  }
  {
    auto tblgen_data_format = (*this)->getAttr(data_formatAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops25(*this, tblgen_data_format, "data_format")))
      return ::mlir::failure();
  }
  {
    auto tblgen_is_training = (*this)->getAttr(is_trainingAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_is_training, "is_training")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops44(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup3 = getODSOperands(3);

    for (auto v : valueGroup3) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup4 = getODSOperands(4);

    for (auto v : valueGroup4) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops44(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSResults(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSResults(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
    auto valueGroup3 = getODSResults(3);

    for (auto v : valueGroup3) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
    auto valueGroup4 = getODSResults(4);

    for (auto v : valueGroup4) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
    auto valueGroup5 = getODSResults(5);

    for (auto v : valueGroup5) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void FusedBatchNormV3Op::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::FusedBatchNormV3Op)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::GatherNdOp definitions
//===----------------------------------------------------------------------===//

GatherNdOpAdaptor::GatherNdOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

GatherNdOpAdaptor::GatherNdOpAdaptor(GatherNdOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange GatherNdOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> GatherNdOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange GatherNdOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value GatherNdOpAdaptor::params() {
  return *getODSOperands(0).begin();
}

::mlir::Value GatherNdOpAdaptor::indices() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr GatherNdOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult GatherNdOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> GatherNdOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range GatherNdOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value GatherNdOp::params() {
  return *getODSOperands(0).begin();
}

::mlir::Value GatherNdOp::indices() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange GatherNdOp::paramsMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange GatherNdOp::indicesMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> GatherNdOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range GatherNdOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value GatherNdOp::output() {
  return *getODSResults(0).begin();
}

::mlir::Type GatherNdOp::Tindices() {
  return mlir::getElementTypeOrSelf(*getODSOperands(1).begin());
}

::mlir::Type GatherNdOp::Tparams() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool GatherNdOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "Tindices") return true;
  if (name == "Tparams") return true;
 return false;
}

::mlir::DictionaryAttr GatherNdOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TindicesAttrName(),
::mlir::TypeAttr::get(Tindices())},
    {TparamsAttrName(),
::mlir::TypeAttr::get(Tparams())}});
}

void GatherNdOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value params, ::mlir::Value indices) {
  odsState.addOperands(params);
  odsState.addOperands(indices);
  odsState.addTypes(output);
}

void GatherNdOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value params, ::mlir::Value indices) {
  odsState.addOperands(params);
  odsState.addOperands(indices);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void GatherNdOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult GatherNdOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void GatherNdOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::GatherNdOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::GatherOp definitions
//===----------------------------------------------------------------------===//

GatherOpAdaptor::GatherOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

GatherOpAdaptor::GatherOpAdaptor(GatherOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange GatherOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> GatherOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange GatherOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value GatherOpAdaptor::params() {
  return *getODSOperands(0).begin();
}

::mlir::Value GatherOpAdaptor::indices() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr GatherOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::BoolAttr GatherOpAdaptor::validate_indices() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("validate_indices").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(true);
  return attr;
}

::mlir::LogicalResult GatherOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_validate_indices = odsAttrs.get("validate_indices");
    if (tblgen_validate_indices && !((tblgen_validate_indices.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.Gather' op ""attribute 'validate_indices' failed to satisfy constraint: bool attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> GatherOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range GatherOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value GatherOp::params() {
  return *getODSOperands(0).begin();
}

::mlir::Value GatherOp::indices() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange GatherOp::paramsMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange GatherOp::indicesMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> GatherOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range GatherOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value GatherOp::output() {
  return *getODSResults(0).begin();
}

::mlir::BoolAttr GatherOp::validate_indicesAttr() {
  return (*this)->getAttr(validate_indicesAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool GatherOp::validate_indices() {
  auto attr = validate_indicesAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(true).getValue();
  return attr.getValue();
}

::mlir::Type GatherOp::Tindices() {
  return mlir::getElementTypeOrSelf(*getODSOperands(1).begin());
}

::mlir::Type GatherOp::Tparams() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool GatherOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "Tindices") return true;
  if (name == "Tparams") return true;
 return false;
}

::mlir::DictionaryAttr GatherOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TindicesAttrName(),
::mlir::TypeAttr::get(Tindices())},
    {TparamsAttrName(),
::mlir::TypeAttr::get(Tparams())}});
}

void GatherOp::validate_indicesAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(validate_indicesAttrName(), attr);
}

void GatherOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value params, ::mlir::Value indices, ::mlir::BoolAttr validate_indices) {
  odsState.addOperands(params);
  odsState.addOperands(indices);
  odsState.addAttribute(validate_indicesAttrName(odsState.name), validate_indices);
  odsState.addTypes(output);
}

void GatherOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value params, ::mlir::Value indices, ::mlir::BoolAttr validate_indices) {
  odsState.addOperands(params);
  odsState.addOperands(indices);
  odsState.addAttribute(validate_indicesAttrName(odsState.name), validate_indices);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void GatherOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value params, ::mlir::Value indices, bool validate_indices) {
  odsState.addOperands(params);
  odsState.addOperands(indices);
  odsState.addAttribute(validate_indicesAttrName(odsState.name), odsBuilder.getBoolAttr(validate_indices));
  odsState.addTypes(output);
}

void GatherOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value params, ::mlir::Value indices, bool validate_indices) {
  odsState.addOperands(params);
  odsState.addOperands(indices);
  odsState.addAttribute(validate_indicesAttrName(odsState.name), odsBuilder.getBoolAttr(validate_indices));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void GatherOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult GatherOp::verify() {
  {
    auto tblgen_validate_indices = (*this)->getAttr(validate_indicesAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_validate_indices, "validate_indices")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void GatherOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::GatherOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::GatherV2Op definitions
//===----------------------------------------------------------------------===//

GatherV2OpAdaptor::GatherV2OpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

GatherV2OpAdaptor::GatherV2OpAdaptor(GatherV2Op &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange GatherV2OpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> GatherV2OpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange GatherV2OpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value GatherV2OpAdaptor::params() {
  return *getODSOperands(0).begin();
}

::mlir::Value GatherV2OpAdaptor::indices() {
  return *getODSOperands(1).begin();
}

::mlir::Value GatherV2OpAdaptor::axis() {
  return *getODSOperands(2).begin();
}

::mlir::DictionaryAttr GatherV2OpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::IntegerAttr GatherV2OpAdaptor::batch_dims() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("batch_dims").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), 0);
  return attr;
}

::mlir::LogicalResult GatherV2OpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_batch_dims = odsAttrs.get("batch_dims");
    if (tblgen_batch_dims && !(((tblgen_batch_dims.isa<::mlir::IntegerAttr>())) && ((tblgen_batch_dims.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.GatherV2' op ""attribute 'batch_dims' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> GatherV2Op::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range GatherV2Op::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value GatherV2Op::params() {
  return *getODSOperands(0).begin();
}

::mlir::Value GatherV2Op::indices() {
  return *getODSOperands(1).begin();
}

::mlir::Value GatherV2Op::axis() {
  return *getODSOperands(2).begin();
}

::mlir::MutableOperandRange GatherV2Op::paramsMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange GatherV2Op::indicesMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange GatherV2Op::axisMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> GatherV2Op::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range GatherV2Op::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value GatherV2Op::output() {
  return *getODSResults(0).begin();
}

::mlir::IntegerAttr GatherV2Op::batch_dimsAttr() {
  return (*this)->getAttr(batch_dimsAttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t GatherV2Op::batch_dims() {
  auto attr = batch_dimsAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), 0).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

::mlir::Type GatherV2Op::Taxis() {
  return mlir::getElementTypeOrSelf(*getODSOperands(2).begin());
}

::mlir::Type GatherV2Op::Tindices() {
  return mlir::getElementTypeOrSelf(*getODSOperands(1).begin());
}

::mlir::Type GatherV2Op::Tparams() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool GatherV2Op::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "Taxis") return true;
  if (name == "Tindices") return true;
  if (name == "Tparams") return true;
 return false;
}

::mlir::DictionaryAttr GatherV2Op::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TaxisAttrName(),
::mlir::TypeAttr::get(Taxis())},
    {TindicesAttrName(),
::mlir::TypeAttr::get(Tindices())},
    {TparamsAttrName(),
::mlir::TypeAttr::get(Tparams())}});
}

void GatherV2Op::batch_dimsAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(batch_dimsAttrName(), attr);
}

void GatherV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value params, ::mlir::Value indices, ::mlir::Value axis, ::mlir::IntegerAttr batch_dims) {
  odsState.addOperands(params);
  odsState.addOperands(indices);
  odsState.addOperands(axis);
  odsState.addAttribute(batch_dimsAttrName(odsState.name), batch_dims);
  odsState.addTypes(output);
}

void GatherV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value params, ::mlir::Value indices, ::mlir::Value axis, ::mlir::IntegerAttr batch_dims) {
  odsState.addOperands(params);
  odsState.addOperands(indices);
  odsState.addOperands(axis);
  odsState.addAttribute(batch_dimsAttrName(odsState.name), batch_dims);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void GatherV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value params, ::mlir::Value indices, ::mlir::Value axis, uint64_t batch_dims) {
  odsState.addOperands(params);
  odsState.addOperands(indices);
  odsState.addOperands(axis);
  odsState.addAttribute(batch_dimsAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), batch_dims));
  odsState.addTypes(output);
}

void GatherV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value params, ::mlir::Value indices, ::mlir::Value axis, uint64_t batch_dims) {
  odsState.addOperands(params);
  odsState.addOperands(indices);
  odsState.addOperands(axis);
  odsState.addAttribute(batch_dimsAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), batch_dims));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void GatherV2Op::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 3u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult GatherV2Op::verify() {
  {
    auto tblgen_batch_dims = (*this)->getAttr(batch_dimsAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_batch_dims, "batch_dims")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return Verify(*this);
}

void GatherV2Op::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::GatherV2Op)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::GeneratorDatasetOp definitions
//===----------------------------------------------------------------------===//

GeneratorDatasetOpAdaptor::GeneratorDatasetOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

GeneratorDatasetOpAdaptor::GeneratorDatasetOpAdaptor(GeneratorDatasetOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange GeneratorDatasetOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> GeneratorDatasetOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  assert(odsAttrs && "missing segment size attribute for op");
  auto sizeAttr = odsAttrs.get("operand_segment_sizes").cast<::mlir::DenseIntElementsAttr>();

  const uint32_t *sizeAttrValueIt = &*sizeAttr.value_begin<uint32_t>();
  if (sizeAttr.isSplat())
    return {*sizeAttrValueIt * index, *sizeAttrValueIt};

  unsigned start = 0;
  for (unsigned i = 0; i < index; ++i)
    start += sizeAttrValueIt[i];
  return {start, sizeAttrValueIt[index]};
}

::mlir::ValueRange GeneratorDatasetOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::ValueRange GeneratorDatasetOpAdaptor::init_func_other_args() {
  return getODSOperands(0);
}

::mlir::ValueRange GeneratorDatasetOpAdaptor::next_func_other_args() {
  return getODSOperands(1);
}

::mlir::ValueRange GeneratorDatasetOpAdaptor::finalize_func_other_args() {
  return getODSOperands(2);
}

::mlir::DictionaryAttr GeneratorDatasetOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::SymbolRefAttr GeneratorDatasetOpAdaptor::init_func() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::SymbolRefAttr attr = odsAttrs.get("init_func").cast<::mlir::SymbolRefAttr>();
  return attr;
}

::mlir::SymbolRefAttr GeneratorDatasetOpAdaptor::next_func() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::SymbolRefAttr attr = odsAttrs.get("next_func").cast<::mlir::SymbolRefAttr>();
  return attr;
}

::mlir::SymbolRefAttr GeneratorDatasetOpAdaptor::finalize_func() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::SymbolRefAttr attr = odsAttrs.get("finalize_func").cast<::mlir::SymbolRefAttr>();
  return attr;
}

::mlir::ArrayAttr GeneratorDatasetOpAdaptor::output_types() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("output_types").cast<::mlir::ArrayAttr>();
  return attr;
}

::mlir::ArrayAttr GeneratorDatasetOpAdaptor::output_shapes() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("output_shapes").cast<::mlir::ArrayAttr>();
  return attr;
}

::mlir::StringAttr GeneratorDatasetOpAdaptor::metadata() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("metadata").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("");
  return attr;
}

::mlir::LogicalResult GeneratorDatasetOpAdaptor::verify(::mlir::Location loc) {
  {
    auto sizeAttr = odsAttrs.get("operand_segment_sizes").dyn_cast<::mlir::DenseIntElementsAttr>();
    if (!sizeAttr)
      return emitError(loc, "'tf.GeneratorDataset' op ""missing segment sizes attribute 'operand_segment_sizes'");
    auto numElements =
        sizeAttr.getType().cast<::mlir::ShapedType>().getNumElements();
    if (numElements != 3)
      return emitError(loc, "'tf.GeneratorDataset' op ""'operand_segment_sizes' attribute for specifying operand segments must have 3 "
                "elements, but got ") << numElements;
  }
    {
    auto tblgen_init_func = odsAttrs.get("init_func");
    if (!tblgen_init_func)
      return emitError(loc, "'tf.GeneratorDataset' op ""requires attribute 'init_func'");

    if (tblgen_init_func && !((tblgen_init_func.isa<::mlir::SymbolRefAttr>())))
      return emitError(loc, "'tf.GeneratorDataset' op ""attribute 'init_func' failed to satisfy constraint: symbol reference attribute");
  }
  {
    auto tblgen_next_func = odsAttrs.get("next_func");
    if (!tblgen_next_func)
      return emitError(loc, "'tf.GeneratorDataset' op ""requires attribute 'next_func'");

    if (tblgen_next_func && !((tblgen_next_func.isa<::mlir::SymbolRefAttr>())))
      return emitError(loc, "'tf.GeneratorDataset' op ""attribute 'next_func' failed to satisfy constraint: symbol reference attribute");
  }
  {
    auto tblgen_finalize_func = odsAttrs.get("finalize_func");
    if (!tblgen_finalize_func)
      return emitError(loc, "'tf.GeneratorDataset' op ""requires attribute 'finalize_func'");

    if (tblgen_finalize_func && !((tblgen_finalize_func.isa<::mlir::SymbolRefAttr>())))
      return emitError(loc, "'tf.GeneratorDataset' op ""attribute 'finalize_func' failed to satisfy constraint: symbol reference attribute");
  }
  {
    auto tblgen_output_types = odsAttrs.get("output_types");
    if (!tblgen_output_types)
      return emitError(loc, "'tf.GeneratorDataset' op ""requires attribute 'output_types'");

    if (tblgen_output_types && !((((tblgen_output_types.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_output_types.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return ((attr.isa<::mlir::TypeAttr>())) && ((attr.cast<::mlir::TypeAttr>().getValue().isa<::mlir::Type>())); }))) && ((tblgen_output_types.cast<::mlir::ArrayAttr>().size() >= 1))))
      return emitError(loc, "'tf.GeneratorDataset' op ""attribute 'output_types' failed to satisfy constraint: type array attribute with at least 1 elements");
  }
  {
    auto tblgen_output_shapes = odsAttrs.get("output_shapes");
    if (!tblgen_output_shapes)
      return emitError(loc, "'tf.GeneratorDataset' op ""requires attribute 'output_shapes'");

    if (tblgen_output_shapes && !((((tblgen_output_shapes.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_output_shapes.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return (attr.isa<mlir::TF::ShapeAttr>()); }))) && ((tblgen_output_shapes.cast<::mlir::ArrayAttr>().size() >= 1))))
      return emitError(loc, "'tf.GeneratorDataset' op ""attribute 'output_shapes' failed to satisfy constraint: tensorflow shape attribute array with at least 1 elements");
  }
  {
    auto tblgen_metadata = odsAttrs.get("metadata");
    if (tblgen_metadata && !((tblgen_metadata.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.GeneratorDataset' op ""attribute 'metadata' failed to satisfy constraint: string attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> GeneratorDatasetOp::getODSOperandIndexAndLength(unsigned index) {
  auto sizeAttr =
      (*this)->getAttr(operand_segment_sizesAttrName()).cast<::mlir::DenseIntElementsAttr>();

  const uint32_t *sizeAttrValueIt = &*sizeAttr.value_begin<uint32_t>();
  if (sizeAttr.isSplat())
    return {*sizeAttrValueIt * index, *sizeAttrValueIt};

  unsigned start = 0;
  for (unsigned i = 0; i < index; ++i)
    start += sizeAttrValueIt[i];
  return {start, sizeAttrValueIt[index]};
}

::mlir::Operation::operand_range GeneratorDatasetOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Operation::operand_range GeneratorDatasetOp::init_func_other_args() {
  return getODSOperands(0);
}

::mlir::Operation::operand_range GeneratorDatasetOp::next_func_other_args() {
  return getODSOperands(1);
}

::mlir::Operation::operand_range GeneratorDatasetOp::finalize_func_other_args() {
  return getODSOperands(2);
}

::mlir::MutableOperandRange GeneratorDatasetOp::init_func_other_argsMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second, ::mlir::MutableOperandRange::OperandSegment(0u, *getOperation()->getAttrDictionary().getNamed(operand_segment_sizesAttrName())));
  return mutableRange;
}

::mlir::MutableOperandRange GeneratorDatasetOp::next_func_other_argsMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second, ::mlir::MutableOperandRange::OperandSegment(1u, *getOperation()->getAttrDictionary().getNamed(operand_segment_sizesAttrName())));
  return mutableRange;
}

::mlir::MutableOperandRange GeneratorDatasetOp::finalize_func_other_argsMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second, ::mlir::MutableOperandRange::OperandSegment(2u, *getOperation()->getAttrDictionary().getNamed(operand_segment_sizesAttrName())));
  return mutableRange;
}

std::pair<unsigned, unsigned> GeneratorDatasetOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range GeneratorDatasetOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value GeneratorDatasetOp::handle() {
  return *getODSResults(0).begin();
}

::mlir::SymbolRefAttr GeneratorDatasetOp::init_funcAttr() {
  return (*this)->getAttr(init_funcAttrName()).cast<::mlir::SymbolRefAttr>();
}

::mlir::SymbolRefAttr GeneratorDatasetOp::init_func() {
  auto attr = init_funcAttr();
  return attr;
}

::mlir::SymbolRefAttr GeneratorDatasetOp::next_funcAttr() {
  return (*this)->getAttr(next_funcAttrName()).cast<::mlir::SymbolRefAttr>();
}

::mlir::SymbolRefAttr GeneratorDatasetOp::next_func() {
  auto attr = next_funcAttr();
  return attr;
}

::mlir::SymbolRefAttr GeneratorDatasetOp::finalize_funcAttr() {
  return (*this)->getAttr(finalize_funcAttrName()).cast<::mlir::SymbolRefAttr>();
}

::mlir::SymbolRefAttr GeneratorDatasetOp::finalize_func() {
  auto attr = finalize_funcAttr();
  return attr;
}

::mlir::ArrayAttr GeneratorDatasetOp::output_typesAttr() {
  return (*this)->getAttr(output_typesAttrName()).cast<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr GeneratorDatasetOp::output_types() {
  auto attr = output_typesAttr();
  return attr;
}

::mlir::ArrayAttr GeneratorDatasetOp::output_shapesAttr() {
  return (*this)->getAttr(output_shapesAttrName()).cast<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr GeneratorDatasetOp::output_shapes() {
  auto attr = output_shapesAttr();
  return attr;
}

::mlir::StringAttr GeneratorDatasetOp::metadataAttr() {
  return (*this)->getAttr(metadataAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef GeneratorDatasetOp::metadata() {
  auto attr = metadataAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("").getValue();
  return attr.getValue();
}

mlir::OperandElementTypeRange GeneratorDatasetOp::Tfinalize_func_args() {
  auto values = getODSOperands(2);
return {mlir::OperandElementTypeIterator(values.begin()), mlir::OperandElementTypeIterator(values.end())};
}

mlir::OperandElementTypeRange GeneratorDatasetOp::Tinit_func_args() {
  auto values = getODSOperands(0);
return {mlir::OperandElementTypeIterator(values.begin()), mlir::OperandElementTypeIterator(values.end())};
}

mlir::OperandElementTypeRange GeneratorDatasetOp::Tnext_func_args() {
  auto values = getODSOperands(1);
return {mlir::OperandElementTypeIterator(values.begin()), mlir::OperandElementTypeIterator(values.end())};
}

bool GeneratorDatasetOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "Tfinalize_func_args") return true;
  if (name == "Tinit_func_args") return true;
  if (name == "Tnext_func_args") return true;
 return false;
}

::mlir::DictionaryAttr GeneratorDatasetOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {Tfinalize_func_argsAttrName(),
ArrayAttr::get(ctx, 
    [&]() {
      llvm::SmallVector<Attribute, 4> ret;
      for (auto t : Tfinalize_func_args())
        ret.push_back(TypeAttr::get(t));
      return ret;
    }())},
    {Tinit_func_argsAttrName(),
ArrayAttr::get(ctx, 
    [&]() {
      llvm::SmallVector<Attribute, 4> ret;
      for (auto t : Tinit_func_args())
        ret.push_back(TypeAttr::get(t));
      return ret;
    }())},
    {Tnext_func_argsAttrName(),
ArrayAttr::get(ctx, 
    [&]() {
      llvm::SmallVector<Attribute, 4> ret;
      for (auto t : Tnext_func_args())
        ret.push_back(TypeAttr::get(t));
      return ret;
    }())}});
}

void GeneratorDatasetOp::init_funcAttr(::mlir::SymbolRefAttr attr) {
  (*this)->setAttr(init_funcAttrName(), attr);
}

void GeneratorDatasetOp::next_funcAttr(::mlir::SymbolRefAttr attr) {
  (*this)->setAttr(next_funcAttrName(), attr);
}

void GeneratorDatasetOp::finalize_funcAttr(::mlir::SymbolRefAttr attr) {
  (*this)->setAttr(finalize_funcAttrName(), attr);
}

void GeneratorDatasetOp::output_typesAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(output_typesAttrName(), attr);
}

void GeneratorDatasetOp::output_shapesAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(output_shapesAttrName(), attr);
}

void GeneratorDatasetOp::metadataAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(metadataAttrName(), attr);
}

void GeneratorDatasetOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type handle, ::mlir::ValueRange init_func_other_args, ::mlir::ValueRange next_func_other_args, ::mlir::ValueRange finalize_func_other_args, ::mlir::SymbolRefAttr init_func, ::mlir::SymbolRefAttr next_func, ::mlir::SymbolRefAttr finalize_func, ::mlir::ArrayAttr output_types, ::mlir::ArrayAttr output_shapes, ::mlir::StringAttr metadata) {
  odsState.addOperands(init_func_other_args);
  odsState.addOperands(next_func_other_args);
  odsState.addOperands(finalize_func_other_args);
  odsState.addAttribute(operand_segment_sizesAttrName(odsState.name), odsBuilder.getI32VectorAttr({static_cast<int32_t>(init_func_other_args.size()), static_cast<int32_t>(next_func_other_args.size()), static_cast<int32_t>(finalize_func_other_args.size())}));
  odsState.addAttribute(init_funcAttrName(odsState.name), init_func);
  odsState.addAttribute(next_funcAttrName(odsState.name), next_func);
  odsState.addAttribute(finalize_funcAttrName(odsState.name), finalize_func);
  odsState.addAttribute(output_typesAttrName(odsState.name), output_types);
  odsState.addAttribute(output_shapesAttrName(odsState.name), output_shapes);
  odsState.addAttribute(metadataAttrName(odsState.name), metadata);
  odsState.addTypes(handle);
}

void GeneratorDatasetOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange init_func_other_args, ::mlir::ValueRange next_func_other_args, ::mlir::ValueRange finalize_func_other_args, ::mlir::SymbolRefAttr init_func, ::mlir::SymbolRefAttr next_func, ::mlir::SymbolRefAttr finalize_func, ::mlir::ArrayAttr output_types, ::mlir::ArrayAttr output_shapes, ::mlir::StringAttr metadata) {
  odsState.addOperands(init_func_other_args);
  odsState.addOperands(next_func_other_args);
  odsState.addOperands(finalize_func_other_args);
  odsState.addAttribute(operand_segment_sizesAttrName(odsState.name), odsBuilder.getI32VectorAttr({static_cast<int32_t>(init_func_other_args.size()), static_cast<int32_t>(next_func_other_args.size()), static_cast<int32_t>(finalize_func_other_args.size())}));
  odsState.addAttribute(init_funcAttrName(odsState.name), init_func);
  odsState.addAttribute(next_funcAttrName(odsState.name), next_func);
  odsState.addAttribute(finalize_funcAttrName(odsState.name), finalize_func);
  odsState.addAttribute(output_typesAttrName(odsState.name), output_types);
  odsState.addAttribute(output_shapesAttrName(odsState.name), output_shapes);
  odsState.addAttribute(metadataAttrName(odsState.name), metadata);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void GeneratorDatasetOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type handle, ::mlir::ValueRange init_func_other_args, ::mlir::ValueRange next_func_other_args, ::mlir::ValueRange finalize_func_other_args, ::mlir::SymbolRefAttr init_func, ::mlir::SymbolRefAttr next_func, ::mlir::SymbolRefAttr finalize_func, ::mlir::ArrayAttr output_types, ::mlir::ArrayAttr output_shapes, ::llvm::StringRef metadata) {
  odsState.addOperands(init_func_other_args);
  odsState.addOperands(next_func_other_args);
  odsState.addOperands(finalize_func_other_args);
  odsState.addAttribute(operand_segment_sizesAttrName(odsState.name), odsBuilder.getI32VectorAttr({static_cast<int32_t>(init_func_other_args.size()), static_cast<int32_t>(next_func_other_args.size()), static_cast<int32_t>(finalize_func_other_args.size())}));
  odsState.addAttribute(init_funcAttrName(odsState.name), init_func);
  odsState.addAttribute(next_funcAttrName(odsState.name), next_func);
  odsState.addAttribute(finalize_funcAttrName(odsState.name), finalize_func);
  odsState.addAttribute(output_typesAttrName(odsState.name), output_types);
  odsState.addAttribute(output_shapesAttrName(odsState.name), output_shapes);
  odsState.addAttribute(metadataAttrName(odsState.name), odsBuilder.getStringAttr(metadata));
  odsState.addTypes(handle);
}

void GeneratorDatasetOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange init_func_other_args, ::mlir::ValueRange next_func_other_args, ::mlir::ValueRange finalize_func_other_args, ::mlir::SymbolRefAttr init_func, ::mlir::SymbolRefAttr next_func, ::mlir::SymbolRefAttr finalize_func, ::mlir::ArrayAttr output_types, ::mlir::ArrayAttr output_shapes, ::llvm::StringRef metadata) {
  odsState.addOperands(init_func_other_args);
  odsState.addOperands(next_func_other_args);
  odsState.addOperands(finalize_func_other_args);
  odsState.addAttribute(operand_segment_sizesAttrName(odsState.name), odsBuilder.getI32VectorAttr({static_cast<int32_t>(init_func_other_args.size()), static_cast<int32_t>(next_func_other_args.size()), static_cast<int32_t>(finalize_func_other_args.size())}));
  odsState.addAttribute(init_funcAttrName(odsState.name), init_func);
  odsState.addAttribute(next_funcAttrName(odsState.name), next_func);
  odsState.addAttribute(finalize_funcAttrName(odsState.name), finalize_func);
  odsState.addAttribute(output_typesAttrName(odsState.name), output_types);
  odsState.addAttribute(output_shapesAttrName(odsState.name), output_shapes);
  odsState.addAttribute(metadataAttrName(odsState.name), odsBuilder.getStringAttr(metadata));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void GeneratorDatasetOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult GeneratorDatasetOp::verify() {
  {
    auto sizeAttr = (*this)->getAttr(operand_segment_sizesAttrName()).dyn_cast<::mlir::DenseIntElementsAttr>();
    if (!sizeAttr)
      return emitOpError("missing segment sizes attribute 'operand_segment_sizes'");
    auto numElements =
        sizeAttr.getType().cast<::mlir::ShapedType>().getNumElements();
    if (numElements != 3)
      return emitOpError("'operand_segment_sizes' attribute for specifying operand segments must have 3 "
                "elements, but got ") << numElements;
  }
    {
    auto tblgen_init_func = (*this)->getAttr(init_funcAttrName());
    if (!tblgen_init_func)
      return emitOpError("requires attribute 'init_func'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops12(*this, tblgen_init_func, "init_func")))
      return ::mlir::failure();
  }
  {
    auto tblgen_next_func = (*this)->getAttr(next_funcAttrName());
    if (!tblgen_next_func)
      return emitOpError("requires attribute 'next_func'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops12(*this, tblgen_next_func, "next_func")))
      return ::mlir::failure();
  }
  {
    auto tblgen_finalize_func = (*this)->getAttr(finalize_funcAttrName());
    if (!tblgen_finalize_func)
      return emitOpError("requires attribute 'finalize_func'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops12(*this, tblgen_finalize_func, "finalize_func")))
      return ::mlir::failure();
  }
  {
    auto tblgen_output_types = (*this)->getAttr(output_typesAttrName());
    if (!tblgen_output_types)
      return emitOpError("requires attribute 'output_types'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops2(*this, tblgen_output_types, "output_types")))
      return ::mlir::failure();
  }
  {
    auto tblgen_output_shapes = (*this)->getAttr(output_shapesAttrName());
    if (!tblgen_output_shapes)
      return emitOpError("requires attribute 'output_shapes'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops3(*this, tblgen_output_shapes, "output_shapes")))
      return ::mlir::failure();
  }
  {
    auto tblgen_metadata = (*this)->getAttr(metadataAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_metadata, "metadata")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops15(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void GeneratorDatasetOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  effects.emplace_back(::mlir::MemoryEffects::Write::get(), ::mlir::TF::ResourceEffects::GeneratorOp::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::GeneratorDatasetOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::GreaterEqualOp definitions
//===----------------------------------------------------------------------===//

GreaterEqualOpAdaptor::GreaterEqualOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

GreaterEqualOpAdaptor::GreaterEqualOpAdaptor(GreaterEqualOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange GreaterEqualOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> GreaterEqualOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange GreaterEqualOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value GreaterEqualOpAdaptor::x() {
  return *getODSOperands(0).begin();
}

::mlir::Value GreaterEqualOpAdaptor::y() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr GreaterEqualOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult GreaterEqualOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> GreaterEqualOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range GreaterEqualOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value GreaterEqualOp::x() {
  return *getODSOperands(0).begin();
}

::mlir::Value GreaterEqualOp::y() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange GreaterEqualOp::xMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange GreaterEqualOp::yMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> GreaterEqualOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range GreaterEqualOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value GreaterEqualOp::z() {
  return *getODSResults(0).begin();
}

::mlir::Type GreaterEqualOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool GreaterEqualOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr GreaterEqualOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void GreaterEqualOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, Value x, Value y) {
  Type resultType;
  if (x.getType().isa<UnrankedTensorType>() ||
      y.getType().isa<UnrankedTensorType>()) {
    resultType = UnrankedTensorType::get(odsBuilder.getI1Type());
  } else {
    SmallVector<int64_t, 4> resultShape;
    if (!OpTrait::util::getBroadcastedShape(
            x.getType().cast<ShapedType>().getShape(),
            y.getType().cast<ShapedType>().getShape(), resultShape)) {
      mlir::emitError(odsState.location,
                      "operands have no broadcastable shapes");
    }

    resultType = RankedTensorType::get(resultShape, odsBuilder.getI1Type());
  }
  return build(odsBuilder, odsState, resultType, x, y);
}

void GreaterEqualOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type z, ::mlir::Value x, ::mlir::Value y) {
  odsState.addOperands(x);
  odsState.addOperands(y);
  odsState.addTypes(z);
}

void GreaterEqualOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value x, ::mlir::Value y) {
  odsState.addOperands(x);
  odsState.addOperands(y);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void GreaterEqualOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult GreaterEqualOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops35(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops35(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops8(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void GreaterEqualOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::GreaterEqualOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::GreaterOp definitions
//===----------------------------------------------------------------------===//

GreaterOpAdaptor::GreaterOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

GreaterOpAdaptor::GreaterOpAdaptor(GreaterOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange GreaterOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> GreaterOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange GreaterOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value GreaterOpAdaptor::x() {
  return *getODSOperands(0).begin();
}

::mlir::Value GreaterOpAdaptor::y() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr GreaterOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult GreaterOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> GreaterOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range GreaterOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value GreaterOp::x() {
  return *getODSOperands(0).begin();
}

::mlir::Value GreaterOp::y() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange GreaterOp::xMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange GreaterOp::yMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> GreaterOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range GreaterOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value GreaterOp::z() {
  return *getODSResults(0).begin();
}

::mlir::Type GreaterOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool GreaterOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr GreaterOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void GreaterOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, Value x, Value y) {
  Type resultType;
  if (x.getType().isa<UnrankedTensorType>() ||
      y.getType().isa<UnrankedTensorType>()) {
    resultType = UnrankedTensorType::get(odsBuilder.getI1Type());
  } else {
    SmallVector<int64_t, 4> resultShape;
    if (!OpTrait::util::getBroadcastedShape(
            x.getType().cast<ShapedType>().getShape(),
            y.getType().cast<ShapedType>().getShape(), resultShape)) {
      mlir::emitError(odsState.location,
                      "operands have no broadcastable shapes");
    }

    resultType = RankedTensorType::get(resultShape, odsBuilder.getI1Type());
  }
  return build(odsBuilder, odsState, resultType, x, y);
}

void GreaterOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type z, ::mlir::Value x, ::mlir::Value y) {
  odsState.addOperands(x);
  odsState.addOperands(y);
  odsState.addTypes(z);
}

void GreaterOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value x, ::mlir::Value y) {
  odsState.addOperands(x);
  odsState.addOperands(y);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void GreaterOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult GreaterOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops35(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops35(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops8(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void GreaterOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::GreaterOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::HSVToRGBOp definitions
//===----------------------------------------------------------------------===//

HSVToRGBOpAdaptor::HSVToRGBOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

HSVToRGBOpAdaptor::HSVToRGBOpAdaptor(HSVToRGBOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange HSVToRGBOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> HSVToRGBOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange HSVToRGBOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value HSVToRGBOpAdaptor::images() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr HSVToRGBOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult HSVToRGBOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> HSVToRGBOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range HSVToRGBOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value HSVToRGBOp::images() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange HSVToRGBOp::imagesMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> HSVToRGBOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range HSVToRGBOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value HSVToRGBOp::output() {
  return *getODSResults(0).begin();
}

::mlir::Type HSVToRGBOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool HSVToRGBOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr HSVToRGBOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void HSVToRGBOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value images) {
  odsState.addOperands(images);
  odsState.addTypes(output);
}

void HSVToRGBOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value images) {
  odsState.addOperands(images);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void HSVToRGBOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult HSVToRGBOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void HSVToRGBOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::HSVToRGBOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::HashTableOp definitions
//===----------------------------------------------------------------------===//

HashTableOpAdaptor::HashTableOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

HashTableOpAdaptor::HashTableOpAdaptor(HashTableOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange HashTableOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> HashTableOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange HashTableOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::DictionaryAttr HashTableOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::StringAttr HashTableOpAdaptor::container() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("container").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("");
  return attr;
}

::mlir::StringAttr HashTableOpAdaptor::shared_name() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("shared_name").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("");
  return attr;
}

::mlir::BoolAttr HashTableOpAdaptor::use_node_name_sharing() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("use_node_name_sharing").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(false);
  return attr;
}

::mlir::TypeAttr HashTableOpAdaptor::key_dtype() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::TypeAttr attr = odsAttrs.get("key_dtype").cast<::mlir::TypeAttr>();
  return attr;
}

::mlir::TypeAttr HashTableOpAdaptor::value_dtype() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::TypeAttr attr = odsAttrs.get("value_dtype").cast<::mlir::TypeAttr>();
  return attr;
}

::mlir::LogicalResult HashTableOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_container = odsAttrs.get("container");
    if (tblgen_container && !((tblgen_container.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.HashTable' op ""attribute 'container' failed to satisfy constraint: string attribute");
  }
  {
    auto tblgen_shared_name = odsAttrs.get("shared_name");
    if (tblgen_shared_name && !((tblgen_shared_name.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.HashTable' op ""attribute 'shared_name' failed to satisfy constraint: string attribute");
  }
  {
    auto tblgen_use_node_name_sharing = odsAttrs.get("use_node_name_sharing");
    if (tblgen_use_node_name_sharing && !((tblgen_use_node_name_sharing.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.HashTable' op ""attribute 'use_node_name_sharing' failed to satisfy constraint: bool attribute");
  }
  {
    auto tblgen_key_dtype = odsAttrs.get("key_dtype");
    if (!tblgen_key_dtype)
      return emitError(loc, "'tf.HashTable' op ""requires attribute 'key_dtype'");

    if (tblgen_key_dtype && !(((tblgen_key_dtype.isa<::mlir::TypeAttr>())) && ((tblgen_key_dtype.cast<::mlir::TypeAttr>().getValue().isa<::mlir::Type>()))))
      return emitError(loc, "'tf.HashTable' op ""attribute 'key_dtype' failed to satisfy constraint: any type attribute");
  }
  {
    auto tblgen_value_dtype = odsAttrs.get("value_dtype");
    if (!tblgen_value_dtype)
      return emitError(loc, "'tf.HashTable' op ""requires attribute 'value_dtype'");

    if (tblgen_value_dtype && !(((tblgen_value_dtype.isa<::mlir::TypeAttr>())) && ((tblgen_value_dtype.cast<::mlir::TypeAttr>().getValue().isa<::mlir::Type>()))))
      return emitError(loc, "'tf.HashTable' op ""attribute 'value_dtype' failed to satisfy constraint: any type attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> HashTableOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range HashTableOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

std::pair<unsigned, unsigned> HashTableOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range HashTableOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value HashTableOp::table_handle() {
  return *getODSResults(0).begin();
}

::mlir::StringAttr HashTableOp::containerAttr() {
  return (*this)->getAttr(containerAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef HashTableOp::container() {
  auto attr = containerAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("").getValue();
  return attr.getValue();
}

::mlir::StringAttr HashTableOp::shared_nameAttr() {
  return (*this)->getAttr(shared_nameAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef HashTableOp::shared_name() {
  auto attr = shared_nameAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("").getValue();
  return attr.getValue();
}

::mlir::BoolAttr HashTableOp::use_node_name_sharingAttr() {
  return (*this)->getAttr(use_node_name_sharingAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool HashTableOp::use_node_name_sharing() {
  auto attr = use_node_name_sharingAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(false).getValue();
  return attr.getValue();
}

::mlir::TypeAttr HashTableOp::key_dtypeAttr() {
  return (*this)->getAttr(key_dtypeAttrName()).cast<::mlir::TypeAttr>();
}

::mlir::Type HashTableOp::key_dtype() {
  auto attr = key_dtypeAttr();
  return attr.getValue().cast<::mlir::Type>();
}

::mlir::TypeAttr HashTableOp::value_dtypeAttr() {
  return (*this)->getAttr(value_dtypeAttrName()).cast<::mlir::TypeAttr>();
}

::mlir::Type HashTableOp::value_dtype() {
  auto attr = value_dtypeAttr();
  return attr.getValue().cast<::mlir::Type>();
}

void HashTableOp::containerAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(containerAttrName(), attr);
}

void HashTableOp::shared_nameAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(shared_nameAttrName(), attr);
}

void HashTableOp::use_node_name_sharingAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(use_node_name_sharingAttrName(), attr);
}

void HashTableOp::key_dtypeAttr(::mlir::TypeAttr attr) {
  (*this)->setAttr(key_dtypeAttrName(), attr);
}

void HashTableOp::value_dtypeAttr(::mlir::TypeAttr attr) {
  (*this)->setAttr(value_dtypeAttrName(), attr);
}

void HashTableOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type table_handle, ::mlir::StringAttr container, ::mlir::StringAttr shared_name, ::mlir::BoolAttr use_node_name_sharing, ::mlir::TypeAttr key_dtype, ::mlir::TypeAttr value_dtype) {
  odsState.addAttribute(containerAttrName(odsState.name), container);
  odsState.addAttribute(shared_nameAttrName(odsState.name), shared_name);
  odsState.addAttribute(use_node_name_sharingAttrName(odsState.name), use_node_name_sharing);
  odsState.addAttribute(key_dtypeAttrName(odsState.name), key_dtype);
  odsState.addAttribute(value_dtypeAttrName(odsState.name), value_dtype);
  odsState.addTypes(table_handle);
}

void HashTableOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::StringAttr container, ::mlir::StringAttr shared_name, ::mlir::BoolAttr use_node_name_sharing, ::mlir::TypeAttr key_dtype, ::mlir::TypeAttr value_dtype) {
  odsState.addAttribute(containerAttrName(odsState.name), container);
  odsState.addAttribute(shared_nameAttrName(odsState.name), shared_name);
  odsState.addAttribute(use_node_name_sharingAttrName(odsState.name), use_node_name_sharing);
  odsState.addAttribute(key_dtypeAttrName(odsState.name), key_dtype);
  odsState.addAttribute(value_dtypeAttrName(odsState.name), value_dtype);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void HashTableOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type table_handle, ::llvm::StringRef container, ::llvm::StringRef shared_name, bool use_node_name_sharing, ::mlir::Type key_dtype, ::mlir::Type value_dtype) {
  odsState.addAttribute(containerAttrName(odsState.name), odsBuilder.getStringAttr(container));
  odsState.addAttribute(shared_nameAttrName(odsState.name), odsBuilder.getStringAttr(shared_name));
  odsState.addAttribute(use_node_name_sharingAttrName(odsState.name), odsBuilder.getBoolAttr(use_node_name_sharing));
  odsState.addAttribute(key_dtypeAttrName(odsState.name), ::mlir::TypeAttr::get(key_dtype));
  odsState.addAttribute(value_dtypeAttrName(odsState.name), ::mlir::TypeAttr::get(value_dtype));
  odsState.addTypes(table_handle);
}

void HashTableOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::llvm::StringRef container, ::llvm::StringRef shared_name, bool use_node_name_sharing, ::mlir::Type key_dtype, ::mlir::Type value_dtype) {
  odsState.addAttribute(containerAttrName(odsState.name), odsBuilder.getStringAttr(container));
  odsState.addAttribute(shared_nameAttrName(odsState.name), odsBuilder.getStringAttr(shared_name));
  odsState.addAttribute(use_node_name_sharingAttrName(odsState.name), odsBuilder.getBoolAttr(use_node_name_sharing));
  odsState.addAttribute(key_dtypeAttrName(odsState.name), ::mlir::TypeAttr::get(key_dtype));
  odsState.addAttribute(value_dtypeAttrName(odsState.name), ::mlir::TypeAttr::get(value_dtype));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void HashTableOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 0u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult HashTableOp::verify() {
  {
    auto tblgen_container = (*this)->getAttr(containerAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_container, "container")))
      return ::mlir::failure();
  }
  {
    auto tblgen_shared_name = (*this)->getAttr(shared_nameAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_shared_name, "shared_name")))
      return ::mlir::failure();
  }
  {
    auto tblgen_use_node_name_sharing = (*this)->getAttr(use_node_name_sharingAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_use_node_name_sharing, "use_node_name_sharing")))
      return ::mlir::failure();
  }
  {
    auto tblgen_key_dtype = (*this)->getAttr(key_dtypeAttrName());
    if (!tblgen_key_dtype)
      return emitOpError("requires attribute 'key_dtype'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops26(*this, tblgen_key_dtype, "key_dtype")))
      return ::mlir::failure();
  }
  {
    auto tblgen_value_dtype = (*this)->getAttr(value_dtypeAttrName());
    if (!tblgen_value_dtype)
      return emitOpError("requires attribute 'value_dtype'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops26(*this, tblgen_value_dtype, "value_dtype")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops19(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void HashTableOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  for (::mlir::Value value : getODSResults(0))
    effects.emplace_back(::mlir::MemoryEffects::Allocate::get(), value, ::mlir::TF::ResourceEffects::LookupTable::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::HashTableOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::HashTableV2Op definitions
//===----------------------------------------------------------------------===//

HashTableV2OpAdaptor::HashTableV2OpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

HashTableV2OpAdaptor::HashTableV2OpAdaptor(HashTableV2Op &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange HashTableV2OpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> HashTableV2OpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange HashTableV2OpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::DictionaryAttr HashTableV2OpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::StringAttr HashTableV2OpAdaptor::container() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("container").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("");
  return attr;
}

::mlir::StringAttr HashTableV2OpAdaptor::shared_name() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("shared_name").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("");
  return attr;
}

::mlir::BoolAttr HashTableV2OpAdaptor::use_node_name_sharing() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("use_node_name_sharing").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(false);
  return attr;
}

::mlir::TypeAttr HashTableV2OpAdaptor::key_dtype() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::TypeAttr attr = odsAttrs.get("key_dtype").cast<::mlir::TypeAttr>();
  return attr;
}

::mlir::TypeAttr HashTableV2OpAdaptor::value_dtype() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::TypeAttr attr = odsAttrs.get("value_dtype").cast<::mlir::TypeAttr>();
  return attr;
}

::mlir::LogicalResult HashTableV2OpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_container = odsAttrs.get("container");
    if (tblgen_container && !((tblgen_container.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.HashTableV2' op ""attribute 'container' failed to satisfy constraint: string attribute");
  }
  {
    auto tblgen_shared_name = odsAttrs.get("shared_name");
    if (tblgen_shared_name && !((tblgen_shared_name.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.HashTableV2' op ""attribute 'shared_name' failed to satisfy constraint: string attribute");
  }
  {
    auto tblgen_use_node_name_sharing = odsAttrs.get("use_node_name_sharing");
    if (tblgen_use_node_name_sharing && !((tblgen_use_node_name_sharing.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.HashTableV2' op ""attribute 'use_node_name_sharing' failed to satisfy constraint: bool attribute");
  }
  {
    auto tblgen_key_dtype = odsAttrs.get("key_dtype");
    if (!tblgen_key_dtype)
      return emitError(loc, "'tf.HashTableV2' op ""requires attribute 'key_dtype'");

    if (tblgen_key_dtype && !(((tblgen_key_dtype.isa<::mlir::TypeAttr>())) && ((tblgen_key_dtype.cast<::mlir::TypeAttr>().getValue().isa<::mlir::Type>()))))
      return emitError(loc, "'tf.HashTableV2' op ""attribute 'key_dtype' failed to satisfy constraint: any type attribute");
  }
  {
    auto tblgen_value_dtype = odsAttrs.get("value_dtype");
    if (!tblgen_value_dtype)
      return emitError(loc, "'tf.HashTableV2' op ""requires attribute 'value_dtype'");

    if (tblgen_value_dtype && !(((tblgen_value_dtype.isa<::mlir::TypeAttr>())) && ((tblgen_value_dtype.cast<::mlir::TypeAttr>().getValue().isa<::mlir::Type>()))))
      return emitError(loc, "'tf.HashTableV2' op ""attribute 'value_dtype' failed to satisfy constraint: any type attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> HashTableV2Op::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range HashTableV2Op::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

std::pair<unsigned, unsigned> HashTableV2Op::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range HashTableV2Op::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value HashTableV2Op::table_handle() {
  return *getODSResults(0).begin();
}

::mlir::StringAttr HashTableV2Op::containerAttr() {
  return (*this)->getAttr(containerAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef HashTableV2Op::container() {
  auto attr = containerAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("").getValue();
  return attr.getValue();
}

::mlir::StringAttr HashTableV2Op::shared_nameAttr() {
  return (*this)->getAttr(shared_nameAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef HashTableV2Op::shared_name() {
  auto attr = shared_nameAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("").getValue();
  return attr.getValue();
}

::mlir::BoolAttr HashTableV2Op::use_node_name_sharingAttr() {
  return (*this)->getAttr(use_node_name_sharingAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool HashTableV2Op::use_node_name_sharing() {
  auto attr = use_node_name_sharingAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(false).getValue();
  return attr.getValue();
}

::mlir::TypeAttr HashTableV2Op::key_dtypeAttr() {
  return (*this)->getAttr(key_dtypeAttrName()).cast<::mlir::TypeAttr>();
}

::mlir::Type HashTableV2Op::key_dtype() {
  auto attr = key_dtypeAttr();
  return attr.getValue().cast<::mlir::Type>();
}

::mlir::TypeAttr HashTableV2Op::value_dtypeAttr() {
  return (*this)->getAttr(value_dtypeAttrName()).cast<::mlir::TypeAttr>();
}

::mlir::Type HashTableV2Op::value_dtype() {
  auto attr = value_dtypeAttr();
  return attr.getValue().cast<::mlir::Type>();
}

void HashTableV2Op::containerAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(containerAttrName(), attr);
}

void HashTableV2Op::shared_nameAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(shared_nameAttrName(), attr);
}

void HashTableV2Op::use_node_name_sharingAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(use_node_name_sharingAttrName(), attr);
}

void HashTableV2Op::key_dtypeAttr(::mlir::TypeAttr attr) {
  (*this)->setAttr(key_dtypeAttrName(), attr);
}

void HashTableV2Op::value_dtypeAttr(::mlir::TypeAttr attr) {
  (*this)->setAttr(value_dtypeAttrName(), attr);
}

void HashTableV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, StringAttr container, StringAttr shared_name, BoolAttr use_node_name_sharing, TypeAttr key_dtype, TypeAttr value_dtype) {
      build(odsBuilder, odsState,
      mlir::RankedTensorType::get({},
      odsBuilder.getType<mlir::TF::ResourceType>()),
      container, shared_name, use_node_name_sharing, key_dtype, value_dtype);
    
}

void HashTableV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type table_handle, ::mlir::StringAttr container, ::mlir::StringAttr shared_name, ::mlir::BoolAttr use_node_name_sharing, ::mlir::TypeAttr key_dtype, ::mlir::TypeAttr value_dtype) {
  odsState.addAttribute(containerAttrName(odsState.name), container);
  odsState.addAttribute(shared_nameAttrName(odsState.name), shared_name);
  odsState.addAttribute(use_node_name_sharingAttrName(odsState.name), use_node_name_sharing);
  odsState.addAttribute(key_dtypeAttrName(odsState.name), key_dtype);
  odsState.addAttribute(value_dtypeAttrName(odsState.name), value_dtype);
  odsState.addTypes(table_handle);
}

void HashTableV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::StringAttr container, ::mlir::StringAttr shared_name, ::mlir::BoolAttr use_node_name_sharing, ::mlir::TypeAttr key_dtype, ::mlir::TypeAttr value_dtype) {
  odsState.addAttribute(containerAttrName(odsState.name), container);
  odsState.addAttribute(shared_nameAttrName(odsState.name), shared_name);
  odsState.addAttribute(use_node_name_sharingAttrName(odsState.name), use_node_name_sharing);
  odsState.addAttribute(key_dtypeAttrName(odsState.name), key_dtype);
  odsState.addAttribute(value_dtypeAttrName(odsState.name), value_dtype);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void HashTableV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type table_handle, ::llvm::StringRef container, ::llvm::StringRef shared_name, bool use_node_name_sharing, ::mlir::Type key_dtype, ::mlir::Type value_dtype) {
  odsState.addAttribute(containerAttrName(odsState.name), odsBuilder.getStringAttr(container));
  odsState.addAttribute(shared_nameAttrName(odsState.name), odsBuilder.getStringAttr(shared_name));
  odsState.addAttribute(use_node_name_sharingAttrName(odsState.name), odsBuilder.getBoolAttr(use_node_name_sharing));
  odsState.addAttribute(key_dtypeAttrName(odsState.name), ::mlir::TypeAttr::get(key_dtype));
  odsState.addAttribute(value_dtypeAttrName(odsState.name), ::mlir::TypeAttr::get(value_dtype));
  odsState.addTypes(table_handle);
}

void HashTableV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::llvm::StringRef container, ::llvm::StringRef shared_name, bool use_node_name_sharing, ::mlir::Type key_dtype, ::mlir::Type value_dtype) {
  odsState.addAttribute(containerAttrName(odsState.name), odsBuilder.getStringAttr(container));
  odsState.addAttribute(shared_nameAttrName(odsState.name), odsBuilder.getStringAttr(shared_name));
  odsState.addAttribute(use_node_name_sharingAttrName(odsState.name), odsBuilder.getBoolAttr(use_node_name_sharing));
  odsState.addAttribute(key_dtypeAttrName(odsState.name), ::mlir::TypeAttr::get(key_dtype));
  odsState.addAttribute(value_dtypeAttrName(odsState.name), ::mlir::TypeAttr::get(value_dtype));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void HashTableV2Op::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 0u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult HashTableV2Op::verify() {
  {
    auto tblgen_container = (*this)->getAttr(containerAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_container, "container")))
      return ::mlir::failure();
  }
  {
    auto tblgen_shared_name = (*this)->getAttr(shared_nameAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_shared_name, "shared_name")))
      return ::mlir::failure();
  }
  {
    auto tblgen_use_node_name_sharing = (*this)->getAttr(use_node_name_sharingAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_use_node_name_sharing, "use_node_name_sharing")))
      return ::mlir::failure();
  }
  {
    auto tblgen_key_dtype = (*this)->getAttr(key_dtypeAttrName());
    if (!tblgen_key_dtype)
      return emitOpError("requires attribute 'key_dtype'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops26(*this, tblgen_key_dtype, "key_dtype")))
      return ::mlir::failure();
  }
  {
    auto tblgen_value_dtype = (*this)->getAttr(value_dtypeAttrName());
    if (!tblgen_value_dtype)
      return emitOpError("requires attribute 'value_dtype'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops26(*this, tblgen_value_dtype, "value_dtype")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void HashTableV2Op::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  for (::mlir::Value value : getODSResults(0))
    effects.emplace_back(::mlir::MemoryEffects::Allocate::get(), value, ::mlir::TF::ResourceEffects::LookupTable::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::HashTableV2Op)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::IFFT2DOp definitions
//===----------------------------------------------------------------------===//

IFFT2DOpAdaptor::IFFT2DOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

IFFT2DOpAdaptor::IFFT2DOpAdaptor(IFFT2DOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange IFFT2DOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> IFFT2DOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange IFFT2DOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value IFFT2DOpAdaptor::input() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr IFFT2DOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult IFFT2DOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> IFFT2DOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range IFFT2DOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value IFFT2DOp::input() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange IFFT2DOp::inputMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> IFFT2DOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range IFFT2DOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value IFFT2DOp::output() {
  return *getODSResults(0).begin();
}

::mlir::Type IFFT2DOp::Tcomplex() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool IFFT2DOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "Tcomplex") return true;
 return false;
}

::mlir::DictionaryAttr IFFT2DOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TcomplexAttrName(),
::mlir::TypeAttr::get(Tcomplex())}});
}

void IFFT2DOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input) {
  odsState.addOperands(input);
  odsState.addTypes(output);
}

void IFFT2DOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input) {
  odsState.addOperands(input);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void IFFT2DOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult IFFT2DOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops12(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops12(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void IFFT2DOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::IFFT2DOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::IFFT3DOp definitions
//===----------------------------------------------------------------------===//

IFFT3DOpAdaptor::IFFT3DOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

IFFT3DOpAdaptor::IFFT3DOpAdaptor(IFFT3DOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange IFFT3DOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> IFFT3DOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange IFFT3DOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value IFFT3DOpAdaptor::input() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr IFFT3DOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult IFFT3DOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> IFFT3DOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range IFFT3DOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value IFFT3DOp::input() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange IFFT3DOp::inputMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> IFFT3DOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range IFFT3DOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value IFFT3DOp::output() {
  return *getODSResults(0).begin();
}

::mlir::Type IFFT3DOp::Tcomplex() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool IFFT3DOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "Tcomplex") return true;
 return false;
}

::mlir::DictionaryAttr IFFT3DOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TcomplexAttrName(),
::mlir::TypeAttr::get(Tcomplex())}});
}

void IFFT3DOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input) {
  odsState.addOperands(input);
  odsState.addTypes(output);
}

void IFFT3DOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input) {
  odsState.addOperands(input);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void IFFT3DOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult IFFT3DOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops12(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops12(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void IFFT3DOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::IFFT3DOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::IFFTOp definitions
//===----------------------------------------------------------------------===//

IFFTOpAdaptor::IFFTOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

IFFTOpAdaptor::IFFTOpAdaptor(IFFTOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange IFFTOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> IFFTOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange IFFTOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value IFFTOpAdaptor::input() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr IFFTOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult IFFTOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> IFFTOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range IFFTOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value IFFTOp::input() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange IFFTOp::inputMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> IFFTOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range IFFTOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value IFFTOp::output() {
  return *getODSResults(0).begin();
}

::mlir::Type IFFTOp::Tcomplex() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool IFFTOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "Tcomplex") return true;
 return false;
}

::mlir::DictionaryAttr IFFTOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TcomplexAttrName(),
::mlir::TypeAttr::get(Tcomplex())}});
}

void IFFTOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input) {
  odsState.addOperands(input);
  odsState.addTypes(output);
}

void IFFTOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input) {
  odsState.addOperands(input);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void IFFTOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult IFFTOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops12(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops12(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void IFFTOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::IFFTOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::IRFFT2DOp definitions
//===----------------------------------------------------------------------===//

IRFFT2DOpAdaptor::IRFFT2DOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

IRFFT2DOpAdaptor::IRFFT2DOpAdaptor(IRFFT2DOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange IRFFT2DOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> IRFFT2DOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange IRFFT2DOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value IRFFT2DOpAdaptor::input() {
  return *getODSOperands(0).begin();
}

::mlir::Value IRFFT2DOpAdaptor::fft_length() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr IRFFT2DOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult IRFFT2DOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> IRFFT2DOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range IRFFT2DOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value IRFFT2DOp::input() {
  return *getODSOperands(0).begin();
}

::mlir::Value IRFFT2DOp::fft_length() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange IRFFT2DOp::inputMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange IRFFT2DOp::fft_lengthMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> IRFFT2DOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range IRFFT2DOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value IRFFT2DOp::output() {
  return *getODSResults(0).begin();
}

::mlir::Type IRFFT2DOp::Tcomplex() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

::mlir::Type IRFFT2DOp::Treal() {
  return mlir::getElementTypeOrSelf(*getODSResults(0).begin());
}

bool IRFFT2DOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "Tcomplex") return true;
  if (name == "Treal") return true;
 return false;
}

::mlir::DictionaryAttr IRFFT2DOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TcomplexAttrName(),
::mlir::TypeAttr::get(Tcomplex())},
    {TrealAttrName(),
::mlir::TypeAttr::get(Treal())}});
}

void IRFFT2DOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input, ::mlir::Value fft_length) {
  odsState.addOperands(input);
  odsState.addOperands(fft_length);
  odsState.addTypes(output);
}

void IRFFT2DOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::Value fft_length) {
  odsState.addOperands(input);
  odsState.addOperands(fft_length);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void IRFFT2DOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult IRFFT2DOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops12(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops11(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops13(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void IRFFT2DOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::IRFFT2DOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::IRFFT3DOp definitions
//===----------------------------------------------------------------------===//

IRFFT3DOpAdaptor::IRFFT3DOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

IRFFT3DOpAdaptor::IRFFT3DOpAdaptor(IRFFT3DOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange IRFFT3DOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> IRFFT3DOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange IRFFT3DOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value IRFFT3DOpAdaptor::input() {
  return *getODSOperands(0).begin();
}

::mlir::Value IRFFT3DOpAdaptor::fft_length() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr IRFFT3DOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult IRFFT3DOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> IRFFT3DOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range IRFFT3DOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value IRFFT3DOp::input() {
  return *getODSOperands(0).begin();
}

::mlir::Value IRFFT3DOp::fft_length() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange IRFFT3DOp::inputMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange IRFFT3DOp::fft_lengthMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> IRFFT3DOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range IRFFT3DOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value IRFFT3DOp::output() {
  return *getODSResults(0).begin();
}

::mlir::Type IRFFT3DOp::Tcomplex() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

::mlir::Type IRFFT3DOp::Treal() {
  return mlir::getElementTypeOrSelf(*getODSResults(0).begin());
}

bool IRFFT3DOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "Tcomplex") return true;
  if (name == "Treal") return true;
 return false;
}

::mlir::DictionaryAttr IRFFT3DOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TcomplexAttrName(),
::mlir::TypeAttr::get(Tcomplex())},
    {TrealAttrName(),
::mlir::TypeAttr::get(Treal())}});
}

void IRFFT3DOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input, ::mlir::Value fft_length) {
  odsState.addOperands(input);
  odsState.addOperands(fft_length);
  odsState.addTypes(output);
}

void IRFFT3DOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::Value fft_length) {
  odsState.addOperands(input);
  odsState.addOperands(fft_length);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void IRFFT3DOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult IRFFT3DOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops12(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops11(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops13(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void IRFFT3DOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::IRFFT3DOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::IRFFTOp definitions
//===----------------------------------------------------------------------===//

IRFFTOpAdaptor::IRFFTOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

IRFFTOpAdaptor::IRFFTOpAdaptor(IRFFTOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange IRFFTOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> IRFFTOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange IRFFTOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value IRFFTOpAdaptor::input() {
  return *getODSOperands(0).begin();
}

::mlir::Value IRFFTOpAdaptor::fft_length() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr IRFFTOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult IRFFTOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> IRFFTOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range IRFFTOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value IRFFTOp::input() {
  return *getODSOperands(0).begin();
}

::mlir::Value IRFFTOp::fft_length() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange IRFFTOp::inputMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange IRFFTOp::fft_lengthMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> IRFFTOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range IRFFTOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value IRFFTOp::output() {
  return *getODSResults(0).begin();
}

::mlir::Type IRFFTOp::Tcomplex() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

::mlir::Type IRFFTOp::Treal() {
  return mlir::getElementTypeOrSelf(*getODSResults(0).begin());
}

bool IRFFTOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "Tcomplex") return true;
  if (name == "Treal") return true;
 return false;
}

::mlir::DictionaryAttr IRFFTOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TcomplexAttrName(),
::mlir::TypeAttr::get(Tcomplex())},
    {TrealAttrName(),
::mlir::TypeAttr::get(Treal())}});
}

void IRFFTOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input, ::mlir::Value fft_length) {
  odsState.addOperands(input);
  odsState.addOperands(fft_length);
  odsState.addTypes(output);
}

void IRFFTOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::Value fft_length) {
  odsState.addOperands(input);
  odsState.addOperands(fft_length);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void IRFFTOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult IRFFTOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops12(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops11(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops13(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void IRFFTOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::IRFFTOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::IdentityNOp definitions
//===----------------------------------------------------------------------===//

IdentityNOpAdaptor::IdentityNOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

IdentityNOpAdaptor::IdentityNOpAdaptor(IdentityNOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange IdentityNOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> IdentityNOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  bool isVariadic[] = {true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (odsOperands.size() - 0) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::ValueRange IdentityNOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::ValueRange IdentityNOpAdaptor::input() {
  return getODSOperands(0);
}

::mlir::DictionaryAttr IdentityNOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult IdentityNOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> IdentityNOp::getODSOperandIndexAndLength(unsigned index) {
  bool isVariadic[] = {true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (getOperation()->getNumOperands() - 0) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::Operation::operand_range IdentityNOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Operation::operand_range IdentityNOp::input() {
  return getODSOperands(0);
}

::mlir::MutableOperandRange IdentityNOp::inputMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> IdentityNOp::getODSResultIndexAndLength(unsigned index) {
  bool isVariadic[] = {true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (getOperation()->getNumResults() - 0) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::Operation::result_range IdentityNOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Operation::result_range IdentityNOp::output() {
  return getODSResults(0);
}

mlir::OperandElementTypeRange IdentityNOp::T() {
  auto values = getODSOperands(0);
return {mlir::OperandElementTypeIterator(values.begin()), mlir::OperandElementTypeIterator(values.end())};
}

bool IdentityNOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr IdentityNOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
ArrayAttr::get(ctx, 
    [&]() {
      llvm::SmallVector<Attribute, 4> ret;
      for (auto t : T())
        ret.push_back(TypeAttr::get(t));
      return ret;
    }())}});
}

void IdentityNOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult IdentityNOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void IdentityNOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::IdentityNOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::IdentityOp definitions
//===----------------------------------------------------------------------===//

IdentityOpAdaptor::IdentityOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

IdentityOpAdaptor::IdentityOpAdaptor(IdentityOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange IdentityOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> IdentityOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange IdentityOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value IdentityOpAdaptor::input() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr IdentityOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult IdentityOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> IdentityOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range IdentityOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value IdentityOp::input() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange IdentityOp::inputMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> IdentityOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range IdentityOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value IdentityOp::output() {
  return *getODSResults(0).begin();
}

::mlir::Type IdentityOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool IdentityOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr IdentityOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void IdentityOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input) {
  odsState.addOperands(input);
  odsState.addTypes(output);
}

void IdentityOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input) {
  odsState.addOperands(input);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void IdentityOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult IdentityOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void IdentityOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::IdentityOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::IfOp definitions
//===----------------------------------------------------------------------===//

IfOpAdaptor::IfOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

IfOpAdaptor::IfOpAdaptor(IfOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange IfOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> IfOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  bool isVariadic[] = {false, true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (odsOperands.size() - 1) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::ValueRange IfOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value IfOpAdaptor::cond() {
  return *getODSOperands(0).begin();
}

::mlir::ValueRange IfOpAdaptor::input() {
  return getODSOperands(1);
}

::mlir::DictionaryAttr IfOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::FlatSymbolRefAttr IfOpAdaptor::then_branch() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::FlatSymbolRefAttr attr = odsAttrs.get("then_branch").cast<::mlir::FlatSymbolRefAttr>();
  return attr;
}

::mlir::FlatSymbolRefAttr IfOpAdaptor::else_branch() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::FlatSymbolRefAttr attr = odsAttrs.get("else_branch").cast<::mlir::FlatSymbolRefAttr>();
  return attr;
}

::mlir::BoolAttr IfOpAdaptor::is_stateless() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("is_stateless").cast<::mlir::BoolAttr>();
  return attr;
}

::mlir::LogicalResult IfOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_then_branch = odsAttrs.get("then_branch");
    if (!tblgen_then_branch)
      return emitError(loc, "'tf.If' op ""requires attribute 'then_branch'");

    if (tblgen_then_branch && !((tblgen_then_branch.isa<::mlir::FlatSymbolRefAttr>())))
      return emitError(loc, "'tf.If' op ""attribute 'then_branch' failed to satisfy constraint: flat symbol reference attribute");
  }
  {
    auto tblgen_else_branch = odsAttrs.get("else_branch");
    if (!tblgen_else_branch)
      return emitError(loc, "'tf.If' op ""requires attribute 'else_branch'");

    if (tblgen_else_branch && !((tblgen_else_branch.isa<::mlir::FlatSymbolRefAttr>())))
      return emitError(loc, "'tf.If' op ""attribute 'else_branch' failed to satisfy constraint: flat symbol reference attribute");
  }
  {
    auto tblgen_is_stateless = odsAttrs.get("is_stateless");
    if (!tblgen_is_stateless)
      return emitError(loc, "'tf.If' op ""requires attribute 'is_stateless'");

    if (tblgen_is_stateless && !((tblgen_is_stateless.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.If' op ""attribute 'is_stateless' failed to satisfy constraint: bool attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> IfOp::getODSOperandIndexAndLength(unsigned index) {
  bool isVariadic[] = {false, true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (getOperation()->getNumOperands() - 1) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::Operation::operand_range IfOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value IfOp::cond() {
  return *getODSOperands(0).begin();
}

::mlir::Operation::operand_range IfOp::input() {
  return getODSOperands(1);
}

::mlir::MutableOperandRange IfOp::condMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange IfOp::inputMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> IfOp::getODSResultIndexAndLength(unsigned index) {
  bool isVariadic[] = {true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (getOperation()->getNumResults() - 0) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::Operation::result_range IfOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Operation::result_range IfOp::output() {
  return getODSResults(0);
}

::mlir::FlatSymbolRefAttr IfOp::then_branchAttr() {
  return (*this)->getAttr(then_branchAttrName()).cast<::mlir::FlatSymbolRefAttr>();
}

::llvm::StringRef IfOp::then_branch() {
  auto attr = then_branchAttr();
  return attr.getValue();
}

::mlir::FlatSymbolRefAttr IfOp::else_branchAttr() {
  return (*this)->getAttr(else_branchAttrName()).cast<::mlir::FlatSymbolRefAttr>();
}

::llvm::StringRef IfOp::else_branch() {
  auto attr = else_branchAttr();
  return attr.getValue();
}

::mlir::BoolAttr IfOp::is_statelessAttr() {
  return (*this)->getAttr(is_statelessAttrName()).cast<::mlir::BoolAttr>();
}

bool IfOp::is_stateless() {
  auto attr = is_statelessAttr();
  return attr.getValue();
}

::mlir::Type IfOp::Tcond() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

mlir::OperandElementTypeRange IfOp::Tin() {
  auto values = getODSOperands(1);
return {mlir::OperandElementTypeIterator(values.begin()), mlir::OperandElementTypeIterator(values.end())};
}

mlir::ResultElementTypeRange IfOp::Tout() {
  auto values = getODSResults(0);
return {mlir::ResultElementTypeIterator(values.begin()), mlir::ResultElementTypeIterator(values.end())};
}

mlir::TF::ResultShapeRange IfOp::output_shapes() {
  auto values = getODSResults(0);
return {mlir::TF::ResultShapeIterator(values.begin()), mlir::TF::ResultShapeIterator(values.end())};
}

bool IfOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "Tcond") return true;
  if (name == "Tin") return true;
  if (name == "Tout") return true;
  if (name == "output_shapes") return true;
 return false;
}

::mlir::DictionaryAttr IfOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TcondAttrName(),
::mlir::TypeAttr::get(Tcond())},
    {TinAttrName(),
ArrayAttr::get(ctx, 
    [&]() {
      llvm::SmallVector<Attribute, 4> ret;
      for (auto t : Tin())
        ret.push_back(TypeAttr::get(t));
      return ret;
    }())},
    {ToutAttrName(),
ArrayAttr::get(ctx, 
    [&]() {
      llvm::SmallVector<Attribute, 4> ret;
      for (auto t : Tout())
        ret.push_back(TypeAttr::get(t));
      return ret;
    }())},
    {output_shapesAttrName(),
ArrayAttr::get(ctx,
      [&](){
        llvm::SmallVector<Attribute, 4> ret;
        for (auto shape : output_shapes())
          ret.push_back(mlir::TF::ShapeAttr::get(ctx, shape));
        return ret;
      }())}});
}

void IfOp::then_branchAttr(::mlir::FlatSymbolRefAttr attr) {
  (*this)->setAttr(then_branchAttrName(), attr);
}

void IfOp::else_branchAttr(::mlir::FlatSymbolRefAttr attr) {
  (*this)->setAttr(else_branchAttrName(), attr);
}

void IfOp::is_statelessAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(is_statelessAttrName(), attr);
}

void IfOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange output, ::mlir::Value cond, ::mlir::ValueRange input, ::mlir::FlatSymbolRefAttr then_branch, ::mlir::FlatSymbolRefAttr else_branch, ::mlir::BoolAttr is_stateless) {
  odsState.addOperands(cond);
  odsState.addOperands(input);
  odsState.addAttribute(then_branchAttrName(odsState.name), then_branch);
  odsState.addAttribute(else_branchAttrName(odsState.name), else_branch);
  odsState.addAttribute(is_statelessAttrName(odsState.name), is_stateless);
  odsState.addTypes(output);
}

void IfOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange output, ::mlir::Value cond, ::mlir::ValueRange input, ::llvm::StringRef then_branch, ::llvm::StringRef else_branch, bool is_stateless) {
  odsState.addOperands(cond);
  odsState.addOperands(input);
  odsState.addAttribute(then_branchAttrName(odsState.name), ::mlir::SymbolRefAttr::get(odsBuilder.getContext(), then_branch));
  odsState.addAttribute(else_branchAttrName(odsState.name), ::mlir::SymbolRefAttr::get(odsBuilder.getContext(), else_branch));
  odsState.addAttribute(is_statelessAttrName(odsState.name), odsBuilder.getBoolAttr(is_stateless));
  odsState.addTypes(output);
}

void IfOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() >= 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult IfOp::verify() {
  {
    auto tblgen_then_branch = (*this)->getAttr(then_branchAttrName());
    if (!tblgen_then_branch)
      return emitOpError("requires attribute 'then_branch'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops27(*this, tblgen_then_branch, "then_branch")))
      return ::mlir::failure();
  }
  {
    auto tblgen_else_branch = (*this)->getAttr(else_branchAttrName());
    if (!tblgen_else_branch)
      return emitOpError("requires attribute 'else_branch'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops27(*this, tblgen_else_branch, "else_branch")))
      return ::mlir::failure();
  }
  {
    auto tblgen_is_stateless = (*this)->getAttr(is_statelessAttrName());
    if (!tblgen_is_stateless)
      return emitOpError("requires attribute 'is_stateless'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_is_stateless, "is_stateless")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::IfOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::IfRegionOp definitions
//===----------------------------------------------------------------------===//

IfRegionOpAdaptor::IfRegionOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

IfRegionOpAdaptor::IfRegionOpAdaptor(IfRegionOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange IfRegionOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> IfRegionOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange IfRegionOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value IfRegionOpAdaptor::cond() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr IfRegionOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::BoolAttr IfRegionOpAdaptor::is_stateless() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("is_stateless").cast<::mlir::BoolAttr>();
  return attr;
}

::mlir::StringAttr IfRegionOpAdaptor::_then_func_name() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("_then_func_name").dyn_cast_or_null<::mlir::StringAttr>();
  return attr;
}

::mlir::StringAttr IfRegionOpAdaptor::_else_func_name() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("_else_func_name").dyn_cast_or_null<::mlir::StringAttr>();
  return attr;
}

::mlir::RegionRange IfRegionOpAdaptor::getRegions() {
  return odsRegions;
}

::mlir::Region &IfRegionOpAdaptor::then_branch() {
  return *odsRegions[0];
}

::mlir::Region &IfRegionOpAdaptor::else_branch() {
  return *odsRegions[1];
}

::mlir::LogicalResult IfRegionOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_is_stateless = odsAttrs.get("is_stateless");
    if (!tblgen_is_stateless)
      return emitError(loc, "'tf.IfRegion' op ""requires attribute 'is_stateless'");

    if (tblgen_is_stateless && !((tblgen_is_stateless.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.IfRegion' op ""attribute 'is_stateless' failed to satisfy constraint: bool attribute");
  }
  {
    auto tblgen__then_func_name = odsAttrs.get("_then_func_name");
    if (tblgen__then_func_name && !((tblgen__then_func_name.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.IfRegion' op ""attribute '_then_func_name' failed to satisfy constraint: string attribute");
  }
  {
    auto tblgen__else_func_name = odsAttrs.get("_else_func_name");
    if (tblgen__else_func_name && !((tblgen__else_func_name.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.IfRegion' op ""attribute '_else_func_name' failed to satisfy constraint: string attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> IfRegionOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range IfRegionOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value IfRegionOp::cond() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange IfRegionOp::condMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> IfRegionOp::getODSResultIndexAndLength(unsigned index) {
  bool isVariadic[] = {true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (getOperation()->getNumResults() - 0) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::Operation::result_range IfRegionOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Operation::result_range IfRegionOp::output() {
  return getODSResults(0);
}

::mlir::Region &IfRegionOp::then_branch() {
  return (*this)->getRegion(0);
}

::mlir::Region &IfRegionOp::else_branch() {
  return (*this)->getRegion(1);
}

::mlir::BoolAttr IfRegionOp::is_statelessAttr() {
  return (*this)->getAttr(is_statelessAttrName()).cast<::mlir::BoolAttr>();
}

bool IfRegionOp::is_stateless() {
  auto attr = is_statelessAttr();
  return attr.getValue();
}

::mlir::StringAttr IfRegionOp::_then_func_nameAttr() {
  return (*this)->getAttr(_then_func_nameAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::Optional< ::llvm::StringRef > IfRegionOp::_then_func_name() {
  auto attr = _then_func_nameAttr();
  return attr ? ::llvm::Optional< ::llvm::StringRef >(attr.getValue()) : (::llvm::None);
}

::mlir::StringAttr IfRegionOp::_else_func_nameAttr() {
  return (*this)->getAttr(_else_func_nameAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::Optional< ::llvm::StringRef > IfRegionOp::_else_func_name() {
  auto attr = _else_func_nameAttr();
  return attr ? ::llvm::Optional< ::llvm::StringRef >(attr.getValue()) : (::llvm::None);
}

void IfRegionOp::is_statelessAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(is_statelessAttrName(), attr);
}

void IfRegionOp::_then_func_nameAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(_then_func_nameAttrName(), attr);
}

void IfRegionOp::_else_func_nameAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(_else_func_nameAttrName(), attr);
}

::mlir::Attribute IfRegionOp::remove_then_func_nameAttr() {
  return (*this)->removeAttr(_then_func_nameAttrName());
}

::mlir::Attribute IfRegionOp::remove_else_func_nameAttr() {
  return (*this)->removeAttr(_else_func_nameAttrName());
}

void IfRegionOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, TypeRange resultTypes, ValueRange operands, llvm::ArrayRef<::mlir::NamedAttribute> attributes, unsigned numRegions) {
      assert(numRegions == 2u && "mismatched number of regions");
      build(odsBuilder, odsState, resultTypes, operands, attributes);
    
}

void IfRegionOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange output, ::mlir::Value cond, ::mlir::BoolAttr is_stateless, /*optional*/::mlir::StringAttr _then_func_name, /*optional*/::mlir::StringAttr _else_func_name) {
  odsState.addOperands(cond);
  odsState.addAttribute(is_statelessAttrName(odsState.name), is_stateless);
  if (_then_func_name) {
  odsState.addAttribute(_then_func_nameAttrName(odsState.name), _then_func_name);
  }
  if (_else_func_name) {
  odsState.addAttribute(_else_func_nameAttrName(odsState.name), _else_func_name);
  }
  (void)odsState.addRegion();
  (void)odsState.addRegion();
  odsState.addTypes(output);
}

void IfRegionOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange output, ::mlir::Value cond, bool is_stateless, /*optional*/::mlir::StringAttr _then_func_name, /*optional*/::mlir::StringAttr _else_func_name) {
  odsState.addOperands(cond);
  odsState.addAttribute(is_statelessAttrName(odsState.name), odsBuilder.getBoolAttr(is_stateless));
  if (_then_func_name) {
  odsState.addAttribute(_then_func_nameAttrName(odsState.name), _then_func_name);
  }
  if (_else_func_name) {
  odsState.addAttribute(_else_func_nameAttrName(odsState.name), _else_func_name);
  }
  (void)odsState.addRegion();
  (void)odsState.addRegion();
  odsState.addTypes(output);
}

void IfRegionOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  for (unsigned i = 0; i != 2; ++i)
    (void)odsState.addRegion();
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult IfRegionOp::verify() {
  {
    auto tblgen_is_stateless = (*this)->getAttr(is_statelessAttrName());
    if (!tblgen_is_stateless)
      return emitOpError("requires attribute 'is_stateless'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_is_stateless, "is_stateless")))
      return ::mlir::failure();
  }
  {
    auto tblgen__then_func_name = (*this)->getAttr(_then_func_nameAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen__then_func_name, "_then_func_name")))
      return ::mlir::failure();
  }
  {
    auto tblgen__else_func_name = (*this)->getAttr(_else_func_nameAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen__else_func_name, "_else_func_name")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops45(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;

    for (auto &region : ::llvm::makeMutableArrayRef((*this)->getRegion(0)))
      if (::mlir::failed(__mlir_ods_local_region_constraint_tf_ops0(*this, region, "then_branch", index++)))
        return ::mlir::failure();

    for (auto &region : ::llvm::makeMutableArrayRef((*this)->getRegion(1)))
      if (::mlir::failed(__mlir_ods_local_region_constraint_tf_ops0(*this, region, "else_branch", index++)))
        return ::mlir::failure();
  }
  return Verify(*this);
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::IfRegionOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::IgammaGradAOp definitions
//===----------------------------------------------------------------------===//

IgammaGradAOpAdaptor::IgammaGradAOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

IgammaGradAOpAdaptor::IgammaGradAOpAdaptor(IgammaGradAOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange IgammaGradAOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> IgammaGradAOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange IgammaGradAOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value IgammaGradAOpAdaptor::a() {
  return *getODSOperands(0).begin();
}

::mlir::Value IgammaGradAOpAdaptor::x() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr IgammaGradAOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult IgammaGradAOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> IgammaGradAOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range IgammaGradAOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value IgammaGradAOp::a() {
  return *getODSOperands(0).begin();
}

::mlir::Value IgammaGradAOp::x() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange IgammaGradAOp::aMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange IgammaGradAOp::xMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> IgammaGradAOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range IgammaGradAOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value IgammaGradAOp::z() {
  return *getODSResults(0).begin();
}

::mlir::Type IgammaGradAOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool IgammaGradAOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr IgammaGradAOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void IgammaGradAOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, Value x, Value y) {
  auto resultType =
      OpTrait::util::getBroadcastedType(x.getType(), y.getType());
  if (!resultType)
    mlir::emitError(odsState.location, "non-broadcastable operands");
  return build(odsBuilder, odsState, resultType, x, y);
}

void IgammaGradAOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type z, ::mlir::Value a, ::mlir::Value x) {
  odsState.addOperands(a);
  odsState.addOperands(x);
  odsState.addTypes(z);
}

void IgammaGradAOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value a, ::mlir::Value x) {
  odsState.addOperands(a);
  odsState.addOperands(x);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void IgammaGradAOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult IgammaGradAOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops13(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops13(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops13(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void IgammaGradAOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::IgammaGradAOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::IgammaOp definitions
//===----------------------------------------------------------------------===//

IgammaOpAdaptor::IgammaOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

IgammaOpAdaptor::IgammaOpAdaptor(IgammaOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange IgammaOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> IgammaOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange IgammaOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value IgammaOpAdaptor::a() {
  return *getODSOperands(0).begin();
}

::mlir::Value IgammaOpAdaptor::x() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr IgammaOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult IgammaOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> IgammaOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range IgammaOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value IgammaOp::a() {
  return *getODSOperands(0).begin();
}

::mlir::Value IgammaOp::x() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange IgammaOp::aMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange IgammaOp::xMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> IgammaOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range IgammaOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value IgammaOp::z() {
  return *getODSResults(0).begin();
}

::mlir::Type IgammaOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool IgammaOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr IgammaOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void IgammaOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, Value x, Value y) {
  auto resultType =
      OpTrait::util::getBroadcastedType(x.getType(), y.getType());
  if (!resultType)
    mlir::emitError(odsState.location, "non-broadcastable operands");
  return build(odsBuilder, odsState, resultType, x, y);
}

void IgammaOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type z, ::mlir::Value a, ::mlir::Value x) {
  odsState.addOperands(a);
  odsState.addOperands(x);
  odsState.addTypes(z);
}

void IgammaOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value a, ::mlir::Value x) {
  odsState.addOperands(a);
  odsState.addOperands(x);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void IgammaOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult IgammaOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void IgammaOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::IgammaOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::IgammacOp definitions
//===----------------------------------------------------------------------===//

IgammacOpAdaptor::IgammacOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

IgammacOpAdaptor::IgammacOpAdaptor(IgammacOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange IgammacOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> IgammacOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange IgammacOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value IgammacOpAdaptor::a() {
  return *getODSOperands(0).begin();
}

::mlir::Value IgammacOpAdaptor::x() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr IgammacOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult IgammacOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> IgammacOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range IgammacOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value IgammacOp::a() {
  return *getODSOperands(0).begin();
}

::mlir::Value IgammacOp::x() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange IgammacOp::aMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange IgammacOp::xMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> IgammacOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range IgammacOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value IgammacOp::z() {
  return *getODSResults(0).begin();
}

::mlir::Type IgammacOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool IgammacOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr IgammacOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void IgammacOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, Value x, Value y) {
  auto resultType =
      OpTrait::util::getBroadcastedType(x.getType(), y.getType());
  if (!resultType)
    mlir::emitError(odsState.location, "non-broadcastable operands");
  return build(odsBuilder, odsState, resultType, x, y);
}

void IgammacOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type z, ::mlir::Value a, ::mlir::Value x) {
  odsState.addOperands(a);
  odsState.addOperands(x);
  odsState.addTypes(z);
}

void IgammacOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value a, ::mlir::Value x) {
  odsState.addOperands(a);
  odsState.addOperands(x);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void IgammacOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult IgammacOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void IgammacOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::IgammacOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::ImagOp definitions
//===----------------------------------------------------------------------===//

ImagOpAdaptor::ImagOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

ImagOpAdaptor::ImagOpAdaptor(ImagOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange ImagOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> ImagOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange ImagOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ImagOpAdaptor::input() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr ImagOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult ImagOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> ImagOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range ImagOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ImagOp::input() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange ImagOp::inputMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> ImagOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range ImagOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ImagOp::output() {
  return *getODSResults(0).begin();
}

::mlir::Type ImagOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

::mlir::Type ImagOp::Tout() {
  return mlir::getElementTypeOrSelf(*getODSResults(0).begin());
}

bool ImagOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
  if (name == "Tout") return true;
 return false;
}

::mlir::DictionaryAttr ImagOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())},
    {ToutAttrName(),
::mlir::TypeAttr::get(Tout())}});
}

void ImagOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input) {
  odsState.addOperands(input);
  odsState.addTypes(output);
}

void ImagOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input) {
  odsState.addOperands(input);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void ImagOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult ImagOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops12(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops13(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void ImagOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::ImagOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::ImportEventOp definitions
//===----------------------------------------------------------------------===//

ImportEventOpAdaptor::ImportEventOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

ImportEventOpAdaptor::ImportEventOpAdaptor(ImportEventOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange ImportEventOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> ImportEventOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange ImportEventOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ImportEventOpAdaptor::writer() {
  return *getODSOperands(0).begin();
}

::mlir::Value ImportEventOpAdaptor::event() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr ImportEventOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult ImportEventOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> ImportEventOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range ImportEventOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ImportEventOp::writer() {
  return *getODSOperands(0).begin();
}

::mlir::Value ImportEventOp::event() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange ImportEventOp::writerMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ImportEventOp::eventMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> ImportEventOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range ImportEventOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

void ImportEventOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value writer, ::mlir::Value event) {
  odsState.addOperands(writer);
  odsState.addOperands(event);
}

void ImportEventOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value writer, ::mlir::Value event) {
  odsState.addOperands(writer);
  odsState.addOperands(event);
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void ImportEventOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 0u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult ImportEventOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops19(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void ImportEventOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  for (::mlir::Value value : getODSOperands(0))
    effects.emplace_back(::mlir::MemoryEffects::Write::get(), value, ::mlir::TF::ResourceEffects::Summary::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::ImportEventOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::InTopKV2Op definitions
//===----------------------------------------------------------------------===//

InTopKV2OpAdaptor::InTopKV2OpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

InTopKV2OpAdaptor::InTopKV2OpAdaptor(InTopKV2Op &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange InTopKV2OpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> InTopKV2OpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange InTopKV2OpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value InTopKV2OpAdaptor::predictions() {
  return *getODSOperands(0).begin();
}

::mlir::Value InTopKV2OpAdaptor::targets() {
  return *getODSOperands(1).begin();
}

::mlir::Value InTopKV2OpAdaptor::k() {
  return *getODSOperands(2).begin();
}

::mlir::DictionaryAttr InTopKV2OpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult InTopKV2OpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> InTopKV2Op::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range InTopKV2Op::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value InTopKV2Op::predictions() {
  return *getODSOperands(0).begin();
}

::mlir::Value InTopKV2Op::targets() {
  return *getODSOperands(1).begin();
}

::mlir::Value InTopKV2Op::k() {
  return *getODSOperands(2).begin();
}

::mlir::MutableOperandRange InTopKV2Op::predictionsMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange InTopKV2Op::targetsMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange InTopKV2Op::kMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> InTopKV2Op::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range InTopKV2Op::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value InTopKV2Op::precision() {
  return *getODSResults(0).begin();
}

::mlir::Type InTopKV2Op::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(1).begin());
}

bool InTopKV2Op::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr InTopKV2Op::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void InTopKV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type precision, ::mlir::Value predictions, ::mlir::Value targets, ::mlir::Value k) {
  odsState.addOperands(predictions);
  odsState.addOperands(targets);
  odsState.addOperands(k);
  odsState.addTypes(precision);
}

void InTopKV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value predictions, ::mlir::Value targets, ::mlir::Value k) {
  odsState.addOperands(predictions);
  odsState.addOperands(targets);
  odsState.addOperands(k);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void InTopKV2Op::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 3u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult InTopKV2Op::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops8(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void InTopKV2Op::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::InTopKV2Op)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::InfeedDequeueOp definitions
//===----------------------------------------------------------------------===//

InfeedDequeueOpAdaptor::InfeedDequeueOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

InfeedDequeueOpAdaptor::InfeedDequeueOpAdaptor(InfeedDequeueOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange InfeedDequeueOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> InfeedDequeueOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange InfeedDequeueOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::DictionaryAttr InfeedDequeueOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::Attribute InfeedDequeueOpAdaptor::shape() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::Attribute attr = odsAttrs.get("shape").cast<::mlir::Attribute>();
  return attr;
}

::mlir::LogicalResult InfeedDequeueOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_shape = odsAttrs.get("shape");
    if (!tblgen_shape)
      return emitError(loc, "'tf.InfeedDequeue' op ""requires attribute 'shape'");

    if (tblgen_shape && !((tblgen_shape.isa<mlir::TF::ShapeAttr>())))
      return emitError(loc, "'tf.InfeedDequeue' op ""attribute 'shape' failed to satisfy constraint: TensorFlow shape attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> InfeedDequeueOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range InfeedDequeueOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

std::pair<unsigned, unsigned> InfeedDequeueOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range InfeedDequeueOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value InfeedDequeueOp::output() {
  return *getODSResults(0).begin();
}

::mlir::Attribute InfeedDequeueOp::shapeAttr() {
  return (*this)->getAttr(shapeAttrName()).cast<::mlir::Attribute>();
}

llvm::Optional<llvm::ArrayRef<int64_t>> InfeedDequeueOp::shape() {
  auto attr = shapeAttr();
  return attr.cast<mlir::TF::ShapeAttr>().getValue();
}

::mlir::Type InfeedDequeueOp::dtype() {
  return mlir::getElementTypeOrSelf(*getODSResults(0).begin());
}

bool InfeedDequeueOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "dtype") return true;
 return false;
}

::mlir::DictionaryAttr InfeedDequeueOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {dtypeAttrName(),
::mlir::TypeAttr::get(dtype())}});
}

void InfeedDequeueOp::shapeAttr(::mlir::Attribute attr) {
  (*this)->setAttr(shapeAttrName(), attr);
}

void InfeedDequeueOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Attribute shape) {
  odsState.addAttribute(shapeAttrName(odsState.name), shape);
  odsState.addTypes(output);
}

void InfeedDequeueOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Attribute shape) {
  odsState.addAttribute(shapeAttrName(odsState.name), shape);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void InfeedDequeueOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, llvm::Optional<llvm::ArrayRef<int64_t>> shape) {
  odsState.addAttribute(shapeAttrName(odsState.name), mlir::TF::ShapeAttr::get(odsBuilder.getContext(), shape));
  odsState.addTypes(output);
}

void InfeedDequeueOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, llvm::Optional<llvm::ArrayRef<int64_t>> shape) {
  odsState.addAttribute(shapeAttrName(odsState.name), mlir::TF::ShapeAttr::get(odsBuilder.getContext(), shape));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void InfeedDequeueOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 0u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult InfeedDequeueOp::verify() {
  {
    auto tblgen_shape = (*this)->getAttr(shapeAttrName());
    if (!tblgen_shape)
      return emitOpError("requires attribute 'shape'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops17(*this, tblgen_shape, "shape")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::InfeedDequeueOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::InfeedDequeueTupleOp definitions
//===----------------------------------------------------------------------===//

InfeedDequeueTupleOpAdaptor::InfeedDequeueTupleOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

InfeedDequeueTupleOpAdaptor::InfeedDequeueTupleOpAdaptor(InfeedDequeueTupleOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange InfeedDequeueTupleOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> InfeedDequeueTupleOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange InfeedDequeueTupleOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::DictionaryAttr InfeedDequeueTupleOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::StringAttr InfeedDequeueTupleOpAdaptor::_XlaSharding() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("_XlaSharding").dyn_cast_or_null<::mlir::StringAttr>();
  return attr;
}

::mlir::LogicalResult InfeedDequeueTupleOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen__XlaSharding = odsAttrs.get("_XlaSharding");
    if (tblgen__XlaSharding && !((tblgen__XlaSharding.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.InfeedDequeueTuple' op ""attribute '_XlaSharding' failed to satisfy constraint: string attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> InfeedDequeueTupleOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range InfeedDequeueTupleOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

std::pair<unsigned, unsigned> InfeedDequeueTupleOp::getODSResultIndexAndLength(unsigned index) {
  bool isVariadic[] = {true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (getOperation()->getNumResults() - 0) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::Operation::result_range InfeedDequeueTupleOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Operation::result_range InfeedDequeueTupleOp::outputs() {
  return getODSResults(0);
}

::mlir::StringAttr InfeedDequeueTupleOp::_XlaShardingAttr() {
  return (*this)->getAttr(_XlaShardingAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::Optional< ::llvm::StringRef > InfeedDequeueTupleOp::_XlaSharding() {
  auto attr = _XlaShardingAttr();
  return attr ? ::llvm::Optional< ::llvm::StringRef >(attr.getValue()) : (::llvm::None);
}

mlir::TF::ResultShapeRange InfeedDequeueTupleOp::shapes() {
  auto values = getODSResults(0);
return {mlir::TF::ResultShapeIterator(values.begin()), mlir::TF::ResultShapeIterator(values.end())};
}

mlir::ResultElementTypeRange InfeedDequeueTupleOp::dtypes() {
  auto values = getODSResults(0);
return {mlir::ResultElementTypeIterator(values.begin()), mlir::ResultElementTypeIterator(values.end())};
}

bool InfeedDequeueTupleOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "shapes") return true;
  if (name == "dtypes") return true;
 return false;
}

::mlir::DictionaryAttr InfeedDequeueTupleOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {shapesAttrName(),
ArrayAttr::get(ctx,
      [&](){
        llvm::SmallVector<Attribute, 4> ret;
        for (auto shape : shapes())
          ret.push_back(mlir::TF::ShapeAttr::get(ctx, shape));
        return ret;
      }())},
    {dtypesAttrName(),
ArrayAttr::get(ctx, 
    [&]() {
      llvm::SmallVector<Attribute, 4> ret;
      for (auto t : dtypes())
        ret.push_back(TypeAttr::get(t));
      return ret;
    }())}});
}

void InfeedDequeueTupleOp::_XlaShardingAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(_XlaShardingAttrName(), attr);
}

::mlir::Attribute InfeedDequeueTupleOp::remove_XlaShardingAttr() {
  return (*this)->removeAttr(_XlaShardingAttrName());
}

void InfeedDequeueTupleOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange outputs, /*optional*/::mlir::StringAttr _XlaSharding) {
  if (_XlaSharding) {
  odsState.addAttribute(_XlaShardingAttrName(odsState.name), _XlaSharding);
  }
  odsState.addTypes(outputs);
}

void InfeedDequeueTupleOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 0u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult InfeedDequeueTupleOp::verify() {
  {
    auto tblgen__XlaSharding = (*this)->getAttr(_XlaShardingAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen__XlaSharding, "_XlaSharding")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::InfeedDequeueTupleOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::InfeedEnqueueTupleOp definitions
//===----------------------------------------------------------------------===//

InfeedEnqueueTupleOpAdaptor::InfeedEnqueueTupleOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

InfeedEnqueueTupleOpAdaptor::InfeedEnqueueTupleOpAdaptor(InfeedEnqueueTupleOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange InfeedEnqueueTupleOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> InfeedEnqueueTupleOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  bool isVariadic[] = {true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (odsOperands.size() - 0) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::ValueRange InfeedEnqueueTupleOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::ValueRange InfeedEnqueueTupleOpAdaptor::inputs() {
  return getODSOperands(0);
}

::mlir::DictionaryAttr InfeedEnqueueTupleOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::ArrayAttr InfeedEnqueueTupleOpAdaptor::dtypes() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("dtypes").cast<::mlir::ArrayAttr>();
  return attr;
}

::mlir::ArrayAttr InfeedEnqueueTupleOpAdaptor::shapes() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("shapes").cast<::mlir::ArrayAttr>();
  return attr;
}

::mlir::ArrayAttr InfeedEnqueueTupleOpAdaptor::layouts() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("layouts").dyn_cast_or_null<::mlir::ArrayAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getI64ArrayAttr({});
  return attr;
}

::mlir::IntegerAttr InfeedEnqueueTupleOpAdaptor::device_ordinal() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("device_ordinal").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), -1);
  return attr;
}

::mlir::LogicalResult InfeedEnqueueTupleOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_dtypes = odsAttrs.get("dtypes");
    if (!tblgen_dtypes)
      return emitError(loc, "'tf.InfeedEnqueueTuple' op ""requires attribute 'dtypes'");

    if (tblgen_dtypes && !((((tblgen_dtypes.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_dtypes.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return ((attr.isa<::mlir::TypeAttr>())) && ((attr.cast<::mlir::TypeAttr>().getValue().isa<::mlir::Type>())); }))) && ((tblgen_dtypes.cast<::mlir::ArrayAttr>().size() >= 1))))
      return emitError(loc, "'tf.InfeedEnqueueTuple' op ""attribute 'dtypes' failed to satisfy constraint: type array attribute with at least 1 elements");
  }
  {
    auto tblgen_shapes = odsAttrs.get("shapes");
    if (!tblgen_shapes)
      return emitError(loc, "'tf.InfeedEnqueueTuple' op ""requires attribute 'shapes'");

    if (tblgen_shapes && !(((tblgen_shapes.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_shapes.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return (attr.isa<mlir::TF::ShapeAttr>()); }))))
      return emitError(loc, "'tf.InfeedEnqueueTuple' op ""attribute 'shapes' failed to satisfy constraint: tensorflow shape attribute array");
  }
  {
    auto tblgen_layouts = odsAttrs.get("layouts");
    if (tblgen_layouts && !(((tblgen_layouts.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_layouts.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return ((attr.isa<::mlir::IntegerAttr>())) && ((attr.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64))); }))))
      return emitError(loc, "'tf.InfeedEnqueueTuple' op ""attribute 'layouts' failed to satisfy constraint: 64-bit integer array attribute");
  }
  {
    auto tblgen_device_ordinal = odsAttrs.get("device_ordinal");
    if (tblgen_device_ordinal && !(((tblgen_device_ordinal.isa<::mlir::IntegerAttr>())) && ((tblgen_device_ordinal.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.InfeedEnqueueTuple' op ""attribute 'device_ordinal' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> InfeedEnqueueTupleOp::getODSOperandIndexAndLength(unsigned index) {
  bool isVariadic[] = {true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (getOperation()->getNumOperands() - 0) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::Operation::operand_range InfeedEnqueueTupleOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Operation::operand_range InfeedEnqueueTupleOp::inputs() {
  return getODSOperands(0);
}

::mlir::MutableOperandRange InfeedEnqueueTupleOp::inputsMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> InfeedEnqueueTupleOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range InfeedEnqueueTupleOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::ArrayAttr InfeedEnqueueTupleOp::dtypesAttr() {
  return (*this)->getAttr(dtypesAttrName()).cast<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr InfeedEnqueueTupleOp::dtypes() {
  auto attr = dtypesAttr();
  return attr;
}

::mlir::ArrayAttr InfeedEnqueueTupleOp::shapesAttr() {
  return (*this)->getAttr(shapesAttrName()).cast<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr InfeedEnqueueTupleOp::shapes() {
  auto attr = shapesAttr();
  return attr;
}

::mlir::ArrayAttr InfeedEnqueueTupleOp::layoutsAttr() {
  return (*this)->getAttr(layoutsAttrName()).dyn_cast_or_null<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr InfeedEnqueueTupleOp::layouts() {
  auto attr = layoutsAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getI64ArrayAttr({});
  return attr;
}

::mlir::IntegerAttr InfeedEnqueueTupleOp::device_ordinalAttr() {
  return (*this)->getAttr(device_ordinalAttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t InfeedEnqueueTupleOp::device_ordinal() {
  auto attr = device_ordinalAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), -1).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

void InfeedEnqueueTupleOp::dtypesAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(dtypesAttrName(), attr);
}

void InfeedEnqueueTupleOp::shapesAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(shapesAttrName(), attr);
}

void InfeedEnqueueTupleOp::layoutsAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(layoutsAttrName(), attr);
}

void InfeedEnqueueTupleOp::device_ordinalAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(device_ordinalAttrName(), attr);
}

void InfeedEnqueueTupleOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange inputs, ::mlir::ArrayAttr dtypes, ::mlir::ArrayAttr shapes, ::mlir::ArrayAttr layouts, ::mlir::IntegerAttr device_ordinal) {
  odsState.addOperands(inputs);
  odsState.addAttribute(dtypesAttrName(odsState.name), dtypes);
  odsState.addAttribute(shapesAttrName(odsState.name), shapes);
  odsState.addAttribute(layoutsAttrName(odsState.name), layouts);
  odsState.addAttribute(device_ordinalAttrName(odsState.name), device_ordinal);
}

void InfeedEnqueueTupleOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange inputs, ::mlir::ArrayAttr dtypes, ::mlir::ArrayAttr shapes, ::mlir::ArrayAttr layouts, ::mlir::IntegerAttr device_ordinal) {
  odsState.addOperands(inputs);
  odsState.addAttribute(dtypesAttrName(odsState.name), dtypes);
  odsState.addAttribute(shapesAttrName(odsState.name), shapes);
  odsState.addAttribute(layoutsAttrName(odsState.name), layouts);
  odsState.addAttribute(device_ordinalAttrName(odsState.name), device_ordinal);
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void InfeedEnqueueTupleOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange inputs, ::mlir::ArrayAttr dtypes, ::mlir::ArrayAttr shapes, ::mlir::ArrayAttr layouts, uint64_t device_ordinal) {
  odsState.addOperands(inputs);
  odsState.addAttribute(dtypesAttrName(odsState.name), dtypes);
  odsState.addAttribute(shapesAttrName(odsState.name), shapes);
  odsState.addAttribute(layoutsAttrName(odsState.name), layouts);
  odsState.addAttribute(device_ordinalAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), device_ordinal));
}

void InfeedEnqueueTupleOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange inputs, ::mlir::ArrayAttr dtypes, ::mlir::ArrayAttr shapes, ::mlir::ArrayAttr layouts, uint64_t device_ordinal) {
  odsState.addOperands(inputs);
  odsState.addAttribute(dtypesAttrName(odsState.name), dtypes);
  odsState.addAttribute(shapesAttrName(odsState.name), shapes);
  odsState.addAttribute(layoutsAttrName(odsState.name), layouts);
  odsState.addAttribute(device_ordinalAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), device_ordinal));
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void InfeedEnqueueTupleOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 0u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult InfeedEnqueueTupleOp::verify() {
  {
    auto tblgen_dtypes = (*this)->getAttr(dtypesAttrName());
    if (!tblgen_dtypes)
      return emitOpError("requires attribute 'dtypes'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops2(*this, tblgen_dtypes, "dtypes")))
      return ::mlir::failure();
  }
  {
    auto tblgen_shapes = (*this)->getAttr(shapesAttrName());
    if (!tblgen_shapes)
      return emitOpError("requires attribute 'shapes'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops28(*this, tblgen_shapes, "shapes")))
      return ::mlir::failure();
  }
  {
    auto tblgen_layouts = (*this)->getAttr(layoutsAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops13(*this, tblgen_layouts, "layouts")))
      return ::mlir::failure();
  }
  {
    auto tblgen_device_ordinal = (*this)->getAttr(device_ordinalAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_device_ordinal, "device_ordinal")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::InfeedEnqueueTupleOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::InitializeTableFromDatasetOp definitions
//===----------------------------------------------------------------------===//

InitializeTableFromDatasetOpAdaptor::InitializeTableFromDatasetOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

InitializeTableFromDatasetOpAdaptor::InitializeTableFromDatasetOpAdaptor(InitializeTableFromDatasetOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange InitializeTableFromDatasetOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> InitializeTableFromDatasetOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange InitializeTableFromDatasetOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value InitializeTableFromDatasetOpAdaptor::table_handle() {
  return *getODSOperands(0).begin();
}

::mlir::Value InitializeTableFromDatasetOpAdaptor::dataset() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr InitializeTableFromDatasetOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult InitializeTableFromDatasetOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> InitializeTableFromDatasetOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range InitializeTableFromDatasetOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value InitializeTableFromDatasetOp::table_handle() {
  return *getODSOperands(0).begin();
}

::mlir::Value InitializeTableFromDatasetOp::dataset() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange InitializeTableFromDatasetOp::table_handleMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange InitializeTableFromDatasetOp::datasetMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> InitializeTableFromDatasetOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range InitializeTableFromDatasetOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

void InitializeTableFromDatasetOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value table_handle, ::mlir::Value dataset) {
  odsState.addOperands(table_handle);
  odsState.addOperands(dataset);
}

void InitializeTableFromDatasetOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value table_handle, ::mlir::Value dataset) {
  odsState.addOperands(table_handle);
  odsState.addOperands(dataset);
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void InitializeTableFromDatasetOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 0u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult InitializeTableFromDatasetOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops15(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void InitializeTableFromDatasetOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  for (::mlir::Value value : getODSOperands(0))
    effects.emplace_back(::mlir::MemoryEffects::Write::get(), value, ::mlir::TF::ResourceEffects::LookupTable::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::InitializeTableFromDatasetOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::InitializeTableFromTextFileOp definitions
//===----------------------------------------------------------------------===//

InitializeTableFromTextFileOpAdaptor::InitializeTableFromTextFileOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

InitializeTableFromTextFileOpAdaptor::InitializeTableFromTextFileOpAdaptor(InitializeTableFromTextFileOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange InitializeTableFromTextFileOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> InitializeTableFromTextFileOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange InitializeTableFromTextFileOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value InitializeTableFromTextFileOpAdaptor::table_handle() {
  return *getODSOperands(0).begin();
}

::mlir::Value InitializeTableFromTextFileOpAdaptor::filename() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr InitializeTableFromTextFileOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::IntegerAttr InitializeTableFromTextFileOpAdaptor::key_index() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("key_index").cast<::mlir::IntegerAttr>();
  return attr;
}

::mlir::IntegerAttr InitializeTableFromTextFileOpAdaptor::value_index() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("value_index").cast<::mlir::IntegerAttr>();
  return attr;
}

::mlir::IntegerAttr InitializeTableFromTextFileOpAdaptor::vocab_size() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("vocab_size").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), -1);
  return attr;
}

::mlir::StringAttr InitializeTableFromTextFileOpAdaptor::delimiter() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("delimiter").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("\t");
  return attr;
}

::mlir::IntegerAttr InitializeTableFromTextFileOpAdaptor::offset() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("offset").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), 0);
  return attr;
}

::mlir::LogicalResult InitializeTableFromTextFileOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_key_index = odsAttrs.get("key_index");
    if (!tblgen_key_index)
      return emitError(loc, "'tf.InitializeTableFromTextFile' op ""requires attribute 'key_index'");

    if (tblgen_key_index && !((((tblgen_key_index.isa<::mlir::IntegerAttr>())) && ((tblgen_key_index.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))) && ((tblgen_key_index.cast<::mlir::IntegerAttr>().getInt() >= -2))))
      return emitError(loc, "'tf.InitializeTableFromTextFile' op ""attribute 'key_index' failed to satisfy constraint: 64-bit signless integer attribute whose minimum value is -2");
  }
  {
    auto tblgen_value_index = odsAttrs.get("value_index");
    if (!tblgen_value_index)
      return emitError(loc, "'tf.InitializeTableFromTextFile' op ""requires attribute 'value_index'");

    if (tblgen_value_index && !((((tblgen_value_index.isa<::mlir::IntegerAttr>())) && ((tblgen_value_index.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))) && ((tblgen_value_index.cast<::mlir::IntegerAttr>().getInt() >= -2))))
      return emitError(loc, "'tf.InitializeTableFromTextFile' op ""attribute 'value_index' failed to satisfy constraint: 64-bit signless integer attribute whose minimum value is -2");
  }
  {
    auto tblgen_vocab_size = odsAttrs.get("vocab_size");
    if (tblgen_vocab_size && !((((tblgen_vocab_size.isa<::mlir::IntegerAttr>())) && ((tblgen_vocab_size.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))) && ((tblgen_vocab_size.cast<::mlir::IntegerAttr>().getInt() >= -1))))
      return emitError(loc, "'tf.InitializeTableFromTextFile' op ""attribute 'vocab_size' failed to satisfy constraint: 64-bit signless integer attribute whose minimum value is -1");
  }
  {
    auto tblgen_delimiter = odsAttrs.get("delimiter");
    if (tblgen_delimiter && !((tblgen_delimiter.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.InitializeTableFromTextFile' op ""attribute 'delimiter' failed to satisfy constraint: string attribute");
  }
  {
    auto tblgen_offset = odsAttrs.get("offset");
    if (tblgen_offset && !(((tblgen_offset.isa<::mlir::IntegerAttr>())) && ((tblgen_offset.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.InitializeTableFromTextFile' op ""attribute 'offset' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> InitializeTableFromTextFileOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range InitializeTableFromTextFileOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value InitializeTableFromTextFileOp::table_handle() {
  return *getODSOperands(0).begin();
}

::mlir::Value InitializeTableFromTextFileOp::filename() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange InitializeTableFromTextFileOp::table_handleMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange InitializeTableFromTextFileOp::filenameMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> InitializeTableFromTextFileOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range InitializeTableFromTextFileOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::IntegerAttr InitializeTableFromTextFileOp::key_indexAttr() {
  return (*this)->getAttr(key_indexAttrName()).cast<::mlir::IntegerAttr>();
}

uint64_t InitializeTableFromTextFileOp::key_index() {
  auto attr = key_indexAttr();
  return attr.getValue().getZExtValue();
}

::mlir::IntegerAttr InitializeTableFromTextFileOp::value_indexAttr() {
  return (*this)->getAttr(value_indexAttrName()).cast<::mlir::IntegerAttr>();
}

uint64_t InitializeTableFromTextFileOp::value_index() {
  auto attr = value_indexAttr();
  return attr.getValue().getZExtValue();
}

::mlir::IntegerAttr InitializeTableFromTextFileOp::vocab_sizeAttr() {
  return (*this)->getAttr(vocab_sizeAttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t InitializeTableFromTextFileOp::vocab_size() {
  auto attr = vocab_sizeAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), -1).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

::mlir::StringAttr InitializeTableFromTextFileOp::delimiterAttr() {
  return (*this)->getAttr(delimiterAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef InitializeTableFromTextFileOp::delimiter() {
  auto attr = delimiterAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("\t").getValue();
  return attr.getValue();
}

::mlir::IntegerAttr InitializeTableFromTextFileOp::offsetAttr() {
  return (*this)->getAttr(offsetAttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t InitializeTableFromTextFileOp::offset() {
  auto attr = offsetAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), 0).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

void InitializeTableFromTextFileOp::key_indexAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(key_indexAttrName(), attr);
}

void InitializeTableFromTextFileOp::value_indexAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(value_indexAttrName(), attr);
}

void InitializeTableFromTextFileOp::vocab_sizeAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(vocab_sizeAttrName(), attr);
}

void InitializeTableFromTextFileOp::delimiterAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(delimiterAttrName(), attr);
}

void InitializeTableFromTextFileOp::offsetAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(offsetAttrName(), attr);
}

void InitializeTableFromTextFileOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value table_handle, ::mlir::Value filename, ::mlir::IntegerAttr key_index, ::mlir::IntegerAttr value_index, ::mlir::IntegerAttr vocab_size, ::mlir::StringAttr delimiter, ::mlir::IntegerAttr offset) {
  odsState.addOperands(table_handle);
  odsState.addOperands(filename);
  odsState.addAttribute(key_indexAttrName(odsState.name), key_index);
  odsState.addAttribute(value_indexAttrName(odsState.name), value_index);
  odsState.addAttribute(vocab_sizeAttrName(odsState.name), vocab_size);
  odsState.addAttribute(delimiterAttrName(odsState.name), delimiter);
  odsState.addAttribute(offsetAttrName(odsState.name), offset);
}

void InitializeTableFromTextFileOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value table_handle, ::mlir::Value filename, ::mlir::IntegerAttr key_index, ::mlir::IntegerAttr value_index, ::mlir::IntegerAttr vocab_size, ::mlir::StringAttr delimiter, ::mlir::IntegerAttr offset) {
  odsState.addOperands(table_handle);
  odsState.addOperands(filename);
  odsState.addAttribute(key_indexAttrName(odsState.name), key_index);
  odsState.addAttribute(value_indexAttrName(odsState.name), value_index);
  odsState.addAttribute(vocab_sizeAttrName(odsState.name), vocab_size);
  odsState.addAttribute(delimiterAttrName(odsState.name), delimiter);
  odsState.addAttribute(offsetAttrName(odsState.name), offset);
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void InitializeTableFromTextFileOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value table_handle, ::mlir::Value filename, uint64_t key_index, uint64_t value_index, uint64_t vocab_size, ::llvm::StringRef delimiter, uint64_t offset) {
  odsState.addOperands(table_handle);
  odsState.addOperands(filename);
  odsState.addAttribute(key_indexAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), key_index));
  odsState.addAttribute(value_indexAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), value_index));
  odsState.addAttribute(vocab_sizeAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), vocab_size));
  odsState.addAttribute(delimiterAttrName(odsState.name), odsBuilder.getStringAttr(delimiter));
  odsState.addAttribute(offsetAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), offset));
}

void InitializeTableFromTextFileOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value table_handle, ::mlir::Value filename, uint64_t key_index, uint64_t value_index, uint64_t vocab_size, ::llvm::StringRef delimiter, uint64_t offset) {
  odsState.addOperands(table_handle);
  odsState.addOperands(filename);
  odsState.addAttribute(key_indexAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), key_index));
  odsState.addAttribute(value_indexAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), value_index));
  odsState.addAttribute(vocab_sizeAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), vocab_size));
  odsState.addAttribute(delimiterAttrName(odsState.name), odsBuilder.getStringAttr(delimiter));
  odsState.addAttribute(offsetAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), offset));
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void InitializeTableFromTextFileOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 0u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult InitializeTableFromTextFileOp::verify() {
  {
    auto tblgen_key_index = (*this)->getAttr(key_indexAttrName());
    if (!tblgen_key_index)
      return emitOpError("requires attribute 'key_index'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops29(*this, tblgen_key_index, "key_index")))
      return ::mlir::failure();
  }
  {
    auto tblgen_value_index = (*this)->getAttr(value_indexAttrName());
    if (!tblgen_value_index)
      return emitOpError("requires attribute 'value_index'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops29(*this, tblgen_value_index, "value_index")))
      return ::mlir::failure();
  }
  {
    auto tblgen_vocab_size = (*this)->getAttr(vocab_sizeAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops30(*this, tblgen_vocab_size, "vocab_size")))
      return ::mlir::failure();
  }
  {
    auto tblgen_delimiter = (*this)->getAttr(delimiterAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_delimiter, "delimiter")))
      return ::mlir::failure();
  }
  {
    auto tblgen_offset = (*this)->getAttr(offsetAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_offset, "offset")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops19(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops19(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void InitializeTableFromTextFileOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  for (::mlir::Value value : getODSOperands(0))
    effects.emplace_back(::mlir::MemoryEffects::Write::get(), value, ::mlir::TF::ResourceEffects::LookupTable::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::InitializeTableFromTextFileOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::InitializeTableFromTextFileV2Op definitions
//===----------------------------------------------------------------------===//

InitializeTableFromTextFileV2OpAdaptor::InitializeTableFromTextFileV2OpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

InitializeTableFromTextFileV2OpAdaptor::InitializeTableFromTextFileV2OpAdaptor(InitializeTableFromTextFileV2Op &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange InitializeTableFromTextFileV2OpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> InitializeTableFromTextFileV2OpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange InitializeTableFromTextFileV2OpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value InitializeTableFromTextFileV2OpAdaptor::table_handle() {
  return *getODSOperands(0).begin();
}

::mlir::Value InitializeTableFromTextFileV2OpAdaptor::filename() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr InitializeTableFromTextFileV2OpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::IntegerAttr InitializeTableFromTextFileV2OpAdaptor::key_index() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("key_index").cast<::mlir::IntegerAttr>();
  return attr;
}

::mlir::IntegerAttr InitializeTableFromTextFileV2OpAdaptor::value_index() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("value_index").cast<::mlir::IntegerAttr>();
  return attr;
}

::mlir::IntegerAttr InitializeTableFromTextFileV2OpAdaptor::vocab_size() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("vocab_size").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), -1);
  return attr;
}

::mlir::StringAttr InitializeTableFromTextFileV2OpAdaptor::delimiter() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("delimiter").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("\t");
  return attr;
}

::mlir::IntegerAttr InitializeTableFromTextFileV2OpAdaptor::offset() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("offset").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), 0);
  return attr;
}

::mlir::LogicalResult InitializeTableFromTextFileV2OpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_key_index = odsAttrs.get("key_index");
    if (!tblgen_key_index)
      return emitError(loc, "'tf.InitializeTableFromTextFileV2' op ""requires attribute 'key_index'");

    if (tblgen_key_index && !((((tblgen_key_index.isa<::mlir::IntegerAttr>())) && ((tblgen_key_index.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))) && ((tblgen_key_index.cast<::mlir::IntegerAttr>().getInt() >= -2))))
      return emitError(loc, "'tf.InitializeTableFromTextFileV2' op ""attribute 'key_index' failed to satisfy constraint: 64-bit signless integer attribute whose minimum value is -2");
  }
  {
    auto tblgen_value_index = odsAttrs.get("value_index");
    if (!tblgen_value_index)
      return emitError(loc, "'tf.InitializeTableFromTextFileV2' op ""requires attribute 'value_index'");

    if (tblgen_value_index && !((((tblgen_value_index.isa<::mlir::IntegerAttr>())) && ((tblgen_value_index.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))) && ((tblgen_value_index.cast<::mlir::IntegerAttr>().getInt() >= -2))))
      return emitError(loc, "'tf.InitializeTableFromTextFileV2' op ""attribute 'value_index' failed to satisfy constraint: 64-bit signless integer attribute whose minimum value is -2");
  }
  {
    auto tblgen_vocab_size = odsAttrs.get("vocab_size");
    if (tblgen_vocab_size && !((((tblgen_vocab_size.isa<::mlir::IntegerAttr>())) && ((tblgen_vocab_size.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))) && ((tblgen_vocab_size.cast<::mlir::IntegerAttr>().getInt() >= -1))))
      return emitError(loc, "'tf.InitializeTableFromTextFileV2' op ""attribute 'vocab_size' failed to satisfy constraint: 64-bit signless integer attribute whose minimum value is -1");
  }
  {
    auto tblgen_delimiter = odsAttrs.get("delimiter");
    if (tblgen_delimiter && !((tblgen_delimiter.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.InitializeTableFromTextFileV2' op ""attribute 'delimiter' failed to satisfy constraint: string attribute");
  }
  {
    auto tblgen_offset = odsAttrs.get("offset");
    if (tblgen_offset && !(((tblgen_offset.isa<::mlir::IntegerAttr>())) && ((tblgen_offset.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.InitializeTableFromTextFileV2' op ""attribute 'offset' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> InitializeTableFromTextFileV2Op::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range InitializeTableFromTextFileV2Op::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value InitializeTableFromTextFileV2Op::table_handle() {
  return *getODSOperands(0).begin();
}

::mlir::Value InitializeTableFromTextFileV2Op::filename() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange InitializeTableFromTextFileV2Op::table_handleMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange InitializeTableFromTextFileV2Op::filenameMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> InitializeTableFromTextFileV2Op::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range InitializeTableFromTextFileV2Op::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::IntegerAttr InitializeTableFromTextFileV2Op::key_indexAttr() {
  return (*this)->getAttr(key_indexAttrName()).cast<::mlir::IntegerAttr>();
}

uint64_t InitializeTableFromTextFileV2Op::key_index() {
  auto attr = key_indexAttr();
  return attr.getValue().getZExtValue();
}

::mlir::IntegerAttr InitializeTableFromTextFileV2Op::value_indexAttr() {
  return (*this)->getAttr(value_indexAttrName()).cast<::mlir::IntegerAttr>();
}

uint64_t InitializeTableFromTextFileV2Op::value_index() {
  auto attr = value_indexAttr();
  return attr.getValue().getZExtValue();
}

::mlir::IntegerAttr InitializeTableFromTextFileV2Op::vocab_sizeAttr() {
  return (*this)->getAttr(vocab_sizeAttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t InitializeTableFromTextFileV2Op::vocab_size() {
  auto attr = vocab_sizeAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), -1).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

::mlir::StringAttr InitializeTableFromTextFileV2Op::delimiterAttr() {
  return (*this)->getAttr(delimiterAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef InitializeTableFromTextFileV2Op::delimiter() {
  auto attr = delimiterAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("\t").getValue();
  return attr.getValue();
}

::mlir::IntegerAttr InitializeTableFromTextFileV2Op::offsetAttr() {
  return (*this)->getAttr(offsetAttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t InitializeTableFromTextFileV2Op::offset() {
  auto attr = offsetAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), 0).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

void InitializeTableFromTextFileV2Op::key_indexAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(key_indexAttrName(), attr);
}

void InitializeTableFromTextFileV2Op::value_indexAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(value_indexAttrName(), attr);
}

void InitializeTableFromTextFileV2Op::vocab_sizeAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(vocab_sizeAttrName(), attr);
}

void InitializeTableFromTextFileV2Op::delimiterAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(delimiterAttrName(), attr);
}

void InitializeTableFromTextFileV2Op::offsetAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(offsetAttrName(), attr);
}

void InitializeTableFromTextFileV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value table_handle, ::mlir::Value filename, ::mlir::IntegerAttr key_index, ::mlir::IntegerAttr value_index, ::mlir::IntegerAttr vocab_size, ::mlir::StringAttr delimiter, ::mlir::IntegerAttr offset) {
  odsState.addOperands(table_handle);
  odsState.addOperands(filename);
  odsState.addAttribute(key_indexAttrName(odsState.name), key_index);
  odsState.addAttribute(value_indexAttrName(odsState.name), value_index);
  odsState.addAttribute(vocab_sizeAttrName(odsState.name), vocab_size);
  odsState.addAttribute(delimiterAttrName(odsState.name), delimiter);
  odsState.addAttribute(offsetAttrName(odsState.name), offset);
}

void InitializeTableFromTextFileV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value table_handle, ::mlir::Value filename, ::mlir::IntegerAttr key_index, ::mlir::IntegerAttr value_index, ::mlir::IntegerAttr vocab_size, ::mlir::StringAttr delimiter, ::mlir::IntegerAttr offset) {
  odsState.addOperands(table_handle);
  odsState.addOperands(filename);
  odsState.addAttribute(key_indexAttrName(odsState.name), key_index);
  odsState.addAttribute(value_indexAttrName(odsState.name), value_index);
  odsState.addAttribute(vocab_sizeAttrName(odsState.name), vocab_size);
  odsState.addAttribute(delimiterAttrName(odsState.name), delimiter);
  odsState.addAttribute(offsetAttrName(odsState.name), offset);
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void InitializeTableFromTextFileV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value table_handle, ::mlir::Value filename, uint64_t key_index, uint64_t value_index, uint64_t vocab_size, ::llvm::StringRef delimiter, uint64_t offset) {
  odsState.addOperands(table_handle);
  odsState.addOperands(filename);
  odsState.addAttribute(key_indexAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), key_index));
  odsState.addAttribute(value_indexAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), value_index));
  odsState.addAttribute(vocab_sizeAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), vocab_size));
  odsState.addAttribute(delimiterAttrName(odsState.name), odsBuilder.getStringAttr(delimiter));
  odsState.addAttribute(offsetAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), offset));
}

void InitializeTableFromTextFileV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value table_handle, ::mlir::Value filename, uint64_t key_index, uint64_t value_index, uint64_t vocab_size, ::llvm::StringRef delimiter, uint64_t offset) {
  odsState.addOperands(table_handle);
  odsState.addOperands(filename);
  odsState.addAttribute(key_indexAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), key_index));
  odsState.addAttribute(value_indexAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), value_index));
  odsState.addAttribute(vocab_sizeAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), vocab_size));
  odsState.addAttribute(delimiterAttrName(odsState.name), odsBuilder.getStringAttr(delimiter));
  odsState.addAttribute(offsetAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), offset));
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void InitializeTableFromTextFileV2Op::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 0u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult InitializeTableFromTextFileV2Op::verify() {
  {
    auto tblgen_key_index = (*this)->getAttr(key_indexAttrName());
    if (!tblgen_key_index)
      return emitOpError("requires attribute 'key_index'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops29(*this, tblgen_key_index, "key_index")))
      return ::mlir::failure();
  }
  {
    auto tblgen_value_index = (*this)->getAttr(value_indexAttrName());
    if (!tblgen_value_index)
      return emitOpError("requires attribute 'value_index'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops29(*this, tblgen_value_index, "value_index")))
      return ::mlir::failure();
  }
  {
    auto tblgen_vocab_size = (*this)->getAttr(vocab_sizeAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops30(*this, tblgen_vocab_size, "vocab_size")))
      return ::mlir::failure();
  }
  {
    auto tblgen_delimiter = (*this)->getAttr(delimiterAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_delimiter, "delimiter")))
      return ::mlir::failure();
  }
  {
    auto tblgen_offset = (*this)->getAttr(offsetAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_offset, "offset")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops19(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void InitializeTableFromTextFileV2Op::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  for (::mlir::Value value : getODSOperands(0))
    effects.emplace_back(::mlir::MemoryEffects::Write::get(), value, ::mlir::TF::ResourceEffects::LookupTable::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::InitializeTableFromTextFileV2Op)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::InitializeTableOp definitions
//===----------------------------------------------------------------------===//

InitializeTableOpAdaptor::InitializeTableOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

InitializeTableOpAdaptor::InitializeTableOpAdaptor(InitializeTableOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange InitializeTableOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> InitializeTableOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange InitializeTableOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value InitializeTableOpAdaptor::table_handle() {
  return *getODSOperands(0).begin();
}

::mlir::Value InitializeTableOpAdaptor::keys() {
  return *getODSOperands(1).begin();
}

::mlir::Value InitializeTableOpAdaptor::values() {
  return *getODSOperands(2).begin();
}

::mlir::DictionaryAttr InitializeTableOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult InitializeTableOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> InitializeTableOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range InitializeTableOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value InitializeTableOp::table_handle() {
  return *getODSOperands(0).begin();
}

::mlir::Value InitializeTableOp::keys() {
  return *getODSOperands(1).begin();
}

::mlir::Value InitializeTableOp::values() {
  return *getODSOperands(2).begin();
}

::mlir::MutableOperandRange InitializeTableOp::table_handleMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange InitializeTableOp::keysMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange InitializeTableOp::valuesMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> InitializeTableOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range InitializeTableOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Type InitializeTableOp::Tkey() {
  return mlir::getElementTypeOrSelf(*getODSOperands(1).begin());
}

::mlir::Type InitializeTableOp::Tval() {
  return mlir::getElementTypeOrSelf(*getODSOperands(2).begin());
}

bool InitializeTableOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "Tkey") return true;
  if (name == "Tval") return true;
 return false;
}

::mlir::DictionaryAttr InitializeTableOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TkeyAttrName(),
::mlir::TypeAttr::get(Tkey())},
    {TvalAttrName(),
::mlir::TypeAttr::get(Tval())}});
}

void InitializeTableOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value table_handle, ::mlir::Value keys, ::mlir::Value values) {
  odsState.addOperands(table_handle);
  odsState.addOperands(keys);
  odsState.addOperands(values);
}

void InitializeTableOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value table_handle, ::mlir::Value keys, ::mlir::Value values) {
  odsState.addOperands(table_handle);
  odsState.addOperands(keys);
  odsState.addOperands(values);
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void InitializeTableOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 3u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 0u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult InitializeTableOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops19(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void InitializeTableOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  for (::mlir::Value value : getODSOperands(0))
    effects.emplace_back(::mlir::MemoryEffects::Write::get(), value, ::mlir::TF::ResourceEffects::LookupTable::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::InitializeTableOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::InitializeTableV2Op definitions
//===----------------------------------------------------------------------===//

InitializeTableV2OpAdaptor::InitializeTableV2OpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

InitializeTableV2OpAdaptor::InitializeTableV2OpAdaptor(InitializeTableV2Op &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange InitializeTableV2OpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> InitializeTableV2OpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange InitializeTableV2OpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value InitializeTableV2OpAdaptor::table_handle() {
  return *getODSOperands(0).begin();
}

::mlir::Value InitializeTableV2OpAdaptor::keys() {
  return *getODSOperands(1).begin();
}

::mlir::Value InitializeTableV2OpAdaptor::values() {
  return *getODSOperands(2).begin();
}

::mlir::DictionaryAttr InitializeTableV2OpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult InitializeTableV2OpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> InitializeTableV2Op::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range InitializeTableV2Op::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value InitializeTableV2Op::table_handle() {
  return *getODSOperands(0).begin();
}

::mlir::Value InitializeTableV2Op::keys() {
  return *getODSOperands(1).begin();
}

::mlir::Value InitializeTableV2Op::values() {
  return *getODSOperands(2).begin();
}

::mlir::MutableOperandRange InitializeTableV2Op::table_handleMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange InitializeTableV2Op::keysMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange InitializeTableV2Op::valuesMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> InitializeTableV2Op::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range InitializeTableV2Op::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Type InitializeTableV2Op::Tkey() {
  return mlir::getElementTypeOrSelf(*getODSOperands(1).begin());
}

::mlir::Type InitializeTableV2Op::Tval() {
  return mlir::getElementTypeOrSelf(*getODSOperands(2).begin());
}

bool InitializeTableV2Op::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "Tkey") return true;
  if (name == "Tval") return true;
 return false;
}

::mlir::DictionaryAttr InitializeTableV2Op::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TkeyAttrName(),
::mlir::TypeAttr::get(Tkey())},
    {TvalAttrName(),
::mlir::TypeAttr::get(Tval())}});
}

void InitializeTableV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value table_handle, ::mlir::Value keys, ::mlir::Value values) {
  odsState.addOperands(table_handle);
  odsState.addOperands(keys);
  odsState.addOperands(values);
}

void InitializeTableV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value table_handle, ::mlir::Value keys, ::mlir::Value values) {
  odsState.addOperands(table_handle);
  odsState.addOperands(keys);
  odsState.addOperands(values);
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void InitializeTableV2Op::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 3u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 0u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult InitializeTableV2Op::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void InitializeTableV2Op::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  for (::mlir::Value value : getODSOperands(0))
    effects.emplace_back(::mlir::MemoryEffects::Write::get(), value, ::mlir::TF::ResourceEffects::LookupTable::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::InitializeTableV2Op)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::InplaceAddOp definitions
//===----------------------------------------------------------------------===//

InplaceAddOpAdaptor::InplaceAddOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

InplaceAddOpAdaptor::InplaceAddOpAdaptor(InplaceAddOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange InplaceAddOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> InplaceAddOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange InplaceAddOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value InplaceAddOpAdaptor::x() {
  return *getODSOperands(0).begin();
}

::mlir::Value InplaceAddOpAdaptor::i() {
  return *getODSOperands(1).begin();
}

::mlir::Value InplaceAddOpAdaptor::v() {
  return *getODSOperands(2).begin();
}

::mlir::DictionaryAttr InplaceAddOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult InplaceAddOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> InplaceAddOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range InplaceAddOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value InplaceAddOp::x() {
  return *getODSOperands(0).begin();
}

::mlir::Value InplaceAddOp::i() {
  return *getODSOperands(1).begin();
}

::mlir::Value InplaceAddOp::v() {
  return *getODSOperands(2).begin();
}

::mlir::MutableOperandRange InplaceAddOp::xMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange InplaceAddOp::iMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange InplaceAddOp::vMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> InplaceAddOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range InplaceAddOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value InplaceAddOp::y() {
  return *getODSResults(0).begin();
}

::mlir::Type InplaceAddOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool InplaceAddOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr InplaceAddOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void InplaceAddOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type y, ::mlir::Value x, ::mlir::Value i, ::mlir::Value v) {
  odsState.addOperands(x);
  odsState.addOperands(i);
  odsState.addOperands(v);
  odsState.addTypes(y);
}

void InplaceAddOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value x, ::mlir::Value i, ::mlir::Value v) {
  odsState.addOperands(x);
  odsState.addOperands(i);
  odsState.addOperands(v);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void InplaceAddOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 3u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult InplaceAddOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops11(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  if (!((tf_type::AreCastCompatible(llvm::makeArrayRef({(*this->getODSOperands(0).begin()).getType(), (*this->getODSResults(0).begin()).getType()})))))
    return emitOpError("failed to verify that all of {x, y} have dynamically equal types ");
  return ::mlir::success();
}

void InplaceAddOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::InplaceAddOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::InplaceUpdateOp definitions
//===----------------------------------------------------------------------===//

InplaceUpdateOpAdaptor::InplaceUpdateOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

InplaceUpdateOpAdaptor::InplaceUpdateOpAdaptor(InplaceUpdateOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange InplaceUpdateOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> InplaceUpdateOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange InplaceUpdateOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value InplaceUpdateOpAdaptor::x() {
  return *getODSOperands(0).begin();
}

::mlir::Value InplaceUpdateOpAdaptor::i() {
  return *getODSOperands(1).begin();
}

::mlir::Value InplaceUpdateOpAdaptor::v() {
  return *getODSOperands(2).begin();
}

::mlir::DictionaryAttr InplaceUpdateOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult InplaceUpdateOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> InplaceUpdateOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range InplaceUpdateOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value InplaceUpdateOp::x() {
  return *getODSOperands(0).begin();
}

::mlir::Value InplaceUpdateOp::i() {
  return *getODSOperands(1).begin();
}

::mlir::Value InplaceUpdateOp::v() {
  return *getODSOperands(2).begin();
}

::mlir::MutableOperandRange InplaceUpdateOp::xMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange InplaceUpdateOp::iMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange InplaceUpdateOp::vMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> InplaceUpdateOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range InplaceUpdateOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value InplaceUpdateOp::y() {
  return *getODSResults(0).begin();
}

::mlir::Type InplaceUpdateOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool InplaceUpdateOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr InplaceUpdateOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void InplaceUpdateOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type y, ::mlir::Value x, ::mlir::Value i, ::mlir::Value v) {
  odsState.addOperands(x);
  odsState.addOperands(i);
  odsState.addOperands(v);
  odsState.addTypes(y);
}

void InplaceUpdateOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value x, ::mlir::Value i, ::mlir::Value v) {
  odsState.addOperands(x);
  odsState.addOperands(i);
  odsState.addOperands(v);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void InplaceUpdateOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 3u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult InplaceUpdateOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops11(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void InplaceUpdateOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::InplaceUpdateOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::InvOp definitions
//===----------------------------------------------------------------------===//

InvOpAdaptor::InvOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

InvOpAdaptor::InvOpAdaptor(InvOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange InvOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> InvOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange InvOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value InvOpAdaptor::x() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr InvOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult InvOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> InvOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range InvOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value InvOp::x() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange InvOp::xMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> InvOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range InvOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value InvOp::y() {
  return *getODSResults(0).begin();
}

::mlir::Type InvOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool InvOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr InvOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void InvOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type y, ::mlir::Value x) {
  odsState.addOperands(x);
  odsState.addTypes(y);
}

void InvOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value x) {
  odsState.addOperands(x);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void InvOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult InvOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops1(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops1(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void InvOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::InvOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::InvertOp definitions
//===----------------------------------------------------------------------===//

InvertOpAdaptor::InvertOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

InvertOpAdaptor::InvertOpAdaptor(InvertOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange InvertOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> InvertOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange InvertOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value InvertOpAdaptor::x() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr InvertOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult InvertOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> InvertOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range InvertOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value InvertOp::x() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange InvertOp::xMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> InvertOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range InvertOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value InvertOp::y() {
  return *getODSResults(0).begin();
}

::mlir::Type InvertOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool InvertOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr InvertOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void InvertOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type y, ::mlir::Value x) {
  odsState.addOperands(x);
  odsState.addTypes(y);
}

void InvertOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value x) {
  odsState.addOperands(x);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void InvertOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

void InvertOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value x) {
  odsState.addOperands(x);
  odsState.addTypes({x.getType()});

}

void InvertOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  odsState.addTypes({operands[0].getType()});

}

::mlir::LogicalResult InvertOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops27(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops27(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void InvertOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::InvertOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::InvertPermutationOp definitions
//===----------------------------------------------------------------------===//

InvertPermutationOpAdaptor::InvertPermutationOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

InvertPermutationOpAdaptor::InvertPermutationOpAdaptor(InvertPermutationOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange InvertPermutationOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> InvertPermutationOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange InvertPermutationOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value InvertPermutationOpAdaptor::x() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr InvertPermutationOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult InvertPermutationOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> InvertPermutationOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range InvertPermutationOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value InvertPermutationOp::x() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange InvertPermutationOp::xMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> InvertPermutationOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range InvertPermutationOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value InvertPermutationOp::y() {
  return *getODSResults(0).begin();
}

::mlir::Type InvertPermutationOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool InvertPermutationOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr InvertPermutationOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void InvertPermutationOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type y, ::mlir::Value x) {
  odsState.addOperands(x);
  odsState.addTypes(y);
}

void InvertPermutationOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value x) {
  odsState.addOperands(x);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void InvertPermutationOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult InvertPermutationOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return Verify(*this);
}

void InvertPermutationOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::InvertPermutationOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::IsFiniteOp definitions
//===----------------------------------------------------------------------===//

IsFiniteOpAdaptor::IsFiniteOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

IsFiniteOpAdaptor::IsFiniteOpAdaptor(IsFiniteOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange IsFiniteOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> IsFiniteOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange IsFiniteOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value IsFiniteOpAdaptor::x() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr IsFiniteOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult IsFiniteOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> IsFiniteOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range IsFiniteOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value IsFiniteOp::x() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange IsFiniteOp::xMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> IsFiniteOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range IsFiniteOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value IsFiniteOp::y() {
  return *getODSResults(0).begin();
}

::mlir::Type IsFiniteOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool IsFiniteOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr IsFiniteOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void IsFiniteOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type y, ::mlir::Value x) {
  odsState.addOperands(x);
  odsState.addTypes(y);
}

void IsFiniteOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value x) {
  odsState.addOperands(x);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void IsFiniteOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult IsFiniteOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops8(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void IsFiniteOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::IsFiniteOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::IsInfOp definitions
//===----------------------------------------------------------------------===//

IsInfOpAdaptor::IsInfOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

IsInfOpAdaptor::IsInfOpAdaptor(IsInfOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange IsInfOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> IsInfOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange IsInfOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value IsInfOpAdaptor::x() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr IsInfOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult IsInfOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> IsInfOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range IsInfOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value IsInfOp::x() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange IsInfOp::xMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> IsInfOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range IsInfOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value IsInfOp::y() {
  return *getODSResults(0).begin();
}

::mlir::Type IsInfOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool IsInfOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr IsInfOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void IsInfOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type y, ::mlir::Value x) {
  odsState.addOperands(x);
  odsState.addTypes(y);
}

void IsInfOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value x) {
  odsState.addOperands(x);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void IsInfOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult IsInfOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops8(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void IsInfOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::IsInfOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::IsNanOp definitions
//===----------------------------------------------------------------------===//

IsNanOpAdaptor::IsNanOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

IsNanOpAdaptor::IsNanOpAdaptor(IsNanOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange IsNanOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> IsNanOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange IsNanOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value IsNanOpAdaptor::x() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr IsNanOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult IsNanOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> IsNanOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range IsNanOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value IsNanOp::x() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange IsNanOp::xMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> IsNanOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range IsNanOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value IsNanOp::y() {
  return *getODSResults(0).begin();
}

::mlir::Type IsNanOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool IsNanOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr IsNanOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void IsNanOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type y, ::mlir::Value x) {
  odsState.addOperands(x);
  odsState.addTypes(y);
}

void IsNanOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value x) {
  odsState.addOperands(x);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void IsNanOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult IsNanOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops8(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void IsNanOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::IsNanOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::IteratorFromStringHandleOp definitions
//===----------------------------------------------------------------------===//

IteratorFromStringHandleOpAdaptor::IteratorFromStringHandleOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

IteratorFromStringHandleOpAdaptor::IteratorFromStringHandleOpAdaptor(IteratorFromStringHandleOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange IteratorFromStringHandleOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> IteratorFromStringHandleOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange IteratorFromStringHandleOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value IteratorFromStringHandleOpAdaptor::string_handle() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr IteratorFromStringHandleOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::ArrayAttr IteratorFromStringHandleOpAdaptor::output_types() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("output_types").dyn_cast_or_null<::mlir::ArrayAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getTypeArrayAttr({});
  return attr;
}

::mlir::ArrayAttr IteratorFromStringHandleOpAdaptor::output_shapes() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("output_shapes").dyn_cast_or_null<::mlir::ArrayAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getArrayAttr({});
  return attr;
}

::mlir::LogicalResult IteratorFromStringHandleOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_output_types = odsAttrs.get("output_types");
    if (tblgen_output_types && !(((tblgen_output_types.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_output_types.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return ((attr.isa<::mlir::TypeAttr>())) && ((attr.cast<::mlir::TypeAttr>().getValue().isa<::mlir::Type>())); }))))
      return emitError(loc, "'tf.IteratorFromStringHandle' op ""attribute 'output_types' failed to satisfy constraint: type array attribute");
  }
  {
    auto tblgen_output_shapes = odsAttrs.get("output_shapes");
    if (tblgen_output_shapes && !(((tblgen_output_shapes.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_output_shapes.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return (attr.isa<mlir::TF::ShapeAttr>()); }))))
      return emitError(loc, "'tf.IteratorFromStringHandle' op ""attribute 'output_shapes' failed to satisfy constraint: tensorflow shape attribute array");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> IteratorFromStringHandleOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range IteratorFromStringHandleOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value IteratorFromStringHandleOp::string_handle() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange IteratorFromStringHandleOp::string_handleMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> IteratorFromStringHandleOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range IteratorFromStringHandleOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value IteratorFromStringHandleOp::resource_handle() {
  return *getODSResults(0).begin();
}

::mlir::ArrayAttr IteratorFromStringHandleOp::output_typesAttr() {
  return (*this)->getAttr(output_typesAttrName()).dyn_cast_or_null<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr IteratorFromStringHandleOp::output_types() {
  auto attr = output_typesAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getTypeArrayAttr({});
  return attr;
}

::mlir::ArrayAttr IteratorFromStringHandleOp::output_shapesAttr() {
  return (*this)->getAttr(output_shapesAttrName()).dyn_cast_or_null<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr IteratorFromStringHandleOp::output_shapes() {
  auto attr = output_shapesAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getArrayAttr({});
  return attr;
}

void IteratorFromStringHandleOp::output_typesAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(output_typesAttrName(), attr);
}

void IteratorFromStringHandleOp::output_shapesAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(output_shapesAttrName(), attr);
}

void IteratorFromStringHandleOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type resource_handle, ::mlir::Value string_handle, ::mlir::ArrayAttr output_types, ::mlir::ArrayAttr output_shapes) {
  odsState.addOperands(string_handle);
  odsState.addAttribute(output_typesAttrName(odsState.name), output_types);
  odsState.addAttribute(output_shapesAttrName(odsState.name), output_shapes);
  odsState.addTypes(resource_handle);
}

void IteratorFromStringHandleOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value string_handle, ::mlir::ArrayAttr output_types, ::mlir::ArrayAttr output_shapes) {
  odsState.addOperands(string_handle);
  odsState.addAttribute(output_typesAttrName(odsState.name), output_types);
  odsState.addAttribute(output_shapesAttrName(odsState.name), output_shapes);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void IteratorFromStringHandleOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult IteratorFromStringHandleOp::verify() {
  {
    auto tblgen_output_types = (*this)->getAttr(output_typesAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops31(*this, tblgen_output_types, "output_types")))
      return ::mlir::failure();
  }
  {
    auto tblgen_output_shapes = (*this)->getAttr(output_shapesAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops28(*this, tblgen_output_shapes, "output_shapes")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops19(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void IteratorFromStringHandleOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  for (::mlir::Value value : getODSResults(0))
    effects.emplace_back(::mlir::MemoryEffects::Allocate::get(), value, ::mlir::TF::ResourceEffects::DatasetIterator::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::IteratorFromStringHandleOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::IteratorFromStringHandleV2Op definitions
//===----------------------------------------------------------------------===//

IteratorFromStringHandleV2OpAdaptor::IteratorFromStringHandleV2OpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

IteratorFromStringHandleV2OpAdaptor::IteratorFromStringHandleV2OpAdaptor(IteratorFromStringHandleV2Op &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange IteratorFromStringHandleV2OpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> IteratorFromStringHandleV2OpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange IteratorFromStringHandleV2OpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value IteratorFromStringHandleV2OpAdaptor::string_handle() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr IteratorFromStringHandleV2OpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::ArrayAttr IteratorFromStringHandleV2OpAdaptor::output_types() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("output_types").dyn_cast_or_null<::mlir::ArrayAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getTypeArrayAttr({});
  return attr;
}

::mlir::ArrayAttr IteratorFromStringHandleV2OpAdaptor::output_shapes() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("output_shapes").dyn_cast_or_null<::mlir::ArrayAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getArrayAttr({});
  return attr;
}

::mlir::LogicalResult IteratorFromStringHandleV2OpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_output_types = odsAttrs.get("output_types");
    if (tblgen_output_types && !(((tblgen_output_types.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_output_types.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return ((attr.isa<::mlir::TypeAttr>())) && ((attr.cast<::mlir::TypeAttr>().getValue().isa<::mlir::Type>())); }))))
      return emitError(loc, "'tf.IteratorFromStringHandleV2' op ""attribute 'output_types' failed to satisfy constraint: type array attribute");
  }
  {
    auto tblgen_output_shapes = odsAttrs.get("output_shapes");
    if (tblgen_output_shapes && !(((tblgen_output_shapes.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_output_shapes.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return (attr.isa<mlir::TF::ShapeAttr>()); }))))
      return emitError(loc, "'tf.IteratorFromStringHandleV2' op ""attribute 'output_shapes' failed to satisfy constraint: tensorflow shape attribute array");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> IteratorFromStringHandleV2Op::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range IteratorFromStringHandleV2Op::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value IteratorFromStringHandleV2Op::string_handle() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange IteratorFromStringHandleV2Op::string_handleMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> IteratorFromStringHandleV2Op::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range IteratorFromStringHandleV2Op::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value IteratorFromStringHandleV2Op::resource_handle() {
  return *getODSResults(0).begin();
}

::mlir::ArrayAttr IteratorFromStringHandleV2Op::output_typesAttr() {
  return (*this)->getAttr(output_typesAttrName()).dyn_cast_or_null<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr IteratorFromStringHandleV2Op::output_types() {
  auto attr = output_typesAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getTypeArrayAttr({});
  return attr;
}

::mlir::ArrayAttr IteratorFromStringHandleV2Op::output_shapesAttr() {
  return (*this)->getAttr(output_shapesAttrName()).dyn_cast_or_null<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr IteratorFromStringHandleV2Op::output_shapes() {
  auto attr = output_shapesAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getArrayAttr({});
  return attr;
}

void IteratorFromStringHandleV2Op::output_typesAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(output_typesAttrName(), attr);
}

void IteratorFromStringHandleV2Op::output_shapesAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(output_shapesAttrName(), attr);
}

void IteratorFromStringHandleV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type resource_handle, ::mlir::Value string_handle, ::mlir::ArrayAttr output_types, ::mlir::ArrayAttr output_shapes) {
  odsState.addOperands(string_handle);
  odsState.addAttribute(output_typesAttrName(odsState.name), output_types);
  odsState.addAttribute(output_shapesAttrName(odsState.name), output_shapes);
  odsState.addTypes(resource_handle);
}

void IteratorFromStringHandleV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value string_handle, ::mlir::ArrayAttr output_types, ::mlir::ArrayAttr output_shapes) {
  odsState.addOperands(string_handle);
  odsState.addAttribute(output_typesAttrName(odsState.name), output_types);
  odsState.addAttribute(output_shapesAttrName(odsState.name), output_shapes);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void IteratorFromStringHandleV2Op::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult IteratorFromStringHandleV2Op::verify() {
  {
    auto tblgen_output_types = (*this)->getAttr(output_typesAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops31(*this, tblgen_output_types, "output_types")))
      return ::mlir::failure();
  }
  {
    auto tblgen_output_shapes = (*this)->getAttr(output_shapesAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops28(*this, tblgen_output_shapes, "output_shapes")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops19(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void IteratorFromStringHandleV2Op::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  for (::mlir::Value value : getODSResults(0))
    effects.emplace_back(::mlir::MemoryEffects::Allocate::get(), value, ::mlir::TF::ResourceEffects::DatasetIterator::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::IteratorFromStringHandleV2Op)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::IteratorGetNextAsOptionalOp definitions
//===----------------------------------------------------------------------===//

IteratorGetNextAsOptionalOpAdaptor::IteratorGetNextAsOptionalOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

IteratorGetNextAsOptionalOpAdaptor::IteratorGetNextAsOptionalOpAdaptor(IteratorGetNextAsOptionalOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange IteratorGetNextAsOptionalOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> IteratorGetNextAsOptionalOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange IteratorGetNextAsOptionalOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value IteratorGetNextAsOptionalOpAdaptor::iterator() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr IteratorGetNextAsOptionalOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::ArrayAttr IteratorGetNextAsOptionalOpAdaptor::output_types() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("output_types").cast<::mlir::ArrayAttr>();
  return attr;
}

::mlir::ArrayAttr IteratorGetNextAsOptionalOpAdaptor::output_shapes() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("output_shapes").cast<::mlir::ArrayAttr>();
  return attr;
}

::mlir::LogicalResult IteratorGetNextAsOptionalOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_output_types = odsAttrs.get("output_types");
    if (!tblgen_output_types)
      return emitError(loc, "'tf.IteratorGetNextAsOptional' op ""requires attribute 'output_types'");

    if (tblgen_output_types && !((((tblgen_output_types.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_output_types.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return ((attr.isa<::mlir::TypeAttr>())) && ((attr.cast<::mlir::TypeAttr>().getValue().isa<::mlir::Type>())); }))) && ((tblgen_output_types.cast<::mlir::ArrayAttr>().size() >= 1))))
      return emitError(loc, "'tf.IteratorGetNextAsOptional' op ""attribute 'output_types' failed to satisfy constraint: type array attribute with at least 1 elements");
  }
  {
    auto tblgen_output_shapes = odsAttrs.get("output_shapes");
    if (!tblgen_output_shapes)
      return emitError(loc, "'tf.IteratorGetNextAsOptional' op ""requires attribute 'output_shapes'");

    if (tblgen_output_shapes && !((((tblgen_output_shapes.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_output_shapes.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return (attr.isa<mlir::TF::ShapeAttr>()); }))) && ((tblgen_output_shapes.cast<::mlir::ArrayAttr>().size() >= 1))))
      return emitError(loc, "'tf.IteratorGetNextAsOptional' op ""attribute 'output_shapes' failed to satisfy constraint: tensorflow shape attribute array with at least 1 elements");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> IteratorGetNextAsOptionalOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range IteratorGetNextAsOptionalOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value IteratorGetNextAsOptionalOp::iterator() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange IteratorGetNextAsOptionalOp::iteratorMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> IteratorGetNextAsOptionalOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range IteratorGetNextAsOptionalOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value IteratorGetNextAsOptionalOp::optional() {
  return *getODSResults(0).begin();
}

::mlir::ArrayAttr IteratorGetNextAsOptionalOp::output_typesAttr() {
  return (*this)->getAttr(output_typesAttrName()).cast<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr IteratorGetNextAsOptionalOp::output_types() {
  auto attr = output_typesAttr();
  return attr;
}

::mlir::ArrayAttr IteratorGetNextAsOptionalOp::output_shapesAttr() {
  return (*this)->getAttr(output_shapesAttrName()).cast<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr IteratorGetNextAsOptionalOp::output_shapes() {
  auto attr = output_shapesAttr();
  return attr;
}

void IteratorGetNextAsOptionalOp::output_typesAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(output_typesAttrName(), attr);
}

void IteratorGetNextAsOptionalOp::output_shapesAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(output_shapesAttrName(), attr);
}

void IteratorGetNextAsOptionalOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type optional, ::mlir::Value iterator, ::mlir::ArrayAttr output_types, ::mlir::ArrayAttr output_shapes) {
  odsState.addOperands(iterator);
  odsState.addAttribute(output_typesAttrName(odsState.name), output_types);
  odsState.addAttribute(output_shapesAttrName(odsState.name), output_shapes);
  odsState.addTypes(optional);
}

void IteratorGetNextAsOptionalOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value iterator, ::mlir::ArrayAttr output_types, ::mlir::ArrayAttr output_shapes) {
  odsState.addOperands(iterator);
  odsState.addAttribute(output_typesAttrName(odsState.name), output_types);
  odsState.addAttribute(output_shapesAttrName(odsState.name), output_shapes);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void IteratorGetNextAsOptionalOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult IteratorGetNextAsOptionalOp::verify() {
  {
    auto tblgen_output_types = (*this)->getAttr(output_typesAttrName());
    if (!tblgen_output_types)
      return emitOpError("requires attribute 'output_types'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops2(*this, tblgen_output_types, "output_types")))
      return ::mlir::failure();
  }
  {
    auto tblgen_output_shapes = (*this)->getAttr(output_shapesAttrName());
    if (!tblgen_output_shapes)
      return emitOpError("requires attribute 'output_shapes'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops3(*this, tblgen_output_shapes, "output_shapes")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops15(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void IteratorGetNextAsOptionalOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  for (::mlir::Value value : getODSOperands(0))
    effects.emplace_back(::mlir::MemoryEffects::Read::get(), value, ::mlir::TF::ResourceEffects::DatasetIterator::get());
  for (::mlir::Value value : getODSOperands(0))
    effects.emplace_back(::mlir::MemoryEffects::Write::get(), value, ::mlir::TF::ResourceEffects::DatasetIterator::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::IteratorGetNextAsOptionalOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::IteratorGetNextOp definitions
//===----------------------------------------------------------------------===//

IteratorGetNextOpAdaptor::IteratorGetNextOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

IteratorGetNextOpAdaptor::IteratorGetNextOpAdaptor(IteratorGetNextOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange IteratorGetNextOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> IteratorGetNextOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange IteratorGetNextOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value IteratorGetNextOpAdaptor::iterator() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr IteratorGetNextOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult IteratorGetNextOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> IteratorGetNextOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range IteratorGetNextOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value IteratorGetNextOp::iterator() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange IteratorGetNextOp::iteratorMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> IteratorGetNextOp::getODSResultIndexAndLength(unsigned index) {
  bool isVariadic[] = {true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (getOperation()->getNumResults() - 0) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::Operation::result_range IteratorGetNextOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Operation::result_range IteratorGetNextOp::components() {
  return getODSResults(0);
}

mlir::TF::ResultShapeRange IteratorGetNextOp::output_shapes() {
  auto values = getODSResults(0);
return {mlir::TF::ResultShapeIterator(values.begin()), mlir::TF::ResultShapeIterator(values.end())};
}

mlir::ResultElementTypeRange IteratorGetNextOp::output_types() {
  auto values = getODSResults(0);
return {mlir::ResultElementTypeIterator(values.begin()), mlir::ResultElementTypeIterator(values.end())};
}

bool IteratorGetNextOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "output_shapes") return true;
  if (name == "output_types") return true;
 return false;
}

::mlir::DictionaryAttr IteratorGetNextOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {output_shapesAttrName(),
ArrayAttr::get(ctx,
      [&](){
        llvm::SmallVector<Attribute, 4> ret;
        for (auto shape : output_shapes())
          ret.push_back(mlir::TF::ShapeAttr::get(ctx, shape));
        return ret;
      }())},
    {output_typesAttrName(),
ArrayAttr::get(ctx, 
    [&]() {
      llvm::SmallVector<Attribute, 4> ret;
      for (auto t : output_types())
        ret.push_back(TypeAttr::get(t));
      return ret;
    }())}});
}

void IteratorGetNextOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange components, ::mlir::Value iterator) {
  odsState.addOperands(iterator);
  odsState.addTypes(components);
}

void IteratorGetNextOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult IteratorGetNextOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void IteratorGetNextOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  for (::mlir::Value value : getODSOperands(0))
    effects.emplace_back(::mlir::MemoryEffects::Read::get(), value, ::mlir::TF::ResourceEffects::DatasetIterator::get());
  for (::mlir::Value value : getODSOperands(0))
    effects.emplace_back(::mlir::MemoryEffects::Write::get(), value, ::mlir::TF::ResourceEffects::DatasetIterator::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::IteratorGetNextOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::IteratorGetNextSyncOp definitions
//===----------------------------------------------------------------------===//

IteratorGetNextSyncOpAdaptor::IteratorGetNextSyncOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

IteratorGetNextSyncOpAdaptor::IteratorGetNextSyncOpAdaptor(IteratorGetNextSyncOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange IteratorGetNextSyncOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> IteratorGetNextSyncOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange IteratorGetNextSyncOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value IteratorGetNextSyncOpAdaptor::iterator() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr IteratorGetNextSyncOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult IteratorGetNextSyncOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> IteratorGetNextSyncOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range IteratorGetNextSyncOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value IteratorGetNextSyncOp::iterator() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange IteratorGetNextSyncOp::iteratorMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> IteratorGetNextSyncOp::getODSResultIndexAndLength(unsigned index) {
  bool isVariadic[] = {true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (getOperation()->getNumResults() - 0) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::Operation::result_range IteratorGetNextSyncOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Operation::result_range IteratorGetNextSyncOp::components() {
  return getODSResults(0);
}

mlir::TF::ResultShapeRange IteratorGetNextSyncOp::output_shapes() {
  auto values = getODSResults(0);
return {mlir::TF::ResultShapeIterator(values.begin()), mlir::TF::ResultShapeIterator(values.end())};
}

mlir::ResultElementTypeRange IteratorGetNextSyncOp::output_types() {
  auto values = getODSResults(0);
return {mlir::ResultElementTypeIterator(values.begin()), mlir::ResultElementTypeIterator(values.end())};
}

bool IteratorGetNextSyncOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "output_shapes") return true;
  if (name == "output_types") return true;
 return false;
}

::mlir::DictionaryAttr IteratorGetNextSyncOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {output_shapesAttrName(),
ArrayAttr::get(ctx,
      [&](){
        llvm::SmallVector<Attribute, 4> ret;
        for (auto shape : output_shapes())
          ret.push_back(mlir::TF::ShapeAttr::get(ctx, shape));
        return ret;
      }())},
    {output_typesAttrName(),
ArrayAttr::get(ctx, 
    [&]() {
      llvm::SmallVector<Attribute, 4> ret;
      for (auto t : output_types())
        ret.push_back(TypeAttr::get(t));
      return ret;
    }())}});
}

void IteratorGetNextSyncOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange components, ::mlir::Value iterator) {
  odsState.addOperands(iterator);
  odsState.addTypes(components);
}

void IteratorGetNextSyncOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult IteratorGetNextSyncOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void IteratorGetNextSyncOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  for (::mlir::Value value : getODSOperands(0))
    effects.emplace_back(::mlir::MemoryEffects::Read::get(), value, ::mlir::TF::ResourceEffects::DatasetIterator::get());
  for (::mlir::Value value : getODSOperands(0))
    effects.emplace_back(::mlir::MemoryEffects::Write::get(), value, ::mlir::TF::ResourceEffects::DatasetIterator::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::IteratorGetNextSyncOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::IteratorOp definitions
//===----------------------------------------------------------------------===//

IteratorOpAdaptor::IteratorOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

IteratorOpAdaptor::IteratorOpAdaptor(IteratorOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange IteratorOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> IteratorOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange IteratorOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::DictionaryAttr IteratorOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::StringAttr IteratorOpAdaptor::shared_name() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("shared_name").cast<::mlir::StringAttr>();
  return attr;
}

::mlir::StringAttr IteratorOpAdaptor::container() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("container").cast<::mlir::StringAttr>();
  return attr;
}

::mlir::ArrayAttr IteratorOpAdaptor::output_types() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("output_types").cast<::mlir::ArrayAttr>();
  return attr;
}

::mlir::ArrayAttr IteratorOpAdaptor::output_shapes() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("output_shapes").cast<::mlir::ArrayAttr>();
  return attr;
}

::mlir::LogicalResult IteratorOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_shared_name = odsAttrs.get("shared_name");
    if (!tblgen_shared_name)
      return emitError(loc, "'tf.Iterator' op ""requires attribute 'shared_name'");

    if (tblgen_shared_name && !((tblgen_shared_name.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.Iterator' op ""attribute 'shared_name' failed to satisfy constraint: string attribute");
  }
  {
    auto tblgen_container = odsAttrs.get("container");
    if (!tblgen_container)
      return emitError(loc, "'tf.Iterator' op ""requires attribute 'container'");

    if (tblgen_container && !((tblgen_container.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.Iterator' op ""attribute 'container' failed to satisfy constraint: string attribute");
  }
  {
    auto tblgen_output_types = odsAttrs.get("output_types");
    if (!tblgen_output_types)
      return emitError(loc, "'tf.Iterator' op ""requires attribute 'output_types'");

    if (tblgen_output_types && !((((tblgen_output_types.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_output_types.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return ((attr.isa<::mlir::TypeAttr>())) && ((attr.cast<::mlir::TypeAttr>().getValue().isa<::mlir::Type>())); }))) && ((tblgen_output_types.cast<::mlir::ArrayAttr>().size() >= 1))))
      return emitError(loc, "'tf.Iterator' op ""attribute 'output_types' failed to satisfy constraint: type array attribute with at least 1 elements");
  }
  {
    auto tblgen_output_shapes = odsAttrs.get("output_shapes");
    if (!tblgen_output_shapes)
      return emitError(loc, "'tf.Iterator' op ""requires attribute 'output_shapes'");

    if (tblgen_output_shapes && !((((tblgen_output_shapes.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_output_shapes.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return (attr.isa<mlir::TF::ShapeAttr>()); }))) && ((tblgen_output_shapes.cast<::mlir::ArrayAttr>().size() >= 1))))
      return emitError(loc, "'tf.Iterator' op ""attribute 'output_shapes' failed to satisfy constraint: tensorflow shape attribute array with at least 1 elements");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> IteratorOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range IteratorOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

std::pair<unsigned, unsigned> IteratorOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range IteratorOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value IteratorOp::handle() {
  return *getODSResults(0).begin();
}

::mlir::StringAttr IteratorOp::shared_nameAttr() {
  return (*this)->getAttr(shared_nameAttrName()).cast<::mlir::StringAttr>();
}

::llvm::StringRef IteratorOp::shared_name() {
  auto attr = shared_nameAttr();
  return attr.getValue();
}

::mlir::StringAttr IteratorOp::containerAttr() {
  return (*this)->getAttr(containerAttrName()).cast<::mlir::StringAttr>();
}

::llvm::StringRef IteratorOp::container() {
  auto attr = containerAttr();
  return attr.getValue();
}

::mlir::ArrayAttr IteratorOp::output_typesAttr() {
  return (*this)->getAttr(output_typesAttrName()).cast<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr IteratorOp::output_types() {
  auto attr = output_typesAttr();
  return attr;
}

::mlir::ArrayAttr IteratorOp::output_shapesAttr() {
  return (*this)->getAttr(output_shapesAttrName()).cast<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr IteratorOp::output_shapes() {
  auto attr = output_shapesAttr();
  return attr;
}

void IteratorOp::shared_nameAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(shared_nameAttrName(), attr);
}

void IteratorOp::containerAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(containerAttrName(), attr);
}

void IteratorOp::output_typesAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(output_typesAttrName(), attr);
}

void IteratorOp::output_shapesAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(output_shapesAttrName(), attr);
}

void IteratorOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type handle, ::mlir::StringAttr shared_name, ::mlir::StringAttr container, ::mlir::ArrayAttr output_types, ::mlir::ArrayAttr output_shapes) {
  odsState.addAttribute(shared_nameAttrName(odsState.name), shared_name);
  odsState.addAttribute(containerAttrName(odsState.name), container);
  odsState.addAttribute(output_typesAttrName(odsState.name), output_types);
  odsState.addAttribute(output_shapesAttrName(odsState.name), output_shapes);
  odsState.addTypes(handle);
}

void IteratorOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::StringAttr shared_name, ::mlir::StringAttr container, ::mlir::ArrayAttr output_types, ::mlir::ArrayAttr output_shapes) {
  odsState.addAttribute(shared_nameAttrName(odsState.name), shared_name);
  odsState.addAttribute(containerAttrName(odsState.name), container);
  odsState.addAttribute(output_typesAttrName(odsState.name), output_types);
  odsState.addAttribute(output_shapesAttrName(odsState.name), output_shapes);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void IteratorOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type handle, ::llvm::StringRef shared_name, ::llvm::StringRef container, ::mlir::ArrayAttr output_types, ::mlir::ArrayAttr output_shapes) {
  odsState.addAttribute(shared_nameAttrName(odsState.name), odsBuilder.getStringAttr(shared_name));
  odsState.addAttribute(containerAttrName(odsState.name), odsBuilder.getStringAttr(container));
  odsState.addAttribute(output_typesAttrName(odsState.name), output_types);
  odsState.addAttribute(output_shapesAttrName(odsState.name), output_shapes);
  odsState.addTypes(handle);
}

void IteratorOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::llvm::StringRef shared_name, ::llvm::StringRef container, ::mlir::ArrayAttr output_types, ::mlir::ArrayAttr output_shapes) {
  odsState.addAttribute(shared_nameAttrName(odsState.name), odsBuilder.getStringAttr(shared_name));
  odsState.addAttribute(containerAttrName(odsState.name), odsBuilder.getStringAttr(container));
  odsState.addAttribute(output_typesAttrName(odsState.name), output_types);
  odsState.addAttribute(output_shapesAttrName(odsState.name), output_shapes);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void IteratorOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 0u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult IteratorOp::verify() {
  {
    auto tblgen_shared_name = (*this)->getAttr(shared_nameAttrName());
    if (!tblgen_shared_name)
      return emitOpError("requires attribute 'shared_name'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_shared_name, "shared_name")))
      return ::mlir::failure();
  }
  {
    auto tblgen_container = (*this)->getAttr(containerAttrName());
    if (!tblgen_container)
      return emitOpError("requires attribute 'container'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_container, "container")))
      return ::mlir::failure();
  }
  {
    auto tblgen_output_types = (*this)->getAttr(output_typesAttrName());
    if (!tblgen_output_types)
      return emitOpError("requires attribute 'output_types'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops2(*this, tblgen_output_types, "output_types")))
      return ::mlir::failure();
  }
  {
    auto tblgen_output_shapes = (*this)->getAttr(output_shapesAttrName());
    if (!tblgen_output_shapes)
      return emitOpError("requires attribute 'output_shapes'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops3(*this, tblgen_output_shapes, "output_shapes")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void IteratorOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  for (::mlir::Value value : getODSResults(0))
    effects.emplace_back(::mlir::MemoryEffects::Allocate::get(), value, ::mlir::TF::ResourceEffects::DatasetIterator::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::IteratorOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::IteratorToStringHandleOp definitions
//===----------------------------------------------------------------------===//

IteratorToStringHandleOpAdaptor::IteratorToStringHandleOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

IteratorToStringHandleOpAdaptor::IteratorToStringHandleOpAdaptor(IteratorToStringHandleOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange IteratorToStringHandleOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> IteratorToStringHandleOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange IteratorToStringHandleOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value IteratorToStringHandleOpAdaptor::resource_handle() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr IteratorToStringHandleOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult IteratorToStringHandleOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> IteratorToStringHandleOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range IteratorToStringHandleOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value IteratorToStringHandleOp::resource_handle() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange IteratorToStringHandleOp::resource_handleMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> IteratorToStringHandleOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range IteratorToStringHandleOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value IteratorToStringHandleOp::string_handle() {
  return *getODSResults(0).begin();
}

void IteratorToStringHandleOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type string_handle, ::mlir::Value resource_handle) {
  odsState.addOperands(resource_handle);
  odsState.addTypes(string_handle);
}

void IteratorToStringHandleOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value resource_handle) {
  odsState.addOperands(resource_handle);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void IteratorToStringHandleOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult IteratorToStringHandleOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops19(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void IteratorToStringHandleOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  for (::mlir::Value value : getODSOperands(0))
    effects.emplace_back(::mlir::MemoryEffects::Read::get(), value, ::mlir::TF::ResourceEffects::DatasetIterator::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::IteratorToStringHandleOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::IteratorV2Op definitions
//===----------------------------------------------------------------------===//

IteratorV2OpAdaptor::IteratorV2OpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

IteratorV2OpAdaptor::IteratorV2OpAdaptor(IteratorV2Op &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange IteratorV2OpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> IteratorV2OpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange IteratorV2OpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::DictionaryAttr IteratorV2OpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::StringAttr IteratorV2OpAdaptor::shared_name() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("shared_name").cast<::mlir::StringAttr>();
  return attr;
}

::mlir::StringAttr IteratorV2OpAdaptor::container() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("container").cast<::mlir::StringAttr>();
  return attr;
}

::mlir::ArrayAttr IteratorV2OpAdaptor::output_types() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("output_types").cast<::mlir::ArrayAttr>();
  return attr;
}

::mlir::ArrayAttr IteratorV2OpAdaptor::output_shapes() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("output_shapes").cast<::mlir::ArrayAttr>();
  return attr;
}

::mlir::LogicalResult IteratorV2OpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_shared_name = odsAttrs.get("shared_name");
    if (!tblgen_shared_name)
      return emitError(loc, "'tf.IteratorV2' op ""requires attribute 'shared_name'");

    if (tblgen_shared_name && !((tblgen_shared_name.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.IteratorV2' op ""attribute 'shared_name' failed to satisfy constraint: string attribute");
  }
  {
    auto tblgen_container = odsAttrs.get("container");
    if (!tblgen_container)
      return emitError(loc, "'tf.IteratorV2' op ""requires attribute 'container'");

    if (tblgen_container && !((tblgen_container.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.IteratorV2' op ""attribute 'container' failed to satisfy constraint: string attribute");
  }
  {
    auto tblgen_output_types = odsAttrs.get("output_types");
    if (!tblgen_output_types)
      return emitError(loc, "'tf.IteratorV2' op ""requires attribute 'output_types'");

    if (tblgen_output_types && !((((tblgen_output_types.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_output_types.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return ((attr.isa<::mlir::TypeAttr>())) && ((attr.cast<::mlir::TypeAttr>().getValue().isa<::mlir::Type>())); }))) && ((tblgen_output_types.cast<::mlir::ArrayAttr>().size() >= 1))))
      return emitError(loc, "'tf.IteratorV2' op ""attribute 'output_types' failed to satisfy constraint: type array attribute with at least 1 elements");
  }
  {
    auto tblgen_output_shapes = odsAttrs.get("output_shapes");
    if (!tblgen_output_shapes)
      return emitError(loc, "'tf.IteratorV2' op ""requires attribute 'output_shapes'");

    if (tblgen_output_shapes && !((((tblgen_output_shapes.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_output_shapes.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return (attr.isa<mlir::TF::ShapeAttr>()); }))) && ((tblgen_output_shapes.cast<::mlir::ArrayAttr>().size() >= 1))))
      return emitError(loc, "'tf.IteratorV2' op ""attribute 'output_shapes' failed to satisfy constraint: tensorflow shape attribute array with at least 1 elements");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> IteratorV2Op::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range IteratorV2Op::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

std::pair<unsigned, unsigned> IteratorV2Op::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range IteratorV2Op::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value IteratorV2Op::handle() {
  return *getODSResults(0).begin();
}

::mlir::StringAttr IteratorV2Op::shared_nameAttr() {
  return (*this)->getAttr(shared_nameAttrName()).cast<::mlir::StringAttr>();
}

::llvm::StringRef IteratorV2Op::shared_name() {
  auto attr = shared_nameAttr();
  return attr.getValue();
}

::mlir::StringAttr IteratorV2Op::containerAttr() {
  return (*this)->getAttr(containerAttrName()).cast<::mlir::StringAttr>();
}

::llvm::StringRef IteratorV2Op::container() {
  auto attr = containerAttr();
  return attr.getValue();
}

::mlir::ArrayAttr IteratorV2Op::output_typesAttr() {
  return (*this)->getAttr(output_typesAttrName()).cast<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr IteratorV2Op::output_types() {
  auto attr = output_typesAttr();
  return attr;
}

::mlir::ArrayAttr IteratorV2Op::output_shapesAttr() {
  return (*this)->getAttr(output_shapesAttrName()).cast<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr IteratorV2Op::output_shapes() {
  auto attr = output_shapesAttr();
  return attr;
}

void IteratorV2Op::shared_nameAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(shared_nameAttrName(), attr);
}

void IteratorV2Op::containerAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(containerAttrName(), attr);
}

void IteratorV2Op::output_typesAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(output_typesAttrName(), attr);
}

void IteratorV2Op::output_shapesAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(output_shapesAttrName(), attr);
}

void IteratorV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type handle, ::mlir::StringAttr shared_name, ::mlir::StringAttr container, ::mlir::ArrayAttr output_types, ::mlir::ArrayAttr output_shapes) {
  odsState.addAttribute(shared_nameAttrName(odsState.name), shared_name);
  odsState.addAttribute(containerAttrName(odsState.name), container);
  odsState.addAttribute(output_typesAttrName(odsState.name), output_types);
  odsState.addAttribute(output_shapesAttrName(odsState.name), output_shapes);
  odsState.addTypes(handle);
}

void IteratorV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::StringAttr shared_name, ::mlir::StringAttr container, ::mlir::ArrayAttr output_types, ::mlir::ArrayAttr output_shapes) {
  odsState.addAttribute(shared_nameAttrName(odsState.name), shared_name);
  odsState.addAttribute(containerAttrName(odsState.name), container);
  odsState.addAttribute(output_typesAttrName(odsState.name), output_types);
  odsState.addAttribute(output_shapesAttrName(odsState.name), output_shapes);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void IteratorV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type handle, ::llvm::StringRef shared_name, ::llvm::StringRef container, ::mlir::ArrayAttr output_types, ::mlir::ArrayAttr output_shapes) {
  odsState.addAttribute(shared_nameAttrName(odsState.name), odsBuilder.getStringAttr(shared_name));
  odsState.addAttribute(containerAttrName(odsState.name), odsBuilder.getStringAttr(container));
  odsState.addAttribute(output_typesAttrName(odsState.name), output_types);
  odsState.addAttribute(output_shapesAttrName(odsState.name), output_shapes);
  odsState.addTypes(handle);
}

void IteratorV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::llvm::StringRef shared_name, ::llvm::StringRef container, ::mlir::ArrayAttr output_types, ::mlir::ArrayAttr output_shapes) {
  odsState.addAttribute(shared_nameAttrName(odsState.name), odsBuilder.getStringAttr(shared_name));
  odsState.addAttribute(containerAttrName(odsState.name), odsBuilder.getStringAttr(container));
  odsState.addAttribute(output_typesAttrName(odsState.name), output_types);
  odsState.addAttribute(output_shapesAttrName(odsState.name), output_shapes);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void IteratorV2Op::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 0u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult IteratorV2Op::verify() {
  {
    auto tblgen_shared_name = (*this)->getAttr(shared_nameAttrName());
    if (!tblgen_shared_name)
      return emitOpError("requires attribute 'shared_name'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_shared_name, "shared_name")))
      return ::mlir::failure();
  }
  {
    auto tblgen_container = (*this)->getAttr(containerAttrName());
    if (!tblgen_container)
      return emitOpError("requires attribute 'container'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_container, "container")))
      return ::mlir::failure();
  }
  {
    auto tblgen_output_types = (*this)->getAttr(output_typesAttrName());
    if (!tblgen_output_types)
      return emitOpError("requires attribute 'output_types'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops2(*this, tblgen_output_types, "output_types")))
      return ::mlir::failure();
  }
  {
    auto tblgen_output_shapes = (*this)->getAttr(output_shapesAttrName());
    if (!tblgen_output_shapes)
      return emitOpError("requires attribute 'output_shapes'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops3(*this, tblgen_output_shapes, "output_shapes")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void IteratorV2Op::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  for (::mlir::Value value : getODSResults(0))
    effects.emplace_back(::mlir::MemoryEffects::Allocate::get(), value, ::mlir::TF::ResourceEffects::DatasetIterator::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::IteratorV2Op)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::KthOrderStatisticOp definitions
//===----------------------------------------------------------------------===//

KthOrderStatisticOpAdaptor::KthOrderStatisticOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

KthOrderStatisticOpAdaptor::KthOrderStatisticOpAdaptor(KthOrderStatisticOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange KthOrderStatisticOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> KthOrderStatisticOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange KthOrderStatisticOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value KthOrderStatisticOpAdaptor::input() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr KthOrderStatisticOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::IntegerAttr KthOrderStatisticOpAdaptor::k() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("k").cast<::mlir::IntegerAttr>();
  return attr;
}

::mlir::LogicalResult KthOrderStatisticOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_k = odsAttrs.get("k");
    if (!tblgen_k)
      return emitError(loc, "'tf.KthOrderStatistic' op ""requires attribute 'k'");

    if (tblgen_k && !(((tblgen_k.isa<::mlir::IntegerAttr>())) && ((tblgen_k.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.KthOrderStatistic' op ""attribute 'k' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> KthOrderStatisticOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range KthOrderStatisticOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value KthOrderStatisticOp::input() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange KthOrderStatisticOp::inputMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> KthOrderStatisticOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range KthOrderStatisticOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value KthOrderStatisticOp::output() {
  return *getODSResults(0).begin();
}

::mlir::IntegerAttr KthOrderStatisticOp::kAttr() {
  return (*this)->getAttr(kAttrName()).cast<::mlir::IntegerAttr>();
}

uint64_t KthOrderStatisticOp::k() {
  auto attr = kAttr();
  return attr.getValue().getZExtValue();
}

void KthOrderStatisticOp::kAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(kAttrName(), attr);
}

void KthOrderStatisticOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input, ::mlir::IntegerAttr k) {
  odsState.addOperands(input);
  odsState.addAttribute(kAttrName(odsState.name), k);
  odsState.addTypes(output);
}

void KthOrderStatisticOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::IntegerAttr k) {
  odsState.addOperands(input);
  odsState.addAttribute(kAttrName(odsState.name), k);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void KthOrderStatisticOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input, uint64_t k) {
  odsState.addOperands(input);
  odsState.addAttribute(kAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), k));
  odsState.addTypes(output);
}

void KthOrderStatisticOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, uint64_t k) {
  odsState.addOperands(input);
  odsState.addAttribute(kAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), k));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void KthOrderStatisticOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult KthOrderStatisticOp::verify() {
  {
    auto tblgen_k = (*this)->getAttr(kAttrName());
    if (!tblgen_k)
      return emitOpError("requires attribute 'k'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_k, "k")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void KthOrderStatisticOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::KthOrderStatisticOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::L2LossOp definitions
//===----------------------------------------------------------------------===//

L2LossOpAdaptor::L2LossOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

L2LossOpAdaptor::L2LossOpAdaptor(L2LossOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange L2LossOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> L2LossOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange L2LossOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value L2LossOpAdaptor::t() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr L2LossOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult L2LossOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> L2LossOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range L2LossOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value L2LossOp::t() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange L2LossOp::tMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> L2LossOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range L2LossOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value L2LossOp::output() {
  return *getODSResults(0).begin();
}

::mlir::Type L2LossOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool L2LossOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr L2LossOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void L2LossOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value t) {
  odsState.addOperands(t);
  odsState.addTypes(output);
}

void L2LossOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value t) {
  odsState.addOperands(t);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void L2LossOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult L2LossOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void L2LossOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::L2LossOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::LRNGradOp definitions
//===----------------------------------------------------------------------===//

LRNGradOpAdaptor::LRNGradOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

LRNGradOpAdaptor::LRNGradOpAdaptor(LRNGradOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange LRNGradOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> LRNGradOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange LRNGradOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value LRNGradOpAdaptor::input_grads() {
  return *getODSOperands(0).begin();
}

::mlir::Value LRNGradOpAdaptor::input_image() {
  return *getODSOperands(1).begin();
}

::mlir::Value LRNGradOpAdaptor::output_image() {
  return *getODSOperands(2).begin();
}

::mlir::DictionaryAttr LRNGradOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::IntegerAttr LRNGradOpAdaptor::depth_radius() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("depth_radius").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), 5);
  return attr;
}

::mlir::FloatAttr LRNGradOpAdaptor::bias() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::FloatAttr attr = odsAttrs.get("bias").dyn_cast_or_null<::mlir::FloatAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getFloatAttr(::mlir::Builder(odsAttrs.getContext()).getF32Type(), 1.0f);
  return attr;
}

::mlir::FloatAttr LRNGradOpAdaptor::alpha() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::FloatAttr attr = odsAttrs.get("alpha").dyn_cast_or_null<::mlir::FloatAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getFloatAttr(::mlir::Builder(odsAttrs.getContext()).getF32Type(), 1.0f);
  return attr;
}

::mlir::FloatAttr LRNGradOpAdaptor::beta() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::FloatAttr attr = odsAttrs.get("beta").dyn_cast_or_null<::mlir::FloatAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getFloatAttr(::mlir::Builder(odsAttrs.getContext()).getF32Type(), 0.5f);
  return attr;
}

::mlir::LogicalResult LRNGradOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_depth_radius = odsAttrs.get("depth_radius");
    if (tblgen_depth_radius && !(((tblgen_depth_radius.isa<::mlir::IntegerAttr>())) && ((tblgen_depth_radius.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.LRNGrad' op ""attribute 'depth_radius' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_bias = odsAttrs.get("bias");
    if (tblgen_bias && !(((tblgen_bias.isa<::mlir::FloatAttr>())) && ((tblgen_bias.cast<::mlir::FloatAttr>().getType().isF32()))))
      return emitError(loc, "'tf.LRNGrad' op ""attribute 'bias' failed to satisfy constraint: 32-bit float attribute");
  }
  {
    auto tblgen_alpha = odsAttrs.get("alpha");
    if (tblgen_alpha && !(((tblgen_alpha.isa<::mlir::FloatAttr>())) && ((tblgen_alpha.cast<::mlir::FloatAttr>().getType().isF32()))))
      return emitError(loc, "'tf.LRNGrad' op ""attribute 'alpha' failed to satisfy constraint: 32-bit float attribute");
  }
  {
    auto tblgen_beta = odsAttrs.get("beta");
    if (tblgen_beta && !(((tblgen_beta.isa<::mlir::FloatAttr>())) && ((tblgen_beta.cast<::mlir::FloatAttr>().getType().isF32()))))
      return emitError(loc, "'tf.LRNGrad' op ""attribute 'beta' failed to satisfy constraint: 32-bit float attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> LRNGradOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range LRNGradOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value LRNGradOp::input_grads() {
  return *getODSOperands(0).begin();
}

::mlir::Value LRNGradOp::input_image() {
  return *getODSOperands(1).begin();
}

::mlir::Value LRNGradOp::output_image() {
  return *getODSOperands(2).begin();
}

::mlir::MutableOperandRange LRNGradOp::input_gradsMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange LRNGradOp::input_imageMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange LRNGradOp::output_imageMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> LRNGradOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range LRNGradOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value LRNGradOp::output() {
  return *getODSResults(0).begin();
}

::mlir::IntegerAttr LRNGradOp::depth_radiusAttr() {
  return (*this)->getAttr(depth_radiusAttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t LRNGradOp::depth_radius() {
  auto attr = depth_radiusAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), 5).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

::mlir::FloatAttr LRNGradOp::biasAttr() {
  return (*this)->getAttr(biasAttrName()).dyn_cast_or_null<::mlir::FloatAttr>();
}

::llvm::APFloat LRNGradOp::bias() {
  auto attr = biasAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getFloatAttr(::mlir::Builder((*this)->getContext()).getF32Type(), 1.0f).getValue();
  return attr.getValue();
}

::mlir::FloatAttr LRNGradOp::alphaAttr() {
  return (*this)->getAttr(alphaAttrName()).dyn_cast_or_null<::mlir::FloatAttr>();
}

::llvm::APFloat LRNGradOp::alpha() {
  auto attr = alphaAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getFloatAttr(::mlir::Builder((*this)->getContext()).getF32Type(), 1.0f).getValue();
  return attr.getValue();
}

::mlir::FloatAttr LRNGradOp::betaAttr() {
  return (*this)->getAttr(betaAttrName()).dyn_cast_or_null<::mlir::FloatAttr>();
}

::llvm::APFloat LRNGradOp::beta() {
  auto attr = betaAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getFloatAttr(::mlir::Builder((*this)->getContext()).getF32Type(), 0.5f).getValue();
  return attr.getValue();
}

::mlir::Type LRNGradOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool LRNGradOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr LRNGradOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void LRNGradOp::depth_radiusAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(depth_radiusAttrName(), attr);
}

void LRNGradOp::biasAttr(::mlir::FloatAttr attr) {
  (*this)->setAttr(biasAttrName(), attr);
}

void LRNGradOp::alphaAttr(::mlir::FloatAttr attr) {
  (*this)->setAttr(alphaAttrName(), attr);
}

void LRNGradOp::betaAttr(::mlir::FloatAttr attr) {
  (*this)->setAttr(betaAttrName(), attr);
}

void LRNGradOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input_grads, ::mlir::Value input_image, ::mlir::Value output_image, ::mlir::IntegerAttr depth_radius, ::mlir::FloatAttr bias, ::mlir::FloatAttr alpha, ::mlir::FloatAttr beta) {
  odsState.addOperands(input_grads);
  odsState.addOperands(input_image);
  odsState.addOperands(output_image);
  odsState.addAttribute(depth_radiusAttrName(odsState.name), depth_radius);
  odsState.addAttribute(biasAttrName(odsState.name), bias);
  odsState.addAttribute(alphaAttrName(odsState.name), alpha);
  odsState.addAttribute(betaAttrName(odsState.name), beta);
  odsState.addTypes(output);
}

void LRNGradOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input_grads, ::mlir::Value input_image, ::mlir::Value output_image, ::mlir::IntegerAttr depth_radius, ::mlir::FloatAttr bias, ::mlir::FloatAttr alpha, ::mlir::FloatAttr beta) {
  odsState.addOperands(input_grads);
  odsState.addOperands(input_image);
  odsState.addOperands(output_image);
  odsState.addAttribute(depth_radiusAttrName(odsState.name), depth_radius);
  odsState.addAttribute(biasAttrName(odsState.name), bias);
  odsState.addAttribute(alphaAttrName(odsState.name), alpha);
  odsState.addAttribute(betaAttrName(odsState.name), beta);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void LRNGradOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input_grads, ::mlir::Value input_image, ::mlir::Value output_image, uint64_t depth_radius, ::llvm::APFloat bias, ::llvm::APFloat alpha, ::llvm::APFloat beta) {
  odsState.addOperands(input_grads);
  odsState.addOperands(input_image);
  odsState.addOperands(output_image);
  odsState.addAttribute(depth_radiusAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), depth_radius));
  odsState.addAttribute(biasAttrName(odsState.name), odsBuilder.getFloatAttr(odsBuilder.getF32Type(), bias));
  odsState.addAttribute(alphaAttrName(odsState.name), odsBuilder.getFloatAttr(odsBuilder.getF32Type(), alpha));
  odsState.addAttribute(betaAttrName(odsState.name), odsBuilder.getFloatAttr(odsBuilder.getF32Type(), beta));
  odsState.addTypes(output);
}

void LRNGradOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input_grads, ::mlir::Value input_image, ::mlir::Value output_image, uint64_t depth_radius, ::llvm::APFloat bias, ::llvm::APFloat alpha, ::llvm::APFloat beta) {
  odsState.addOperands(input_grads);
  odsState.addOperands(input_image);
  odsState.addOperands(output_image);
  odsState.addAttribute(depth_radiusAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), depth_radius));
  odsState.addAttribute(biasAttrName(odsState.name), odsBuilder.getFloatAttr(odsBuilder.getF32Type(), bias));
  odsState.addAttribute(alphaAttrName(odsState.name), odsBuilder.getFloatAttr(odsBuilder.getF32Type(), alpha));
  odsState.addAttribute(betaAttrName(odsState.name), odsBuilder.getFloatAttr(odsBuilder.getF32Type(), beta));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void LRNGradOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 3u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult LRNGradOp::verify() {
  {
    auto tblgen_depth_radius = (*this)->getAttr(depth_radiusAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_depth_radius, "depth_radius")))
      return ::mlir::failure();
  }
  {
    auto tblgen_bias = (*this)->getAttr(biasAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops5(*this, tblgen_bias, "bias")))
      return ::mlir::failure();
  }
  {
    auto tblgen_alpha = (*this)->getAttr(alphaAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops5(*this, tblgen_alpha, "alpha")))
      return ::mlir::failure();
  }
  {
    auto tblgen_beta = (*this)->getAttr(betaAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops5(*this, tblgen_beta, "beta")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops44(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops44(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops44(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops44(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void LRNGradOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::LRNGradOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::LRNOp definitions
//===----------------------------------------------------------------------===//

LRNOpAdaptor::LRNOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

LRNOpAdaptor::LRNOpAdaptor(LRNOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange LRNOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> LRNOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange LRNOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value LRNOpAdaptor::input() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr LRNOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::IntegerAttr LRNOpAdaptor::depth_radius() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("depth_radius").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), 5);
  return attr;
}

::mlir::FloatAttr LRNOpAdaptor::bias() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::FloatAttr attr = odsAttrs.get("bias").dyn_cast_or_null<::mlir::FloatAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getFloatAttr(::mlir::Builder(odsAttrs.getContext()).getF32Type(), 1.0f);
  return attr;
}

::mlir::FloatAttr LRNOpAdaptor::alpha() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::FloatAttr attr = odsAttrs.get("alpha").dyn_cast_or_null<::mlir::FloatAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getFloatAttr(::mlir::Builder(odsAttrs.getContext()).getF32Type(), 1.0f);
  return attr;
}

::mlir::FloatAttr LRNOpAdaptor::beta() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::FloatAttr attr = odsAttrs.get("beta").dyn_cast_or_null<::mlir::FloatAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getFloatAttr(::mlir::Builder(odsAttrs.getContext()).getF32Type(), 0.5f);
  return attr;
}

::mlir::LogicalResult LRNOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_depth_radius = odsAttrs.get("depth_radius");
    if (tblgen_depth_radius && !(((tblgen_depth_radius.isa<::mlir::IntegerAttr>())) && ((tblgen_depth_radius.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.LRN' op ""attribute 'depth_radius' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_bias = odsAttrs.get("bias");
    if (tblgen_bias && !(((tblgen_bias.isa<::mlir::FloatAttr>())) && ((tblgen_bias.cast<::mlir::FloatAttr>().getType().isF32()))))
      return emitError(loc, "'tf.LRN' op ""attribute 'bias' failed to satisfy constraint: 32-bit float attribute");
  }
  {
    auto tblgen_alpha = odsAttrs.get("alpha");
    if (tblgen_alpha && !(((tblgen_alpha.isa<::mlir::FloatAttr>())) && ((tblgen_alpha.cast<::mlir::FloatAttr>().getType().isF32()))))
      return emitError(loc, "'tf.LRN' op ""attribute 'alpha' failed to satisfy constraint: 32-bit float attribute");
  }
  {
    auto tblgen_beta = odsAttrs.get("beta");
    if (tblgen_beta && !(((tblgen_beta.isa<::mlir::FloatAttr>())) && ((tblgen_beta.cast<::mlir::FloatAttr>().getType().isF32()))))
      return emitError(loc, "'tf.LRN' op ""attribute 'beta' failed to satisfy constraint: 32-bit float attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> LRNOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range LRNOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value LRNOp::input() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange LRNOp::inputMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> LRNOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range LRNOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value LRNOp::output() {
  return *getODSResults(0).begin();
}

::mlir::IntegerAttr LRNOp::depth_radiusAttr() {
  return (*this)->getAttr(depth_radiusAttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t LRNOp::depth_radius() {
  auto attr = depth_radiusAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), 5).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

::mlir::FloatAttr LRNOp::biasAttr() {
  return (*this)->getAttr(biasAttrName()).dyn_cast_or_null<::mlir::FloatAttr>();
}

::llvm::APFloat LRNOp::bias() {
  auto attr = biasAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getFloatAttr(::mlir::Builder((*this)->getContext()).getF32Type(), 1.0f).getValue();
  return attr.getValue();
}

::mlir::FloatAttr LRNOp::alphaAttr() {
  return (*this)->getAttr(alphaAttrName()).dyn_cast_or_null<::mlir::FloatAttr>();
}

::llvm::APFloat LRNOp::alpha() {
  auto attr = alphaAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getFloatAttr(::mlir::Builder((*this)->getContext()).getF32Type(), 1.0f).getValue();
  return attr.getValue();
}

::mlir::FloatAttr LRNOp::betaAttr() {
  return (*this)->getAttr(betaAttrName()).dyn_cast_or_null<::mlir::FloatAttr>();
}

::llvm::APFloat LRNOp::beta() {
  auto attr = betaAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getFloatAttr(::mlir::Builder((*this)->getContext()).getF32Type(), 0.5f).getValue();
  return attr.getValue();
}

::mlir::Type LRNOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool LRNOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr LRNOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void LRNOp::depth_radiusAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(depth_radiusAttrName(), attr);
}

void LRNOp::biasAttr(::mlir::FloatAttr attr) {
  (*this)->setAttr(biasAttrName(), attr);
}

void LRNOp::alphaAttr(::mlir::FloatAttr attr) {
  (*this)->setAttr(alphaAttrName(), attr);
}

void LRNOp::betaAttr(::mlir::FloatAttr attr) {
  (*this)->setAttr(betaAttrName(), attr);
}

void LRNOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input, ::mlir::IntegerAttr depth_radius, ::mlir::FloatAttr bias, ::mlir::FloatAttr alpha, ::mlir::FloatAttr beta) {
  odsState.addOperands(input);
  odsState.addAttribute(depth_radiusAttrName(odsState.name), depth_radius);
  odsState.addAttribute(biasAttrName(odsState.name), bias);
  odsState.addAttribute(alphaAttrName(odsState.name), alpha);
  odsState.addAttribute(betaAttrName(odsState.name), beta);
  odsState.addTypes(output);
}

void LRNOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::IntegerAttr depth_radius, ::mlir::FloatAttr bias, ::mlir::FloatAttr alpha, ::mlir::FloatAttr beta) {
  odsState.addOperands(input);
  odsState.addAttribute(depth_radiusAttrName(odsState.name), depth_radius);
  odsState.addAttribute(biasAttrName(odsState.name), bias);
  odsState.addAttribute(alphaAttrName(odsState.name), alpha);
  odsState.addAttribute(betaAttrName(odsState.name), beta);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void LRNOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input, uint64_t depth_radius, ::llvm::APFloat bias, ::llvm::APFloat alpha, ::llvm::APFloat beta) {
  odsState.addOperands(input);
  odsState.addAttribute(depth_radiusAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), depth_radius));
  odsState.addAttribute(biasAttrName(odsState.name), odsBuilder.getFloatAttr(odsBuilder.getF32Type(), bias));
  odsState.addAttribute(alphaAttrName(odsState.name), odsBuilder.getFloatAttr(odsBuilder.getF32Type(), alpha));
  odsState.addAttribute(betaAttrName(odsState.name), odsBuilder.getFloatAttr(odsBuilder.getF32Type(), beta));
  odsState.addTypes(output);
}

void LRNOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, uint64_t depth_radius, ::llvm::APFloat bias, ::llvm::APFloat alpha, ::llvm::APFloat beta) {
  odsState.addOperands(input);
  odsState.addAttribute(depth_radiusAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), depth_radius));
  odsState.addAttribute(biasAttrName(odsState.name), odsBuilder.getFloatAttr(odsBuilder.getF32Type(), bias));
  odsState.addAttribute(alphaAttrName(odsState.name), odsBuilder.getFloatAttr(odsBuilder.getF32Type(), alpha));
  odsState.addAttribute(betaAttrName(odsState.name), odsBuilder.getFloatAttr(odsBuilder.getF32Type(), beta));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void LRNOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult LRNOp::verify() {
  {
    auto tblgen_depth_radius = (*this)->getAttr(depth_radiusAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_depth_radius, "depth_radius")))
      return ::mlir::failure();
  }
  {
    auto tblgen_bias = (*this)->getAttr(biasAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops5(*this, tblgen_bias, "bias")))
      return ::mlir::failure();
  }
  {
    auto tblgen_alpha = (*this)->getAttr(alphaAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops5(*this, tblgen_alpha, "alpha")))
      return ::mlir::failure();
  }
  {
    auto tblgen_beta = (*this)->getAttr(betaAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops5(*this, tblgen_beta, "beta")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops44(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops44(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void LRNOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::LRNOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::LeakyReluGradOp definitions
//===----------------------------------------------------------------------===//

LeakyReluGradOpAdaptor::LeakyReluGradOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

LeakyReluGradOpAdaptor::LeakyReluGradOpAdaptor(LeakyReluGradOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange LeakyReluGradOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> LeakyReluGradOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange LeakyReluGradOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value LeakyReluGradOpAdaptor::gradients() {
  return *getODSOperands(0).begin();
}

::mlir::Value LeakyReluGradOpAdaptor::features() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr LeakyReluGradOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::FloatAttr LeakyReluGradOpAdaptor::alpha() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::FloatAttr attr = odsAttrs.get("alpha").dyn_cast_or_null<::mlir::FloatAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getFloatAttr(::mlir::Builder(odsAttrs.getContext()).getF32Type(), 0.2f);
  return attr;
}

::mlir::LogicalResult LeakyReluGradOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_alpha = odsAttrs.get("alpha");
    if (tblgen_alpha && !(((tblgen_alpha.isa<::mlir::FloatAttr>())) && ((tblgen_alpha.cast<::mlir::FloatAttr>().getType().isF32()))))
      return emitError(loc, "'tf.LeakyReluGrad' op ""attribute 'alpha' failed to satisfy constraint: 32-bit float attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> LeakyReluGradOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range LeakyReluGradOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value LeakyReluGradOp::gradients() {
  return *getODSOperands(0).begin();
}

::mlir::Value LeakyReluGradOp::features() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange LeakyReluGradOp::gradientsMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange LeakyReluGradOp::featuresMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> LeakyReluGradOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range LeakyReluGradOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value LeakyReluGradOp::backprops() {
  return *getODSResults(0).begin();
}

::mlir::FloatAttr LeakyReluGradOp::alphaAttr() {
  return (*this)->getAttr(alphaAttrName()).dyn_cast_or_null<::mlir::FloatAttr>();
}

::llvm::APFloat LeakyReluGradOp::alpha() {
  auto attr = alphaAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getFloatAttr(::mlir::Builder((*this)->getContext()).getF32Type(), 0.2f).getValue();
  return attr.getValue();
}

::mlir::Type LeakyReluGradOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool LeakyReluGradOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr LeakyReluGradOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void LeakyReluGradOp::alphaAttr(::mlir::FloatAttr attr) {
  (*this)->setAttr(alphaAttrName(), attr);
}

void LeakyReluGradOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type backprops, ::mlir::Value gradients, ::mlir::Value features, ::mlir::FloatAttr alpha) {
  odsState.addOperands(gradients);
  odsState.addOperands(features);
  odsState.addAttribute(alphaAttrName(odsState.name), alpha);
  odsState.addTypes(backprops);
}

void LeakyReluGradOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value gradients, ::mlir::Value features, ::mlir::FloatAttr alpha) {
  odsState.addOperands(gradients);
  odsState.addOperands(features);
  odsState.addAttribute(alphaAttrName(odsState.name), alpha);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void LeakyReluGradOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type backprops, ::mlir::Value gradients, ::mlir::Value features, ::llvm::APFloat alpha) {
  odsState.addOperands(gradients);
  odsState.addOperands(features);
  odsState.addAttribute(alphaAttrName(odsState.name), odsBuilder.getFloatAttr(odsBuilder.getF32Type(), alpha));
  odsState.addTypes(backprops);
}

void LeakyReluGradOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value gradients, ::mlir::Value features, ::llvm::APFloat alpha) {
  odsState.addOperands(gradients);
  odsState.addOperands(features);
  odsState.addAttribute(alphaAttrName(odsState.name), odsBuilder.getFloatAttr(odsBuilder.getF32Type(), alpha));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void LeakyReluGradOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult LeakyReluGradOp::verify() {
  {
    auto tblgen_alpha = (*this)->getAttr(alphaAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops5(*this, tblgen_alpha, "alpha")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void LeakyReluGradOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::LeakyReluGradOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::LeakyReluOp definitions
//===----------------------------------------------------------------------===//

LeakyReluOpAdaptor::LeakyReluOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

LeakyReluOpAdaptor::LeakyReluOpAdaptor(LeakyReluOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange LeakyReluOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> LeakyReluOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange LeakyReluOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value LeakyReluOpAdaptor::features() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr LeakyReluOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::FloatAttr LeakyReluOpAdaptor::alpha() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::FloatAttr attr = odsAttrs.get("alpha").dyn_cast_or_null<::mlir::FloatAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getFloatAttr(::mlir::Builder(odsAttrs.getContext()).getF32Type(), 0.2f);
  return attr;
}

::mlir::LogicalResult LeakyReluOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_alpha = odsAttrs.get("alpha");
    if (tblgen_alpha && !(((tblgen_alpha.isa<::mlir::FloatAttr>())) && ((tblgen_alpha.cast<::mlir::FloatAttr>().getType().isF32()))))
      return emitError(loc, "'tf.LeakyRelu' op ""attribute 'alpha' failed to satisfy constraint: 32-bit float attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> LeakyReluOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range LeakyReluOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value LeakyReluOp::features() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange LeakyReluOp::featuresMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> LeakyReluOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range LeakyReluOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value LeakyReluOp::activations() {
  return *getODSResults(0).begin();
}

::mlir::FloatAttr LeakyReluOp::alphaAttr() {
  return (*this)->getAttr(alphaAttrName()).dyn_cast_or_null<::mlir::FloatAttr>();
}

::llvm::APFloat LeakyReluOp::alpha() {
  auto attr = alphaAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getFloatAttr(::mlir::Builder((*this)->getContext()).getF32Type(), 0.2f).getValue();
  return attr.getValue();
}

::mlir::Type LeakyReluOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool LeakyReluOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr LeakyReluOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void LeakyReluOp::alphaAttr(::mlir::FloatAttr attr) {
  (*this)->setAttr(alphaAttrName(), attr);
}

void LeakyReluOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type activations, ::mlir::Value features, ::mlir::FloatAttr alpha) {
  odsState.addOperands(features);
  odsState.addAttribute(alphaAttrName(odsState.name), alpha);
  odsState.addTypes(activations);
}

void LeakyReluOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value features, ::mlir::FloatAttr alpha) {
  odsState.addOperands(features);
  odsState.addAttribute(alphaAttrName(odsState.name), alpha);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void LeakyReluOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type activations, ::mlir::Value features, ::llvm::APFloat alpha) {
  odsState.addOperands(features);
  odsState.addAttribute(alphaAttrName(odsState.name), odsBuilder.getFloatAttr(odsBuilder.getF32Type(), alpha));
  odsState.addTypes(activations);
}

void LeakyReluOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value features, ::llvm::APFloat alpha) {
  odsState.addOperands(features);
  odsState.addAttribute(alphaAttrName(odsState.name), odsBuilder.getFloatAttr(odsBuilder.getF32Type(), alpha));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void LeakyReluOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult LeakyReluOp::verify() {
  {
    auto tblgen_alpha = (*this)->getAttr(alphaAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops5(*this, tblgen_alpha, "alpha")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void LeakyReluOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::LeakyReluOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::LeftShiftOp definitions
//===----------------------------------------------------------------------===//

LeftShiftOpAdaptor::LeftShiftOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

LeftShiftOpAdaptor::LeftShiftOpAdaptor(LeftShiftOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange LeftShiftOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> LeftShiftOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange LeftShiftOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value LeftShiftOpAdaptor::x() {
  return *getODSOperands(0).begin();
}

::mlir::Value LeftShiftOpAdaptor::y() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr LeftShiftOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult LeftShiftOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> LeftShiftOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range LeftShiftOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value LeftShiftOp::x() {
  return *getODSOperands(0).begin();
}

::mlir::Value LeftShiftOp::y() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange LeftShiftOp::xMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange LeftShiftOp::yMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> LeftShiftOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range LeftShiftOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value LeftShiftOp::z() {
  return *getODSResults(0).begin();
}

::mlir::Type LeftShiftOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool LeftShiftOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr LeftShiftOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void LeftShiftOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, Value x, Value y) {
  auto resultType =
      OpTrait::util::getBroadcastedType(x.getType(), y.getType());
  if (!resultType)
    mlir::emitError(odsState.location, "non-broadcastable operands");
  return build(odsBuilder, odsState, resultType, x, y);
}

void LeftShiftOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type z, ::mlir::Value x, ::mlir::Value y) {
  odsState.addOperands(x);
  odsState.addOperands(y);
  odsState.addTypes(z);
}

void LeftShiftOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value x, ::mlir::Value y) {
  odsState.addOperands(x);
  odsState.addOperands(y);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void LeftShiftOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult LeftShiftOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops27(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops27(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops27(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void LeftShiftOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::LeftShiftOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::LegacyCallOp definitions
//===----------------------------------------------------------------------===//

LegacyCallOpAdaptor::LegacyCallOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

LegacyCallOpAdaptor::LegacyCallOpAdaptor(LegacyCallOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange LegacyCallOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> LegacyCallOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  bool isVariadic[] = {true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (odsOperands.size() - 0) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::ValueRange LegacyCallOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::ValueRange LegacyCallOpAdaptor::args() {
  return getODSOperands(0);
}

::mlir::DictionaryAttr LegacyCallOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::FlatSymbolRefAttr LegacyCallOpAdaptor::f() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::FlatSymbolRefAttr attr = odsAttrs.get("f").cast<::mlir::FlatSymbolRefAttr>();
  return attr;
}

::mlir::BoolAttr LegacyCallOpAdaptor::_disable_call_shape_inference() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("_disable_call_shape_inference").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(false);
  return attr;
}

::mlir::LogicalResult LegacyCallOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_f = odsAttrs.get("f");
    if (!tblgen_f)
      return emitError(loc, "'tf.LegacyCall' op ""requires attribute 'f'");

    if (tblgen_f && !((tblgen_f.isa<::mlir::FlatSymbolRefAttr>())))
      return emitError(loc, "'tf.LegacyCall' op ""attribute 'f' failed to satisfy constraint: flat symbol reference attribute");
  }
  {
    auto tblgen__disable_call_shape_inference = odsAttrs.get("_disable_call_shape_inference");
    if (tblgen__disable_call_shape_inference && !((tblgen__disable_call_shape_inference.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.LegacyCall' op ""attribute '_disable_call_shape_inference' failed to satisfy constraint: bool attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> LegacyCallOp::getODSOperandIndexAndLength(unsigned index) {
  bool isVariadic[] = {true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (getOperation()->getNumOperands() - 0) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::Operation::operand_range LegacyCallOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Operation::operand_range LegacyCallOp::args() {
  return getODSOperands(0);
}

::mlir::MutableOperandRange LegacyCallOp::argsMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> LegacyCallOp::getODSResultIndexAndLength(unsigned index) {
  bool isVariadic[] = {true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (getOperation()->getNumResults() - 0) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::Operation::result_range LegacyCallOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Operation::result_range LegacyCallOp::output() {
  return getODSResults(0);
}

::mlir::FlatSymbolRefAttr LegacyCallOp::fAttr() {
  return (*this)->getAttr(fAttrName()).cast<::mlir::FlatSymbolRefAttr>();
}

::llvm::StringRef LegacyCallOp::f() {
  auto attr = fAttr();
  return attr.getValue();
}

::mlir::BoolAttr LegacyCallOp::_disable_call_shape_inferenceAttr() {
  return (*this)->getAttr(_disable_call_shape_inferenceAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool LegacyCallOp::_disable_call_shape_inference() {
  auto attr = _disable_call_shape_inferenceAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(false).getValue();
  return attr.getValue();
}

void LegacyCallOp::fAttr(::mlir::FlatSymbolRefAttr attr) {
  (*this)->setAttr(fAttrName(), attr);
}

void LegacyCallOp::_disable_call_shape_inferenceAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(_disable_call_shape_inferenceAttrName(), attr);
}

void LegacyCallOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange output, ::mlir::ValueRange args, ::mlir::FlatSymbolRefAttr f, ::mlir::BoolAttr _disable_call_shape_inference) {
  odsState.addOperands(args);
  odsState.addAttribute(fAttrName(odsState.name), f);
  odsState.addAttribute(_disable_call_shape_inferenceAttrName(odsState.name), _disable_call_shape_inference);
  odsState.addTypes(output);
}

void LegacyCallOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange output, ::mlir::ValueRange args, ::llvm::StringRef f, bool _disable_call_shape_inference) {
  odsState.addOperands(args);
  odsState.addAttribute(fAttrName(odsState.name), ::mlir::SymbolRefAttr::get(odsBuilder.getContext(), f));
  odsState.addAttribute(_disable_call_shape_inferenceAttrName(odsState.name), odsBuilder.getBoolAttr(_disable_call_shape_inference));
  odsState.addTypes(output);
}

void LegacyCallOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult LegacyCallOp::verify() {
  {
    auto tblgen_f = (*this)->getAttr(fAttrName());
    if (!tblgen_f)
      return emitOpError("requires attribute 'f'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops27(*this, tblgen_f, "f")))
      return ::mlir::failure();
  }
  {
    auto tblgen__disable_call_shape_inference = (*this)->getAttr(_disable_call_shape_inferenceAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen__disable_call_shape_inference, "_disable_call_shape_inference")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void LegacyCallOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::LegacyCallOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::LessEqualOp definitions
//===----------------------------------------------------------------------===//

LessEqualOpAdaptor::LessEqualOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

LessEqualOpAdaptor::LessEqualOpAdaptor(LessEqualOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange LessEqualOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> LessEqualOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange LessEqualOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value LessEqualOpAdaptor::x() {
  return *getODSOperands(0).begin();
}

::mlir::Value LessEqualOpAdaptor::y() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr LessEqualOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult LessEqualOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> LessEqualOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range LessEqualOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value LessEqualOp::x() {
  return *getODSOperands(0).begin();
}

::mlir::Value LessEqualOp::y() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange LessEqualOp::xMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange LessEqualOp::yMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> LessEqualOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range LessEqualOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value LessEqualOp::z() {
  return *getODSResults(0).begin();
}

::mlir::Type LessEqualOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool LessEqualOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr LessEqualOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void LessEqualOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, Value x, Value y) {
  Type resultType;
  if (x.getType().isa<UnrankedTensorType>() ||
      y.getType().isa<UnrankedTensorType>()) {
    resultType = UnrankedTensorType::get(odsBuilder.getI1Type());
  } else {
    SmallVector<int64_t, 4> resultShape;
    if (!OpTrait::util::getBroadcastedShape(
            x.getType().cast<ShapedType>().getShape(),
            y.getType().cast<ShapedType>().getShape(), resultShape)) {
      mlir::emitError(odsState.location,
                      "operands have no broadcastable shapes");
    }

    resultType = RankedTensorType::get(resultShape, odsBuilder.getI1Type());
  }
  return build(odsBuilder, odsState, resultType, x, y);
}

void LessEqualOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type z, ::mlir::Value x, ::mlir::Value y) {
  odsState.addOperands(x);
  odsState.addOperands(y);
  odsState.addTypes(z);
}

void LessEqualOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value x, ::mlir::Value y) {
  odsState.addOperands(x);
  odsState.addOperands(y);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void LessEqualOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult LessEqualOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops35(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops35(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops8(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void LessEqualOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::LessEqualOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::LessOp definitions
//===----------------------------------------------------------------------===//

LessOpAdaptor::LessOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

LessOpAdaptor::LessOpAdaptor(LessOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange LessOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> LessOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange LessOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value LessOpAdaptor::x() {
  return *getODSOperands(0).begin();
}

::mlir::Value LessOpAdaptor::y() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr LessOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult LessOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> LessOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range LessOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value LessOp::x() {
  return *getODSOperands(0).begin();
}

::mlir::Value LessOp::y() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange LessOp::xMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange LessOp::yMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> LessOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range LessOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value LessOp::z() {
  return *getODSResults(0).begin();
}

::mlir::Type LessOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool LessOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr LessOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void LessOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, Value x, Value y) {
  Type resultType;
  if (x.getType().isa<UnrankedTensorType>() ||
      y.getType().isa<UnrankedTensorType>()) {
    resultType = UnrankedTensorType::get(odsBuilder.getI1Type());
  } else {
    SmallVector<int64_t, 4> resultShape;
    if (!OpTrait::util::getBroadcastedShape(
            x.getType().cast<ShapedType>().getShape(),
            y.getType().cast<ShapedType>().getShape(), resultShape)) {
      mlir::emitError(odsState.location,
                      "operands have no broadcastable shapes");
    }

    resultType = RankedTensorType::get(resultShape, odsBuilder.getI1Type());
  }
  return build(odsBuilder, odsState, resultType, x, y);
}

void LessOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type z, ::mlir::Value x, ::mlir::Value y) {
  odsState.addOperands(x);
  odsState.addOperands(y);
  odsState.addTypes(z);
}

void LessOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value x, ::mlir::Value y) {
  odsState.addOperands(x);
  odsState.addOperands(y);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void LessOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult LessOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops35(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops35(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops8(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void LessOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::LessOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::LgammaOp definitions
//===----------------------------------------------------------------------===//

LgammaOpAdaptor::LgammaOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

LgammaOpAdaptor::LgammaOpAdaptor(LgammaOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange LgammaOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> LgammaOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange LgammaOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value LgammaOpAdaptor::x() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr LgammaOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult LgammaOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> LgammaOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range LgammaOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value LgammaOp::x() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange LgammaOp::xMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> LgammaOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range LgammaOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value LgammaOp::y() {
  return *getODSResults(0).begin();
}

::mlir::Type LgammaOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool LgammaOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr LgammaOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void LgammaOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type y, ::mlir::Value x) {
  odsState.addOperands(x);
  odsState.addTypes(y);
}

void LgammaOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value x) {
  odsState.addOperands(x);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void LgammaOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult LgammaOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void LgammaOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::LgammaOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::LinSpaceOp definitions
//===----------------------------------------------------------------------===//

LinSpaceOpAdaptor::LinSpaceOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

LinSpaceOpAdaptor::LinSpaceOpAdaptor(LinSpaceOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange LinSpaceOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> LinSpaceOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange LinSpaceOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value LinSpaceOpAdaptor::start() {
  return *getODSOperands(0).begin();
}

::mlir::Value LinSpaceOpAdaptor::stop() {
  return *getODSOperands(1).begin();
}

::mlir::Value LinSpaceOpAdaptor::num() {
  return *getODSOperands(2).begin();
}

::mlir::DictionaryAttr LinSpaceOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult LinSpaceOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> LinSpaceOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range LinSpaceOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value LinSpaceOp::start() {
  return *getODSOperands(0).begin();
}

::mlir::Value LinSpaceOp::stop() {
  return *getODSOperands(1).begin();
}

::mlir::Value LinSpaceOp::num() {
  return *getODSOperands(2).begin();
}

::mlir::MutableOperandRange LinSpaceOp::startMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange LinSpaceOp::stopMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange LinSpaceOp::numMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> LinSpaceOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range LinSpaceOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value LinSpaceOp::output() {
  return *getODSResults(0).begin();
}

::mlir::Type LinSpaceOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

::mlir::Type LinSpaceOp::Tidx() {
  return mlir::getElementTypeOrSelf(*getODSOperands(2).begin());
}

bool LinSpaceOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
  if (name == "Tidx") return true;
 return false;
}

::mlir::DictionaryAttr LinSpaceOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())},
    {TidxAttrName(),
::mlir::TypeAttr::get(Tidx())}});
}

void LinSpaceOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value start, ::mlir::Value stop, ::mlir::Value num) {
  odsState.addOperands(start);
  odsState.addOperands(stop);
  odsState.addOperands(num);
  odsState.addTypes(output);
}

void LinSpaceOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value start, ::mlir::Value stop, ::mlir::Value num) {
  odsState.addOperands(start);
  odsState.addOperands(stop);
  odsState.addOperands(num);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void LinSpaceOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 3u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult LinSpaceOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void LinSpaceOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::LinSpaceOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::ListDiffOp definitions
//===----------------------------------------------------------------------===//

ListDiffOpAdaptor::ListDiffOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

ListDiffOpAdaptor::ListDiffOpAdaptor(ListDiffOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange ListDiffOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> ListDiffOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange ListDiffOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ListDiffOpAdaptor::x() {
  return *getODSOperands(0).begin();
}

::mlir::Value ListDiffOpAdaptor::y() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr ListDiffOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult ListDiffOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

void ListDiffOp::getAsmResultNames(::mlir::OpAsmSetValueNameFn setNameFn) {
  auto resultGroup0 = getODSResults(0);
  if (!llvm::empty(resultGroup0))
    setNameFn(*resultGroup0.begin(), "out");
  auto resultGroup1 = getODSResults(1);
  if (!llvm::empty(resultGroup1))
    setNameFn(*resultGroup1.begin(), "idx");
}

std::pair<unsigned, unsigned> ListDiffOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range ListDiffOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ListDiffOp::x() {
  return *getODSOperands(0).begin();
}

::mlir::Value ListDiffOp::y() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange ListDiffOp::xMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ListDiffOp::yMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> ListDiffOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range ListDiffOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ListDiffOp::out() {
  return *getODSResults(0).begin();
}

::mlir::Value ListDiffOp::idx() {
  return *getODSResults(1).begin();
}

::mlir::Type ListDiffOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

::mlir::Type ListDiffOp::out_idx() {
  return mlir::getElementTypeOrSelf(*getODSResults(1).begin());
}

bool ListDiffOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
  if (name == "out_idx") return true;
 return false;
}

::mlir::DictionaryAttr ListDiffOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())},
    {out_idxAttrName(),
::mlir::TypeAttr::get(out_idx())}});
}

void ListDiffOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type out, ::mlir::Type idx, ::mlir::Value x, ::mlir::Value y) {
  odsState.addOperands(x);
  odsState.addOperands(y);
  odsState.addTypes(out);
  odsState.addTypes(idx);
}

void ListDiffOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value x, ::mlir::Value y) {
  odsState.addOperands(x);
  odsState.addOperands(y);
  assert(resultTypes.size() == 2u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void ListDiffOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 2u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult ListDiffOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSResults(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void ListDiffOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::ListDiffOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::LoadTPUEmbeddingADAMParametersGradAccumDebugOp definitions
//===----------------------------------------------------------------------===//

LoadTPUEmbeddingADAMParametersGradAccumDebugOpAdaptor::LoadTPUEmbeddingADAMParametersGradAccumDebugOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

LoadTPUEmbeddingADAMParametersGradAccumDebugOpAdaptor::LoadTPUEmbeddingADAMParametersGradAccumDebugOpAdaptor(LoadTPUEmbeddingADAMParametersGradAccumDebugOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange LoadTPUEmbeddingADAMParametersGradAccumDebugOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> LoadTPUEmbeddingADAMParametersGradAccumDebugOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange LoadTPUEmbeddingADAMParametersGradAccumDebugOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value LoadTPUEmbeddingADAMParametersGradAccumDebugOpAdaptor::parameters() {
  return *getODSOperands(0).begin();
}

::mlir::Value LoadTPUEmbeddingADAMParametersGradAccumDebugOpAdaptor::momenta() {
  return *getODSOperands(1).begin();
}

::mlir::Value LoadTPUEmbeddingADAMParametersGradAccumDebugOpAdaptor::velocities() {
  return *getODSOperands(2).begin();
}

::mlir::Value LoadTPUEmbeddingADAMParametersGradAccumDebugOpAdaptor::gradient_accumulators() {
  return *getODSOperands(3).begin();
}

::mlir::DictionaryAttr LoadTPUEmbeddingADAMParametersGradAccumDebugOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::IntegerAttr LoadTPUEmbeddingADAMParametersGradAccumDebugOpAdaptor::table_id() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("table_id").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), -1);
  return attr;
}

::mlir::StringAttr LoadTPUEmbeddingADAMParametersGradAccumDebugOpAdaptor::table_name() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("table_name").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("");
  return attr;
}

::mlir::IntegerAttr LoadTPUEmbeddingADAMParametersGradAccumDebugOpAdaptor::num_shards() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("num_shards").cast<::mlir::IntegerAttr>();
  return attr;
}

::mlir::IntegerAttr LoadTPUEmbeddingADAMParametersGradAccumDebugOpAdaptor::shard_id() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("shard_id").cast<::mlir::IntegerAttr>();
  return attr;
}

::mlir::StringAttr LoadTPUEmbeddingADAMParametersGradAccumDebugOpAdaptor::config() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("config").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("");
  return attr;
}

::mlir::LogicalResult LoadTPUEmbeddingADAMParametersGradAccumDebugOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_table_id = odsAttrs.get("table_id");
    if (tblgen_table_id && !(((tblgen_table_id.isa<::mlir::IntegerAttr>())) && ((tblgen_table_id.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.LoadTPUEmbeddingADAMParametersGradAccumDebug' op ""attribute 'table_id' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_table_name = odsAttrs.get("table_name");
    if (tblgen_table_name && !((tblgen_table_name.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.LoadTPUEmbeddingADAMParametersGradAccumDebug' op ""attribute 'table_name' failed to satisfy constraint: string attribute");
  }
  {
    auto tblgen_num_shards = odsAttrs.get("num_shards");
    if (!tblgen_num_shards)
      return emitError(loc, "'tf.LoadTPUEmbeddingADAMParametersGradAccumDebug' op ""requires attribute 'num_shards'");

    if (tblgen_num_shards && !(((tblgen_num_shards.isa<::mlir::IntegerAttr>())) && ((tblgen_num_shards.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.LoadTPUEmbeddingADAMParametersGradAccumDebug' op ""attribute 'num_shards' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_shard_id = odsAttrs.get("shard_id");
    if (!tblgen_shard_id)
      return emitError(loc, "'tf.LoadTPUEmbeddingADAMParametersGradAccumDebug' op ""requires attribute 'shard_id'");

    if (tblgen_shard_id && !(((tblgen_shard_id.isa<::mlir::IntegerAttr>())) && ((tblgen_shard_id.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.LoadTPUEmbeddingADAMParametersGradAccumDebug' op ""attribute 'shard_id' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_config = odsAttrs.get("config");
    if (tblgen_config && !((tblgen_config.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.LoadTPUEmbeddingADAMParametersGradAccumDebug' op ""attribute 'config' failed to satisfy constraint: string attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> LoadTPUEmbeddingADAMParametersGradAccumDebugOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range LoadTPUEmbeddingADAMParametersGradAccumDebugOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value LoadTPUEmbeddingADAMParametersGradAccumDebugOp::parameters() {
  return *getODSOperands(0).begin();
}

::mlir::Value LoadTPUEmbeddingADAMParametersGradAccumDebugOp::momenta() {
  return *getODSOperands(1).begin();
}

::mlir::Value LoadTPUEmbeddingADAMParametersGradAccumDebugOp::velocities() {
  return *getODSOperands(2).begin();
}

::mlir::Value LoadTPUEmbeddingADAMParametersGradAccumDebugOp::gradient_accumulators() {
  return *getODSOperands(3).begin();
}

::mlir::MutableOperandRange LoadTPUEmbeddingADAMParametersGradAccumDebugOp::parametersMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange LoadTPUEmbeddingADAMParametersGradAccumDebugOp::momentaMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange LoadTPUEmbeddingADAMParametersGradAccumDebugOp::velocitiesMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange LoadTPUEmbeddingADAMParametersGradAccumDebugOp::gradient_accumulatorsMutable() {
  auto range = getODSOperandIndexAndLength(3);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> LoadTPUEmbeddingADAMParametersGradAccumDebugOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range LoadTPUEmbeddingADAMParametersGradAccumDebugOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::IntegerAttr LoadTPUEmbeddingADAMParametersGradAccumDebugOp::table_idAttr() {
  return (*this)->getAttr(table_idAttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t LoadTPUEmbeddingADAMParametersGradAccumDebugOp::table_id() {
  auto attr = table_idAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), -1).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

::mlir::StringAttr LoadTPUEmbeddingADAMParametersGradAccumDebugOp::table_nameAttr() {
  return (*this)->getAttr(table_nameAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef LoadTPUEmbeddingADAMParametersGradAccumDebugOp::table_name() {
  auto attr = table_nameAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("").getValue();
  return attr.getValue();
}

::mlir::IntegerAttr LoadTPUEmbeddingADAMParametersGradAccumDebugOp::num_shardsAttr() {
  return (*this)->getAttr(num_shardsAttrName()).cast<::mlir::IntegerAttr>();
}

uint64_t LoadTPUEmbeddingADAMParametersGradAccumDebugOp::num_shards() {
  auto attr = num_shardsAttr();
  return attr.getValue().getZExtValue();
}

::mlir::IntegerAttr LoadTPUEmbeddingADAMParametersGradAccumDebugOp::shard_idAttr() {
  return (*this)->getAttr(shard_idAttrName()).cast<::mlir::IntegerAttr>();
}

uint64_t LoadTPUEmbeddingADAMParametersGradAccumDebugOp::shard_id() {
  auto attr = shard_idAttr();
  return attr.getValue().getZExtValue();
}

::mlir::StringAttr LoadTPUEmbeddingADAMParametersGradAccumDebugOp::configAttr() {
  return (*this)->getAttr(configAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef LoadTPUEmbeddingADAMParametersGradAccumDebugOp::config() {
  auto attr = configAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("").getValue();
  return attr.getValue();
}

void LoadTPUEmbeddingADAMParametersGradAccumDebugOp::table_idAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(table_idAttrName(), attr);
}

void LoadTPUEmbeddingADAMParametersGradAccumDebugOp::table_nameAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(table_nameAttrName(), attr);
}

void LoadTPUEmbeddingADAMParametersGradAccumDebugOp::num_shardsAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(num_shardsAttrName(), attr);
}

void LoadTPUEmbeddingADAMParametersGradAccumDebugOp::shard_idAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(shard_idAttrName(), attr);
}

void LoadTPUEmbeddingADAMParametersGradAccumDebugOp::configAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(configAttrName(), attr);
}

void LoadTPUEmbeddingADAMParametersGradAccumDebugOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value parameters, ::mlir::Value momenta, ::mlir::Value velocities, ::mlir::Value gradient_accumulators, ::mlir::IntegerAttr table_id, ::mlir::StringAttr table_name, ::mlir::IntegerAttr num_shards, ::mlir::IntegerAttr shard_id, ::mlir::StringAttr config) {
  odsState.addOperands(parameters);
  odsState.addOperands(momenta);
  odsState.addOperands(velocities);
  odsState.addOperands(gradient_accumulators);
  odsState.addAttribute(table_idAttrName(odsState.name), table_id);
  odsState.addAttribute(table_nameAttrName(odsState.name), table_name);
  odsState.addAttribute(num_shardsAttrName(odsState.name), num_shards);
  odsState.addAttribute(shard_idAttrName(odsState.name), shard_id);
  odsState.addAttribute(configAttrName(odsState.name), config);
}

void LoadTPUEmbeddingADAMParametersGradAccumDebugOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value parameters, ::mlir::Value momenta, ::mlir::Value velocities, ::mlir::Value gradient_accumulators, ::mlir::IntegerAttr table_id, ::mlir::StringAttr table_name, ::mlir::IntegerAttr num_shards, ::mlir::IntegerAttr shard_id, ::mlir::StringAttr config) {
  odsState.addOperands(parameters);
  odsState.addOperands(momenta);
  odsState.addOperands(velocities);
  odsState.addOperands(gradient_accumulators);
  odsState.addAttribute(table_idAttrName(odsState.name), table_id);
  odsState.addAttribute(table_nameAttrName(odsState.name), table_name);
  odsState.addAttribute(num_shardsAttrName(odsState.name), num_shards);
  odsState.addAttribute(shard_idAttrName(odsState.name), shard_id);
  odsState.addAttribute(configAttrName(odsState.name), config);
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void LoadTPUEmbeddingADAMParametersGradAccumDebugOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value parameters, ::mlir::Value momenta, ::mlir::Value velocities, ::mlir::Value gradient_accumulators, uint64_t table_id, ::llvm::StringRef table_name, uint64_t num_shards, uint64_t shard_id, ::llvm::StringRef config) {
  odsState.addOperands(parameters);
  odsState.addOperands(momenta);
  odsState.addOperands(velocities);
  odsState.addOperands(gradient_accumulators);
  odsState.addAttribute(table_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), table_id));
  odsState.addAttribute(table_nameAttrName(odsState.name), odsBuilder.getStringAttr(table_name));
  odsState.addAttribute(num_shardsAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), num_shards));
  odsState.addAttribute(shard_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), shard_id));
  odsState.addAttribute(configAttrName(odsState.name), odsBuilder.getStringAttr(config));
}

void LoadTPUEmbeddingADAMParametersGradAccumDebugOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value parameters, ::mlir::Value momenta, ::mlir::Value velocities, ::mlir::Value gradient_accumulators, uint64_t table_id, ::llvm::StringRef table_name, uint64_t num_shards, uint64_t shard_id, ::llvm::StringRef config) {
  odsState.addOperands(parameters);
  odsState.addOperands(momenta);
  odsState.addOperands(velocities);
  odsState.addOperands(gradient_accumulators);
  odsState.addAttribute(table_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), table_id));
  odsState.addAttribute(table_nameAttrName(odsState.name), odsBuilder.getStringAttr(table_name));
  odsState.addAttribute(num_shardsAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), num_shards));
  odsState.addAttribute(shard_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), shard_id));
  odsState.addAttribute(configAttrName(odsState.name), odsBuilder.getStringAttr(config));
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void LoadTPUEmbeddingADAMParametersGradAccumDebugOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 4u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 0u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult LoadTPUEmbeddingADAMParametersGradAccumDebugOp::verify() {
  {
    auto tblgen_table_id = (*this)->getAttr(table_idAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_table_id, "table_id")))
      return ::mlir::failure();
  }
  {
    auto tblgen_table_name = (*this)->getAttr(table_nameAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_table_name, "table_name")))
      return ::mlir::failure();
  }
  {
    auto tblgen_num_shards = (*this)->getAttr(num_shardsAttrName());
    if (!tblgen_num_shards)
      return emitOpError("requires attribute 'num_shards'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_num_shards, "num_shards")))
      return ::mlir::failure();
  }
  {
    auto tblgen_shard_id = (*this)->getAttr(shard_idAttrName());
    if (!tblgen_shard_id)
      return emitOpError("requires attribute 'shard_id'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_shard_id, "shard_id")))
      return ::mlir::failure();
  }
  {
    auto tblgen_config = (*this)->getAttr(configAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_config, "config")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup3 = getODSOperands(3);

    for (auto v : valueGroup3) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void LoadTPUEmbeddingADAMParametersGradAccumDebugOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  effects.emplace_back(::mlir::MemoryEffects::Write::get(), ::mlir::TF::ResourceEffects::MustExecute::get());
  effects.emplace_back(::mlir::MemoryEffects::Read::get(), ::mlir::TF::ResourceEffects::TPUEmbedding::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::LoadTPUEmbeddingADAMParametersGradAccumDebugOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::LoadTPUEmbeddingADAMParametersOp definitions
//===----------------------------------------------------------------------===//

LoadTPUEmbeddingADAMParametersOpAdaptor::LoadTPUEmbeddingADAMParametersOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

LoadTPUEmbeddingADAMParametersOpAdaptor::LoadTPUEmbeddingADAMParametersOpAdaptor(LoadTPUEmbeddingADAMParametersOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange LoadTPUEmbeddingADAMParametersOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> LoadTPUEmbeddingADAMParametersOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange LoadTPUEmbeddingADAMParametersOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value LoadTPUEmbeddingADAMParametersOpAdaptor::parameters() {
  return *getODSOperands(0).begin();
}

::mlir::Value LoadTPUEmbeddingADAMParametersOpAdaptor::momenta() {
  return *getODSOperands(1).begin();
}

::mlir::Value LoadTPUEmbeddingADAMParametersOpAdaptor::velocities() {
  return *getODSOperands(2).begin();
}

::mlir::DictionaryAttr LoadTPUEmbeddingADAMParametersOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::IntegerAttr LoadTPUEmbeddingADAMParametersOpAdaptor::table_id() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("table_id").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), -1);
  return attr;
}

::mlir::StringAttr LoadTPUEmbeddingADAMParametersOpAdaptor::table_name() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("table_name").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("");
  return attr;
}

::mlir::IntegerAttr LoadTPUEmbeddingADAMParametersOpAdaptor::num_shards() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("num_shards").cast<::mlir::IntegerAttr>();
  return attr;
}

::mlir::IntegerAttr LoadTPUEmbeddingADAMParametersOpAdaptor::shard_id() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("shard_id").cast<::mlir::IntegerAttr>();
  return attr;
}

::mlir::StringAttr LoadTPUEmbeddingADAMParametersOpAdaptor::config() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("config").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("");
  return attr;
}

::mlir::LogicalResult LoadTPUEmbeddingADAMParametersOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_table_id = odsAttrs.get("table_id");
    if (tblgen_table_id && !(((tblgen_table_id.isa<::mlir::IntegerAttr>())) && ((tblgen_table_id.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.LoadTPUEmbeddingADAMParameters' op ""attribute 'table_id' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_table_name = odsAttrs.get("table_name");
    if (tblgen_table_name && !((tblgen_table_name.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.LoadTPUEmbeddingADAMParameters' op ""attribute 'table_name' failed to satisfy constraint: string attribute");
  }
  {
    auto tblgen_num_shards = odsAttrs.get("num_shards");
    if (!tblgen_num_shards)
      return emitError(loc, "'tf.LoadTPUEmbeddingADAMParameters' op ""requires attribute 'num_shards'");

    if (tblgen_num_shards && !(((tblgen_num_shards.isa<::mlir::IntegerAttr>())) && ((tblgen_num_shards.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.LoadTPUEmbeddingADAMParameters' op ""attribute 'num_shards' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_shard_id = odsAttrs.get("shard_id");
    if (!tblgen_shard_id)
      return emitError(loc, "'tf.LoadTPUEmbeddingADAMParameters' op ""requires attribute 'shard_id'");

    if (tblgen_shard_id && !(((tblgen_shard_id.isa<::mlir::IntegerAttr>())) && ((tblgen_shard_id.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.LoadTPUEmbeddingADAMParameters' op ""attribute 'shard_id' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_config = odsAttrs.get("config");
    if (tblgen_config && !((tblgen_config.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.LoadTPUEmbeddingADAMParameters' op ""attribute 'config' failed to satisfy constraint: string attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> LoadTPUEmbeddingADAMParametersOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range LoadTPUEmbeddingADAMParametersOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value LoadTPUEmbeddingADAMParametersOp::parameters() {
  return *getODSOperands(0).begin();
}

::mlir::Value LoadTPUEmbeddingADAMParametersOp::momenta() {
  return *getODSOperands(1).begin();
}

::mlir::Value LoadTPUEmbeddingADAMParametersOp::velocities() {
  return *getODSOperands(2).begin();
}

::mlir::MutableOperandRange LoadTPUEmbeddingADAMParametersOp::parametersMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange LoadTPUEmbeddingADAMParametersOp::momentaMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange LoadTPUEmbeddingADAMParametersOp::velocitiesMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> LoadTPUEmbeddingADAMParametersOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range LoadTPUEmbeddingADAMParametersOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::IntegerAttr LoadTPUEmbeddingADAMParametersOp::table_idAttr() {
  return (*this)->getAttr(table_idAttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t LoadTPUEmbeddingADAMParametersOp::table_id() {
  auto attr = table_idAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), -1).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

::mlir::StringAttr LoadTPUEmbeddingADAMParametersOp::table_nameAttr() {
  return (*this)->getAttr(table_nameAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef LoadTPUEmbeddingADAMParametersOp::table_name() {
  auto attr = table_nameAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("").getValue();
  return attr.getValue();
}

::mlir::IntegerAttr LoadTPUEmbeddingADAMParametersOp::num_shardsAttr() {
  return (*this)->getAttr(num_shardsAttrName()).cast<::mlir::IntegerAttr>();
}

uint64_t LoadTPUEmbeddingADAMParametersOp::num_shards() {
  auto attr = num_shardsAttr();
  return attr.getValue().getZExtValue();
}

::mlir::IntegerAttr LoadTPUEmbeddingADAMParametersOp::shard_idAttr() {
  return (*this)->getAttr(shard_idAttrName()).cast<::mlir::IntegerAttr>();
}

uint64_t LoadTPUEmbeddingADAMParametersOp::shard_id() {
  auto attr = shard_idAttr();
  return attr.getValue().getZExtValue();
}

::mlir::StringAttr LoadTPUEmbeddingADAMParametersOp::configAttr() {
  return (*this)->getAttr(configAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef LoadTPUEmbeddingADAMParametersOp::config() {
  auto attr = configAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("").getValue();
  return attr.getValue();
}

void LoadTPUEmbeddingADAMParametersOp::table_idAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(table_idAttrName(), attr);
}

void LoadTPUEmbeddingADAMParametersOp::table_nameAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(table_nameAttrName(), attr);
}

void LoadTPUEmbeddingADAMParametersOp::num_shardsAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(num_shardsAttrName(), attr);
}

void LoadTPUEmbeddingADAMParametersOp::shard_idAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(shard_idAttrName(), attr);
}

void LoadTPUEmbeddingADAMParametersOp::configAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(configAttrName(), attr);
}

void LoadTPUEmbeddingADAMParametersOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value parameters, ::mlir::Value momenta, ::mlir::Value velocities, ::mlir::IntegerAttr table_id, ::mlir::StringAttr table_name, ::mlir::IntegerAttr num_shards, ::mlir::IntegerAttr shard_id, ::mlir::StringAttr config) {
  odsState.addOperands(parameters);
  odsState.addOperands(momenta);
  odsState.addOperands(velocities);
  odsState.addAttribute(table_idAttrName(odsState.name), table_id);
  odsState.addAttribute(table_nameAttrName(odsState.name), table_name);
  odsState.addAttribute(num_shardsAttrName(odsState.name), num_shards);
  odsState.addAttribute(shard_idAttrName(odsState.name), shard_id);
  odsState.addAttribute(configAttrName(odsState.name), config);
}

void LoadTPUEmbeddingADAMParametersOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value parameters, ::mlir::Value momenta, ::mlir::Value velocities, ::mlir::IntegerAttr table_id, ::mlir::StringAttr table_name, ::mlir::IntegerAttr num_shards, ::mlir::IntegerAttr shard_id, ::mlir::StringAttr config) {
  odsState.addOperands(parameters);
  odsState.addOperands(momenta);
  odsState.addOperands(velocities);
  odsState.addAttribute(table_idAttrName(odsState.name), table_id);
  odsState.addAttribute(table_nameAttrName(odsState.name), table_name);
  odsState.addAttribute(num_shardsAttrName(odsState.name), num_shards);
  odsState.addAttribute(shard_idAttrName(odsState.name), shard_id);
  odsState.addAttribute(configAttrName(odsState.name), config);
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void LoadTPUEmbeddingADAMParametersOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value parameters, ::mlir::Value momenta, ::mlir::Value velocities, uint64_t table_id, ::llvm::StringRef table_name, uint64_t num_shards, uint64_t shard_id, ::llvm::StringRef config) {
  odsState.addOperands(parameters);
  odsState.addOperands(momenta);
  odsState.addOperands(velocities);
  odsState.addAttribute(table_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), table_id));
  odsState.addAttribute(table_nameAttrName(odsState.name), odsBuilder.getStringAttr(table_name));
  odsState.addAttribute(num_shardsAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), num_shards));
  odsState.addAttribute(shard_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), shard_id));
  odsState.addAttribute(configAttrName(odsState.name), odsBuilder.getStringAttr(config));
}

void LoadTPUEmbeddingADAMParametersOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value parameters, ::mlir::Value momenta, ::mlir::Value velocities, uint64_t table_id, ::llvm::StringRef table_name, uint64_t num_shards, uint64_t shard_id, ::llvm::StringRef config) {
  odsState.addOperands(parameters);
  odsState.addOperands(momenta);
  odsState.addOperands(velocities);
  odsState.addAttribute(table_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), table_id));
  odsState.addAttribute(table_nameAttrName(odsState.name), odsBuilder.getStringAttr(table_name));
  odsState.addAttribute(num_shardsAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), num_shards));
  odsState.addAttribute(shard_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), shard_id));
  odsState.addAttribute(configAttrName(odsState.name), odsBuilder.getStringAttr(config));
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void LoadTPUEmbeddingADAMParametersOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 3u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 0u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult LoadTPUEmbeddingADAMParametersOp::verify() {
  {
    auto tblgen_table_id = (*this)->getAttr(table_idAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_table_id, "table_id")))
      return ::mlir::failure();
  }
  {
    auto tblgen_table_name = (*this)->getAttr(table_nameAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_table_name, "table_name")))
      return ::mlir::failure();
  }
  {
    auto tblgen_num_shards = (*this)->getAttr(num_shardsAttrName());
    if (!tblgen_num_shards)
      return emitOpError("requires attribute 'num_shards'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_num_shards, "num_shards")))
      return ::mlir::failure();
  }
  {
    auto tblgen_shard_id = (*this)->getAttr(shard_idAttrName());
    if (!tblgen_shard_id)
      return emitOpError("requires attribute 'shard_id'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_shard_id, "shard_id")))
      return ::mlir::failure();
  }
  {
    auto tblgen_config = (*this)->getAttr(configAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_config, "config")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void LoadTPUEmbeddingADAMParametersOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  effects.emplace_back(::mlir::MemoryEffects::Write::get(), ::mlir::TF::ResourceEffects::MustExecute::get());
  effects.emplace_back(::mlir::MemoryEffects::Read::get(), ::mlir::TF::ResourceEffects::TPUEmbedding::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::LoadTPUEmbeddingADAMParametersOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::LoadTPUEmbeddingAdadeltaParametersGradAccumDebugOp definitions
//===----------------------------------------------------------------------===//

LoadTPUEmbeddingAdadeltaParametersGradAccumDebugOpAdaptor::LoadTPUEmbeddingAdadeltaParametersGradAccumDebugOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

LoadTPUEmbeddingAdadeltaParametersGradAccumDebugOpAdaptor::LoadTPUEmbeddingAdadeltaParametersGradAccumDebugOpAdaptor(LoadTPUEmbeddingAdadeltaParametersGradAccumDebugOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange LoadTPUEmbeddingAdadeltaParametersGradAccumDebugOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> LoadTPUEmbeddingAdadeltaParametersGradAccumDebugOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange LoadTPUEmbeddingAdadeltaParametersGradAccumDebugOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value LoadTPUEmbeddingAdadeltaParametersGradAccumDebugOpAdaptor::parameters() {
  return *getODSOperands(0).begin();
}

::mlir::Value LoadTPUEmbeddingAdadeltaParametersGradAccumDebugOpAdaptor::accumulators() {
  return *getODSOperands(1).begin();
}

::mlir::Value LoadTPUEmbeddingAdadeltaParametersGradAccumDebugOpAdaptor::updates() {
  return *getODSOperands(2).begin();
}

::mlir::Value LoadTPUEmbeddingAdadeltaParametersGradAccumDebugOpAdaptor::gradient_accumulators() {
  return *getODSOperands(3).begin();
}

::mlir::DictionaryAttr LoadTPUEmbeddingAdadeltaParametersGradAccumDebugOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::IntegerAttr LoadTPUEmbeddingAdadeltaParametersGradAccumDebugOpAdaptor::table_id() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("table_id").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), -1);
  return attr;
}

::mlir::StringAttr LoadTPUEmbeddingAdadeltaParametersGradAccumDebugOpAdaptor::table_name() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("table_name").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("");
  return attr;
}

::mlir::IntegerAttr LoadTPUEmbeddingAdadeltaParametersGradAccumDebugOpAdaptor::num_shards() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("num_shards").cast<::mlir::IntegerAttr>();
  return attr;
}

::mlir::IntegerAttr LoadTPUEmbeddingAdadeltaParametersGradAccumDebugOpAdaptor::shard_id() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("shard_id").cast<::mlir::IntegerAttr>();
  return attr;
}

::mlir::StringAttr LoadTPUEmbeddingAdadeltaParametersGradAccumDebugOpAdaptor::config() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("config").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("");
  return attr;
}

::mlir::LogicalResult LoadTPUEmbeddingAdadeltaParametersGradAccumDebugOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_table_id = odsAttrs.get("table_id");
    if (tblgen_table_id && !(((tblgen_table_id.isa<::mlir::IntegerAttr>())) && ((tblgen_table_id.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.LoadTPUEmbeddingAdadeltaParametersGradAccumDebug' op ""attribute 'table_id' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_table_name = odsAttrs.get("table_name");
    if (tblgen_table_name && !((tblgen_table_name.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.LoadTPUEmbeddingAdadeltaParametersGradAccumDebug' op ""attribute 'table_name' failed to satisfy constraint: string attribute");
  }
  {
    auto tblgen_num_shards = odsAttrs.get("num_shards");
    if (!tblgen_num_shards)
      return emitError(loc, "'tf.LoadTPUEmbeddingAdadeltaParametersGradAccumDebug' op ""requires attribute 'num_shards'");

    if (tblgen_num_shards && !(((tblgen_num_shards.isa<::mlir::IntegerAttr>())) && ((tblgen_num_shards.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.LoadTPUEmbeddingAdadeltaParametersGradAccumDebug' op ""attribute 'num_shards' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_shard_id = odsAttrs.get("shard_id");
    if (!tblgen_shard_id)
      return emitError(loc, "'tf.LoadTPUEmbeddingAdadeltaParametersGradAccumDebug' op ""requires attribute 'shard_id'");

    if (tblgen_shard_id && !(((tblgen_shard_id.isa<::mlir::IntegerAttr>())) && ((tblgen_shard_id.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.LoadTPUEmbeddingAdadeltaParametersGradAccumDebug' op ""attribute 'shard_id' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_config = odsAttrs.get("config");
    if (tblgen_config && !((tblgen_config.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.LoadTPUEmbeddingAdadeltaParametersGradAccumDebug' op ""attribute 'config' failed to satisfy constraint: string attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> LoadTPUEmbeddingAdadeltaParametersGradAccumDebugOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range LoadTPUEmbeddingAdadeltaParametersGradAccumDebugOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value LoadTPUEmbeddingAdadeltaParametersGradAccumDebugOp::parameters() {
  return *getODSOperands(0).begin();
}

::mlir::Value LoadTPUEmbeddingAdadeltaParametersGradAccumDebugOp::accumulators() {
  return *getODSOperands(1).begin();
}

::mlir::Value LoadTPUEmbeddingAdadeltaParametersGradAccumDebugOp::updates() {
  return *getODSOperands(2).begin();
}

::mlir::Value LoadTPUEmbeddingAdadeltaParametersGradAccumDebugOp::gradient_accumulators() {
  return *getODSOperands(3).begin();
}

::mlir::MutableOperandRange LoadTPUEmbeddingAdadeltaParametersGradAccumDebugOp::parametersMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange LoadTPUEmbeddingAdadeltaParametersGradAccumDebugOp::accumulatorsMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange LoadTPUEmbeddingAdadeltaParametersGradAccumDebugOp::updatesMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange LoadTPUEmbeddingAdadeltaParametersGradAccumDebugOp::gradient_accumulatorsMutable() {
  auto range = getODSOperandIndexAndLength(3);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> LoadTPUEmbeddingAdadeltaParametersGradAccumDebugOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range LoadTPUEmbeddingAdadeltaParametersGradAccumDebugOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::IntegerAttr LoadTPUEmbeddingAdadeltaParametersGradAccumDebugOp::table_idAttr() {
  return (*this)->getAttr(table_idAttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t LoadTPUEmbeddingAdadeltaParametersGradAccumDebugOp::table_id() {
  auto attr = table_idAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), -1).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

::mlir::StringAttr LoadTPUEmbeddingAdadeltaParametersGradAccumDebugOp::table_nameAttr() {
  return (*this)->getAttr(table_nameAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef LoadTPUEmbeddingAdadeltaParametersGradAccumDebugOp::table_name() {
  auto attr = table_nameAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("").getValue();
  return attr.getValue();
}

::mlir::IntegerAttr LoadTPUEmbeddingAdadeltaParametersGradAccumDebugOp::num_shardsAttr() {
  return (*this)->getAttr(num_shardsAttrName()).cast<::mlir::IntegerAttr>();
}

uint64_t LoadTPUEmbeddingAdadeltaParametersGradAccumDebugOp::num_shards() {
  auto attr = num_shardsAttr();
  return attr.getValue().getZExtValue();
}

::mlir::IntegerAttr LoadTPUEmbeddingAdadeltaParametersGradAccumDebugOp::shard_idAttr() {
  return (*this)->getAttr(shard_idAttrName()).cast<::mlir::IntegerAttr>();
}

uint64_t LoadTPUEmbeddingAdadeltaParametersGradAccumDebugOp::shard_id() {
  auto attr = shard_idAttr();
  return attr.getValue().getZExtValue();
}

::mlir::StringAttr LoadTPUEmbeddingAdadeltaParametersGradAccumDebugOp::configAttr() {
  return (*this)->getAttr(configAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef LoadTPUEmbeddingAdadeltaParametersGradAccumDebugOp::config() {
  auto attr = configAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("").getValue();
  return attr.getValue();
}

void LoadTPUEmbeddingAdadeltaParametersGradAccumDebugOp::table_idAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(table_idAttrName(), attr);
}

void LoadTPUEmbeddingAdadeltaParametersGradAccumDebugOp::table_nameAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(table_nameAttrName(), attr);
}

void LoadTPUEmbeddingAdadeltaParametersGradAccumDebugOp::num_shardsAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(num_shardsAttrName(), attr);
}

void LoadTPUEmbeddingAdadeltaParametersGradAccumDebugOp::shard_idAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(shard_idAttrName(), attr);
}

void LoadTPUEmbeddingAdadeltaParametersGradAccumDebugOp::configAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(configAttrName(), attr);
}

void LoadTPUEmbeddingAdadeltaParametersGradAccumDebugOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value parameters, ::mlir::Value accumulators, ::mlir::Value updates, ::mlir::Value gradient_accumulators, ::mlir::IntegerAttr table_id, ::mlir::StringAttr table_name, ::mlir::IntegerAttr num_shards, ::mlir::IntegerAttr shard_id, ::mlir::StringAttr config) {
  odsState.addOperands(parameters);
  odsState.addOperands(accumulators);
  odsState.addOperands(updates);
  odsState.addOperands(gradient_accumulators);
  odsState.addAttribute(table_idAttrName(odsState.name), table_id);
  odsState.addAttribute(table_nameAttrName(odsState.name), table_name);
  odsState.addAttribute(num_shardsAttrName(odsState.name), num_shards);
  odsState.addAttribute(shard_idAttrName(odsState.name), shard_id);
  odsState.addAttribute(configAttrName(odsState.name), config);
}

void LoadTPUEmbeddingAdadeltaParametersGradAccumDebugOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value parameters, ::mlir::Value accumulators, ::mlir::Value updates, ::mlir::Value gradient_accumulators, ::mlir::IntegerAttr table_id, ::mlir::StringAttr table_name, ::mlir::IntegerAttr num_shards, ::mlir::IntegerAttr shard_id, ::mlir::StringAttr config) {
  odsState.addOperands(parameters);
  odsState.addOperands(accumulators);
  odsState.addOperands(updates);
  odsState.addOperands(gradient_accumulators);
  odsState.addAttribute(table_idAttrName(odsState.name), table_id);
  odsState.addAttribute(table_nameAttrName(odsState.name), table_name);
  odsState.addAttribute(num_shardsAttrName(odsState.name), num_shards);
  odsState.addAttribute(shard_idAttrName(odsState.name), shard_id);
  odsState.addAttribute(configAttrName(odsState.name), config);
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void LoadTPUEmbeddingAdadeltaParametersGradAccumDebugOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value parameters, ::mlir::Value accumulators, ::mlir::Value updates, ::mlir::Value gradient_accumulators, uint64_t table_id, ::llvm::StringRef table_name, uint64_t num_shards, uint64_t shard_id, ::llvm::StringRef config) {
  odsState.addOperands(parameters);
  odsState.addOperands(accumulators);
  odsState.addOperands(updates);
  odsState.addOperands(gradient_accumulators);
  odsState.addAttribute(table_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), table_id));
  odsState.addAttribute(table_nameAttrName(odsState.name), odsBuilder.getStringAttr(table_name));
  odsState.addAttribute(num_shardsAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), num_shards));
  odsState.addAttribute(shard_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), shard_id));
  odsState.addAttribute(configAttrName(odsState.name), odsBuilder.getStringAttr(config));
}

void LoadTPUEmbeddingAdadeltaParametersGradAccumDebugOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value parameters, ::mlir::Value accumulators, ::mlir::Value updates, ::mlir::Value gradient_accumulators, uint64_t table_id, ::llvm::StringRef table_name, uint64_t num_shards, uint64_t shard_id, ::llvm::StringRef config) {
  odsState.addOperands(parameters);
  odsState.addOperands(accumulators);
  odsState.addOperands(updates);
  odsState.addOperands(gradient_accumulators);
  odsState.addAttribute(table_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), table_id));
  odsState.addAttribute(table_nameAttrName(odsState.name), odsBuilder.getStringAttr(table_name));
  odsState.addAttribute(num_shardsAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), num_shards));
  odsState.addAttribute(shard_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), shard_id));
  odsState.addAttribute(configAttrName(odsState.name), odsBuilder.getStringAttr(config));
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void LoadTPUEmbeddingAdadeltaParametersGradAccumDebugOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 4u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 0u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult LoadTPUEmbeddingAdadeltaParametersGradAccumDebugOp::verify() {
  {
    auto tblgen_table_id = (*this)->getAttr(table_idAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_table_id, "table_id")))
      return ::mlir::failure();
  }
  {
    auto tblgen_table_name = (*this)->getAttr(table_nameAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_table_name, "table_name")))
      return ::mlir::failure();
  }
  {
    auto tblgen_num_shards = (*this)->getAttr(num_shardsAttrName());
    if (!tblgen_num_shards)
      return emitOpError("requires attribute 'num_shards'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_num_shards, "num_shards")))
      return ::mlir::failure();
  }
  {
    auto tblgen_shard_id = (*this)->getAttr(shard_idAttrName());
    if (!tblgen_shard_id)
      return emitOpError("requires attribute 'shard_id'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_shard_id, "shard_id")))
      return ::mlir::failure();
  }
  {
    auto tblgen_config = (*this)->getAttr(configAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_config, "config")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup3 = getODSOperands(3);

    for (auto v : valueGroup3) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void LoadTPUEmbeddingAdadeltaParametersGradAccumDebugOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  effects.emplace_back(::mlir::MemoryEffects::Write::get(), ::mlir::TF::ResourceEffects::MustExecute::get());
  effects.emplace_back(::mlir::MemoryEffects::Read::get(), ::mlir::TF::ResourceEffects::TPUEmbedding::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::LoadTPUEmbeddingAdadeltaParametersGradAccumDebugOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::LoadTPUEmbeddingAdadeltaParametersOp definitions
//===----------------------------------------------------------------------===//

LoadTPUEmbeddingAdadeltaParametersOpAdaptor::LoadTPUEmbeddingAdadeltaParametersOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

LoadTPUEmbeddingAdadeltaParametersOpAdaptor::LoadTPUEmbeddingAdadeltaParametersOpAdaptor(LoadTPUEmbeddingAdadeltaParametersOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange LoadTPUEmbeddingAdadeltaParametersOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> LoadTPUEmbeddingAdadeltaParametersOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange LoadTPUEmbeddingAdadeltaParametersOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value LoadTPUEmbeddingAdadeltaParametersOpAdaptor::parameters() {
  return *getODSOperands(0).begin();
}

::mlir::Value LoadTPUEmbeddingAdadeltaParametersOpAdaptor::accumulators() {
  return *getODSOperands(1).begin();
}

::mlir::Value LoadTPUEmbeddingAdadeltaParametersOpAdaptor::updates() {
  return *getODSOperands(2).begin();
}

::mlir::DictionaryAttr LoadTPUEmbeddingAdadeltaParametersOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::IntegerAttr LoadTPUEmbeddingAdadeltaParametersOpAdaptor::table_id() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("table_id").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), -1);
  return attr;
}

::mlir::StringAttr LoadTPUEmbeddingAdadeltaParametersOpAdaptor::table_name() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("table_name").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("");
  return attr;
}

::mlir::IntegerAttr LoadTPUEmbeddingAdadeltaParametersOpAdaptor::num_shards() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("num_shards").cast<::mlir::IntegerAttr>();
  return attr;
}

::mlir::IntegerAttr LoadTPUEmbeddingAdadeltaParametersOpAdaptor::shard_id() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("shard_id").cast<::mlir::IntegerAttr>();
  return attr;
}

::mlir::StringAttr LoadTPUEmbeddingAdadeltaParametersOpAdaptor::config() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("config").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("");
  return attr;
}

::mlir::LogicalResult LoadTPUEmbeddingAdadeltaParametersOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_table_id = odsAttrs.get("table_id");
    if (tblgen_table_id && !(((tblgen_table_id.isa<::mlir::IntegerAttr>())) && ((tblgen_table_id.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.LoadTPUEmbeddingAdadeltaParameters' op ""attribute 'table_id' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_table_name = odsAttrs.get("table_name");
    if (tblgen_table_name && !((tblgen_table_name.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.LoadTPUEmbeddingAdadeltaParameters' op ""attribute 'table_name' failed to satisfy constraint: string attribute");
  }
  {
    auto tblgen_num_shards = odsAttrs.get("num_shards");
    if (!tblgen_num_shards)
      return emitError(loc, "'tf.LoadTPUEmbeddingAdadeltaParameters' op ""requires attribute 'num_shards'");

    if (tblgen_num_shards && !(((tblgen_num_shards.isa<::mlir::IntegerAttr>())) && ((tblgen_num_shards.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.LoadTPUEmbeddingAdadeltaParameters' op ""attribute 'num_shards' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_shard_id = odsAttrs.get("shard_id");
    if (!tblgen_shard_id)
      return emitError(loc, "'tf.LoadTPUEmbeddingAdadeltaParameters' op ""requires attribute 'shard_id'");

    if (tblgen_shard_id && !(((tblgen_shard_id.isa<::mlir::IntegerAttr>())) && ((tblgen_shard_id.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.LoadTPUEmbeddingAdadeltaParameters' op ""attribute 'shard_id' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_config = odsAttrs.get("config");
    if (tblgen_config && !((tblgen_config.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.LoadTPUEmbeddingAdadeltaParameters' op ""attribute 'config' failed to satisfy constraint: string attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> LoadTPUEmbeddingAdadeltaParametersOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range LoadTPUEmbeddingAdadeltaParametersOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value LoadTPUEmbeddingAdadeltaParametersOp::parameters() {
  return *getODSOperands(0).begin();
}

::mlir::Value LoadTPUEmbeddingAdadeltaParametersOp::accumulators() {
  return *getODSOperands(1).begin();
}

::mlir::Value LoadTPUEmbeddingAdadeltaParametersOp::updates() {
  return *getODSOperands(2).begin();
}

::mlir::MutableOperandRange LoadTPUEmbeddingAdadeltaParametersOp::parametersMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange LoadTPUEmbeddingAdadeltaParametersOp::accumulatorsMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange LoadTPUEmbeddingAdadeltaParametersOp::updatesMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> LoadTPUEmbeddingAdadeltaParametersOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range LoadTPUEmbeddingAdadeltaParametersOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::IntegerAttr LoadTPUEmbeddingAdadeltaParametersOp::table_idAttr() {
  return (*this)->getAttr(table_idAttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t LoadTPUEmbeddingAdadeltaParametersOp::table_id() {
  auto attr = table_idAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), -1).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

::mlir::StringAttr LoadTPUEmbeddingAdadeltaParametersOp::table_nameAttr() {
  return (*this)->getAttr(table_nameAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef LoadTPUEmbeddingAdadeltaParametersOp::table_name() {
  auto attr = table_nameAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("").getValue();
  return attr.getValue();
}

::mlir::IntegerAttr LoadTPUEmbeddingAdadeltaParametersOp::num_shardsAttr() {
  return (*this)->getAttr(num_shardsAttrName()).cast<::mlir::IntegerAttr>();
}

uint64_t LoadTPUEmbeddingAdadeltaParametersOp::num_shards() {
  auto attr = num_shardsAttr();
  return attr.getValue().getZExtValue();
}

::mlir::IntegerAttr LoadTPUEmbeddingAdadeltaParametersOp::shard_idAttr() {
  return (*this)->getAttr(shard_idAttrName()).cast<::mlir::IntegerAttr>();
}

uint64_t LoadTPUEmbeddingAdadeltaParametersOp::shard_id() {
  auto attr = shard_idAttr();
  return attr.getValue().getZExtValue();
}

::mlir::StringAttr LoadTPUEmbeddingAdadeltaParametersOp::configAttr() {
  return (*this)->getAttr(configAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef LoadTPUEmbeddingAdadeltaParametersOp::config() {
  auto attr = configAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("").getValue();
  return attr.getValue();
}

void LoadTPUEmbeddingAdadeltaParametersOp::table_idAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(table_idAttrName(), attr);
}

void LoadTPUEmbeddingAdadeltaParametersOp::table_nameAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(table_nameAttrName(), attr);
}

void LoadTPUEmbeddingAdadeltaParametersOp::num_shardsAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(num_shardsAttrName(), attr);
}

void LoadTPUEmbeddingAdadeltaParametersOp::shard_idAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(shard_idAttrName(), attr);
}

void LoadTPUEmbeddingAdadeltaParametersOp::configAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(configAttrName(), attr);
}

void LoadTPUEmbeddingAdadeltaParametersOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value parameters, ::mlir::Value accumulators, ::mlir::Value updates, ::mlir::IntegerAttr table_id, ::mlir::StringAttr table_name, ::mlir::IntegerAttr num_shards, ::mlir::IntegerAttr shard_id, ::mlir::StringAttr config) {
  odsState.addOperands(parameters);
  odsState.addOperands(accumulators);
  odsState.addOperands(updates);
  odsState.addAttribute(table_idAttrName(odsState.name), table_id);
  odsState.addAttribute(table_nameAttrName(odsState.name), table_name);
  odsState.addAttribute(num_shardsAttrName(odsState.name), num_shards);
  odsState.addAttribute(shard_idAttrName(odsState.name), shard_id);
  odsState.addAttribute(configAttrName(odsState.name), config);
}

void LoadTPUEmbeddingAdadeltaParametersOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value parameters, ::mlir::Value accumulators, ::mlir::Value updates, ::mlir::IntegerAttr table_id, ::mlir::StringAttr table_name, ::mlir::IntegerAttr num_shards, ::mlir::IntegerAttr shard_id, ::mlir::StringAttr config) {
  odsState.addOperands(parameters);
  odsState.addOperands(accumulators);
  odsState.addOperands(updates);
  odsState.addAttribute(table_idAttrName(odsState.name), table_id);
  odsState.addAttribute(table_nameAttrName(odsState.name), table_name);
  odsState.addAttribute(num_shardsAttrName(odsState.name), num_shards);
  odsState.addAttribute(shard_idAttrName(odsState.name), shard_id);
  odsState.addAttribute(configAttrName(odsState.name), config);
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void LoadTPUEmbeddingAdadeltaParametersOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value parameters, ::mlir::Value accumulators, ::mlir::Value updates, uint64_t table_id, ::llvm::StringRef table_name, uint64_t num_shards, uint64_t shard_id, ::llvm::StringRef config) {
  odsState.addOperands(parameters);
  odsState.addOperands(accumulators);
  odsState.addOperands(updates);
  odsState.addAttribute(table_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), table_id));
  odsState.addAttribute(table_nameAttrName(odsState.name), odsBuilder.getStringAttr(table_name));
  odsState.addAttribute(num_shardsAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), num_shards));
  odsState.addAttribute(shard_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), shard_id));
  odsState.addAttribute(configAttrName(odsState.name), odsBuilder.getStringAttr(config));
}

void LoadTPUEmbeddingAdadeltaParametersOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value parameters, ::mlir::Value accumulators, ::mlir::Value updates, uint64_t table_id, ::llvm::StringRef table_name, uint64_t num_shards, uint64_t shard_id, ::llvm::StringRef config) {
  odsState.addOperands(parameters);
  odsState.addOperands(accumulators);
  odsState.addOperands(updates);
  odsState.addAttribute(table_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), table_id));
  odsState.addAttribute(table_nameAttrName(odsState.name), odsBuilder.getStringAttr(table_name));
  odsState.addAttribute(num_shardsAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), num_shards));
  odsState.addAttribute(shard_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), shard_id));
  odsState.addAttribute(configAttrName(odsState.name), odsBuilder.getStringAttr(config));
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void LoadTPUEmbeddingAdadeltaParametersOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 3u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 0u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult LoadTPUEmbeddingAdadeltaParametersOp::verify() {
  {
    auto tblgen_table_id = (*this)->getAttr(table_idAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_table_id, "table_id")))
      return ::mlir::failure();
  }
  {
    auto tblgen_table_name = (*this)->getAttr(table_nameAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_table_name, "table_name")))
      return ::mlir::failure();
  }
  {
    auto tblgen_num_shards = (*this)->getAttr(num_shardsAttrName());
    if (!tblgen_num_shards)
      return emitOpError("requires attribute 'num_shards'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_num_shards, "num_shards")))
      return ::mlir::failure();
  }
  {
    auto tblgen_shard_id = (*this)->getAttr(shard_idAttrName());
    if (!tblgen_shard_id)
      return emitOpError("requires attribute 'shard_id'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_shard_id, "shard_id")))
      return ::mlir::failure();
  }
  {
    auto tblgen_config = (*this)->getAttr(configAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_config, "config")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void LoadTPUEmbeddingAdadeltaParametersOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  effects.emplace_back(::mlir::MemoryEffects::Write::get(), ::mlir::TF::ResourceEffects::MustExecute::get());
  effects.emplace_back(::mlir::MemoryEffects::Read::get(), ::mlir::TF::ResourceEffects::TPUEmbedding::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::LoadTPUEmbeddingAdadeltaParametersOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::LoadTPUEmbeddingAdagradParametersGradAccumDebugOp definitions
//===----------------------------------------------------------------------===//

LoadTPUEmbeddingAdagradParametersGradAccumDebugOpAdaptor::LoadTPUEmbeddingAdagradParametersGradAccumDebugOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

LoadTPUEmbeddingAdagradParametersGradAccumDebugOpAdaptor::LoadTPUEmbeddingAdagradParametersGradAccumDebugOpAdaptor(LoadTPUEmbeddingAdagradParametersGradAccumDebugOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange LoadTPUEmbeddingAdagradParametersGradAccumDebugOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> LoadTPUEmbeddingAdagradParametersGradAccumDebugOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange LoadTPUEmbeddingAdagradParametersGradAccumDebugOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value LoadTPUEmbeddingAdagradParametersGradAccumDebugOpAdaptor::parameters() {
  return *getODSOperands(0).begin();
}

::mlir::Value LoadTPUEmbeddingAdagradParametersGradAccumDebugOpAdaptor::accumulators() {
  return *getODSOperands(1).begin();
}

::mlir::Value LoadTPUEmbeddingAdagradParametersGradAccumDebugOpAdaptor::gradient_accumulators() {
  return *getODSOperands(2).begin();
}

::mlir::DictionaryAttr LoadTPUEmbeddingAdagradParametersGradAccumDebugOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::IntegerAttr LoadTPUEmbeddingAdagradParametersGradAccumDebugOpAdaptor::table_id() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("table_id").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), -1);
  return attr;
}

::mlir::StringAttr LoadTPUEmbeddingAdagradParametersGradAccumDebugOpAdaptor::table_name() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("table_name").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("");
  return attr;
}

::mlir::IntegerAttr LoadTPUEmbeddingAdagradParametersGradAccumDebugOpAdaptor::num_shards() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("num_shards").cast<::mlir::IntegerAttr>();
  return attr;
}

::mlir::IntegerAttr LoadTPUEmbeddingAdagradParametersGradAccumDebugOpAdaptor::shard_id() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("shard_id").cast<::mlir::IntegerAttr>();
  return attr;
}

::mlir::StringAttr LoadTPUEmbeddingAdagradParametersGradAccumDebugOpAdaptor::config() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("config").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("");
  return attr;
}

::mlir::LogicalResult LoadTPUEmbeddingAdagradParametersGradAccumDebugOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_table_id = odsAttrs.get("table_id");
    if (tblgen_table_id && !(((tblgen_table_id.isa<::mlir::IntegerAttr>())) && ((tblgen_table_id.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.LoadTPUEmbeddingAdagradParametersGradAccumDebug' op ""attribute 'table_id' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_table_name = odsAttrs.get("table_name");
    if (tblgen_table_name && !((tblgen_table_name.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.LoadTPUEmbeddingAdagradParametersGradAccumDebug' op ""attribute 'table_name' failed to satisfy constraint: string attribute");
  }
  {
    auto tblgen_num_shards = odsAttrs.get("num_shards");
    if (!tblgen_num_shards)
      return emitError(loc, "'tf.LoadTPUEmbeddingAdagradParametersGradAccumDebug' op ""requires attribute 'num_shards'");

    if (tblgen_num_shards && !(((tblgen_num_shards.isa<::mlir::IntegerAttr>())) && ((tblgen_num_shards.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.LoadTPUEmbeddingAdagradParametersGradAccumDebug' op ""attribute 'num_shards' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_shard_id = odsAttrs.get("shard_id");
    if (!tblgen_shard_id)
      return emitError(loc, "'tf.LoadTPUEmbeddingAdagradParametersGradAccumDebug' op ""requires attribute 'shard_id'");

    if (tblgen_shard_id && !(((tblgen_shard_id.isa<::mlir::IntegerAttr>())) && ((tblgen_shard_id.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.LoadTPUEmbeddingAdagradParametersGradAccumDebug' op ""attribute 'shard_id' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_config = odsAttrs.get("config");
    if (tblgen_config && !((tblgen_config.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.LoadTPUEmbeddingAdagradParametersGradAccumDebug' op ""attribute 'config' failed to satisfy constraint: string attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> LoadTPUEmbeddingAdagradParametersGradAccumDebugOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range LoadTPUEmbeddingAdagradParametersGradAccumDebugOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value LoadTPUEmbeddingAdagradParametersGradAccumDebugOp::parameters() {
  return *getODSOperands(0).begin();
}

::mlir::Value LoadTPUEmbeddingAdagradParametersGradAccumDebugOp::accumulators() {
  return *getODSOperands(1).begin();
}

::mlir::Value LoadTPUEmbeddingAdagradParametersGradAccumDebugOp::gradient_accumulators() {
  return *getODSOperands(2).begin();
}

::mlir::MutableOperandRange LoadTPUEmbeddingAdagradParametersGradAccumDebugOp::parametersMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange LoadTPUEmbeddingAdagradParametersGradAccumDebugOp::accumulatorsMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange LoadTPUEmbeddingAdagradParametersGradAccumDebugOp::gradient_accumulatorsMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> LoadTPUEmbeddingAdagradParametersGradAccumDebugOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range LoadTPUEmbeddingAdagradParametersGradAccumDebugOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::IntegerAttr LoadTPUEmbeddingAdagradParametersGradAccumDebugOp::table_idAttr() {
  return (*this)->getAttr(table_idAttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t LoadTPUEmbeddingAdagradParametersGradAccumDebugOp::table_id() {
  auto attr = table_idAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), -1).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

::mlir::StringAttr LoadTPUEmbeddingAdagradParametersGradAccumDebugOp::table_nameAttr() {
  return (*this)->getAttr(table_nameAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef LoadTPUEmbeddingAdagradParametersGradAccumDebugOp::table_name() {
  auto attr = table_nameAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("").getValue();
  return attr.getValue();
}

::mlir::IntegerAttr LoadTPUEmbeddingAdagradParametersGradAccumDebugOp::num_shardsAttr() {
  return (*this)->getAttr(num_shardsAttrName()).cast<::mlir::IntegerAttr>();
}

uint64_t LoadTPUEmbeddingAdagradParametersGradAccumDebugOp::num_shards() {
  auto attr = num_shardsAttr();
  return attr.getValue().getZExtValue();
}

::mlir::IntegerAttr LoadTPUEmbeddingAdagradParametersGradAccumDebugOp::shard_idAttr() {
  return (*this)->getAttr(shard_idAttrName()).cast<::mlir::IntegerAttr>();
}

uint64_t LoadTPUEmbeddingAdagradParametersGradAccumDebugOp::shard_id() {
  auto attr = shard_idAttr();
  return attr.getValue().getZExtValue();
}

::mlir::StringAttr LoadTPUEmbeddingAdagradParametersGradAccumDebugOp::configAttr() {
  return (*this)->getAttr(configAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef LoadTPUEmbeddingAdagradParametersGradAccumDebugOp::config() {
  auto attr = configAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("").getValue();
  return attr.getValue();
}

void LoadTPUEmbeddingAdagradParametersGradAccumDebugOp::table_idAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(table_idAttrName(), attr);
}

void LoadTPUEmbeddingAdagradParametersGradAccumDebugOp::table_nameAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(table_nameAttrName(), attr);
}

void LoadTPUEmbeddingAdagradParametersGradAccumDebugOp::num_shardsAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(num_shardsAttrName(), attr);
}

void LoadTPUEmbeddingAdagradParametersGradAccumDebugOp::shard_idAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(shard_idAttrName(), attr);
}

void LoadTPUEmbeddingAdagradParametersGradAccumDebugOp::configAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(configAttrName(), attr);
}

void LoadTPUEmbeddingAdagradParametersGradAccumDebugOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value parameters, ::mlir::Value accumulators, ::mlir::Value gradient_accumulators, ::mlir::IntegerAttr table_id, ::mlir::StringAttr table_name, ::mlir::IntegerAttr num_shards, ::mlir::IntegerAttr shard_id, ::mlir::StringAttr config) {
  odsState.addOperands(parameters);
  odsState.addOperands(accumulators);
  odsState.addOperands(gradient_accumulators);
  odsState.addAttribute(table_idAttrName(odsState.name), table_id);
  odsState.addAttribute(table_nameAttrName(odsState.name), table_name);
  odsState.addAttribute(num_shardsAttrName(odsState.name), num_shards);
  odsState.addAttribute(shard_idAttrName(odsState.name), shard_id);
  odsState.addAttribute(configAttrName(odsState.name), config);
}

void LoadTPUEmbeddingAdagradParametersGradAccumDebugOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value parameters, ::mlir::Value accumulators, ::mlir::Value gradient_accumulators, ::mlir::IntegerAttr table_id, ::mlir::StringAttr table_name, ::mlir::IntegerAttr num_shards, ::mlir::IntegerAttr shard_id, ::mlir::StringAttr config) {
  odsState.addOperands(parameters);
  odsState.addOperands(accumulators);
  odsState.addOperands(gradient_accumulators);
  odsState.addAttribute(table_idAttrName(odsState.name), table_id);
  odsState.addAttribute(table_nameAttrName(odsState.name), table_name);
  odsState.addAttribute(num_shardsAttrName(odsState.name), num_shards);
  odsState.addAttribute(shard_idAttrName(odsState.name), shard_id);
  odsState.addAttribute(configAttrName(odsState.name), config);
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void LoadTPUEmbeddingAdagradParametersGradAccumDebugOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value parameters, ::mlir::Value accumulators, ::mlir::Value gradient_accumulators, uint64_t table_id, ::llvm::StringRef table_name, uint64_t num_shards, uint64_t shard_id, ::llvm::StringRef config) {
  odsState.addOperands(parameters);
  odsState.addOperands(accumulators);
  odsState.addOperands(gradient_accumulators);
  odsState.addAttribute(table_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), table_id));
  odsState.addAttribute(table_nameAttrName(odsState.name), odsBuilder.getStringAttr(table_name));
  odsState.addAttribute(num_shardsAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), num_shards));
  odsState.addAttribute(shard_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), shard_id));
  odsState.addAttribute(configAttrName(odsState.name), odsBuilder.getStringAttr(config));
}

void LoadTPUEmbeddingAdagradParametersGradAccumDebugOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value parameters, ::mlir::Value accumulators, ::mlir::Value gradient_accumulators, uint64_t table_id, ::llvm::StringRef table_name, uint64_t num_shards, uint64_t shard_id, ::llvm::StringRef config) {
  odsState.addOperands(parameters);
  odsState.addOperands(accumulators);
  odsState.addOperands(gradient_accumulators);
  odsState.addAttribute(table_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), table_id));
  odsState.addAttribute(table_nameAttrName(odsState.name), odsBuilder.getStringAttr(table_name));
  odsState.addAttribute(num_shardsAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), num_shards));
  odsState.addAttribute(shard_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), shard_id));
  odsState.addAttribute(configAttrName(odsState.name), odsBuilder.getStringAttr(config));
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void LoadTPUEmbeddingAdagradParametersGradAccumDebugOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 3u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 0u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult LoadTPUEmbeddingAdagradParametersGradAccumDebugOp::verify() {
  {
    auto tblgen_table_id = (*this)->getAttr(table_idAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_table_id, "table_id")))
      return ::mlir::failure();
  }
  {
    auto tblgen_table_name = (*this)->getAttr(table_nameAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_table_name, "table_name")))
      return ::mlir::failure();
  }
  {
    auto tblgen_num_shards = (*this)->getAttr(num_shardsAttrName());
    if (!tblgen_num_shards)
      return emitOpError("requires attribute 'num_shards'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_num_shards, "num_shards")))
      return ::mlir::failure();
  }
  {
    auto tblgen_shard_id = (*this)->getAttr(shard_idAttrName());
    if (!tblgen_shard_id)
      return emitOpError("requires attribute 'shard_id'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_shard_id, "shard_id")))
      return ::mlir::failure();
  }
  {
    auto tblgen_config = (*this)->getAttr(configAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_config, "config")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void LoadTPUEmbeddingAdagradParametersGradAccumDebugOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  effects.emplace_back(::mlir::MemoryEffects::Write::get(), ::mlir::TF::ResourceEffects::MustExecute::get());
  effects.emplace_back(::mlir::MemoryEffects::Read::get(), ::mlir::TF::ResourceEffects::TPUEmbedding::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::LoadTPUEmbeddingAdagradParametersGradAccumDebugOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::LoadTPUEmbeddingAdagradParametersOp definitions
//===----------------------------------------------------------------------===//

LoadTPUEmbeddingAdagradParametersOpAdaptor::LoadTPUEmbeddingAdagradParametersOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

LoadTPUEmbeddingAdagradParametersOpAdaptor::LoadTPUEmbeddingAdagradParametersOpAdaptor(LoadTPUEmbeddingAdagradParametersOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange LoadTPUEmbeddingAdagradParametersOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> LoadTPUEmbeddingAdagradParametersOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange LoadTPUEmbeddingAdagradParametersOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value LoadTPUEmbeddingAdagradParametersOpAdaptor::parameters() {
  return *getODSOperands(0).begin();
}

::mlir::Value LoadTPUEmbeddingAdagradParametersOpAdaptor::accumulators() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr LoadTPUEmbeddingAdagradParametersOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::IntegerAttr LoadTPUEmbeddingAdagradParametersOpAdaptor::table_id() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("table_id").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), -1);
  return attr;
}

::mlir::StringAttr LoadTPUEmbeddingAdagradParametersOpAdaptor::table_name() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("table_name").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("");
  return attr;
}

::mlir::IntegerAttr LoadTPUEmbeddingAdagradParametersOpAdaptor::num_shards() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("num_shards").cast<::mlir::IntegerAttr>();
  return attr;
}

::mlir::IntegerAttr LoadTPUEmbeddingAdagradParametersOpAdaptor::shard_id() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("shard_id").cast<::mlir::IntegerAttr>();
  return attr;
}

::mlir::StringAttr LoadTPUEmbeddingAdagradParametersOpAdaptor::config() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("config").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("");
  return attr;
}

::mlir::LogicalResult LoadTPUEmbeddingAdagradParametersOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_table_id = odsAttrs.get("table_id");
    if (tblgen_table_id && !(((tblgen_table_id.isa<::mlir::IntegerAttr>())) && ((tblgen_table_id.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.LoadTPUEmbeddingAdagradParameters' op ""attribute 'table_id' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_table_name = odsAttrs.get("table_name");
    if (tblgen_table_name && !((tblgen_table_name.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.LoadTPUEmbeddingAdagradParameters' op ""attribute 'table_name' failed to satisfy constraint: string attribute");
  }
  {
    auto tblgen_num_shards = odsAttrs.get("num_shards");
    if (!tblgen_num_shards)
      return emitError(loc, "'tf.LoadTPUEmbeddingAdagradParameters' op ""requires attribute 'num_shards'");

    if (tblgen_num_shards && !(((tblgen_num_shards.isa<::mlir::IntegerAttr>())) && ((tblgen_num_shards.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.LoadTPUEmbeddingAdagradParameters' op ""attribute 'num_shards' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_shard_id = odsAttrs.get("shard_id");
    if (!tblgen_shard_id)
      return emitError(loc, "'tf.LoadTPUEmbeddingAdagradParameters' op ""requires attribute 'shard_id'");

    if (tblgen_shard_id && !(((tblgen_shard_id.isa<::mlir::IntegerAttr>())) && ((tblgen_shard_id.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.LoadTPUEmbeddingAdagradParameters' op ""attribute 'shard_id' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_config = odsAttrs.get("config");
    if (tblgen_config && !((tblgen_config.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.LoadTPUEmbeddingAdagradParameters' op ""attribute 'config' failed to satisfy constraint: string attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> LoadTPUEmbeddingAdagradParametersOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range LoadTPUEmbeddingAdagradParametersOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value LoadTPUEmbeddingAdagradParametersOp::parameters() {
  return *getODSOperands(0).begin();
}

::mlir::Value LoadTPUEmbeddingAdagradParametersOp::accumulators() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange LoadTPUEmbeddingAdagradParametersOp::parametersMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange LoadTPUEmbeddingAdagradParametersOp::accumulatorsMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> LoadTPUEmbeddingAdagradParametersOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range LoadTPUEmbeddingAdagradParametersOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::IntegerAttr LoadTPUEmbeddingAdagradParametersOp::table_idAttr() {
  return (*this)->getAttr(table_idAttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t LoadTPUEmbeddingAdagradParametersOp::table_id() {
  auto attr = table_idAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), -1).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

::mlir::StringAttr LoadTPUEmbeddingAdagradParametersOp::table_nameAttr() {
  return (*this)->getAttr(table_nameAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef LoadTPUEmbeddingAdagradParametersOp::table_name() {
  auto attr = table_nameAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("").getValue();
  return attr.getValue();
}

::mlir::IntegerAttr LoadTPUEmbeddingAdagradParametersOp::num_shardsAttr() {
  return (*this)->getAttr(num_shardsAttrName()).cast<::mlir::IntegerAttr>();
}

uint64_t LoadTPUEmbeddingAdagradParametersOp::num_shards() {
  auto attr = num_shardsAttr();
  return attr.getValue().getZExtValue();
}

::mlir::IntegerAttr LoadTPUEmbeddingAdagradParametersOp::shard_idAttr() {
  return (*this)->getAttr(shard_idAttrName()).cast<::mlir::IntegerAttr>();
}

uint64_t LoadTPUEmbeddingAdagradParametersOp::shard_id() {
  auto attr = shard_idAttr();
  return attr.getValue().getZExtValue();
}

::mlir::StringAttr LoadTPUEmbeddingAdagradParametersOp::configAttr() {
  return (*this)->getAttr(configAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef LoadTPUEmbeddingAdagradParametersOp::config() {
  auto attr = configAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("").getValue();
  return attr.getValue();
}

void LoadTPUEmbeddingAdagradParametersOp::table_idAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(table_idAttrName(), attr);
}

void LoadTPUEmbeddingAdagradParametersOp::table_nameAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(table_nameAttrName(), attr);
}

void LoadTPUEmbeddingAdagradParametersOp::num_shardsAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(num_shardsAttrName(), attr);
}

void LoadTPUEmbeddingAdagradParametersOp::shard_idAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(shard_idAttrName(), attr);
}

void LoadTPUEmbeddingAdagradParametersOp::configAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(configAttrName(), attr);
}

void LoadTPUEmbeddingAdagradParametersOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value parameters, ::mlir::Value accumulators, ::mlir::IntegerAttr table_id, ::mlir::StringAttr table_name, ::mlir::IntegerAttr num_shards, ::mlir::IntegerAttr shard_id, ::mlir::StringAttr config) {
  odsState.addOperands(parameters);
  odsState.addOperands(accumulators);
  odsState.addAttribute(table_idAttrName(odsState.name), table_id);
  odsState.addAttribute(table_nameAttrName(odsState.name), table_name);
  odsState.addAttribute(num_shardsAttrName(odsState.name), num_shards);
  odsState.addAttribute(shard_idAttrName(odsState.name), shard_id);
  odsState.addAttribute(configAttrName(odsState.name), config);
}

void LoadTPUEmbeddingAdagradParametersOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value parameters, ::mlir::Value accumulators, ::mlir::IntegerAttr table_id, ::mlir::StringAttr table_name, ::mlir::IntegerAttr num_shards, ::mlir::IntegerAttr shard_id, ::mlir::StringAttr config) {
  odsState.addOperands(parameters);
  odsState.addOperands(accumulators);
  odsState.addAttribute(table_idAttrName(odsState.name), table_id);
  odsState.addAttribute(table_nameAttrName(odsState.name), table_name);
  odsState.addAttribute(num_shardsAttrName(odsState.name), num_shards);
  odsState.addAttribute(shard_idAttrName(odsState.name), shard_id);
  odsState.addAttribute(configAttrName(odsState.name), config);
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void LoadTPUEmbeddingAdagradParametersOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value parameters, ::mlir::Value accumulators, uint64_t table_id, ::llvm::StringRef table_name, uint64_t num_shards, uint64_t shard_id, ::llvm::StringRef config) {
  odsState.addOperands(parameters);
  odsState.addOperands(accumulators);
  odsState.addAttribute(table_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), table_id));
  odsState.addAttribute(table_nameAttrName(odsState.name), odsBuilder.getStringAttr(table_name));
  odsState.addAttribute(num_shardsAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), num_shards));
  odsState.addAttribute(shard_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), shard_id));
  odsState.addAttribute(configAttrName(odsState.name), odsBuilder.getStringAttr(config));
}

void LoadTPUEmbeddingAdagradParametersOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value parameters, ::mlir::Value accumulators, uint64_t table_id, ::llvm::StringRef table_name, uint64_t num_shards, uint64_t shard_id, ::llvm::StringRef config) {
  odsState.addOperands(parameters);
  odsState.addOperands(accumulators);
  odsState.addAttribute(table_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), table_id));
  odsState.addAttribute(table_nameAttrName(odsState.name), odsBuilder.getStringAttr(table_name));
  odsState.addAttribute(num_shardsAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), num_shards));
  odsState.addAttribute(shard_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), shard_id));
  odsState.addAttribute(configAttrName(odsState.name), odsBuilder.getStringAttr(config));
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void LoadTPUEmbeddingAdagradParametersOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 0u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult LoadTPUEmbeddingAdagradParametersOp::verify() {
  {
    auto tblgen_table_id = (*this)->getAttr(table_idAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_table_id, "table_id")))
      return ::mlir::failure();
  }
  {
    auto tblgen_table_name = (*this)->getAttr(table_nameAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_table_name, "table_name")))
      return ::mlir::failure();
  }
  {
    auto tblgen_num_shards = (*this)->getAttr(num_shardsAttrName());
    if (!tblgen_num_shards)
      return emitOpError("requires attribute 'num_shards'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_num_shards, "num_shards")))
      return ::mlir::failure();
  }
  {
    auto tblgen_shard_id = (*this)->getAttr(shard_idAttrName());
    if (!tblgen_shard_id)
      return emitOpError("requires attribute 'shard_id'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_shard_id, "shard_id")))
      return ::mlir::failure();
  }
  {
    auto tblgen_config = (*this)->getAttr(configAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_config, "config")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void LoadTPUEmbeddingAdagradParametersOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  effects.emplace_back(::mlir::MemoryEffects::Write::get(), ::mlir::TF::ResourceEffects::MustExecute::get());
  effects.emplace_back(::mlir::MemoryEffects::Read::get(), ::mlir::TF::ResourceEffects::TPUEmbedding::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::LoadTPUEmbeddingAdagradParametersOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::LoadTPUEmbeddingCenteredRMSPropParametersOp definitions
//===----------------------------------------------------------------------===//

LoadTPUEmbeddingCenteredRMSPropParametersOpAdaptor::LoadTPUEmbeddingCenteredRMSPropParametersOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

LoadTPUEmbeddingCenteredRMSPropParametersOpAdaptor::LoadTPUEmbeddingCenteredRMSPropParametersOpAdaptor(LoadTPUEmbeddingCenteredRMSPropParametersOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange LoadTPUEmbeddingCenteredRMSPropParametersOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> LoadTPUEmbeddingCenteredRMSPropParametersOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange LoadTPUEmbeddingCenteredRMSPropParametersOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value LoadTPUEmbeddingCenteredRMSPropParametersOpAdaptor::parameters() {
  return *getODSOperands(0).begin();
}

::mlir::Value LoadTPUEmbeddingCenteredRMSPropParametersOpAdaptor::ms() {
  return *getODSOperands(1).begin();
}

::mlir::Value LoadTPUEmbeddingCenteredRMSPropParametersOpAdaptor::mom() {
  return *getODSOperands(2).begin();
}

::mlir::Value LoadTPUEmbeddingCenteredRMSPropParametersOpAdaptor::mg() {
  return *getODSOperands(3).begin();
}

::mlir::DictionaryAttr LoadTPUEmbeddingCenteredRMSPropParametersOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::IntegerAttr LoadTPUEmbeddingCenteredRMSPropParametersOpAdaptor::table_id() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("table_id").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), -1);
  return attr;
}

::mlir::StringAttr LoadTPUEmbeddingCenteredRMSPropParametersOpAdaptor::table_name() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("table_name").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("");
  return attr;
}

::mlir::IntegerAttr LoadTPUEmbeddingCenteredRMSPropParametersOpAdaptor::num_shards() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("num_shards").cast<::mlir::IntegerAttr>();
  return attr;
}

::mlir::IntegerAttr LoadTPUEmbeddingCenteredRMSPropParametersOpAdaptor::shard_id() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("shard_id").cast<::mlir::IntegerAttr>();
  return attr;
}

::mlir::StringAttr LoadTPUEmbeddingCenteredRMSPropParametersOpAdaptor::config() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("config").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("");
  return attr;
}

::mlir::LogicalResult LoadTPUEmbeddingCenteredRMSPropParametersOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_table_id = odsAttrs.get("table_id");
    if (tblgen_table_id && !(((tblgen_table_id.isa<::mlir::IntegerAttr>())) && ((tblgen_table_id.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.LoadTPUEmbeddingCenteredRMSPropParameters' op ""attribute 'table_id' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_table_name = odsAttrs.get("table_name");
    if (tblgen_table_name && !((tblgen_table_name.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.LoadTPUEmbeddingCenteredRMSPropParameters' op ""attribute 'table_name' failed to satisfy constraint: string attribute");
  }
  {
    auto tblgen_num_shards = odsAttrs.get("num_shards");
    if (!tblgen_num_shards)
      return emitError(loc, "'tf.LoadTPUEmbeddingCenteredRMSPropParameters' op ""requires attribute 'num_shards'");

    if (tblgen_num_shards && !(((tblgen_num_shards.isa<::mlir::IntegerAttr>())) && ((tblgen_num_shards.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.LoadTPUEmbeddingCenteredRMSPropParameters' op ""attribute 'num_shards' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_shard_id = odsAttrs.get("shard_id");
    if (!tblgen_shard_id)
      return emitError(loc, "'tf.LoadTPUEmbeddingCenteredRMSPropParameters' op ""requires attribute 'shard_id'");

    if (tblgen_shard_id && !(((tblgen_shard_id.isa<::mlir::IntegerAttr>())) && ((tblgen_shard_id.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.LoadTPUEmbeddingCenteredRMSPropParameters' op ""attribute 'shard_id' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_config = odsAttrs.get("config");
    if (tblgen_config && !((tblgen_config.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.LoadTPUEmbeddingCenteredRMSPropParameters' op ""attribute 'config' failed to satisfy constraint: string attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> LoadTPUEmbeddingCenteredRMSPropParametersOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range LoadTPUEmbeddingCenteredRMSPropParametersOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value LoadTPUEmbeddingCenteredRMSPropParametersOp::parameters() {
  return *getODSOperands(0).begin();
}

::mlir::Value LoadTPUEmbeddingCenteredRMSPropParametersOp::ms() {
  return *getODSOperands(1).begin();
}

::mlir::Value LoadTPUEmbeddingCenteredRMSPropParametersOp::mom() {
  return *getODSOperands(2).begin();
}

::mlir::Value LoadTPUEmbeddingCenteredRMSPropParametersOp::mg() {
  return *getODSOperands(3).begin();
}

::mlir::MutableOperandRange LoadTPUEmbeddingCenteredRMSPropParametersOp::parametersMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange LoadTPUEmbeddingCenteredRMSPropParametersOp::msMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange LoadTPUEmbeddingCenteredRMSPropParametersOp::momMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange LoadTPUEmbeddingCenteredRMSPropParametersOp::mgMutable() {
  auto range = getODSOperandIndexAndLength(3);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> LoadTPUEmbeddingCenteredRMSPropParametersOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range LoadTPUEmbeddingCenteredRMSPropParametersOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::IntegerAttr LoadTPUEmbeddingCenteredRMSPropParametersOp::table_idAttr() {
  return (*this)->getAttr(table_idAttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t LoadTPUEmbeddingCenteredRMSPropParametersOp::table_id() {
  auto attr = table_idAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), -1).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

::mlir::StringAttr LoadTPUEmbeddingCenteredRMSPropParametersOp::table_nameAttr() {
  return (*this)->getAttr(table_nameAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef LoadTPUEmbeddingCenteredRMSPropParametersOp::table_name() {
  auto attr = table_nameAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("").getValue();
  return attr.getValue();
}

::mlir::IntegerAttr LoadTPUEmbeddingCenteredRMSPropParametersOp::num_shardsAttr() {
  return (*this)->getAttr(num_shardsAttrName()).cast<::mlir::IntegerAttr>();
}

uint64_t LoadTPUEmbeddingCenteredRMSPropParametersOp::num_shards() {
  auto attr = num_shardsAttr();
  return attr.getValue().getZExtValue();
}

::mlir::IntegerAttr LoadTPUEmbeddingCenteredRMSPropParametersOp::shard_idAttr() {
  return (*this)->getAttr(shard_idAttrName()).cast<::mlir::IntegerAttr>();
}

uint64_t LoadTPUEmbeddingCenteredRMSPropParametersOp::shard_id() {
  auto attr = shard_idAttr();
  return attr.getValue().getZExtValue();
}

::mlir::StringAttr LoadTPUEmbeddingCenteredRMSPropParametersOp::configAttr() {
  return (*this)->getAttr(configAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef LoadTPUEmbeddingCenteredRMSPropParametersOp::config() {
  auto attr = configAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("").getValue();
  return attr.getValue();
}

void LoadTPUEmbeddingCenteredRMSPropParametersOp::table_idAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(table_idAttrName(), attr);
}

void LoadTPUEmbeddingCenteredRMSPropParametersOp::table_nameAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(table_nameAttrName(), attr);
}

void LoadTPUEmbeddingCenteredRMSPropParametersOp::num_shardsAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(num_shardsAttrName(), attr);
}

void LoadTPUEmbeddingCenteredRMSPropParametersOp::shard_idAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(shard_idAttrName(), attr);
}

void LoadTPUEmbeddingCenteredRMSPropParametersOp::configAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(configAttrName(), attr);
}

void LoadTPUEmbeddingCenteredRMSPropParametersOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value parameters, ::mlir::Value ms, ::mlir::Value mom, ::mlir::Value mg, ::mlir::IntegerAttr table_id, ::mlir::StringAttr table_name, ::mlir::IntegerAttr num_shards, ::mlir::IntegerAttr shard_id, ::mlir::StringAttr config) {
  odsState.addOperands(parameters);
  odsState.addOperands(ms);
  odsState.addOperands(mom);
  odsState.addOperands(mg);
  odsState.addAttribute(table_idAttrName(odsState.name), table_id);
  odsState.addAttribute(table_nameAttrName(odsState.name), table_name);
  odsState.addAttribute(num_shardsAttrName(odsState.name), num_shards);
  odsState.addAttribute(shard_idAttrName(odsState.name), shard_id);
  odsState.addAttribute(configAttrName(odsState.name), config);
}

void LoadTPUEmbeddingCenteredRMSPropParametersOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value parameters, ::mlir::Value ms, ::mlir::Value mom, ::mlir::Value mg, ::mlir::IntegerAttr table_id, ::mlir::StringAttr table_name, ::mlir::IntegerAttr num_shards, ::mlir::IntegerAttr shard_id, ::mlir::StringAttr config) {
  odsState.addOperands(parameters);
  odsState.addOperands(ms);
  odsState.addOperands(mom);
  odsState.addOperands(mg);
  odsState.addAttribute(table_idAttrName(odsState.name), table_id);
  odsState.addAttribute(table_nameAttrName(odsState.name), table_name);
  odsState.addAttribute(num_shardsAttrName(odsState.name), num_shards);
  odsState.addAttribute(shard_idAttrName(odsState.name), shard_id);
  odsState.addAttribute(configAttrName(odsState.name), config);
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void LoadTPUEmbeddingCenteredRMSPropParametersOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value parameters, ::mlir::Value ms, ::mlir::Value mom, ::mlir::Value mg, uint64_t table_id, ::llvm::StringRef table_name, uint64_t num_shards, uint64_t shard_id, ::llvm::StringRef config) {
  odsState.addOperands(parameters);
  odsState.addOperands(ms);
  odsState.addOperands(mom);
  odsState.addOperands(mg);
  odsState.addAttribute(table_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), table_id));
  odsState.addAttribute(table_nameAttrName(odsState.name), odsBuilder.getStringAttr(table_name));
  odsState.addAttribute(num_shardsAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), num_shards));
  odsState.addAttribute(shard_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), shard_id));
  odsState.addAttribute(configAttrName(odsState.name), odsBuilder.getStringAttr(config));
}

void LoadTPUEmbeddingCenteredRMSPropParametersOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value parameters, ::mlir::Value ms, ::mlir::Value mom, ::mlir::Value mg, uint64_t table_id, ::llvm::StringRef table_name, uint64_t num_shards, uint64_t shard_id, ::llvm::StringRef config) {
  odsState.addOperands(parameters);
  odsState.addOperands(ms);
  odsState.addOperands(mom);
  odsState.addOperands(mg);
  odsState.addAttribute(table_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), table_id));
  odsState.addAttribute(table_nameAttrName(odsState.name), odsBuilder.getStringAttr(table_name));
  odsState.addAttribute(num_shardsAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), num_shards));
  odsState.addAttribute(shard_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), shard_id));
  odsState.addAttribute(configAttrName(odsState.name), odsBuilder.getStringAttr(config));
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void LoadTPUEmbeddingCenteredRMSPropParametersOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 4u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 0u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult LoadTPUEmbeddingCenteredRMSPropParametersOp::verify() {
  {
    auto tblgen_table_id = (*this)->getAttr(table_idAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_table_id, "table_id")))
      return ::mlir::failure();
  }
  {
    auto tblgen_table_name = (*this)->getAttr(table_nameAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_table_name, "table_name")))
      return ::mlir::failure();
  }
  {
    auto tblgen_num_shards = (*this)->getAttr(num_shardsAttrName());
    if (!tblgen_num_shards)
      return emitOpError("requires attribute 'num_shards'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_num_shards, "num_shards")))
      return ::mlir::failure();
  }
  {
    auto tblgen_shard_id = (*this)->getAttr(shard_idAttrName());
    if (!tblgen_shard_id)
      return emitOpError("requires attribute 'shard_id'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_shard_id, "shard_id")))
      return ::mlir::failure();
  }
  {
    auto tblgen_config = (*this)->getAttr(configAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_config, "config")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup3 = getODSOperands(3);

    for (auto v : valueGroup3) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void LoadTPUEmbeddingCenteredRMSPropParametersOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  effects.emplace_back(::mlir::MemoryEffects::Write::get(), ::mlir::TF::ResourceEffects::MustExecute::get());
  effects.emplace_back(::mlir::MemoryEffects::Read::get(), ::mlir::TF::ResourceEffects::TPUEmbedding::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::LoadTPUEmbeddingCenteredRMSPropParametersOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::LoadTPUEmbeddingFTRLParametersGradAccumDebugOp definitions
//===----------------------------------------------------------------------===//

LoadTPUEmbeddingFTRLParametersGradAccumDebugOpAdaptor::LoadTPUEmbeddingFTRLParametersGradAccumDebugOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

LoadTPUEmbeddingFTRLParametersGradAccumDebugOpAdaptor::LoadTPUEmbeddingFTRLParametersGradAccumDebugOpAdaptor(LoadTPUEmbeddingFTRLParametersGradAccumDebugOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange LoadTPUEmbeddingFTRLParametersGradAccumDebugOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> LoadTPUEmbeddingFTRLParametersGradAccumDebugOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange LoadTPUEmbeddingFTRLParametersGradAccumDebugOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value LoadTPUEmbeddingFTRLParametersGradAccumDebugOpAdaptor::parameters() {
  return *getODSOperands(0).begin();
}

::mlir::Value LoadTPUEmbeddingFTRLParametersGradAccumDebugOpAdaptor::accumulators() {
  return *getODSOperands(1).begin();
}

::mlir::Value LoadTPUEmbeddingFTRLParametersGradAccumDebugOpAdaptor::linears() {
  return *getODSOperands(2).begin();
}

::mlir::Value LoadTPUEmbeddingFTRLParametersGradAccumDebugOpAdaptor::gradient_accumulators() {
  return *getODSOperands(3).begin();
}

::mlir::DictionaryAttr LoadTPUEmbeddingFTRLParametersGradAccumDebugOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::IntegerAttr LoadTPUEmbeddingFTRLParametersGradAccumDebugOpAdaptor::table_id() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("table_id").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), -1);
  return attr;
}

::mlir::StringAttr LoadTPUEmbeddingFTRLParametersGradAccumDebugOpAdaptor::table_name() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("table_name").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("");
  return attr;
}

::mlir::IntegerAttr LoadTPUEmbeddingFTRLParametersGradAccumDebugOpAdaptor::num_shards() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("num_shards").cast<::mlir::IntegerAttr>();
  return attr;
}

::mlir::IntegerAttr LoadTPUEmbeddingFTRLParametersGradAccumDebugOpAdaptor::shard_id() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("shard_id").cast<::mlir::IntegerAttr>();
  return attr;
}

::mlir::StringAttr LoadTPUEmbeddingFTRLParametersGradAccumDebugOpAdaptor::config() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("config").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("");
  return attr;
}

::mlir::LogicalResult LoadTPUEmbeddingFTRLParametersGradAccumDebugOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_table_id = odsAttrs.get("table_id");
    if (tblgen_table_id && !(((tblgen_table_id.isa<::mlir::IntegerAttr>())) && ((tblgen_table_id.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.LoadTPUEmbeddingFTRLParametersGradAccumDebug' op ""attribute 'table_id' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_table_name = odsAttrs.get("table_name");
    if (tblgen_table_name && !((tblgen_table_name.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.LoadTPUEmbeddingFTRLParametersGradAccumDebug' op ""attribute 'table_name' failed to satisfy constraint: string attribute");
  }
  {
    auto tblgen_num_shards = odsAttrs.get("num_shards");
    if (!tblgen_num_shards)
      return emitError(loc, "'tf.LoadTPUEmbeddingFTRLParametersGradAccumDebug' op ""requires attribute 'num_shards'");

    if (tblgen_num_shards && !(((tblgen_num_shards.isa<::mlir::IntegerAttr>())) && ((tblgen_num_shards.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.LoadTPUEmbeddingFTRLParametersGradAccumDebug' op ""attribute 'num_shards' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_shard_id = odsAttrs.get("shard_id");
    if (!tblgen_shard_id)
      return emitError(loc, "'tf.LoadTPUEmbeddingFTRLParametersGradAccumDebug' op ""requires attribute 'shard_id'");

    if (tblgen_shard_id && !(((tblgen_shard_id.isa<::mlir::IntegerAttr>())) && ((tblgen_shard_id.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.LoadTPUEmbeddingFTRLParametersGradAccumDebug' op ""attribute 'shard_id' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_config = odsAttrs.get("config");
    if (tblgen_config && !((tblgen_config.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.LoadTPUEmbeddingFTRLParametersGradAccumDebug' op ""attribute 'config' failed to satisfy constraint: string attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> LoadTPUEmbeddingFTRLParametersGradAccumDebugOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range LoadTPUEmbeddingFTRLParametersGradAccumDebugOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value LoadTPUEmbeddingFTRLParametersGradAccumDebugOp::parameters() {
  return *getODSOperands(0).begin();
}

::mlir::Value LoadTPUEmbeddingFTRLParametersGradAccumDebugOp::accumulators() {
  return *getODSOperands(1).begin();
}

::mlir::Value LoadTPUEmbeddingFTRLParametersGradAccumDebugOp::linears() {
  return *getODSOperands(2).begin();
}

::mlir::Value LoadTPUEmbeddingFTRLParametersGradAccumDebugOp::gradient_accumulators() {
  return *getODSOperands(3).begin();
}

::mlir::MutableOperandRange LoadTPUEmbeddingFTRLParametersGradAccumDebugOp::parametersMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange LoadTPUEmbeddingFTRLParametersGradAccumDebugOp::accumulatorsMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange LoadTPUEmbeddingFTRLParametersGradAccumDebugOp::linearsMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange LoadTPUEmbeddingFTRLParametersGradAccumDebugOp::gradient_accumulatorsMutable() {
  auto range = getODSOperandIndexAndLength(3);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> LoadTPUEmbeddingFTRLParametersGradAccumDebugOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range LoadTPUEmbeddingFTRLParametersGradAccumDebugOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::IntegerAttr LoadTPUEmbeddingFTRLParametersGradAccumDebugOp::table_idAttr() {
  return (*this)->getAttr(table_idAttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t LoadTPUEmbeddingFTRLParametersGradAccumDebugOp::table_id() {
  auto attr = table_idAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), -1).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

::mlir::StringAttr LoadTPUEmbeddingFTRLParametersGradAccumDebugOp::table_nameAttr() {
  return (*this)->getAttr(table_nameAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef LoadTPUEmbeddingFTRLParametersGradAccumDebugOp::table_name() {
  auto attr = table_nameAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("").getValue();
  return attr.getValue();
}

::mlir::IntegerAttr LoadTPUEmbeddingFTRLParametersGradAccumDebugOp::num_shardsAttr() {
  return (*this)->getAttr(num_shardsAttrName()).cast<::mlir::IntegerAttr>();
}

uint64_t LoadTPUEmbeddingFTRLParametersGradAccumDebugOp::num_shards() {
  auto attr = num_shardsAttr();
  return attr.getValue().getZExtValue();
}

::mlir::IntegerAttr LoadTPUEmbeddingFTRLParametersGradAccumDebugOp::shard_idAttr() {
  return (*this)->getAttr(shard_idAttrName()).cast<::mlir::IntegerAttr>();
}

uint64_t LoadTPUEmbeddingFTRLParametersGradAccumDebugOp::shard_id() {
  auto attr = shard_idAttr();
  return attr.getValue().getZExtValue();
}

::mlir::StringAttr LoadTPUEmbeddingFTRLParametersGradAccumDebugOp::configAttr() {
  return (*this)->getAttr(configAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef LoadTPUEmbeddingFTRLParametersGradAccumDebugOp::config() {
  auto attr = configAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("").getValue();
  return attr.getValue();
}

void LoadTPUEmbeddingFTRLParametersGradAccumDebugOp::table_idAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(table_idAttrName(), attr);
}

void LoadTPUEmbeddingFTRLParametersGradAccumDebugOp::table_nameAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(table_nameAttrName(), attr);
}

void LoadTPUEmbeddingFTRLParametersGradAccumDebugOp::num_shardsAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(num_shardsAttrName(), attr);
}

void LoadTPUEmbeddingFTRLParametersGradAccumDebugOp::shard_idAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(shard_idAttrName(), attr);
}

void LoadTPUEmbeddingFTRLParametersGradAccumDebugOp::configAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(configAttrName(), attr);
}

void LoadTPUEmbeddingFTRLParametersGradAccumDebugOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value parameters, ::mlir::Value accumulators, ::mlir::Value linears, ::mlir::Value gradient_accumulators, ::mlir::IntegerAttr table_id, ::mlir::StringAttr table_name, ::mlir::IntegerAttr num_shards, ::mlir::IntegerAttr shard_id, ::mlir::StringAttr config) {
  odsState.addOperands(parameters);
  odsState.addOperands(accumulators);
  odsState.addOperands(linears);
  odsState.addOperands(gradient_accumulators);
  odsState.addAttribute(table_idAttrName(odsState.name), table_id);
  odsState.addAttribute(table_nameAttrName(odsState.name), table_name);
  odsState.addAttribute(num_shardsAttrName(odsState.name), num_shards);
  odsState.addAttribute(shard_idAttrName(odsState.name), shard_id);
  odsState.addAttribute(configAttrName(odsState.name), config);
}

void LoadTPUEmbeddingFTRLParametersGradAccumDebugOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value parameters, ::mlir::Value accumulators, ::mlir::Value linears, ::mlir::Value gradient_accumulators, ::mlir::IntegerAttr table_id, ::mlir::StringAttr table_name, ::mlir::IntegerAttr num_shards, ::mlir::IntegerAttr shard_id, ::mlir::StringAttr config) {
  odsState.addOperands(parameters);
  odsState.addOperands(accumulators);
  odsState.addOperands(linears);
  odsState.addOperands(gradient_accumulators);
  odsState.addAttribute(table_idAttrName(odsState.name), table_id);
  odsState.addAttribute(table_nameAttrName(odsState.name), table_name);
  odsState.addAttribute(num_shardsAttrName(odsState.name), num_shards);
  odsState.addAttribute(shard_idAttrName(odsState.name), shard_id);
  odsState.addAttribute(configAttrName(odsState.name), config);
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void LoadTPUEmbeddingFTRLParametersGradAccumDebugOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value parameters, ::mlir::Value accumulators, ::mlir::Value linears, ::mlir::Value gradient_accumulators, uint64_t table_id, ::llvm::StringRef table_name, uint64_t num_shards, uint64_t shard_id, ::llvm::StringRef config) {
  odsState.addOperands(parameters);
  odsState.addOperands(accumulators);
  odsState.addOperands(linears);
  odsState.addOperands(gradient_accumulators);
  odsState.addAttribute(table_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), table_id));
  odsState.addAttribute(table_nameAttrName(odsState.name), odsBuilder.getStringAttr(table_name));
  odsState.addAttribute(num_shardsAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), num_shards));
  odsState.addAttribute(shard_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), shard_id));
  odsState.addAttribute(configAttrName(odsState.name), odsBuilder.getStringAttr(config));
}

void LoadTPUEmbeddingFTRLParametersGradAccumDebugOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value parameters, ::mlir::Value accumulators, ::mlir::Value linears, ::mlir::Value gradient_accumulators, uint64_t table_id, ::llvm::StringRef table_name, uint64_t num_shards, uint64_t shard_id, ::llvm::StringRef config) {
  odsState.addOperands(parameters);
  odsState.addOperands(accumulators);
  odsState.addOperands(linears);
  odsState.addOperands(gradient_accumulators);
  odsState.addAttribute(table_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), table_id));
  odsState.addAttribute(table_nameAttrName(odsState.name), odsBuilder.getStringAttr(table_name));
  odsState.addAttribute(num_shardsAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), num_shards));
  odsState.addAttribute(shard_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), shard_id));
  odsState.addAttribute(configAttrName(odsState.name), odsBuilder.getStringAttr(config));
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void LoadTPUEmbeddingFTRLParametersGradAccumDebugOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 4u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 0u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult LoadTPUEmbeddingFTRLParametersGradAccumDebugOp::verify() {
  {
    auto tblgen_table_id = (*this)->getAttr(table_idAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_table_id, "table_id")))
      return ::mlir::failure();
  }
  {
    auto tblgen_table_name = (*this)->getAttr(table_nameAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_table_name, "table_name")))
      return ::mlir::failure();
  }
  {
    auto tblgen_num_shards = (*this)->getAttr(num_shardsAttrName());
    if (!tblgen_num_shards)
      return emitOpError("requires attribute 'num_shards'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_num_shards, "num_shards")))
      return ::mlir::failure();
  }
  {
    auto tblgen_shard_id = (*this)->getAttr(shard_idAttrName());
    if (!tblgen_shard_id)
      return emitOpError("requires attribute 'shard_id'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_shard_id, "shard_id")))
      return ::mlir::failure();
  }
  {
    auto tblgen_config = (*this)->getAttr(configAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_config, "config")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup3 = getODSOperands(3);

    for (auto v : valueGroup3) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void LoadTPUEmbeddingFTRLParametersGradAccumDebugOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  effects.emplace_back(::mlir::MemoryEffects::Write::get(), ::mlir::TF::ResourceEffects::MustExecute::get());
  effects.emplace_back(::mlir::MemoryEffects::Read::get(), ::mlir::TF::ResourceEffects::TPUEmbedding::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::LoadTPUEmbeddingFTRLParametersGradAccumDebugOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::LoadTPUEmbeddingFTRLParametersOp definitions
//===----------------------------------------------------------------------===//

LoadTPUEmbeddingFTRLParametersOpAdaptor::LoadTPUEmbeddingFTRLParametersOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

LoadTPUEmbeddingFTRLParametersOpAdaptor::LoadTPUEmbeddingFTRLParametersOpAdaptor(LoadTPUEmbeddingFTRLParametersOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange LoadTPUEmbeddingFTRLParametersOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> LoadTPUEmbeddingFTRLParametersOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange LoadTPUEmbeddingFTRLParametersOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value LoadTPUEmbeddingFTRLParametersOpAdaptor::parameters() {
  return *getODSOperands(0).begin();
}

::mlir::Value LoadTPUEmbeddingFTRLParametersOpAdaptor::accumulators() {
  return *getODSOperands(1).begin();
}

::mlir::Value LoadTPUEmbeddingFTRLParametersOpAdaptor::linears() {
  return *getODSOperands(2).begin();
}

::mlir::DictionaryAttr LoadTPUEmbeddingFTRLParametersOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::IntegerAttr LoadTPUEmbeddingFTRLParametersOpAdaptor::table_id() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("table_id").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), -1);
  return attr;
}

::mlir::StringAttr LoadTPUEmbeddingFTRLParametersOpAdaptor::table_name() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("table_name").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("");
  return attr;
}

::mlir::IntegerAttr LoadTPUEmbeddingFTRLParametersOpAdaptor::num_shards() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("num_shards").cast<::mlir::IntegerAttr>();
  return attr;
}

::mlir::IntegerAttr LoadTPUEmbeddingFTRLParametersOpAdaptor::shard_id() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("shard_id").cast<::mlir::IntegerAttr>();
  return attr;
}

::mlir::StringAttr LoadTPUEmbeddingFTRLParametersOpAdaptor::config() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("config").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("");
  return attr;
}

::mlir::LogicalResult LoadTPUEmbeddingFTRLParametersOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_table_id = odsAttrs.get("table_id");
    if (tblgen_table_id && !(((tblgen_table_id.isa<::mlir::IntegerAttr>())) && ((tblgen_table_id.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.LoadTPUEmbeddingFTRLParameters' op ""attribute 'table_id' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_table_name = odsAttrs.get("table_name");
    if (tblgen_table_name && !((tblgen_table_name.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.LoadTPUEmbeddingFTRLParameters' op ""attribute 'table_name' failed to satisfy constraint: string attribute");
  }
  {
    auto tblgen_num_shards = odsAttrs.get("num_shards");
    if (!tblgen_num_shards)
      return emitError(loc, "'tf.LoadTPUEmbeddingFTRLParameters' op ""requires attribute 'num_shards'");

    if (tblgen_num_shards && !(((tblgen_num_shards.isa<::mlir::IntegerAttr>())) && ((tblgen_num_shards.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.LoadTPUEmbeddingFTRLParameters' op ""attribute 'num_shards' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_shard_id = odsAttrs.get("shard_id");
    if (!tblgen_shard_id)
      return emitError(loc, "'tf.LoadTPUEmbeddingFTRLParameters' op ""requires attribute 'shard_id'");

    if (tblgen_shard_id && !(((tblgen_shard_id.isa<::mlir::IntegerAttr>())) && ((tblgen_shard_id.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.LoadTPUEmbeddingFTRLParameters' op ""attribute 'shard_id' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_config = odsAttrs.get("config");
    if (tblgen_config && !((tblgen_config.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.LoadTPUEmbeddingFTRLParameters' op ""attribute 'config' failed to satisfy constraint: string attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> LoadTPUEmbeddingFTRLParametersOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range LoadTPUEmbeddingFTRLParametersOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value LoadTPUEmbeddingFTRLParametersOp::parameters() {
  return *getODSOperands(0).begin();
}

::mlir::Value LoadTPUEmbeddingFTRLParametersOp::accumulators() {
  return *getODSOperands(1).begin();
}

::mlir::Value LoadTPUEmbeddingFTRLParametersOp::linears() {
  return *getODSOperands(2).begin();
}

::mlir::MutableOperandRange LoadTPUEmbeddingFTRLParametersOp::parametersMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange LoadTPUEmbeddingFTRLParametersOp::accumulatorsMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange LoadTPUEmbeddingFTRLParametersOp::linearsMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> LoadTPUEmbeddingFTRLParametersOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range LoadTPUEmbeddingFTRLParametersOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::IntegerAttr LoadTPUEmbeddingFTRLParametersOp::table_idAttr() {
  return (*this)->getAttr(table_idAttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t LoadTPUEmbeddingFTRLParametersOp::table_id() {
  auto attr = table_idAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), -1).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

::mlir::StringAttr LoadTPUEmbeddingFTRLParametersOp::table_nameAttr() {
  return (*this)->getAttr(table_nameAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef LoadTPUEmbeddingFTRLParametersOp::table_name() {
  auto attr = table_nameAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("").getValue();
  return attr.getValue();
}

::mlir::IntegerAttr LoadTPUEmbeddingFTRLParametersOp::num_shardsAttr() {
  return (*this)->getAttr(num_shardsAttrName()).cast<::mlir::IntegerAttr>();
}

uint64_t LoadTPUEmbeddingFTRLParametersOp::num_shards() {
  auto attr = num_shardsAttr();
  return attr.getValue().getZExtValue();
}

::mlir::IntegerAttr LoadTPUEmbeddingFTRLParametersOp::shard_idAttr() {
  return (*this)->getAttr(shard_idAttrName()).cast<::mlir::IntegerAttr>();
}

uint64_t LoadTPUEmbeddingFTRLParametersOp::shard_id() {
  auto attr = shard_idAttr();
  return attr.getValue().getZExtValue();
}

::mlir::StringAttr LoadTPUEmbeddingFTRLParametersOp::configAttr() {
  return (*this)->getAttr(configAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef LoadTPUEmbeddingFTRLParametersOp::config() {
  auto attr = configAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("").getValue();
  return attr.getValue();
}

void LoadTPUEmbeddingFTRLParametersOp::table_idAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(table_idAttrName(), attr);
}

void LoadTPUEmbeddingFTRLParametersOp::table_nameAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(table_nameAttrName(), attr);
}

void LoadTPUEmbeddingFTRLParametersOp::num_shardsAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(num_shardsAttrName(), attr);
}

void LoadTPUEmbeddingFTRLParametersOp::shard_idAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(shard_idAttrName(), attr);
}

void LoadTPUEmbeddingFTRLParametersOp::configAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(configAttrName(), attr);
}

void LoadTPUEmbeddingFTRLParametersOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value parameters, ::mlir::Value accumulators, ::mlir::Value linears, ::mlir::IntegerAttr table_id, ::mlir::StringAttr table_name, ::mlir::IntegerAttr num_shards, ::mlir::IntegerAttr shard_id, ::mlir::StringAttr config) {
  odsState.addOperands(parameters);
  odsState.addOperands(accumulators);
  odsState.addOperands(linears);
  odsState.addAttribute(table_idAttrName(odsState.name), table_id);
  odsState.addAttribute(table_nameAttrName(odsState.name), table_name);
  odsState.addAttribute(num_shardsAttrName(odsState.name), num_shards);
  odsState.addAttribute(shard_idAttrName(odsState.name), shard_id);
  odsState.addAttribute(configAttrName(odsState.name), config);
}

void LoadTPUEmbeddingFTRLParametersOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value parameters, ::mlir::Value accumulators, ::mlir::Value linears, ::mlir::IntegerAttr table_id, ::mlir::StringAttr table_name, ::mlir::IntegerAttr num_shards, ::mlir::IntegerAttr shard_id, ::mlir::StringAttr config) {
  odsState.addOperands(parameters);
  odsState.addOperands(accumulators);
  odsState.addOperands(linears);
  odsState.addAttribute(table_idAttrName(odsState.name), table_id);
  odsState.addAttribute(table_nameAttrName(odsState.name), table_name);
  odsState.addAttribute(num_shardsAttrName(odsState.name), num_shards);
  odsState.addAttribute(shard_idAttrName(odsState.name), shard_id);
  odsState.addAttribute(configAttrName(odsState.name), config);
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void LoadTPUEmbeddingFTRLParametersOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value parameters, ::mlir::Value accumulators, ::mlir::Value linears, uint64_t table_id, ::llvm::StringRef table_name, uint64_t num_shards, uint64_t shard_id, ::llvm::StringRef config) {
  odsState.addOperands(parameters);
  odsState.addOperands(accumulators);
  odsState.addOperands(linears);
  odsState.addAttribute(table_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), table_id));
  odsState.addAttribute(table_nameAttrName(odsState.name), odsBuilder.getStringAttr(table_name));
  odsState.addAttribute(num_shardsAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), num_shards));
  odsState.addAttribute(shard_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), shard_id));
  odsState.addAttribute(configAttrName(odsState.name), odsBuilder.getStringAttr(config));
}

void LoadTPUEmbeddingFTRLParametersOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value parameters, ::mlir::Value accumulators, ::mlir::Value linears, uint64_t table_id, ::llvm::StringRef table_name, uint64_t num_shards, uint64_t shard_id, ::llvm::StringRef config) {
  odsState.addOperands(parameters);
  odsState.addOperands(accumulators);
  odsState.addOperands(linears);
  odsState.addAttribute(table_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), table_id));
  odsState.addAttribute(table_nameAttrName(odsState.name), odsBuilder.getStringAttr(table_name));
  odsState.addAttribute(num_shardsAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), num_shards));
  odsState.addAttribute(shard_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), shard_id));
  odsState.addAttribute(configAttrName(odsState.name), odsBuilder.getStringAttr(config));
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void LoadTPUEmbeddingFTRLParametersOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 3u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 0u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult LoadTPUEmbeddingFTRLParametersOp::verify() {
  {
    auto tblgen_table_id = (*this)->getAttr(table_idAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_table_id, "table_id")))
      return ::mlir::failure();
  }
  {
    auto tblgen_table_name = (*this)->getAttr(table_nameAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_table_name, "table_name")))
      return ::mlir::failure();
  }
  {
    auto tblgen_num_shards = (*this)->getAttr(num_shardsAttrName());
    if (!tblgen_num_shards)
      return emitOpError("requires attribute 'num_shards'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_num_shards, "num_shards")))
      return ::mlir::failure();
  }
  {
    auto tblgen_shard_id = (*this)->getAttr(shard_idAttrName());
    if (!tblgen_shard_id)
      return emitOpError("requires attribute 'shard_id'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_shard_id, "shard_id")))
      return ::mlir::failure();
  }
  {
    auto tblgen_config = (*this)->getAttr(configAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_config, "config")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void LoadTPUEmbeddingFTRLParametersOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  effects.emplace_back(::mlir::MemoryEffects::Write::get(), ::mlir::TF::ResourceEffects::MustExecute::get());
  effects.emplace_back(::mlir::MemoryEffects::Read::get(), ::mlir::TF::ResourceEffects::TPUEmbedding::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::LoadTPUEmbeddingFTRLParametersOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::LoadTPUEmbeddingMDLAdagradLightParametersOp definitions
//===----------------------------------------------------------------------===//

LoadTPUEmbeddingMDLAdagradLightParametersOpAdaptor::LoadTPUEmbeddingMDLAdagradLightParametersOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

LoadTPUEmbeddingMDLAdagradLightParametersOpAdaptor::LoadTPUEmbeddingMDLAdagradLightParametersOpAdaptor(LoadTPUEmbeddingMDLAdagradLightParametersOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange LoadTPUEmbeddingMDLAdagradLightParametersOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> LoadTPUEmbeddingMDLAdagradLightParametersOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange LoadTPUEmbeddingMDLAdagradLightParametersOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value LoadTPUEmbeddingMDLAdagradLightParametersOpAdaptor::parameters() {
  return *getODSOperands(0).begin();
}

::mlir::Value LoadTPUEmbeddingMDLAdagradLightParametersOpAdaptor::accumulators() {
  return *getODSOperands(1).begin();
}

::mlir::Value LoadTPUEmbeddingMDLAdagradLightParametersOpAdaptor::weights() {
  return *getODSOperands(2).begin();
}

::mlir::Value LoadTPUEmbeddingMDLAdagradLightParametersOpAdaptor::benefits() {
  return *getODSOperands(3).begin();
}

::mlir::DictionaryAttr LoadTPUEmbeddingMDLAdagradLightParametersOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::IntegerAttr LoadTPUEmbeddingMDLAdagradLightParametersOpAdaptor::table_id() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("table_id").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), -1);
  return attr;
}

::mlir::StringAttr LoadTPUEmbeddingMDLAdagradLightParametersOpAdaptor::table_name() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("table_name").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("");
  return attr;
}

::mlir::IntegerAttr LoadTPUEmbeddingMDLAdagradLightParametersOpAdaptor::num_shards() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("num_shards").cast<::mlir::IntegerAttr>();
  return attr;
}

::mlir::IntegerAttr LoadTPUEmbeddingMDLAdagradLightParametersOpAdaptor::shard_id() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("shard_id").cast<::mlir::IntegerAttr>();
  return attr;
}

::mlir::StringAttr LoadTPUEmbeddingMDLAdagradLightParametersOpAdaptor::config() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("config").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("");
  return attr;
}

::mlir::LogicalResult LoadTPUEmbeddingMDLAdagradLightParametersOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_table_id = odsAttrs.get("table_id");
    if (tblgen_table_id && !(((tblgen_table_id.isa<::mlir::IntegerAttr>())) && ((tblgen_table_id.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.LoadTPUEmbeddingMDLAdagradLightParameters' op ""attribute 'table_id' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_table_name = odsAttrs.get("table_name");
    if (tblgen_table_name && !((tblgen_table_name.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.LoadTPUEmbeddingMDLAdagradLightParameters' op ""attribute 'table_name' failed to satisfy constraint: string attribute");
  }
  {
    auto tblgen_num_shards = odsAttrs.get("num_shards");
    if (!tblgen_num_shards)
      return emitError(loc, "'tf.LoadTPUEmbeddingMDLAdagradLightParameters' op ""requires attribute 'num_shards'");

    if (tblgen_num_shards && !(((tblgen_num_shards.isa<::mlir::IntegerAttr>())) && ((tblgen_num_shards.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.LoadTPUEmbeddingMDLAdagradLightParameters' op ""attribute 'num_shards' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_shard_id = odsAttrs.get("shard_id");
    if (!tblgen_shard_id)
      return emitError(loc, "'tf.LoadTPUEmbeddingMDLAdagradLightParameters' op ""requires attribute 'shard_id'");

    if (tblgen_shard_id && !(((tblgen_shard_id.isa<::mlir::IntegerAttr>())) && ((tblgen_shard_id.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.LoadTPUEmbeddingMDLAdagradLightParameters' op ""attribute 'shard_id' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_config = odsAttrs.get("config");
    if (tblgen_config && !((tblgen_config.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.LoadTPUEmbeddingMDLAdagradLightParameters' op ""attribute 'config' failed to satisfy constraint: string attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> LoadTPUEmbeddingMDLAdagradLightParametersOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range LoadTPUEmbeddingMDLAdagradLightParametersOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value LoadTPUEmbeddingMDLAdagradLightParametersOp::parameters() {
  return *getODSOperands(0).begin();
}

::mlir::Value LoadTPUEmbeddingMDLAdagradLightParametersOp::accumulators() {
  return *getODSOperands(1).begin();
}

::mlir::Value LoadTPUEmbeddingMDLAdagradLightParametersOp::weights() {
  return *getODSOperands(2).begin();
}

::mlir::Value LoadTPUEmbeddingMDLAdagradLightParametersOp::benefits() {
  return *getODSOperands(3).begin();
}

::mlir::MutableOperandRange LoadTPUEmbeddingMDLAdagradLightParametersOp::parametersMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange LoadTPUEmbeddingMDLAdagradLightParametersOp::accumulatorsMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange LoadTPUEmbeddingMDLAdagradLightParametersOp::weightsMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange LoadTPUEmbeddingMDLAdagradLightParametersOp::benefitsMutable() {
  auto range = getODSOperandIndexAndLength(3);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> LoadTPUEmbeddingMDLAdagradLightParametersOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range LoadTPUEmbeddingMDLAdagradLightParametersOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::IntegerAttr LoadTPUEmbeddingMDLAdagradLightParametersOp::table_idAttr() {
  return (*this)->getAttr(table_idAttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t LoadTPUEmbeddingMDLAdagradLightParametersOp::table_id() {
  auto attr = table_idAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), -1).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

::mlir::StringAttr LoadTPUEmbeddingMDLAdagradLightParametersOp::table_nameAttr() {
  return (*this)->getAttr(table_nameAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef LoadTPUEmbeddingMDLAdagradLightParametersOp::table_name() {
  auto attr = table_nameAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("").getValue();
  return attr.getValue();
}

::mlir::IntegerAttr LoadTPUEmbeddingMDLAdagradLightParametersOp::num_shardsAttr() {
  return (*this)->getAttr(num_shardsAttrName()).cast<::mlir::IntegerAttr>();
}

uint64_t LoadTPUEmbeddingMDLAdagradLightParametersOp::num_shards() {
  auto attr = num_shardsAttr();
  return attr.getValue().getZExtValue();
}

::mlir::IntegerAttr LoadTPUEmbeddingMDLAdagradLightParametersOp::shard_idAttr() {
  return (*this)->getAttr(shard_idAttrName()).cast<::mlir::IntegerAttr>();
}

uint64_t LoadTPUEmbeddingMDLAdagradLightParametersOp::shard_id() {
  auto attr = shard_idAttr();
  return attr.getValue().getZExtValue();
}

::mlir::StringAttr LoadTPUEmbeddingMDLAdagradLightParametersOp::configAttr() {
  return (*this)->getAttr(configAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef LoadTPUEmbeddingMDLAdagradLightParametersOp::config() {
  auto attr = configAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("").getValue();
  return attr.getValue();
}

void LoadTPUEmbeddingMDLAdagradLightParametersOp::table_idAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(table_idAttrName(), attr);
}

void LoadTPUEmbeddingMDLAdagradLightParametersOp::table_nameAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(table_nameAttrName(), attr);
}

void LoadTPUEmbeddingMDLAdagradLightParametersOp::num_shardsAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(num_shardsAttrName(), attr);
}

void LoadTPUEmbeddingMDLAdagradLightParametersOp::shard_idAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(shard_idAttrName(), attr);
}

void LoadTPUEmbeddingMDLAdagradLightParametersOp::configAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(configAttrName(), attr);
}

void LoadTPUEmbeddingMDLAdagradLightParametersOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value parameters, ::mlir::Value accumulators, ::mlir::Value weights, ::mlir::Value benefits, ::mlir::IntegerAttr table_id, ::mlir::StringAttr table_name, ::mlir::IntegerAttr num_shards, ::mlir::IntegerAttr shard_id, ::mlir::StringAttr config) {
  odsState.addOperands(parameters);
  odsState.addOperands(accumulators);
  odsState.addOperands(weights);
  odsState.addOperands(benefits);
  odsState.addAttribute(table_idAttrName(odsState.name), table_id);
  odsState.addAttribute(table_nameAttrName(odsState.name), table_name);
  odsState.addAttribute(num_shardsAttrName(odsState.name), num_shards);
  odsState.addAttribute(shard_idAttrName(odsState.name), shard_id);
  odsState.addAttribute(configAttrName(odsState.name), config);
}

void LoadTPUEmbeddingMDLAdagradLightParametersOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value parameters, ::mlir::Value accumulators, ::mlir::Value weights, ::mlir::Value benefits, ::mlir::IntegerAttr table_id, ::mlir::StringAttr table_name, ::mlir::IntegerAttr num_shards, ::mlir::IntegerAttr shard_id, ::mlir::StringAttr config) {
  odsState.addOperands(parameters);
  odsState.addOperands(accumulators);
  odsState.addOperands(weights);
  odsState.addOperands(benefits);
  odsState.addAttribute(table_idAttrName(odsState.name), table_id);
  odsState.addAttribute(table_nameAttrName(odsState.name), table_name);
  odsState.addAttribute(num_shardsAttrName(odsState.name), num_shards);
  odsState.addAttribute(shard_idAttrName(odsState.name), shard_id);
  odsState.addAttribute(configAttrName(odsState.name), config);
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void LoadTPUEmbeddingMDLAdagradLightParametersOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value parameters, ::mlir::Value accumulators, ::mlir::Value weights, ::mlir::Value benefits, uint64_t table_id, ::llvm::StringRef table_name, uint64_t num_shards, uint64_t shard_id, ::llvm::StringRef config) {
  odsState.addOperands(parameters);
  odsState.addOperands(accumulators);
  odsState.addOperands(weights);
  odsState.addOperands(benefits);
  odsState.addAttribute(table_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), table_id));
  odsState.addAttribute(table_nameAttrName(odsState.name), odsBuilder.getStringAttr(table_name));
  odsState.addAttribute(num_shardsAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), num_shards));
  odsState.addAttribute(shard_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), shard_id));
  odsState.addAttribute(configAttrName(odsState.name), odsBuilder.getStringAttr(config));
}

void LoadTPUEmbeddingMDLAdagradLightParametersOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value parameters, ::mlir::Value accumulators, ::mlir::Value weights, ::mlir::Value benefits, uint64_t table_id, ::llvm::StringRef table_name, uint64_t num_shards, uint64_t shard_id, ::llvm::StringRef config) {
  odsState.addOperands(parameters);
  odsState.addOperands(accumulators);
  odsState.addOperands(weights);
  odsState.addOperands(benefits);
  odsState.addAttribute(table_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), table_id));
  odsState.addAttribute(table_nameAttrName(odsState.name), odsBuilder.getStringAttr(table_name));
  odsState.addAttribute(num_shardsAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), num_shards));
  odsState.addAttribute(shard_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), shard_id));
  odsState.addAttribute(configAttrName(odsState.name), odsBuilder.getStringAttr(config));
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void LoadTPUEmbeddingMDLAdagradLightParametersOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 4u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 0u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult LoadTPUEmbeddingMDLAdagradLightParametersOp::verify() {
  {
    auto tblgen_table_id = (*this)->getAttr(table_idAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_table_id, "table_id")))
      return ::mlir::failure();
  }
  {
    auto tblgen_table_name = (*this)->getAttr(table_nameAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_table_name, "table_name")))
      return ::mlir::failure();
  }
  {
    auto tblgen_num_shards = (*this)->getAttr(num_shardsAttrName());
    if (!tblgen_num_shards)
      return emitOpError("requires attribute 'num_shards'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_num_shards, "num_shards")))
      return ::mlir::failure();
  }
  {
    auto tblgen_shard_id = (*this)->getAttr(shard_idAttrName());
    if (!tblgen_shard_id)
      return emitOpError("requires attribute 'shard_id'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_shard_id, "shard_id")))
      return ::mlir::failure();
  }
  {
    auto tblgen_config = (*this)->getAttr(configAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_config, "config")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup3 = getODSOperands(3);

    for (auto v : valueGroup3) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void LoadTPUEmbeddingMDLAdagradLightParametersOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  effects.emplace_back(::mlir::MemoryEffects::Write::get(), ::mlir::TF::ResourceEffects::MustExecute::get());
  effects.emplace_back(::mlir::MemoryEffects::Read::get(), ::mlir::TF::ResourceEffects::TPUEmbedding::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::LoadTPUEmbeddingMDLAdagradLightParametersOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::LoadTPUEmbeddingMomentumParametersGradAccumDebugOp definitions
//===----------------------------------------------------------------------===//

LoadTPUEmbeddingMomentumParametersGradAccumDebugOpAdaptor::LoadTPUEmbeddingMomentumParametersGradAccumDebugOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

LoadTPUEmbeddingMomentumParametersGradAccumDebugOpAdaptor::LoadTPUEmbeddingMomentumParametersGradAccumDebugOpAdaptor(LoadTPUEmbeddingMomentumParametersGradAccumDebugOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange LoadTPUEmbeddingMomentumParametersGradAccumDebugOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> LoadTPUEmbeddingMomentumParametersGradAccumDebugOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange LoadTPUEmbeddingMomentumParametersGradAccumDebugOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value LoadTPUEmbeddingMomentumParametersGradAccumDebugOpAdaptor::parameters() {
  return *getODSOperands(0).begin();
}

::mlir::Value LoadTPUEmbeddingMomentumParametersGradAccumDebugOpAdaptor::momenta() {
  return *getODSOperands(1).begin();
}

::mlir::Value LoadTPUEmbeddingMomentumParametersGradAccumDebugOpAdaptor::gradient_accumulators() {
  return *getODSOperands(2).begin();
}

::mlir::DictionaryAttr LoadTPUEmbeddingMomentumParametersGradAccumDebugOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::IntegerAttr LoadTPUEmbeddingMomentumParametersGradAccumDebugOpAdaptor::table_id() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("table_id").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), -1);
  return attr;
}

::mlir::StringAttr LoadTPUEmbeddingMomentumParametersGradAccumDebugOpAdaptor::table_name() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("table_name").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("");
  return attr;
}

::mlir::IntegerAttr LoadTPUEmbeddingMomentumParametersGradAccumDebugOpAdaptor::num_shards() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("num_shards").cast<::mlir::IntegerAttr>();
  return attr;
}

::mlir::IntegerAttr LoadTPUEmbeddingMomentumParametersGradAccumDebugOpAdaptor::shard_id() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("shard_id").cast<::mlir::IntegerAttr>();
  return attr;
}

::mlir::StringAttr LoadTPUEmbeddingMomentumParametersGradAccumDebugOpAdaptor::config() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("config").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("");
  return attr;
}

::mlir::LogicalResult LoadTPUEmbeddingMomentumParametersGradAccumDebugOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_table_id = odsAttrs.get("table_id");
    if (tblgen_table_id && !(((tblgen_table_id.isa<::mlir::IntegerAttr>())) && ((tblgen_table_id.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.LoadTPUEmbeddingMomentumParametersGradAccumDebug' op ""attribute 'table_id' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_table_name = odsAttrs.get("table_name");
    if (tblgen_table_name && !((tblgen_table_name.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.LoadTPUEmbeddingMomentumParametersGradAccumDebug' op ""attribute 'table_name' failed to satisfy constraint: string attribute");
  }
  {
    auto tblgen_num_shards = odsAttrs.get("num_shards");
    if (!tblgen_num_shards)
      return emitError(loc, "'tf.LoadTPUEmbeddingMomentumParametersGradAccumDebug' op ""requires attribute 'num_shards'");

    if (tblgen_num_shards && !(((tblgen_num_shards.isa<::mlir::IntegerAttr>())) && ((tblgen_num_shards.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.LoadTPUEmbeddingMomentumParametersGradAccumDebug' op ""attribute 'num_shards' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_shard_id = odsAttrs.get("shard_id");
    if (!tblgen_shard_id)
      return emitError(loc, "'tf.LoadTPUEmbeddingMomentumParametersGradAccumDebug' op ""requires attribute 'shard_id'");

    if (tblgen_shard_id && !(((tblgen_shard_id.isa<::mlir::IntegerAttr>())) && ((tblgen_shard_id.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.LoadTPUEmbeddingMomentumParametersGradAccumDebug' op ""attribute 'shard_id' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_config = odsAttrs.get("config");
    if (tblgen_config && !((tblgen_config.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.LoadTPUEmbeddingMomentumParametersGradAccumDebug' op ""attribute 'config' failed to satisfy constraint: string attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> LoadTPUEmbeddingMomentumParametersGradAccumDebugOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range LoadTPUEmbeddingMomentumParametersGradAccumDebugOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value LoadTPUEmbeddingMomentumParametersGradAccumDebugOp::parameters() {
  return *getODSOperands(0).begin();
}

::mlir::Value LoadTPUEmbeddingMomentumParametersGradAccumDebugOp::momenta() {
  return *getODSOperands(1).begin();
}

::mlir::Value LoadTPUEmbeddingMomentumParametersGradAccumDebugOp::gradient_accumulators() {
  return *getODSOperands(2).begin();
}

::mlir::MutableOperandRange LoadTPUEmbeddingMomentumParametersGradAccumDebugOp::parametersMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange LoadTPUEmbeddingMomentumParametersGradAccumDebugOp::momentaMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange LoadTPUEmbeddingMomentumParametersGradAccumDebugOp::gradient_accumulatorsMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> LoadTPUEmbeddingMomentumParametersGradAccumDebugOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range LoadTPUEmbeddingMomentumParametersGradAccumDebugOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::IntegerAttr LoadTPUEmbeddingMomentumParametersGradAccumDebugOp::table_idAttr() {
  return (*this)->getAttr(table_idAttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t LoadTPUEmbeddingMomentumParametersGradAccumDebugOp::table_id() {
  auto attr = table_idAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), -1).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

::mlir::StringAttr LoadTPUEmbeddingMomentumParametersGradAccumDebugOp::table_nameAttr() {
  return (*this)->getAttr(table_nameAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef LoadTPUEmbeddingMomentumParametersGradAccumDebugOp::table_name() {
  auto attr = table_nameAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("").getValue();
  return attr.getValue();
}

::mlir::IntegerAttr LoadTPUEmbeddingMomentumParametersGradAccumDebugOp::num_shardsAttr() {
  return (*this)->getAttr(num_shardsAttrName()).cast<::mlir::IntegerAttr>();
}

uint64_t LoadTPUEmbeddingMomentumParametersGradAccumDebugOp::num_shards() {
  auto attr = num_shardsAttr();
  return attr.getValue().getZExtValue();
}

::mlir::IntegerAttr LoadTPUEmbeddingMomentumParametersGradAccumDebugOp::shard_idAttr() {
  return (*this)->getAttr(shard_idAttrName()).cast<::mlir::IntegerAttr>();
}

uint64_t LoadTPUEmbeddingMomentumParametersGradAccumDebugOp::shard_id() {
  auto attr = shard_idAttr();
  return attr.getValue().getZExtValue();
}

::mlir::StringAttr LoadTPUEmbeddingMomentumParametersGradAccumDebugOp::configAttr() {
  return (*this)->getAttr(configAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef LoadTPUEmbeddingMomentumParametersGradAccumDebugOp::config() {
  auto attr = configAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("").getValue();
  return attr.getValue();
}

void LoadTPUEmbeddingMomentumParametersGradAccumDebugOp::table_idAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(table_idAttrName(), attr);
}

void LoadTPUEmbeddingMomentumParametersGradAccumDebugOp::table_nameAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(table_nameAttrName(), attr);
}

void LoadTPUEmbeddingMomentumParametersGradAccumDebugOp::num_shardsAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(num_shardsAttrName(), attr);
}

void LoadTPUEmbeddingMomentumParametersGradAccumDebugOp::shard_idAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(shard_idAttrName(), attr);
}

void LoadTPUEmbeddingMomentumParametersGradAccumDebugOp::configAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(configAttrName(), attr);
}

void LoadTPUEmbeddingMomentumParametersGradAccumDebugOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value parameters, ::mlir::Value momenta, ::mlir::Value gradient_accumulators, ::mlir::IntegerAttr table_id, ::mlir::StringAttr table_name, ::mlir::IntegerAttr num_shards, ::mlir::IntegerAttr shard_id, ::mlir::StringAttr config) {
  odsState.addOperands(parameters);
  odsState.addOperands(momenta);
  odsState.addOperands(gradient_accumulators);
  odsState.addAttribute(table_idAttrName(odsState.name), table_id);
  odsState.addAttribute(table_nameAttrName(odsState.name), table_name);
  odsState.addAttribute(num_shardsAttrName(odsState.name), num_shards);
  odsState.addAttribute(shard_idAttrName(odsState.name), shard_id);
  odsState.addAttribute(configAttrName(odsState.name), config);
}

void LoadTPUEmbeddingMomentumParametersGradAccumDebugOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value parameters, ::mlir::Value momenta, ::mlir::Value gradient_accumulators, ::mlir::IntegerAttr table_id, ::mlir::StringAttr table_name, ::mlir::IntegerAttr num_shards, ::mlir::IntegerAttr shard_id, ::mlir::StringAttr config) {
  odsState.addOperands(parameters);
  odsState.addOperands(momenta);
  odsState.addOperands(gradient_accumulators);
  odsState.addAttribute(table_idAttrName(odsState.name), table_id);
  odsState.addAttribute(table_nameAttrName(odsState.name), table_name);
  odsState.addAttribute(num_shardsAttrName(odsState.name), num_shards);
  odsState.addAttribute(shard_idAttrName(odsState.name), shard_id);
  odsState.addAttribute(configAttrName(odsState.name), config);
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void LoadTPUEmbeddingMomentumParametersGradAccumDebugOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value parameters, ::mlir::Value momenta, ::mlir::Value gradient_accumulators, uint64_t table_id, ::llvm::StringRef table_name, uint64_t num_shards, uint64_t shard_id, ::llvm::StringRef config) {
  odsState.addOperands(parameters);
  odsState.addOperands(momenta);
  odsState.addOperands(gradient_accumulators);
  odsState.addAttribute(table_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), table_id));
  odsState.addAttribute(table_nameAttrName(odsState.name), odsBuilder.getStringAttr(table_name));
  odsState.addAttribute(num_shardsAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), num_shards));
  odsState.addAttribute(shard_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), shard_id));
  odsState.addAttribute(configAttrName(odsState.name), odsBuilder.getStringAttr(config));
}

void LoadTPUEmbeddingMomentumParametersGradAccumDebugOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value parameters, ::mlir::Value momenta, ::mlir::Value gradient_accumulators, uint64_t table_id, ::llvm::StringRef table_name, uint64_t num_shards, uint64_t shard_id, ::llvm::StringRef config) {
  odsState.addOperands(parameters);
  odsState.addOperands(momenta);
  odsState.addOperands(gradient_accumulators);
  odsState.addAttribute(table_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), table_id));
  odsState.addAttribute(table_nameAttrName(odsState.name), odsBuilder.getStringAttr(table_name));
  odsState.addAttribute(num_shardsAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), num_shards));
  odsState.addAttribute(shard_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), shard_id));
  odsState.addAttribute(configAttrName(odsState.name), odsBuilder.getStringAttr(config));
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void LoadTPUEmbeddingMomentumParametersGradAccumDebugOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 3u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 0u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult LoadTPUEmbeddingMomentumParametersGradAccumDebugOp::verify() {
  {
    auto tblgen_table_id = (*this)->getAttr(table_idAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_table_id, "table_id")))
      return ::mlir::failure();
  }
  {
    auto tblgen_table_name = (*this)->getAttr(table_nameAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_table_name, "table_name")))
      return ::mlir::failure();
  }
  {
    auto tblgen_num_shards = (*this)->getAttr(num_shardsAttrName());
    if (!tblgen_num_shards)
      return emitOpError("requires attribute 'num_shards'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_num_shards, "num_shards")))
      return ::mlir::failure();
  }
  {
    auto tblgen_shard_id = (*this)->getAttr(shard_idAttrName());
    if (!tblgen_shard_id)
      return emitOpError("requires attribute 'shard_id'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_shard_id, "shard_id")))
      return ::mlir::failure();
  }
  {
    auto tblgen_config = (*this)->getAttr(configAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_config, "config")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void LoadTPUEmbeddingMomentumParametersGradAccumDebugOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  effects.emplace_back(::mlir::MemoryEffects::Write::get(), ::mlir::TF::ResourceEffects::MustExecute::get());
  effects.emplace_back(::mlir::MemoryEffects::Read::get(), ::mlir::TF::ResourceEffects::TPUEmbedding::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::LoadTPUEmbeddingMomentumParametersGradAccumDebugOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::LoadTPUEmbeddingMomentumParametersOp definitions
//===----------------------------------------------------------------------===//

LoadTPUEmbeddingMomentumParametersOpAdaptor::LoadTPUEmbeddingMomentumParametersOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

LoadTPUEmbeddingMomentumParametersOpAdaptor::LoadTPUEmbeddingMomentumParametersOpAdaptor(LoadTPUEmbeddingMomentumParametersOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange LoadTPUEmbeddingMomentumParametersOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> LoadTPUEmbeddingMomentumParametersOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange LoadTPUEmbeddingMomentumParametersOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value LoadTPUEmbeddingMomentumParametersOpAdaptor::parameters() {
  return *getODSOperands(0).begin();
}

::mlir::Value LoadTPUEmbeddingMomentumParametersOpAdaptor::momenta() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr LoadTPUEmbeddingMomentumParametersOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::IntegerAttr LoadTPUEmbeddingMomentumParametersOpAdaptor::table_id() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("table_id").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), -1);
  return attr;
}

::mlir::StringAttr LoadTPUEmbeddingMomentumParametersOpAdaptor::table_name() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("table_name").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("");
  return attr;
}

::mlir::IntegerAttr LoadTPUEmbeddingMomentumParametersOpAdaptor::num_shards() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("num_shards").cast<::mlir::IntegerAttr>();
  return attr;
}

::mlir::IntegerAttr LoadTPUEmbeddingMomentumParametersOpAdaptor::shard_id() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("shard_id").cast<::mlir::IntegerAttr>();
  return attr;
}

::mlir::StringAttr LoadTPUEmbeddingMomentumParametersOpAdaptor::config() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("config").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("");
  return attr;
}

::mlir::LogicalResult LoadTPUEmbeddingMomentumParametersOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_table_id = odsAttrs.get("table_id");
    if (tblgen_table_id && !(((tblgen_table_id.isa<::mlir::IntegerAttr>())) && ((tblgen_table_id.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.LoadTPUEmbeddingMomentumParameters' op ""attribute 'table_id' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_table_name = odsAttrs.get("table_name");
    if (tblgen_table_name && !((tblgen_table_name.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.LoadTPUEmbeddingMomentumParameters' op ""attribute 'table_name' failed to satisfy constraint: string attribute");
  }
  {
    auto tblgen_num_shards = odsAttrs.get("num_shards");
    if (!tblgen_num_shards)
      return emitError(loc, "'tf.LoadTPUEmbeddingMomentumParameters' op ""requires attribute 'num_shards'");

    if (tblgen_num_shards && !(((tblgen_num_shards.isa<::mlir::IntegerAttr>())) && ((tblgen_num_shards.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.LoadTPUEmbeddingMomentumParameters' op ""attribute 'num_shards' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_shard_id = odsAttrs.get("shard_id");
    if (!tblgen_shard_id)
      return emitError(loc, "'tf.LoadTPUEmbeddingMomentumParameters' op ""requires attribute 'shard_id'");

    if (tblgen_shard_id && !(((tblgen_shard_id.isa<::mlir::IntegerAttr>())) && ((tblgen_shard_id.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.LoadTPUEmbeddingMomentumParameters' op ""attribute 'shard_id' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_config = odsAttrs.get("config");
    if (tblgen_config && !((tblgen_config.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.LoadTPUEmbeddingMomentumParameters' op ""attribute 'config' failed to satisfy constraint: string attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> LoadTPUEmbeddingMomentumParametersOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range LoadTPUEmbeddingMomentumParametersOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value LoadTPUEmbeddingMomentumParametersOp::parameters() {
  return *getODSOperands(0).begin();
}

::mlir::Value LoadTPUEmbeddingMomentumParametersOp::momenta() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange LoadTPUEmbeddingMomentumParametersOp::parametersMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange LoadTPUEmbeddingMomentumParametersOp::momentaMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> LoadTPUEmbeddingMomentumParametersOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range LoadTPUEmbeddingMomentumParametersOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::IntegerAttr LoadTPUEmbeddingMomentumParametersOp::table_idAttr() {
  return (*this)->getAttr(table_idAttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t LoadTPUEmbeddingMomentumParametersOp::table_id() {
  auto attr = table_idAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), -1).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

::mlir::StringAttr LoadTPUEmbeddingMomentumParametersOp::table_nameAttr() {
  return (*this)->getAttr(table_nameAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef LoadTPUEmbeddingMomentumParametersOp::table_name() {
  auto attr = table_nameAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("").getValue();
  return attr.getValue();
}

::mlir::IntegerAttr LoadTPUEmbeddingMomentumParametersOp::num_shardsAttr() {
  return (*this)->getAttr(num_shardsAttrName()).cast<::mlir::IntegerAttr>();
}

uint64_t LoadTPUEmbeddingMomentumParametersOp::num_shards() {
  auto attr = num_shardsAttr();
  return attr.getValue().getZExtValue();
}

::mlir::IntegerAttr LoadTPUEmbeddingMomentumParametersOp::shard_idAttr() {
  return (*this)->getAttr(shard_idAttrName()).cast<::mlir::IntegerAttr>();
}

uint64_t LoadTPUEmbeddingMomentumParametersOp::shard_id() {
  auto attr = shard_idAttr();
  return attr.getValue().getZExtValue();
}

::mlir::StringAttr LoadTPUEmbeddingMomentumParametersOp::configAttr() {
  return (*this)->getAttr(configAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef LoadTPUEmbeddingMomentumParametersOp::config() {
  auto attr = configAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("").getValue();
  return attr.getValue();
}

void LoadTPUEmbeddingMomentumParametersOp::table_idAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(table_idAttrName(), attr);
}

void LoadTPUEmbeddingMomentumParametersOp::table_nameAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(table_nameAttrName(), attr);
}

void LoadTPUEmbeddingMomentumParametersOp::num_shardsAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(num_shardsAttrName(), attr);
}

void LoadTPUEmbeddingMomentumParametersOp::shard_idAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(shard_idAttrName(), attr);
}

void LoadTPUEmbeddingMomentumParametersOp::configAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(configAttrName(), attr);
}

void LoadTPUEmbeddingMomentumParametersOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value parameters, ::mlir::Value momenta, ::mlir::IntegerAttr table_id, ::mlir::StringAttr table_name, ::mlir::IntegerAttr num_shards, ::mlir::IntegerAttr shard_id, ::mlir::StringAttr config) {
  odsState.addOperands(parameters);
  odsState.addOperands(momenta);
  odsState.addAttribute(table_idAttrName(odsState.name), table_id);
  odsState.addAttribute(table_nameAttrName(odsState.name), table_name);
  odsState.addAttribute(num_shardsAttrName(odsState.name), num_shards);
  odsState.addAttribute(shard_idAttrName(odsState.name), shard_id);
  odsState.addAttribute(configAttrName(odsState.name), config);
}

void LoadTPUEmbeddingMomentumParametersOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value parameters, ::mlir::Value momenta, ::mlir::IntegerAttr table_id, ::mlir::StringAttr table_name, ::mlir::IntegerAttr num_shards, ::mlir::IntegerAttr shard_id, ::mlir::StringAttr config) {
  odsState.addOperands(parameters);
  odsState.addOperands(momenta);
  odsState.addAttribute(table_idAttrName(odsState.name), table_id);
  odsState.addAttribute(table_nameAttrName(odsState.name), table_name);
  odsState.addAttribute(num_shardsAttrName(odsState.name), num_shards);
  odsState.addAttribute(shard_idAttrName(odsState.name), shard_id);
  odsState.addAttribute(configAttrName(odsState.name), config);
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void LoadTPUEmbeddingMomentumParametersOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value parameters, ::mlir::Value momenta, uint64_t table_id, ::llvm::StringRef table_name, uint64_t num_shards, uint64_t shard_id, ::llvm::StringRef config) {
  odsState.addOperands(parameters);
  odsState.addOperands(momenta);
  odsState.addAttribute(table_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), table_id));
  odsState.addAttribute(table_nameAttrName(odsState.name), odsBuilder.getStringAttr(table_name));
  odsState.addAttribute(num_shardsAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), num_shards));
  odsState.addAttribute(shard_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), shard_id));
  odsState.addAttribute(configAttrName(odsState.name), odsBuilder.getStringAttr(config));
}

void LoadTPUEmbeddingMomentumParametersOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value parameters, ::mlir::Value momenta, uint64_t table_id, ::llvm::StringRef table_name, uint64_t num_shards, uint64_t shard_id, ::llvm::StringRef config) {
  odsState.addOperands(parameters);
  odsState.addOperands(momenta);
  odsState.addAttribute(table_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), table_id));
  odsState.addAttribute(table_nameAttrName(odsState.name), odsBuilder.getStringAttr(table_name));
  odsState.addAttribute(num_shardsAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), num_shards));
  odsState.addAttribute(shard_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), shard_id));
  odsState.addAttribute(configAttrName(odsState.name), odsBuilder.getStringAttr(config));
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void LoadTPUEmbeddingMomentumParametersOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 0u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult LoadTPUEmbeddingMomentumParametersOp::verify() {
  {
    auto tblgen_table_id = (*this)->getAttr(table_idAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_table_id, "table_id")))
      return ::mlir::failure();
  }
  {
    auto tblgen_table_name = (*this)->getAttr(table_nameAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_table_name, "table_name")))
      return ::mlir::failure();
  }
  {
    auto tblgen_num_shards = (*this)->getAttr(num_shardsAttrName());
    if (!tblgen_num_shards)
      return emitOpError("requires attribute 'num_shards'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_num_shards, "num_shards")))
      return ::mlir::failure();
  }
  {
    auto tblgen_shard_id = (*this)->getAttr(shard_idAttrName());
    if (!tblgen_shard_id)
      return emitOpError("requires attribute 'shard_id'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_shard_id, "shard_id")))
      return ::mlir::failure();
  }
  {
    auto tblgen_config = (*this)->getAttr(configAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_config, "config")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void LoadTPUEmbeddingMomentumParametersOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  effects.emplace_back(::mlir::MemoryEffects::Write::get(), ::mlir::TF::ResourceEffects::MustExecute::get());
  effects.emplace_back(::mlir::MemoryEffects::Read::get(), ::mlir::TF::ResourceEffects::TPUEmbedding::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::LoadTPUEmbeddingMomentumParametersOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::LoadTPUEmbeddingProximalAdagradParametersGradAccumDebugOp definitions
//===----------------------------------------------------------------------===//

LoadTPUEmbeddingProximalAdagradParametersGradAccumDebugOpAdaptor::LoadTPUEmbeddingProximalAdagradParametersGradAccumDebugOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

LoadTPUEmbeddingProximalAdagradParametersGradAccumDebugOpAdaptor::LoadTPUEmbeddingProximalAdagradParametersGradAccumDebugOpAdaptor(LoadTPUEmbeddingProximalAdagradParametersGradAccumDebugOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange LoadTPUEmbeddingProximalAdagradParametersGradAccumDebugOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> LoadTPUEmbeddingProximalAdagradParametersGradAccumDebugOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange LoadTPUEmbeddingProximalAdagradParametersGradAccumDebugOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value LoadTPUEmbeddingProximalAdagradParametersGradAccumDebugOpAdaptor::parameters() {
  return *getODSOperands(0).begin();
}

::mlir::Value LoadTPUEmbeddingProximalAdagradParametersGradAccumDebugOpAdaptor::accumulators() {
  return *getODSOperands(1).begin();
}

::mlir::Value LoadTPUEmbeddingProximalAdagradParametersGradAccumDebugOpAdaptor::gradient_accumulators() {
  return *getODSOperands(2).begin();
}

::mlir::DictionaryAttr LoadTPUEmbeddingProximalAdagradParametersGradAccumDebugOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::IntegerAttr LoadTPUEmbeddingProximalAdagradParametersGradAccumDebugOpAdaptor::table_id() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("table_id").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), -1);
  return attr;
}

::mlir::StringAttr LoadTPUEmbeddingProximalAdagradParametersGradAccumDebugOpAdaptor::table_name() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("table_name").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("");
  return attr;
}

::mlir::IntegerAttr LoadTPUEmbeddingProximalAdagradParametersGradAccumDebugOpAdaptor::num_shards() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("num_shards").cast<::mlir::IntegerAttr>();
  return attr;
}

::mlir::IntegerAttr LoadTPUEmbeddingProximalAdagradParametersGradAccumDebugOpAdaptor::shard_id() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("shard_id").cast<::mlir::IntegerAttr>();
  return attr;
}

::mlir::StringAttr LoadTPUEmbeddingProximalAdagradParametersGradAccumDebugOpAdaptor::config() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("config").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("");
  return attr;
}

::mlir::LogicalResult LoadTPUEmbeddingProximalAdagradParametersGradAccumDebugOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_table_id = odsAttrs.get("table_id");
    if (tblgen_table_id && !(((tblgen_table_id.isa<::mlir::IntegerAttr>())) && ((tblgen_table_id.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.LoadTPUEmbeddingProximalAdagradParametersGradAccumDebug' op ""attribute 'table_id' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_table_name = odsAttrs.get("table_name");
    if (tblgen_table_name && !((tblgen_table_name.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.LoadTPUEmbeddingProximalAdagradParametersGradAccumDebug' op ""attribute 'table_name' failed to satisfy constraint: string attribute");
  }
  {
    auto tblgen_num_shards = odsAttrs.get("num_shards");
    if (!tblgen_num_shards)
      return emitError(loc, "'tf.LoadTPUEmbeddingProximalAdagradParametersGradAccumDebug' op ""requires attribute 'num_shards'");

    if (tblgen_num_shards && !(((tblgen_num_shards.isa<::mlir::IntegerAttr>())) && ((tblgen_num_shards.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.LoadTPUEmbeddingProximalAdagradParametersGradAccumDebug' op ""attribute 'num_shards' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_shard_id = odsAttrs.get("shard_id");
    if (!tblgen_shard_id)
      return emitError(loc, "'tf.LoadTPUEmbeddingProximalAdagradParametersGradAccumDebug' op ""requires attribute 'shard_id'");

    if (tblgen_shard_id && !(((tblgen_shard_id.isa<::mlir::IntegerAttr>())) && ((tblgen_shard_id.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.LoadTPUEmbeddingProximalAdagradParametersGradAccumDebug' op ""attribute 'shard_id' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_config = odsAttrs.get("config");
    if (tblgen_config && !((tblgen_config.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.LoadTPUEmbeddingProximalAdagradParametersGradAccumDebug' op ""attribute 'config' failed to satisfy constraint: string attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> LoadTPUEmbeddingProximalAdagradParametersGradAccumDebugOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range LoadTPUEmbeddingProximalAdagradParametersGradAccumDebugOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value LoadTPUEmbeddingProximalAdagradParametersGradAccumDebugOp::parameters() {
  return *getODSOperands(0).begin();
}

::mlir::Value LoadTPUEmbeddingProximalAdagradParametersGradAccumDebugOp::accumulators() {
  return *getODSOperands(1).begin();
}

::mlir::Value LoadTPUEmbeddingProximalAdagradParametersGradAccumDebugOp::gradient_accumulators() {
  return *getODSOperands(2).begin();
}

::mlir::MutableOperandRange LoadTPUEmbeddingProximalAdagradParametersGradAccumDebugOp::parametersMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange LoadTPUEmbeddingProximalAdagradParametersGradAccumDebugOp::accumulatorsMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange LoadTPUEmbeddingProximalAdagradParametersGradAccumDebugOp::gradient_accumulatorsMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> LoadTPUEmbeddingProximalAdagradParametersGradAccumDebugOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range LoadTPUEmbeddingProximalAdagradParametersGradAccumDebugOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::IntegerAttr LoadTPUEmbeddingProximalAdagradParametersGradAccumDebugOp::table_idAttr() {
  return (*this)->getAttr(table_idAttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t LoadTPUEmbeddingProximalAdagradParametersGradAccumDebugOp::table_id() {
  auto attr = table_idAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), -1).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

::mlir::StringAttr LoadTPUEmbeddingProximalAdagradParametersGradAccumDebugOp::table_nameAttr() {
  return (*this)->getAttr(table_nameAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef LoadTPUEmbeddingProximalAdagradParametersGradAccumDebugOp::table_name() {
  auto attr = table_nameAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("").getValue();
  return attr.getValue();
}

::mlir::IntegerAttr LoadTPUEmbeddingProximalAdagradParametersGradAccumDebugOp::num_shardsAttr() {
  return (*this)->getAttr(num_shardsAttrName()).cast<::mlir::IntegerAttr>();
}

uint64_t LoadTPUEmbeddingProximalAdagradParametersGradAccumDebugOp::num_shards() {
  auto attr = num_shardsAttr();
  return attr.getValue().getZExtValue();
}

::mlir::IntegerAttr LoadTPUEmbeddingProximalAdagradParametersGradAccumDebugOp::shard_idAttr() {
  return (*this)->getAttr(shard_idAttrName()).cast<::mlir::IntegerAttr>();
}

uint64_t LoadTPUEmbeddingProximalAdagradParametersGradAccumDebugOp::shard_id() {
  auto attr = shard_idAttr();
  return attr.getValue().getZExtValue();
}

::mlir::StringAttr LoadTPUEmbeddingProximalAdagradParametersGradAccumDebugOp::configAttr() {
  return (*this)->getAttr(configAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef LoadTPUEmbeddingProximalAdagradParametersGradAccumDebugOp::config() {
  auto attr = configAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("").getValue();
  return attr.getValue();
}

void LoadTPUEmbeddingProximalAdagradParametersGradAccumDebugOp::table_idAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(table_idAttrName(), attr);
}

void LoadTPUEmbeddingProximalAdagradParametersGradAccumDebugOp::table_nameAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(table_nameAttrName(), attr);
}

void LoadTPUEmbeddingProximalAdagradParametersGradAccumDebugOp::num_shardsAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(num_shardsAttrName(), attr);
}

void LoadTPUEmbeddingProximalAdagradParametersGradAccumDebugOp::shard_idAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(shard_idAttrName(), attr);
}

void LoadTPUEmbeddingProximalAdagradParametersGradAccumDebugOp::configAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(configAttrName(), attr);
}

void LoadTPUEmbeddingProximalAdagradParametersGradAccumDebugOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value parameters, ::mlir::Value accumulators, ::mlir::Value gradient_accumulators, ::mlir::IntegerAttr table_id, ::mlir::StringAttr table_name, ::mlir::IntegerAttr num_shards, ::mlir::IntegerAttr shard_id, ::mlir::StringAttr config) {
  odsState.addOperands(parameters);
  odsState.addOperands(accumulators);
  odsState.addOperands(gradient_accumulators);
  odsState.addAttribute(table_idAttrName(odsState.name), table_id);
  odsState.addAttribute(table_nameAttrName(odsState.name), table_name);
  odsState.addAttribute(num_shardsAttrName(odsState.name), num_shards);
  odsState.addAttribute(shard_idAttrName(odsState.name), shard_id);
  odsState.addAttribute(configAttrName(odsState.name), config);
}

void LoadTPUEmbeddingProximalAdagradParametersGradAccumDebugOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value parameters, ::mlir::Value accumulators, ::mlir::Value gradient_accumulators, ::mlir::IntegerAttr table_id, ::mlir::StringAttr table_name, ::mlir::IntegerAttr num_shards, ::mlir::IntegerAttr shard_id, ::mlir::StringAttr config) {
  odsState.addOperands(parameters);
  odsState.addOperands(accumulators);
  odsState.addOperands(gradient_accumulators);
  odsState.addAttribute(table_idAttrName(odsState.name), table_id);
  odsState.addAttribute(table_nameAttrName(odsState.name), table_name);
  odsState.addAttribute(num_shardsAttrName(odsState.name), num_shards);
  odsState.addAttribute(shard_idAttrName(odsState.name), shard_id);
  odsState.addAttribute(configAttrName(odsState.name), config);
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void LoadTPUEmbeddingProximalAdagradParametersGradAccumDebugOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value parameters, ::mlir::Value accumulators, ::mlir::Value gradient_accumulators, uint64_t table_id, ::llvm::StringRef table_name, uint64_t num_shards, uint64_t shard_id, ::llvm::StringRef config) {
  odsState.addOperands(parameters);
  odsState.addOperands(accumulators);
  odsState.addOperands(gradient_accumulators);
  odsState.addAttribute(table_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), table_id));
  odsState.addAttribute(table_nameAttrName(odsState.name), odsBuilder.getStringAttr(table_name));
  odsState.addAttribute(num_shardsAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), num_shards));
  odsState.addAttribute(shard_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), shard_id));
  odsState.addAttribute(configAttrName(odsState.name), odsBuilder.getStringAttr(config));
}

void LoadTPUEmbeddingProximalAdagradParametersGradAccumDebugOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value parameters, ::mlir::Value accumulators, ::mlir::Value gradient_accumulators, uint64_t table_id, ::llvm::StringRef table_name, uint64_t num_shards, uint64_t shard_id, ::llvm::StringRef config) {
  odsState.addOperands(parameters);
  odsState.addOperands(accumulators);
  odsState.addOperands(gradient_accumulators);
  odsState.addAttribute(table_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), table_id));
  odsState.addAttribute(table_nameAttrName(odsState.name), odsBuilder.getStringAttr(table_name));
  odsState.addAttribute(num_shardsAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), num_shards));
  odsState.addAttribute(shard_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), shard_id));
  odsState.addAttribute(configAttrName(odsState.name), odsBuilder.getStringAttr(config));
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void LoadTPUEmbeddingProximalAdagradParametersGradAccumDebugOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 3u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 0u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult LoadTPUEmbeddingProximalAdagradParametersGradAccumDebugOp::verify() {
  {
    auto tblgen_table_id = (*this)->getAttr(table_idAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_table_id, "table_id")))
      return ::mlir::failure();
  }
  {
    auto tblgen_table_name = (*this)->getAttr(table_nameAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_table_name, "table_name")))
      return ::mlir::failure();
  }
  {
    auto tblgen_num_shards = (*this)->getAttr(num_shardsAttrName());
    if (!tblgen_num_shards)
      return emitOpError("requires attribute 'num_shards'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_num_shards, "num_shards")))
      return ::mlir::failure();
  }
  {
    auto tblgen_shard_id = (*this)->getAttr(shard_idAttrName());
    if (!tblgen_shard_id)
      return emitOpError("requires attribute 'shard_id'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_shard_id, "shard_id")))
      return ::mlir::failure();
  }
  {
    auto tblgen_config = (*this)->getAttr(configAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_config, "config")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void LoadTPUEmbeddingProximalAdagradParametersGradAccumDebugOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  effects.emplace_back(::mlir::MemoryEffects::Write::get(), ::mlir::TF::ResourceEffects::MustExecute::get());
  effects.emplace_back(::mlir::MemoryEffects::Read::get(), ::mlir::TF::ResourceEffects::TPUEmbedding::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::LoadTPUEmbeddingProximalAdagradParametersGradAccumDebugOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::LoadTPUEmbeddingProximalAdagradParametersOp definitions
//===----------------------------------------------------------------------===//

LoadTPUEmbeddingProximalAdagradParametersOpAdaptor::LoadTPUEmbeddingProximalAdagradParametersOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

LoadTPUEmbeddingProximalAdagradParametersOpAdaptor::LoadTPUEmbeddingProximalAdagradParametersOpAdaptor(LoadTPUEmbeddingProximalAdagradParametersOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange LoadTPUEmbeddingProximalAdagradParametersOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> LoadTPUEmbeddingProximalAdagradParametersOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange LoadTPUEmbeddingProximalAdagradParametersOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value LoadTPUEmbeddingProximalAdagradParametersOpAdaptor::parameters() {
  return *getODSOperands(0).begin();
}

::mlir::Value LoadTPUEmbeddingProximalAdagradParametersOpAdaptor::accumulators() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr LoadTPUEmbeddingProximalAdagradParametersOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::IntegerAttr LoadTPUEmbeddingProximalAdagradParametersOpAdaptor::table_id() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("table_id").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), -1);
  return attr;
}

::mlir::StringAttr LoadTPUEmbeddingProximalAdagradParametersOpAdaptor::table_name() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("table_name").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("");
  return attr;
}

::mlir::IntegerAttr LoadTPUEmbeddingProximalAdagradParametersOpAdaptor::num_shards() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("num_shards").cast<::mlir::IntegerAttr>();
  return attr;
}

::mlir::IntegerAttr LoadTPUEmbeddingProximalAdagradParametersOpAdaptor::shard_id() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("shard_id").cast<::mlir::IntegerAttr>();
  return attr;
}

::mlir::StringAttr LoadTPUEmbeddingProximalAdagradParametersOpAdaptor::config() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("config").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("");
  return attr;
}

::mlir::LogicalResult LoadTPUEmbeddingProximalAdagradParametersOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_table_id = odsAttrs.get("table_id");
    if (tblgen_table_id && !(((tblgen_table_id.isa<::mlir::IntegerAttr>())) && ((tblgen_table_id.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.LoadTPUEmbeddingProximalAdagradParameters' op ""attribute 'table_id' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_table_name = odsAttrs.get("table_name");
    if (tblgen_table_name && !((tblgen_table_name.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.LoadTPUEmbeddingProximalAdagradParameters' op ""attribute 'table_name' failed to satisfy constraint: string attribute");
  }
  {
    auto tblgen_num_shards = odsAttrs.get("num_shards");
    if (!tblgen_num_shards)
      return emitError(loc, "'tf.LoadTPUEmbeddingProximalAdagradParameters' op ""requires attribute 'num_shards'");

    if (tblgen_num_shards && !(((tblgen_num_shards.isa<::mlir::IntegerAttr>())) && ((tblgen_num_shards.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.LoadTPUEmbeddingProximalAdagradParameters' op ""attribute 'num_shards' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_shard_id = odsAttrs.get("shard_id");
    if (!tblgen_shard_id)
      return emitError(loc, "'tf.LoadTPUEmbeddingProximalAdagradParameters' op ""requires attribute 'shard_id'");

    if (tblgen_shard_id && !(((tblgen_shard_id.isa<::mlir::IntegerAttr>())) && ((tblgen_shard_id.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.LoadTPUEmbeddingProximalAdagradParameters' op ""attribute 'shard_id' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_config = odsAttrs.get("config");
    if (tblgen_config && !((tblgen_config.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.LoadTPUEmbeddingProximalAdagradParameters' op ""attribute 'config' failed to satisfy constraint: string attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> LoadTPUEmbeddingProximalAdagradParametersOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range LoadTPUEmbeddingProximalAdagradParametersOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value LoadTPUEmbeddingProximalAdagradParametersOp::parameters() {
  return *getODSOperands(0).begin();
}

::mlir::Value LoadTPUEmbeddingProximalAdagradParametersOp::accumulators() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange LoadTPUEmbeddingProximalAdagradParametersOp::parametersMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange LoadTPUEmbeddingProximalAdagradParametersOp::accumulatorsMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> LoadTPUEmbeddingProximalAdagradParametersOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range LoadTPUEmbeddingProximalAdagradParametersOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::IntegerAttr LoadTPUEmbeddingProximalAdagradParametersOp::table_idAttr() {
  return (*this)->getAttr(table_idAttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t LoadTPUEmbeddingProximalAdagradParametersOp::table_id() {
  auto attr = table_idAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), -1).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

::mlir::StringAttr LoadTPUEmbeddingProximalAdagradParametersOp::table_nameAttr() {
  return (*this)->getAttr(table_nameAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef LoadTPUEmbeddingProximalAdagradParametersOp::table_name() {
  auto attr = table_nameAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("").getValue();
  return attr.getValue();
}

::mlir::IntegerAttr LoadTPUEmbeddingProximalAdagradParametersOp::num_shardsAttr() {
  return (*this)->getAttr(num_shardsAttrName()).cast<::mlir::IntegerAttr>();
}

uint64_t LoadTPUEmbeddingProximalAdagradParametersOp::num_shards() {
  auto attr = num_shardsAttr();
  return attr.getValue().getZExtValue();
}

::mlir::IntegerAttr LoadTPUEmbeddingProximalAdagradParametersOp::shard_idAttr() {
  return (*this)->getAttr(shard_idAttrName()).cast<::mlir::IntegerAttr>();
}

uint64_t LoadTPUEmbeddingProximalAdagradParametersOp::shard_id() {
  auto attr = shard_idAttr();
  return attr.getValue().getZExtValue();
}

::mlir::StringAttr LoadTPUEmbeddingProximalAdagradParametersOp::configAttr() {
  return (*this)->getAttr(configAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef LoadTPUEmbeddingProximalAdagradParametersOp::config() {
  auto attr = configAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("").getValue();
  return attr.getValue();
}

void LoadTPUEmbeddingProximalAdagradParametersOp::table_idAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(table_idAttrName(), attr);
}

void LoadTPUEmbeddingProximalAdagradParametersOp::table_nameAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(table_nameAttrName(), attr);
}

void LoadTPUEmbeddingProximalAdagradParametersOp::num_shardsAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(num_shardsAttrName(), attr);
}

void LoadTPUEmbeddingProximalAdagradParametersOp::shard_idAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(shard_idAttrName(), attr);
}

void LoadTPUEmbeddingProximalAdagradParametersOp::configAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(configAttrName(), attr);
}

void LoadTPUEmbeddingProximalAdagradParametersOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value parameters, ::mlir::Value accumulators, ::mlir::IntegerAttr table_id, ::mlir::StringAttr table_name, ::mlir::IntegerAttr num_shards, ::mlir::IntegerAttr shard_id, ::mlir::StringAttr config) {
  odsState.addOperands(parameters);
  odsState.addOperands(accumulators);
  odsState.addAttribute(table_idAttrName(odsState.name), table_id);
  odsState.addAttribute(table_nameAttrName(odsState.name), table_name);
  odsState.addAttribute(num_shardsAttrName(odsState.name), num_shards);
  odsState.addAttribute(shard_idAttrName(odsState.name), shard_id);
  odsState.addAttribute(configAttrName(odsState.name), config);
}

void LoadTPUEmbeddingProximalAdagradParametersOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value parameters, ::mlir::Value accumulators, ::mlir::IntegerAttr table_id, ::mlir::StringAttr table_name, ::mlir::IntegerAttr num_shards, ::mlir::IntegerAttr shard_id, ::mlir::StringAttr config) {
  odsState.addOperands(parameters);
  odsState.addOperands(accumulators);
  odsState.addAttribute(table_idAttrName(odsState.name), table_id);
  odsState.addAttribute(table_nameAttrName(odsState.name), table_name);
  odsState.addAttribute(num_shardsAttrName(odsState.name), num_shards);
  odsState.addAttribute(shard_idAttrName(odsState.name), shard_id);
  odsState.addAttribute(configAttrName(odsState.name), config);
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void LoadTPUEmbeddingProximalAdagradParametersOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value parameters, ::mlir::Value accumulators, uint64_t table_id, ::llvm::StringRef table_name, uint64_t num_shards, uint64_t shard_id, ::llvm::StringRef config) {
  odsState.addOperands(parameters);
  odsState.addOperands(accumulators);
  odsState.addAttribute(table_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), table_id));
  odsState.addAttribute(table_nameAttrName(odsState.name), odsBuilder.getStringAttr(table_name));
  odsState.addAttribute(num_shardsAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), num_shards));
  odsState.addAttribute(shard_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), shard_id));
  odsState.addAttribute(configAttrName(odsState.name), odsBuilder.getStringAttr(config));
}

void LoadTPUEmbeddingProximalAdagradParametersOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value parameters, ::mlir::Value accumulators, uint64_t table_id, ::llvm::StringRef table_name, uint64_t num_shards, uint64_t shard_id, ::llvm::StringRef config) {
  odsState.addOperands(parameters);
  odsState.addOperands(accumulators);
  odsState.addAttribute(table_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), table_id));
  odsState.addAttribute(table_nameAttrName(odsState.name), odsBuilder.getStringAttr(table_name));
  odsState.addAttribute(num_shardsAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), num_shards));
  odsState.addAttribute(shard_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), shard_id));
  odsState.addAttribute(configAttrName(odsState.name), odsBuilder.getStringAttr(config));
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void LoadTPUEmbeddingProximalAdagradParametersOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 0u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult LoadTPUEmbeddingProximalAdagradParametersOp::verify() {
  {
    auto tblgen_table_id = (*this)->getAttr(table_idAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_table_id, "table_id")))
      return ::mlir::failure();
  }
  {
    auto tblgen_table_name = (*this)->getAttr(table_nameAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_table_name, "table_name")))
      return ::mlir::failure();
  }
  {
    auto tblgen_num_shards = (*this)->getAttr(num_shardsAttrName());
    if (!tblgen_num_shards)
      return emitOpError("requires attribute 'num_shards'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_num_shards, "num_shards")))
      return ::mlir::failure();
  }
  {
    auto tblgen_shard_id = (*this)->getAttr(shard_idAttrName());
    if (!tblgen_shard_id)
      return emitOpError("requires attribute 'shard_id'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_shard_id, "shard_id")))
      return ::mlir::failure();
  }
  {
    auto tblgen_config = (*this)->getAttr(configAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_config, "config")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void LoadTPUEmbeddingProximalAdagradParametersOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  effects.emplace_back(::mlir::MemoryEffects::Write::get(), ::mlir::TF::ResourceEffects::MustExecute::get());
  effects.emplace_back(::mlir::MemoryEffects::Read::get(), ::mlir::TF::ResourceEffects::TPUEmbedding::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::LoadTPUEmbeddingProximalAdagradParametersOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::LoadTPUEmbeddingProximalYogiParametersGradAccumDebugOp definitions
//===----------------------------------------------------------------------===//

LoadTPUEmbeddingProximalYogiParametersGradAccumDebugOpAdaptor::LoadTPUEmbeddingProximalYogiParametersGradAccumDebugOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

LoadTPUEmbeddingProximalYogiParametersGradAccumDebugOpAdaptor::LoadTPUEmbeddingProximalYogiParametersGradAccumDebugOpAdaptor(LoadTPUEmbeddingProximalYogiParametersGradAccumDebugOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange LoadTPUEmbeddingProximalYogiParametersGradAccumDebugOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> LoadTPUEmbeddingProximalYogiParametersGradAccumDebugOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange LoadTPUEmbeddingProximalYogiParametersGradAccumDebugOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value LoadTPUEmbeddingProximalYogiParametersGradAccumDebugOpAdaptor::parameters() {
  return *getODSOperands(0).begin();
}

::mlir::Value LoadTPUEmbeddingProximalYogiParametersGradAccumDebugOpAdaptor::v() {
  return *getODSOperands(1).begin();
}

::mlir::Value LoadTPUEmbeddingProximalYogiParametersGradAccumDebugOpAdaptor::m() {
  return *getODSOperands(2).begin();
}

::mlir::Value LoadTPUEmbeddingProximalYogiParametersGradAccumDebugOpAdaptor::gradient_accumulators() {
  return *getODSOperands(3).begin();
}

::mlir::DictionaryAttr LoadTPUEmbeddingProximalYogiParametersGradAccumDebugOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::IntegerAttr LoadTPUEmbeddingProximalYogiParametersGradAccumDebugOpAdaptor::table_id() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("table_id").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), -1);
  return attr;
}

::mlir::StringAttr LoadTPUEmbeddingProximalYogiParametersGradAccumDebugOpAdaptor::table_name() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("table_name").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("");
  return attr;
}

::mlir::IntegerAttr LoadTPUEmbeddingProximalYogiParametersGradAccumDebugOpAdaptor::num_shards() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("num_shards").cast<::mlir::IntegerAttr>();
  return attr;
}

::mlir::IntegerAttr LoadTPUEmbeddingProximalYogiParametersGradAccumDebugOpAdaptor::shard_id() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("shard_id").cast<::mlir::IntegerAttr>();
  return attr;
}

::mlir::StringAttr LoadTPUEmbeddingProximalYogiParametersGradAccumDebugOpAdaptor::config() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("config").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("");
  return attr;
}

::mlir::LogicalResult LoadTPUEmbeddingProximalYogiParametersGradAccumDebugOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_table_id = odsAttrs.get("table_id");
    if (tblgen_table_id && !(((tblgen_table_id.isa<::mlir::IntegerAttr>())) && ((tblgen_table_id.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.LoadTPUEmbeddingProximalYogiParametersGradAccumDebug' op ""attribute 'table_id' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_table_name = odsAttrs.get("table_name");
    if (tblgen_table_name && !((tblgen_table_name.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.LoadTPUEmbeddingProximalYogiParametersGradAccumDebug' op ""attribute 'table_name' failed to satisfy constraint: string attribute");
  }
  {
    auto tblgen_num_shards = odsAttrs.get("num_shards");
    if (!tblgen_num_shards)
      return emitError(loc, "'tf.LoadTPUEmbeddingProximalYogiParametersGradAccumDebug' op ""requires attribute 'num_shards'");

    if (tblgen_num_shards && !(((tblgen_num_shards.isa<::mlir::IntegerAttr>())) && ((tblgen_num_shards.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.LoadTPUEmbeddingProximalYogiParametersGradAccumDebug' op ""attribute 'num_shards' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_shard_id = odsAttrs.get("shard_id");
    if (!tblgen_shard_id)
      return emitError(loc, "'tf.LoadTPUEmbeddingProximalYogiParametersGradAccumDebug' op ""requires attribute 'shard_id'");

    if (tblgen_shard_id && !(((tblgen_shard_id.isa<::mlir::IntegerAttr>())) && ((tblgen_shard_id.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.LoadTPUEmbeddingProximalYogiParametersGradAccumDebug' op ""attribute 'shard_id' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_config = odsAttrs.get("config");
    if (tblgen_config && !((tblgen_config.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.LoadTPUEmbeddingProximalYogiParametersGradAccumDebug' op ""attribute 'config' failed to satisfy constraint: string attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> LoadTPUEmbeddingProximalYogiParametersGradAccumDebugOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range LoadTPUEmbeddingProximalYogiParametersGradAccumDebugOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value LoadTPUEmbeddingProximalYogiParametersGradAccumDebugOp::parameters() {
  return *getODSOperands(0).begin();
}

::mlir::Value LoadTPUEmbeddingProximalYogiParametersGradAccumDebugOp::v() {
  return *getODSOperands(1).begin();
}

::mlir::Value LoadTPUEmbeddingProximalYogiParametersGradAccumDebugOp::m() {
  return *getODSOperands(2).begin();
}

::mlir::Value LoadTPUEmbeddingProximalYogiParametersGradAccumDebugOp::gradient_accumulators() {
  return *getODSOperands(3).begin();
}

::mlir::MutableOperandRange LoadTPUEmbeddingProximalYogiParametersGradAccumDebugOp::parametersMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange LoadTPUEmbeddingProximalYogiParametersGradAccumDebugOp::vMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange LoadTPUEmbeddingProximalYogiParametersGradAccumDebugOp::mMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange LoadTPUEmbeddingProximalYogiParametersGradAccumDebugOp::gradient_accumulatorsMutable() {
  auto range = getODSOperandIndexAndLength(3);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> LoadTPUEmbeddingProximalYogiParametersGradAccumDebugOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range LoadTPUEmbeddingProximalYogiParametersGradAccumDebugOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::IntegerAttr LoadTPUEmbeddingProximalYogiParametersGradAccumDebugOp::table_idAttr() {
  return (*this)->getAttr(table_idAttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t LoadTPUEmbeddingProximalYogiParametersGradAccumDebugOp::table_id() {
  auto attr = table_idAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), -1).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

::mlir::StringAttr LoadTPUEmbeddingProximalYogiParametersGradAccumDebugOp::table_nameAttr() {
  return (*this)->getAttr(table_nameAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef LoadTPUEmbeddingProximalYogiParametersGradAccumDebugOp::table_name() {
  auto attr = table_nameAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("").getValue();
  return attr.getValue();
}

::mlir::IntegerAttr LoadTPUEmbeddingProximalYogiParametersGradAccumDebugOp::num_shardsAttr() {
  return (*this)->getAttr(num_shardsAttrName()).cast<::mlir::IntegerAttr>();
}

uint64_t LoadTPUEmbeddingProximalYogiParametersGradAccumDebugOp::num_shards() {
  auto attr = num_shardsAttr();
  return attr.getValue().getZExtValue();
}

::mlir::IntegerAttr LoadTPUEmbeddingProximalYogiParametersGradAccumDebugOp::shard_idAttr() {
  return (*this)->getAttr(shard_idAttrName()).cast<::mlir::IntegerAttr>();
}

uint64_t LoadTPUEmbeddingProximalYogiParametersGradAccumDebugOp::shard_id() {
  auto attr = shard_idAttr();
  return attr.getValue().getZExtValue();
}

::mlir::StringAttr LoadTPUEmbeddingProximalYogiParametersGradAccumDebugOp::configAttr() {
  return (*this)->getAttr(configAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef LoadTPUEmbeddingProximalYogiParametersGradAccumDebugOp::config() {
  auto attr = configAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("").getValue();
  return attr.getValue();
}

void LoadTPUEmbeddingProximalYogiParametersGradAccumDebugOp::table_idAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(table_idAttrName(), attr);
}

void LoadTPUEmbeddingProximalYogiParametersGradAccumDebugOp::table_nameAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(table_nameAttrName(), attr);
}

void LoadTPUEmbeddingProximalYogiParametersGradAccumDebugOp::num_shardsAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(num_shardsAttrName(), attr);
}

void LoadTPUEmbeddingProximalYogiParametersGradAccumDebugOp::shard_idAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(shard_idAttrName(), attr);
}

void LoadTPUEmbeddingProximalYogiParametersGradAccumDebugOp::configAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(configAttrName(), attr);
}

void LoadTPUEmbeddingProximalYogiParametersGradAccumDebugOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value parameters, ::mlir::Value v, ::mlir::Value m, ::mlir::Value gradient_accumulators, ::mlir::IntegerAttr table_id, ::mlir::StringAttr table_name, ::mlir::IntegerAttr num_shards, ::mlir::IntegerAttr shard_id, ::mlir::StringAttr config) {
  odsState.addOperands(parameters);
  odsState.addOperands(v);
  odsState.addOperands(m);
  odsState.addOperands(gradient_accumulators);
  odsState.addAttribute(table_idAttrName(odsState.name), table_id);
  odsState.addAttribute(table_nameAttrName(odsState.name), table_name);
  odsState.addAttribute(num_shardsAttrName(odsState.name), num_shards);
  odsState.addAttribute(shard_idAttrName(odsState.name), shard_id);
  odsState.addAttribute(configAttrName(odsState.name), config);
}

void LoadTPUEmbeddingProximalYogiParametersGradAccumDebugOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value parameters, ::mlir::Value v, ::mlir::Value m, ::mlir::Value gradient_accumulators, ::mlir::IntegerAttr table_id, ::mlir::StringAttr table_name, ::mlir::IntegerAttr num_shards, ::mlir::IntegerAttr shard_id, ::mlir::StringAttr config) {
  odsState.addOperands(parameters);
  odsState.addOperands(v);
  odsState.addOperands(m);
  odsState.addOperands(gradient_accumulators);
  odsState.addAttribute(table_idAttrName(odsState.name), table_id);
  odsState.addAttribute(table_nameAttrName(odsState.name), table_name);
  odsState.addAttribute(num_shardsAttrName(odsState.name), num_shards);
  odsState.addAttribute(shard_idAttrName(odsState.name), shard_id);
  odsState.addAttribute(configAttrName(odsState.name), config);
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void LoadTPUEmbeddingProximalYogiParametersGradAccumDebugOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value parameters, ::mlir::Value v, ::mlir::Value m, ::mlir::Value gradient_accumulators, uint64_t table_id, ::llvm::StringRef table_name, uint64_t num_shards, uint64_t shard_id, ::llvm::StringRef config) {
  odsState.addOperands(parameters);
  odsState.addOperands(v);
  odsState.addOperands(m);
  odsState.addOperands(gradient_accumulators);
  odsState.addAttribute(table_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), table_id));
  odsState.addAttribute(table_nameAttrName(odsState.name), odsBuilder.getStringAttr(table_name));
  odsState.addAttribute(num_shardsAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), num_shards));
  odsState.addAttribute(shard_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), shard_id));
  odsState.addAttribute(configAttrName(odsState.name), odsBuilder.getStringAttr(config));
}

void LoadTPUEmbeddingProximalYogiParametersGradAccumDebugOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value parameters, ::mlir::Value v, ::mlir::Value m, ::mlir::Value gradient_accumulators, uint64_t table_id, ::llvm::StringRef table_name, uint64_t num_shards, uint64_t shard_id, ::llvm::StringRef config) {
  odsState.addOperands(parameters);
  odsState.addOperands(v);
  odsState.addOperands(m);
  odsState.addOperands(gradient_accumulators);
  odsState.addAttribute(table_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), table_id));
  odsState.addAttribute(table_nameAttrName(odsState.name), odsBuilder.getStringAttr(table_name));
  odsState.addAttribute(num_shardsAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), num_shards));
  odsState.addAttribute(shard_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), shard_id));
  odsState.addAttribute(configAttrName(odsState.name), odsBuilder.getStringAttr(config));
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void LoadTPUEmbeddingProximalYogiParametersGradAccumDebugOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 4u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 0u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult LoadTPUEmbeddingProximalYogiParametersGradAccumDebugOp::verify() {
  {
    auto tblgen_table_id = (*this)->getAttr(table_idAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_table_id, "table_id")))
      return ::mlir::failure();
  }
  {
    auto tblgen_table_name = (*this)->getAttr(table_nameAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_table_name, "table_name")))
      return ::mlir::failure();
  }
  {
    auto tblgen_num_shards = (*this)->getAttr(num_shardsAttrName());
    if (!tblgen_num_shards)
      return emitOpError("requires attribute 'num_shards'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_num_shards, "num_shards")))
      return ::mlir::failure();
  }
  {
    auto tblgen_shard_id = (*this)->getAttr(shard_idAttrName());
    if (!tblgen_shard_id)
      return emitOpError("requires attribute 'shard_id'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_shard_id, "shard_id")))
      return ::mlir::failure();
  }
  {
    auto tblgen_config = (*this)->getAttr(configAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_config, "config")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup3 = getODSOperands(3);

    for (auto v : valueGroup3) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void LoadTPUEmbeddingProximalYogiParametersGradAccumDebugOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  effects.emplace_back(::mlir::MemoryEffects::Write::get(), ::mlir::TF::ResourceEffects::MustExecute::get());
  effects.emplace_back(::mlir::MemoryEffects::Read::get(), ::mlir::TF::ResourceEffects::TPUEmbedding::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::LoadTPUEmbeddingProximalYogiParametersGradAccumDebugOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::LoadTPUEmbeddingProximalYogiParametersOp definitions
//===----------------------------------------------------------------------===//

LoadTPUEmbeddingProximalYogiParametersOpAdaptor::LoadTPUEmbeddingProximalYogiParametersOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

LoadTPUEmbeddingProximalYogiParametersOpAdaptor::LoadTPUEmbeddingProximalYogiParametersOpAdaptor(LoadTPUEmbeddingProximalYogiParametersOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange LoadTPUEmbeddingProximalYogiParametersOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> LoadTPUEmbeddingProximalYogiParametersOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange LoadTPUEmbeddingProximalYogiParametersOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value LoadTPUEmbeddingProximalYogiParametersOpAdaptor::parameters() {
  return *getODSOperands(0).begin();
}

::mlir::Value LoadTPUEmbeddingProximalYogiParametersOpAdaptor::v() {
  return *getODSOperands(1).begin();
}

::mlir::Value LoadTPUEmbeddingProximalYogiParametersOpAdaptor::m() {
  return *getODSOperands(2).begin();
}

::mlir::DictionaryAttr LoadTPUEmbeddingProximalYogiParametersOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::IntegerAttr LoadTPUEmbeddingProximalYogiParametersOpAdaptor::table_id() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("table_id").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), -1);
  return attr;
}

::mlir::StringAttr LoadTPUEmbeddingProximalYogiParametersOpAdaptor::table_name() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("table_name").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("");
  return attr;
}

::mlir::IntegerAttr LoadTPUEmbeddingProximalYogiParametersOpAdaptor::num_shards() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("num_shards").cast<::mlir::IntegerAttr>();
  return attr;
}

::mlir::IntegerAttr LoadTPUEmbeddingProximalYogiParametersOpAdaptor::shard_id() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("shard_id").cast<::mlir::IntegerAttr>();
  return attr;
}

::mlir::StringAttr LoadTPUEmbeddingProximalYogiParametersOpAdaptor::config() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("config").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("");
  return attr;
}

::mlir::LogicalResult LoadTPUEmbeddingProximalYogiParametersOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_table_id = odsAttrs.get("table_id");
    if (tblgen_table_id && !(((tblgen_table_id.isa<::mlir::IntegerAttr>())) && ((tblgen_table_id.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.LoadTPUEmbeddingProximalYogiParameters' op ""attribute 'table_id' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_table_name = odsAttrs.get("table_name");
    if (tblgen_table_name && !((tblgen_table_name.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.LoadTPUEmbeddingProximalYogiParameters' op ""attribute 'table_name' failed to satisfy constraint: string attribute");
  }
  {
    auto tblgen_num_shards = odsAttrs.get("num_shards");
    if (!tblgen_num_shards)
      return emitError(loc, "'tf.LoadTPUEmbeddingProximalYogiParameters' op ""requires attribute 'num_shards'");

    if (tblgen_num_shards && !(((tblgen_num_shards.isa<::mlir::IntegerAttr>())) && ((tblgen_num_shards.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.LoadTPUEmbeddingProximalYogiParameters' op ""attribute 'num_shards' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_shard_id = odsAttrs.get("shard_id");
    if (!tblgen_shard_id)
      return emitError(loc, "'tf.LoadTPUEmbeddingProximalYogiParameters' op ""requires attribute 'shard_id'");

    if (tblgen_shard_id && !(((tblgen_shard_id.isa<::mlir::IntegerAttr>())) && ((tblgen_shard_id.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.LoadTPUEmbeddingProximalYogiParameters' op ""attribute 'shard_id' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_config = odsAttrs.get("config");
    if (tblgen_config && !((tblgen_config.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.LoadTPUEmbeddingProximalYogiParameters' op ""attribute 'config' failed to satisfy constraint: string attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> LoadTPUEmbeddingProximalYogiParametersOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range LoadTPUEmbeddingProximalYogiParametersOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value LoadTPUEmbeddingProximalYogiParametersOp::parameters() {
  return *getODSOperands(0).begin();
}

::mlir::Value LoadTPUEmbeddingProximalYogiParametersOp::v() {
  return *getODSOperands(1).begin();
}

::mlir::Value LoadTPUEmbeddingProximalYogiParametersOp::m() {
  return *getODSOperands(2).begin();
}

::mlir::MutableOperandRange LoadTPUEmbeddingProximalYogiParametersOp::parametersMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange LoadTPUEmbeddingProximalYogiParametersOp::vMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange LoadTPUEmbeddingProximalYogiParametersOp::mMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> LoadTPUEmbeddingProximalYogiParametersOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range LoadTPUEmbeddingProximalYogiParametersOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::IntegerAttr LoadTPUEmbeddingProximalYogiParametersOp::table_idAttr() {
  return (*this)->getAttr(table_idAttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t LoadTPUEmbeddingProximalYogiParametersOp::table_id() {
  auto attr = table_idAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), -1).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

::mlir::StringAttr LoadTPUEmbeddingProximalYogiParametersOp::table_nameAttr() {
  return (*this)->getAttr(table_nameAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef LoadTPUEmbeddingProximalYogiParametersOp::table_name() {
  auto attr = table_nameAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("").getValue();
  return attr.getValue();
}

::mlir::IntegerAttr LoadTPUEmbeddingProximalYogiParametersOp::num_shardsAttr() {
  return (*this)->getAttr(num_shardsAttrName()).cast<::mlir::IntegerAttr>();
}

uint64_t LoadTPUEmbeddingProximalYogiParametersOp::num_shards() {
  auto attr = num_shardsAttr();
  return attr.getValue().getZExtValue();
}

::mlir::IntegerAttr LoadTPUEmbeddingProximalYogiParametersOp::shard_idAttr() {
  return (*this)->getAttr(shard_idAttrName()).cast<::mlir::IntegerAttr>();
}

uint64_t LoadTPUEmbeddingProximalYogiParametersOp::shard_id() {
  auto attr = shard_idAttr();
  return attr.getValue().getZExtValue();
}

::mlir::StringAttr LoadTPUEmbeddingProximalYogiParametersOp::configAttr() {
  return (*this)->getAttr(configAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef LoadTPUEmbeddingProximalYogiParametersOp::config() {
  auto attr = configAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("").getValue();
  return attr.getValue();
}

void LoadTPUEmbeddingProximalYogiParametersOp::table_idAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(table_idAttrName(), attr);
}

void LoadTPUEmbeddingProximalYogiParametersOp::table_nameAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(table_nameAttrName(), attr);
}

void LoadTPUEmbeddingProximalYogiParametersOp::num_shardsAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(num_shardsAttrName(), attr);
}

void LoadTPUEmbeddingProximalYogiParametersOp::shard_idAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(shard_idAttrName(), attr);
}

void LoadTPUEmbeddingProximalYogiParametersOp::configAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(configAttrName(), attr);
}

void LoadTPUEmbeddingProximalYogiParametersOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value parameters, ::mlir::Value v, ::mlir::Value m, ::mlir::IntegerAttr table_id, ::mlir::StringAttr table_name, ::mlir::IntegerAttr num_shards, ::mlir::IntegerAttr shard_id, ::mlir::StringAttr config) {
  odsState.addOperands(parameters);
  odsState.addOperands(v);
  odsState.addOperands(m);
  odsState.addAttribute(table_idAttrName(odsState.name), table_id);
  odsState.addAttribute(table_nameAttrName(odsState.name), table_name);
  odsState.addAttribute(num_shardsAttrName(odsState.name), num_shards);
  odsState.addAttribute(shard_idAttrName(odsState.name), shard_id);
  odsState.addAttribute(configAttrName(odsState.name), config);
}

void LoadTPUEmbeddingProximalYogiParametersOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value parameters, ::mlir::Value v, ::mlir::Value m, ::mlir::IntegerAttr table_id, ::mlir::StringAttr table_name, ::mlir::IntegerAttr num_shards, ::mlir::IntegerAttr shard_id, ::mlir::StringAttr config) {
  odsState.addOperands(parameters);
  odsState.addOperands(v);
  odsState.addOperands(m);
  odsState.addAttribute(table_idAttrName(odsState.name), table_id);
  odsState.addAttribute(table_nameAttrName(odsState.name), table_name);
  odsState.addAttribute(num_shardsAttrName(odsState.name), num_shards);
  odsState.addAttribute(shard_idAttrName(odsState.name), shard_id);
  odsState.addAttribute(configAttrName(odsState.name), config);
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void LoadTPUEmbeddingProximalYogiParametersOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value parameters, ::mlir::Value v, ::mlir::Value m, uint64_t table_id, ::llvm::StringRef table_name, uint64_t num_shards, uint64_t shard_id, ::llvm::StringRef config) {
  odsState.addOperands(parameters);
  odsState.addOperands(v);
  odsState.addOperands(m);
  odsState.addAttribute(table_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), table_id));
  odsState.addAttribute(table_nameAttrName(odsState.name), odsBuilder.getStringAttr(table_name));
  odsState.addAttribute(num_shardsAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), num_shards));
  odsState.addAttribute(shard_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), shard_id));
  odsState.addAttribute(configAttrName(odsState.name), odsBuilder.getStringAttr(config));
}

void LoadTPUEmbeddingProximalYogiParametersOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value parameters, ::mlir::Value v, ::mlir::Value m, uint64_t table_id, ::llvm::StringRef table_name, uint64_t num_shards, uint64_t shard_id, ::llvm::StringRef config) {
  odsState.addOperands(parameters);
  odsState.addOperands(v);
  odsState.addOperands(m);
  odsState.addAttribute(table_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), table_id));
  odsState.addAttribute(table_nameAttrName(odsState.name), odsBuilder.getStringAttr(table_name));
  odsState.addAttribute(num_shardsAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), num_shards));
  odsState.addAttribute(shard_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), shard_id));
  odsState.addAttribute(configAttrName(odsState.name), odsBuilder.getStringAttr(config));
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void LoadTPUEmbeddingProximalYogiParametersOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 3u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 0u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult LoadTPUEmbeddingProximalYogiParametersOp::verify() {
  {
    auto tblgen_table_id = (*this)->getAttr(table_idAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_table_id, "table_id")))
      return ::mlir::failure();
  }
  {
    auto tblgen_table_name = (*this)->getAttr(table_nameAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_table_name, "table_name")))
      return ::mlir::failure();
  }
  {
    auto tblgen_num_shards = (*this)->getAttr(num_shardsAttrName());
    if (!tblgen_num_shards)
      return emitOpError("requires attribute 'num_shards'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_num_shards, "num_shards")))
      return ::mlir::failure();
  }
  {
    auto tblgen_shard_id = (*this)->getAttr(shard_idAttrName());
    if (!tblgen_shard_id)
      return emitOpError("requires attribute 'shard_id'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_shard_id, "shard_id")))
      return ::mlir::failure();
  }
  {
    auto tblgen_config = (*this)->getAttr(configAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_config, "config")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void LoadTPUEmbeddingProximalYogiParametersOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  effects.emplace_back(::mlir::MemoryEffects::Write::get(), ::mlir::TF::ResourceEffects::MustExecute::get());
  effects.emplace_back(::mlir::MemoryEffects::Read::get(), ::mlir::TF::ResourceEffects::TPUEmbedding::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::LoadTPUEmbeddingProximalYogiParametersOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::LoadTPUEmbeddingRMSPropParametersGradAccumDebugOp definitions
//===----------------------------------------------------------------------===//

LoadTPUEmbeddingRMSPropParametersGradAccumDebugOpAdaptor::LoadTPUEmbeddingRMSPropParametersGradAccumDebugOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

LoadTPUEmbeddingRMSPropParametersGradAccumDebugOpAdaptor::LoadTPUEmbeddingRMSPropParametersGradAccumDebugOpAdaptor(LoadTPUEmbeddingRMSPropParametersGradAccumDebugOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange LoadTPUEmbeddingRMSPropParametersGradAccumDebugOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> LoadTPUEmbeddingRMSPropParametersGradAccumDebugOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange LoadTPUEmbeddingRMSPropParametersGradAccumDebugOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value LoadTPUEmbeddingRMSPropParametersGradAccumDebugOpAdaptor::parameters() {
  return *getODSOperands(0).begin();
}

::mlir::Value LoadTPUEmbeddingRMSPropParametersGradAccumDebugOpAdaptor::ms() {
  return *getODSOperands(1).begin();
}

::mlir::Value LoadTPUEmbeddingRMSPropParametersGradAccumDebugOpAdaptor::mom() {
  return *getODSOperands(2).begin();
}

::mlir::Value LoadTPUEmbeddingRMSPropParametersGradAccumDebugOpAdaptor::gradient_accumulators() {
  return *getODSOperands(3).begin();
}

::mlir::DictionaryAttr LoadTPUEmbeddingRMSPropParametersGradAccumDebugOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::IntegerAttr LoadTPUEmbeddingRMSPropParametersGradAccumDebugOpAdaptor::table_id() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("table_id").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), -1);
  return attr;
}

::mlir::StringAttr LoadTPUEmbeddingRMSPropParametersGradAccumDebugOpAdaptor::table_name() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("table_name").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("");
  return attr;
}

::mlir::IntegerAttr LoadTPUEmbeddingRMSPropParametersGradAccumDebugOpAdaptor::num_shards() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("num_shards").cast<::mlir::IntegerAttr>();
  return attr;
}

::mlir::IntegerAttr LoadTPUEmbeddingRMSPropParametersGradAccumDebugOpAdaptor::shard_id() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("shard_id").cast<::mlir::IntegerAttr>();
  return attr;
}

::mlir::StringAttr LoadTPUEmbeddingRMSPropParametersGradAccumDebugOpAdaptor::config() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("config").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("");
  return attr;
}

::mlir::LogicalResult LoadTPUEmbeddingRMSPropParametersGradAccumDebugOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_table_id = odsAttrs.get("table_id");
    if (tblgen_table_id && !(((tblgen_table_id.isa<::mlir::IntegerAttr>())) && ((tblgen_table_id.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.LoadTPUEmbeddingRMSPropParametersGradAccumDebug' op ""attribute 'table_id' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_table_name = odsAttrs.get("table_name");
    if (tblgen_table_name && !((tblgen_table_name.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.LoadTPUEmbeddingRMSPropParametersGradAccumDebug' op ""attribute 'table_name' failed to satisfy constraint: string attribute");
  }
  {
    auto tblgen_num_shards = odsAttrs.get("num_shards");
    if (!tblgen_num_shards)
      return emitError(loc, "'tf.LoadTPUEmbeddingRMSPropParametersGradAccumDebug' op ""requires attribute 'num_shards'");

    if (tblgen_num_shards && !(((tblgen_num_shards.isa<::mlir::IntegerAttr>())) && ((tblgen_num_shards.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.LoadTPUEmbeddingRMSPropParametersGradAccumDebug' op ""attribute 'num_shards' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_shard_id = odsAttrs.get("shard_id");
    if (!tblgen_shard_id)
      return emitError(loc, "'tf.LoadTPUEmbeddingRMSPropParametersGradAccumDebug' op ""requires attribute 'shard_id'");

    if (tblgen_shard_id && !(((tblgen_shard_id.isa<::mlir::IntegerAttr>())) && ((tblgen_shard_id.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.LoadTPUEmbeddingRMSPropParametersGradAccumDebug' op ""attribute 'shard_id' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_config = odsAttrs.get("config");
    if (tblgen_config && !((tblgen_config.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.LoadTPUEmbeddingRMSPropParametersGradAccumDebug' op ""attribute 'config' failed to satisfy constraint: string attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> LoadTPUEmbeddingRMSPropParametersGradAccumDebugOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range LoadTPUEmbeddingRMSPropParametersGradAccumDebugOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value LoadTPUEmbeddingRMSPropParametersGradAccumDebugOp::parameters() {
  return *getODSOperands(0).begin();
}

::mlir::Value LoadTPUEmbeddingRMSPropParametersGradAccumDebugOp::ms() {
  return *getODSOperands(1).begin();
}

::mlir::Value LoadTPUEmbeddingRMSPropParametersGradAccumDebugOp::mom() {
  return *getODSOperands(2).begin();
}

::mlir::Value LoadTPUEmbeddingRMSPropParametersGradAccumDebugOp::gradient_accumulators() {
  return *getODSOperands(3).begin();
}

::mlir::MutableOperandRange LoadTPUEmbeddingRMSPropParametersGradAccumDebugOp::parametersMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange LoadTPUEmbeddingRMSPropParametersGradAccumDebugOp::msMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange LoadTPUEmbeddingRMSPropParametersGradAccumDebugOp::momMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange LoadTPUEmbeddingRMSPropParametersGradAccumDebugOp::gradient_accumulatorsMutable() {
  auto range = getODSOperandIndexAndLength(3);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> LoadTPUEmbeddingRMSPropParametersGradAccumDebugOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range LoadTPUEmbeddingRMSPropParametersGradAccumDebugOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::IntegerAttr LoadTPUEmbeddingRMSPropParametersGradAccumDebugOp::table_idAttr() {
  return (*this)->getAttr(table_idAttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t LoadTPUEmbeddingRMSPropParametersGradAccumDebugOp::table_id() {
  auto attr = table_idAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), -1).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

::mlir::StringAttr LoadTPUEmbeddingRMSPropParametersGradAccumDebugOp::table_nameAttr() {
  return (*this)->getAttr(table_nameAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef LoadTPUEmbeddingRMSPropParametersGradAccumDebugOp::table_name() {
  auto attr = table_nameAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("").getValue();
  return attr.getValue();
}

::mlir::IntegerAttr LoadTPUEmbeddingRMSPropParametersGradAccumDebugOp::num_shardsAttr() {
  return (*this)->getAttr(num_shardsAttrName()).cast<::mlir::IntegerAttr>();
}

uint64_t LoadTPUEmbeddingRMSPropParametersGradAccumDebugOp::num_shards() {
  auto attr = num_shardsAttr();
  return attr.getValue().getZExtValue();
}

::mlir::IntegerAttr LoadTPUEmbeddingRMSPropParametersGradAccumDebugOp::shard_idAttr() {
  return (*this)->getAttr(shard_idAttrName()).cast<::mlir::IntegerAttr>();
}

uint64_t LoadTPUEmbeddingRMSPropParametersGradAccumDebugOp::shard_id() {
  auto attr = shard_idAttr();
  return attr.getValue().getZExtValue();
}

::mlir::StringAttr LoadTPUEmbeddingRMSPropParametersGradAccumDebugOp::configAttr() {
  return (*this)->getAttr(configAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef LoadTPUEmbeddingRMSPropParametersGradAccumDebugOp::config() {
  auto attr = configAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("").getValue();
  return attr.getValue();
}

void LoadTPUEmbeddingRMSPropParametersGradAccumDebugOp::table_idAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(table_idAttrName(), attr);
}

void LoadTPUEmbeddingRMSPropParametersGradAccumDebugOp::table_nameAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(table_nameAttrName(), attr);
}

void LoadTPUEmbeddingRMSPropParametersGradAccumDebugOp::num_shardsAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(num_shardsAttrName(), attr);
}

void LoadTPUEmbeddingRMSPropParametersGradAccumDebugOp::shard_idAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(shard_idAttrName(), attr);
}

void LoadTPUEmbeddingRMSPropParametersGradAccumDebugOp::configAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(configAttrName(), attr);
}

void LoadTPUEmbeddingRMSPropParametersGradAccumDebugOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value parameters, ::mlir::Value ms, ::mlir::Value mom, ::mlir::Value gradient_accumulators, ::mlir::IntegerAttr table_id, ::mlir::StringAttr table_name, ::mlir::IntegerAttr num_shards, ::mlir::IntegerAttr shard_id, ::mlir::StringAttr config) {
  odsState.addOperands(parameters);
  odsState.addOperands(ms);
  odsState.addOperands(mom);
  odsState.addOperands(gradient_accumulators);
  odsState.addAttribute(table_idAttrName(odsState.name), table_id);
  odsState.addAttribute(table_nameAttrName(odsState.name), table_name);
  odsState.addAttribute(num_shardsAttrName(odsState.name), num_shards);
  odsState.addAttribute(shard_idAttrName(odsState.name), shard_id);
  odsState.addAttribute(configAttrName(odsState.name), config);
}

void LoadTPUEmbeddingRMSPropParametersGradAccumDebugOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value parameters, ::mlir::Value ms, ::mlir::Value mom, ::mlir::Value gradient_accumulators, ::mlir::IntegerAttr table_id, ::mlir::StringAttr table_name, ::mlir::IntegerAttr num_shards, ::mlir::IntegerAttr shard_id, ::mlir::StringAttr config) {
  odsState.addOperands(parameters);
  odsState.addOperands(ms);
  odsState.addOperands(mom);
  odsState.addOperands(gradient_accumulators);
  odsState.addAttribute(table_idAttrName(odsState.name), table_id);
  odsState.addAttribute(table_nameAttrName(odsState.name), table_name);
  odsState.addAttribute(num_shardsAttrName(odsState.name), num_shards);
  odsState.addAttribute(shard_idAttrName(odsState.name), shard_id);
  odsState.addAttribute(configAttrName(odsState.name), config);
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void LoadTPUEmbeddingRMSPropParametersGradAccumDebugOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value parameters, ::mlir::Value ms, ::mlir::Value mom, ::mlir::Value gradient_accumulators, uint64_t table_id, ::llvm::StringRef table_name, uint64_t num_shards, uint64_t shard_id, ::llvm::StringRef config) {
  odsState.addOperands(parameters);
  odsState.addOperands(ms);
  odsState.addOperands(mom);
  odsState.addOperands(gradient_accumulators);
  odsState.addAttribute(table_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), table_id));
  odsState.addAttribute(table_nameAttrName(odsState.name), odsBuilder.getStringAttr(table_name));
  odsState.addAttribute(num_shardsAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), num_shards));
  odsState.addAttribute(shard_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), shard_id));
  odsState.addAttribute(configAttrName(odsState.name), odsBuilder.getStringAttr(config));
}

void LoadTPUEmbeddingRMSPropParametersGradAccumDebugOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value parameters, ::mlir::Value ms, ::mlir::Value mom, ::mlir::Value gradient_accumulators, uint64_t table_id, ::llvm::StringRef table_name, uint64_t num_shards, uint64_t shard_id, ::llvm::StringRef config) {
  odsState.addOperands(parameters);
  odsState.addOperands(ms);
  odsState.addOperands(mom);
  odsState.addOperands(gradient_accumulators);
  odsState.addAttribute(table_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), table_id));
  odsState.addAttribute(table_nameAttrName(odsState.name), odsBuilder.getStringAttr(table_name));
  odsState.addAttribute(num_shardsAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), num_shards));
  odsState.addAttribute(shard_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), shard_id));
  odsState.addAttribute(configAttrName(odsState.name), odsBuilder.getStringAttr(config));
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void LoadTPUEmbeddingRMSPropParametersGradAccumDebugOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 4u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 0u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult LoadTPUEmbeddingRMSPropParametersGradAccumDebugOp::verify() {
  {
    auto tblgen_table_id = (*this)->getAttr(table_idAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_table_id, "table_id")))
      return ::mlir::failure();
  }
  {
    auto tblgen_table_name = (*this)->getAttr(table_nameAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_table_name, "table_name")))
      return ::mlir::failure();
  }
  {
    auto tblgen_num_shards = (*this)->getAttr(num_shardsAttrName());
    if (!tblgen_num_shards)
      return emitOpError("requires attribute 'num_shards'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_num_shards, "num_shards")))
      return ::mlir::failure();
  }
  {
    auto tblgen_shard_id = (*this)->getAttr(shard_idAttrName());
    if (!tblgen_shard_id)
      return emitOpError("requires attribute 'shard_id'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_shard_id, "shard_id")))
      return ::mlir::failure();
  }
  {
    auto tblgen_config = (*this)->getAttr(configAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_config, "config")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup3 = getODSOperands(3);

    for (auto v : valueGroup3) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void LoadTPUEmbeddingRMSPropParametersGradAccumDebugOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  effects.emplace_back(::mlir::MemoryEffects::Write::get(), ::mlir::TF::ResourceEffects::MustExecute::get());
  effects.emplace_back(::mlir::MemoryEffects::Read::get(), ::mlir::TF::ResourceEffects::TPUEmbedding::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::LoadTPUEmbeddingRMSPropParametersGradAccumDebugOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::LoadTPUEmbeddingRMSPropParametersOp definitions
//===----------------------------------------------------------------------===//

LoadTPUEmbeddingRMSPropParametersOpAdaptor::LoadTPUEmbeddingRMSPropParametersOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

LoadTPUEmbeddingRMSPropParametersOpAdaptor::LoadTPUEmbeddingRMSPropParametersOpAdaptor(LoadTPUEmbeddingRMSPropParametersOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange LoadTPUEmbeddingRMSPropParametersOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> LoadTPUEmbeddingRMSPropParametersOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange LoadTPUEmbeddingRMSPropParametersOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value LoadTPUEmbeddingRMSPropParametersOpAdaptor::parameters() {
  return *getODSOperands(0).begin();
}

::mlir::Value LoadTPUEmbeddingRMSPropParametersOpAdaptor::ms() {
  return *getODSOperands(1).begin();
}

::mlir::Value LoadTPUEmbeddingRMSPropParametersOpAdaptor::mom() {
  return *getODSOperands(2).begin();
}

::mlir::DictionaryAttr LoadTPUEmbeddingRMSPropParametersOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::IntegerAttr LoadTPUEmbeddingRMSPropParametersOpAdaptor::table_id() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("table_id").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), -1);
  return attr;
}

::mlir::StringAttr LoadTPUEmbeddingRMSPropParametersOpAdaptor::table_name() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("table_name").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("");
  return attr;
}

::mlir::IntegerAttr LoadTPUEmbeddingRMSPropParametersOpAdaptor::num_shards() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("num_shards").cast<::mlir::IntegerAttr>();
  return attr;
}

::mlir::IntegerAttr LoadTPUEmbeddingRMSPropParametersOpAdaptor::shard_id() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("shard_id").cast<::mlir::IntegerAttr>();
  return attr;
}

::mlir::StringAttr LoadTPUEmbeddingRMSPropParametersOpAdaptor::config() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("config").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("");
  return attr;
}

::mlir::LogicalResult LoadTPUEmbeddingRMSPropParametersOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_table_id = odsAttrs.get("table_id");
    if (tblgen_table_id && !(((tblgen_table_id.isa<::mlir::IntegerAttr>())) && ((tblgen_table_id.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.LoadTPUEmbeddingRMSPropParameters' op ""attribute 'table_id' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_table_name = odsAttrs.get("table_name");
    if (tblgen_table_name && !((tblgen_table_name.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.LoadTPUEmbeddingRMSPropParameters' op ""attribute 'table_name' failed to satisfy constraint: string attribute");
  }
  {
    auto tblgen_num_shards = odsAttrs.get("num_shards");
    if (!tblgen_num_shards)
      return emitError(loc, "'tf.LoadTPUEmbeddingRMSPropParameters' op ""requires attribute 'num_shards'");

    if (tblgen_num_shards && !(((tblgen_num_shards.isa<::mlir::IntegerAttr>())) && ((tblgen_num_shards.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.LoadTPUEmbeddingRMSPropParameters' op ""attribute 'num_shards' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_shard_id = odsAttrs.get("shard_id");
    if (!tblgen_shard_id)
      return emitError(loc, "'tf.LoadTPUEmbeddingRMSPropParameters' op ""requires attribute 'shard_id'");

    if (tblgen_shard_id && !(((tblgen_shard_id.isa<::mlir::IntegerAttr>())) && ((tblgen_shard_id.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.LoadTPUEmbeddingRMSPropParameters' op ""attribute 'shard_id' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_config = odsAttrs.get("config");
    if (tblgen_config && !((tblgen_config.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.LoadTPUEmbeddingRMSPropParameters' op ""attribute 'config' failed to satisfy constraint: string attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> LoadTPUEmbeddingRMSPropParametersOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range LoadTPUEmbeddingRMSPropParametersOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value LoadTPUEmbeddingRMSPropParametersOp::parameters() {
  return *getODSOperands(0).begin();
}

::mlir::Value LoadTPUEmbeddingRMSPropParametersOp::ms() {
  return *getODSOperands(1).begin();
}

::mlir::Value LoadTPUEmbeddingRMSPropParametersOp::mom() {
  return *getODSOperands(2).begin();
}

::mlir::MutableOperandRange LoadTPUEmbeddingRMSPropParametersOp::parametersMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange LoadTPUEmbeddingRMSPropParametersOp::msMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange LoadTPUEmbeddingRMSPropParametersOp::momMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> LoadTPUEmbeddingRMSPropParametersOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range LoadTPUEmbeddingRMSPropParametersOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::IntegerAttr LoadTPUEmbeddingRMSPropParametersOp::table_idAttr() {
  return (*this)->getAttr(table_idAttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t LoadTPUEmbeddingRMSPropParametersOp::table_id() {
  auto attr = table_idAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), -1).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

::mlir::StringAttr LoadTPUEmbeddingRMSPropParametersOp::table_nameAttr() {
  return (*this)->getAttr(table_nameAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef LoadTPUEmbeddingRMSPropParametersOp::table_name() {
  auto attr = table_nameAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("").getValue();
  return attr.getValue();
}

::mlir::IntegerAttr LoadTPUEmbeddingRMSPropParametersOp::num_shardsAttr() {
  return (*this)->getAttr(num_shardsAttrName()).cast<::mlir::IntegerAttr>();
}

uint64_t LoadTPUEmbeddingRMSPropParametersOp::num_shards() {
  auto attr = num_shardsAttr();
  return attr.getValue().getZExtValue();
}

::mlir::IntegerAttr LoadTPUEmbeddingRMSPropParametersOp::shard_idAttr() {
  return (*this)->getAttr(shard_idAttrName()).cast<::mlir::IntegerAttr>();
}

uint64_t LoadTPUEmbeddingRMSPropParametersOp::shard_id() {
  auto attr = shard_idAttr();
  return attr.getValue().getZExtValue();
}

::mlir::StringAttr LoadTPUEmbeddingRMSPropParametersOp::configAttr() {
  return (*this)->getAttr(configAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef LoadTPUEmbeddingRMSPropParametersOp::config() {
  auto attr = configAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("").getValue();
  return attr.getValue();
}

void LoadTPUEmbeddingRMSPropParametersOp::table_idAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(table_idAttrName(), attr);
}

void LoadTPUEmbeddingRMSPropParametersOp::table_nameAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(table_nameAttrName(), attr);
}

void LoadTPUEmbeddingRMSPropParametersOp::num_shardsAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(num_shardsAttrName(), attr);
}

void LoadTPUEmbeddingRMSPropParametersOp::shard_idAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(shard_idAttrName(), attr);
}

void LoadTPUEmbeddingRMSPropParametersOp::configAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(configAttrName(), attr);
}

void LoadTPUEmbeddingRMSPropParametersOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value parameters, ::mlir::Value ms, ::mlir::Value mom, ::mlir::IntegerAttr table_id, ::mlir::StringAttr table_name, ::mlir::IntegerAttr num_shards, ::mlir::IntegerAttr shard_id, ::mlir::StringAttr config) {
  odsState.addOperands(parameters);
  odsState.addOperands(ms);
  odsState.addOperands(mom);
  odsState.addAttribute(table_idAttrName(odsState.name), table_id);
  odsState.addAttribute(table_nameAttrName(odsState.name), table_name);
  odsState.addAttribute(num_shardsAttrName(odsState.name), num_shards);
  odsState.addAttribute(shard_idAttrName(odsState.name), shard_id);
  odsState.addAttribute(configAttrName(odsState.name), config);
}

void LoadTPUEmbeddingRMSPropParametersOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value parameters, ::mlir::Value ms, ::mlir::Value mom, ::mlir::IntegerAttr table_id, ::mlir::StringAttr table_name, ::mlir::IntegerAttr num_shards, ::mlir::IntegerAttr shard_id, ::mlir::StringAttr config) {
  odsState.addOperands(parameters);
  odsState.addOperands(ms);
  odsState.addOperands(mom);
  odsState.addAttribute(table_idAttrName(odsState.name), table_id);
  odsState.addAttribute(table_nameAttrName(odsState.name), table_name);
  odsState.addAttribute(num_shardsAttrName(odsState.name), num_shards);
  odsState.addAttribute(shard_idAttrName(odsState.name), shard_id);
  odsState.addAttribute(configAttrName(odsState.name), config);
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void LoadTPUEmbeddingRMSPropParametersOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value parameters, ::mlir::Value ms, ::mlir::Value mom, uint64_t table_id, ::llvm::StringRef table_name, uint64_t num_shards, uint64_t shard_id, ::llvm::StringRef config) {
  odsState.addOperands(parameters);
  odsState.addOperands(ms);
  odsState.addOperands(mom);
  odsState.addAttribute(table_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), table_id));
  odsState.addAttribute(table_nameAttrName(odsState.name), odsBuilder.getStringAttr(table_name));
  odsState.addAttribute(num_shardsAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), num_shards));
  odsState.addAttribute(shard_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), shard_id));
  odsState.addAttribute(configAttrName(odsState.name), odsBuilder.getStringAttr(config));
}

void LoadTPUEmbeddingRMSPropParametersOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value parameters, ::mlir::Value ms, ::mlir::Value mom, uint64_t table_id, ::llvm::StringRef table_name, uint64_t num_shards, uint64_t shard_id, ::llvm::StringRef config) {
  odsState.addOperands(parameters);
  odsState.addOperands(ms);
  odsState.addOperands(mom);
  odsState.addAttribute(table_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), table_id));
  odsState.addAttribute(table_nameAttrName(odsState.name), odsBuilder.getStringAttr(table_name));
  odsState.addAttribute(num_shardsAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), num_shards));
  odsState.addAttribute(shard_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), shard_id));
  odsState.addAttribute(configAttrName(odsState.name), odsBuilder.getStringAttr(config));
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void LoadTPUEmbeddingRMSPropParametersOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 3u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 0u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult LoadTPUEmbeddingRMSPropParametersOp::verify() {
  {
    auto tblgen_table_id = (*this)->getAttr(table_idAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_table_id, "table_id")))
      return ::mlir::failure();
  }
  {
    auto tblgen_table_name = (*this)->getAttr(table_nameAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_table_name, "table_name")))
      return ::mlir::failure();
  }
  {
    auto tblgen_num_shards = (*this)->getAttr(num_shardsAttrName());
    if (!tblgen_num_shards)
      return emitOpError("requires attribute 'num_shards'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_num_shards, "num_shards")))
      return ::mlir::failure();
  }
  {
    auto tblgen_shard_id = (*this)->getAttr(shard_idAttrName());
    if (!tblgen_shard_id)
      return emitOpError("requires attribute 'shard_id'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_shard_id, "shard_id")))
      return ::mlir::failure();
  }
  {
    auto tblgen_config = (*this)->getAttr(configAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_config, "config")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void LoadTPUEmbeddingRMSPropParametersOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  effects.emplace_back(::mlir::MemoryEffects::Write::get(), ::mlir::TF::ResourceEffects::MustExecute::get());
  effects.emplace_back(::mlir::MemoryEffects::Read::get(), ::mlir::TF::ResourceEffects::TPUEmbedding::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::LoadTPUEmbeddingRMSPropParametersOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::LoadTPUEmbeddingStochasticGradientDescentParametersGradAccumDebugOp definitions
//===----------------------------------------------------------------------===//

LoadTPUEmbeddingStochasticGradientDescentParametersGradAccumDebugOpAdaptor::LoadTPUEmbeddingStochasticGradientDescentParametersGradAccumDebugOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

LoadTPUEmbeddingStochasticGradientDescentParametersGradAccumDebugOpAdaptor::LoadTPUEmbeddingStochasticGradientDescentParametersGradAccumDebugOpAdaptor(LoadTPUEmbeddingStochasticGradientDescentParametersGradAccumDebugOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange LoadTPUEmbeddingStochasticGradientDescentParametersGradAccumDebugOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> LoadTPUEmbeddingStochasticGradientDescentParametersGradAccumDebugOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange LoadTPUEmbeddingStochasticGradientDescentParametersGradAccumDebugOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value LoadTPUEmbeddingStochasticGradientDescentParametersGradAccumDebugOpAdaptor::parameters() {
  return *getODSOperands(0).begin();
}

::mlir::Value LoadTPUEmbeddingStochasticGradientDescentParametersGradAccumDebugOpAdaptor::gradient_accumulators() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr LoadTPUEmbeddingStochasticGradientDescentParametersGradAccumDebugOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::IntegerAttr LoadTPUEmbeddingStochasticGradientDescentParametersGradAccumDebugOpAdaptor::table_id() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("table_id").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), -1);
  return attr;
}

::mlir::StringAttr LoadTPUEmbeddingStochasticGradientDescentParametersGradAccumDebugOpAdaptor::table_name() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("table_name").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("");
  return attr;
}

::mlir::IntegerAttr LoadTPUEmbeddingStochasticGradientDescentParametersGradAccumDebugOpAdaptor::num_shards() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("num_shards").cast<::mlir::IntegerAttr>();
  return attr;
}

::mlir::IntegerAttr LoadTPUEmbeddingStochasticGradientDescentParametersGradAccumDebugOpAdaptor::shard_id() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("shard_id").cast<::mlir::IntegerAttr>();
  return attr;
}

::mlir::StringAttr LoadTPUEmbeddingStochasticGradientDescentParametersGradAccumDebugOpAdaptor::config() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("config").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("");
  return attr;
}

::mlir::LogicalResult LoadTPUEmbeddingStochasticGradientDescentParametersGradAccumDebugOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_table_id = odsAttrs.get("table_id");
    if (tblgen_table_id && !(((tblgen_table_id.isa<::mlir::IntegerAttr>())) && ((tblgen_table_id.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.LoadTPUEmbeddingStochasticGradientDescentParametersGradAccumDebug' op ""attribute 'table_id' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_table_name = odsAttrs.get("table_name");
    if (tblgen_table_name && !((tblgen_table_name.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.LoadTPUEmbeddingStochasticGradientDescentParametersGradAccumDebug' op ""attribute 'table_name' failed to satisfy constraint: string attribute");
  }
  {
    auto tblgen_num_shards = odsAttrs.get("num_shards");
    if (!tblgen_num_shards)
      return emitError(loc, "'tf.LoadTPUEmbeddingStochasticGradientDescentParametersGradAccumDebug' op ""requires attribute 'num_shards'");

    if (tblgen_num_shards && !(((tblgen_num_shards.isa<::mlir::IntegerAttr>())) && ((tblgen_num_shards.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.LoadTPUEmbeddingStochasticGradientDescentParametersGradAccumDebug' op ""attribute 'num_shards' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_shard_id = odsAttrs.get("shard_id");
    if (!tblgen_shard_id)
      return emitError(loc, "'tf.LoadTPUEmbeddingStochasticGradientDescentParametersGradAccumDebug' op ""requires attribute 'shard_id'");

    if (tblgen_shard_id && !(((tblgen_shard_id.isa<::mlir::IntegerAttr>())) && ((tblgen_shard_id.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.LoadTPUEmbeddingStochasticGradientDescentParametersGradAccumDebug' op ""attribute 'shard_id' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_config = odsAttrs.get("config");
    if (tblgen_config && !((tblgen_config.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.LoadTPUEmbeddingStochasticGradientDescentParametersGradAccumDebug' op ""attribute 'config' failed to satisfy constraint: string attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> LoadTPUEmbeddingStochasticGradientDescentParametersGradAccumDebugOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range LoadTPUEmbeddingStochasticGradientDescentParametersGradAccumDebugOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value LoadTPUEmbeddingStochasticGradientDescentParametersGradAccumDebugOp::parameters() {
  return *getODSOperands(0).begin();
}

::mlir::Value LoadTPUEmbeddingStochasticGradientDescentParametersGradAccumDebugOp::gradient_accumulators() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange LoadTPUEmbeddingStochasticGradientDescentParametersGradAccumDebugOp::parametersMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange LoadTPUEmbeddingStochasticGradientDescentParametersGradAccumDebugOp::gradient_accumulatorsMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> LoadTPUEmbeddingStochasticGradientDescentParametersGradAccumDebugOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range LoadTPUEmbeddingStochasticGradientDescentParametersGradAccumDebugOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::IntegerAttr LoadTPUEmbeddingStochasticGradientDescentParametersGradAccumDebugOp::table_idAttr() {
  return (*this)->getAttr(table_idAttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t LoadTPUEmbeddingStochasticGradientDescentParametersGradAccumDebugOp::table_id() {
  auto attr = table_idAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), -1).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

::mlir::StringAttr LoadTPUEmbeddingStochasticGradientDescentParametersGradAccumDebugOp::table_nameAttr() {
  return (*this)->getAttr(table_nameAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef LoadTPUEmbeddingStochasticGradientDescentParametersGradAccumDebugOp::table_name() {
  auto attr = table_nameAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("").getValue();
  return attr.getValue();
}

::mlir::IntegerAttr LoadTPUEmbeddingStochasticGradientDescentParametersGradAccumDebugOp::num_shardsAttr() {
  return (*this)->getAttr(num_shardsAttrName()).cast<::mlir::IntegerAttr>();
}

uint64_t LoadTPUEmbeddingStochasticGradientDescentParametersGradAccumDebugOp::num_shards() {
  auto attr = num_shardsAttr();
  return attr.getValue().getZExtValue();
}

::mlir::IntegerAttr LoadTPUEmbeddingStochasticGradientDescentParametersGradAccumDebugOp::shard_idAttr() {
  return (*this)->getAttr(shard_idAttrName()).cast<::mlir::IntegerAttr>();
}

uint64_t LoadTPUEmbeddingStochasticGradientDescentParametersGradAccumDebugOp::shard_id() {
  auto attr = shard_idAttr();
  return attr.getValue().getZExtValue();
}

::mlir::StringAttr LoadTPUEmbeddingStochasticGradientDescentParametersGradAccumDebugOp::configAttr() {
  return (*this)->getAttr(configAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef LoadTPUEmbeddingStochasticGradientDescentParametersGradAccumDebugOp::config() {
  auto attr = configAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("").getValue();
  return attr.getValue();
}

void LoadTPUEmbeddingStochasticGradientDescentParametersGradAccumDebugOp::table_idAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(table_idAttrName(), attr);
}

void LoadTPUEmbeddingStochasticGradientDescentParametersGradAccumDebugOp::table_nameAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(table_nameAttrName(), attr);
}

void LoadTPUEmbeddingStochasticGradientDescentParametersGradAccumDebugOp::num_shardsAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(num_shardsAttrName(), attr);
}

void LoadTPUEmbeddingStochasticGradientDescentParametersGradAccumDebugOp::shard_idAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(shard_idAttrName(), attr);
}

void LoadTPUEmbeddingStochasticGradientDescentParametersGradAccumDebugOp::configAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(configAttrName(), attr);
}

void LoadTPUEmbeddingStochasticGradientDescentParametersGradAccumDebugOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value parameters, ::mlir::Value gradient_accumulators, ::mlir::IntegerAttr table_id, ::mlir::StringAttr table_name, ::mlir::IntegerAttr num_shards, ::mlir::IntegerAttr shard_id, ::mlir::StringAttr config) {
  odsState.addOperands(parameters);
  odsState.addOperands(gradient_accumulators);
  odsState.addAttribute(table_idAttrName(odsState.name), table_id);
  odsState.addAttribute(table_nameAttrName(odsState.name), table_name);
  odsState.addAttribute(num_shardsAttrName(odsState.name), num_shards);
  odsState.addAttribute(shard_idAttrName(odsState.name), shard_id);
  odsState.addAttribute(configAttrName(odsState.name), config);
}

void LoadTPUEmbeddingStochasticGradientDescentParametersGradAccumDebugOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value parameters, ::mlir::Value gradient_accumulators, ::mlir::IntegerAttr table_id, ::mlir::StringAttr table_name, ::mlir::IntegerAttr num_shards, ::mlir::IntegerAttr shard_id, ::mlir::StringAttr config) {
  odsState.addOperands(parameters);
  odsState.addOperands(gradient_accumulators);
  odsState.addAttribute(table_idAttrName(odsState.name), table_id);
  odsState.addAttribute(table_nameAttrName(odsState.name), table_name);
  odsState.addAttribute(num_shardsAttrName(odsState.name), num_shards);
  odsState.addAttribute(shard_idAttrName(odsState.name), shard_id);
  odsState.addAttribute(configAttrName(odsState.name), config);
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void LoadTPUEmbeddingStochasticGradientDescentParametersGradAccumDebugOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value parameters, ::mlir::Value gradient_accumulators, uint64_t table_id, ::llvm::StringRef table_name, uint64_t num_shards, uint64_t shard_id, ::llvm::StringRef config) {
  odsState.addOperands(parameters);
  odsState.addOperands(gradient_accumulators);
  odsState.addAttribute(table_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), table_id));
  odsState.addAttribute(table_nameAttrName(odsState.name), odsBuilder.getStringAttr(table_name));
  odsState.addAttribute(num_shardsAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), num_shards));
  odsState.addAttribute(shard_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), shard_id));
  odsState.addAttribute(configAttrName(odsState.name), odsBuilder.getStringAttr(config));
}

void LoadTPUEmbeddingStochasticGradientDescentParametersGradAccumDebugOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value parameters, ::mlir::Value gradient_accumulators, uint64_t table_id, ::llvm::StringRef table_name, uint64_t num_shards, uint64_t shard_id, ::llvm::StringRef config) {
  odsState.addOperands(parameters);
  odsState.addOperands(gradient_accumulators);
  odsState.addAttribute(table_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), table_id));
  odsState.addAttribute(table_nameAttrName(odsState.name), odsBuilder.getStringAttr(table_name));
  odsState.addAttribute(num_shardsAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), num_shards));
  odsState.addAttribute(shard_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), shard_id));
  odsState.addAttribute(configAttrName(odsState.name), odsBuilder.getStringAttr(config));
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void LoadTPUEmbeddingStochasticGradientDescentParametersGradAccumDebugOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 0u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult LoadTPUEmbeddingStochasticGradientDescentParametersGradAccumDebugOp::verify() {
  {
    auto tblgen_table_id = (*this)->getAttr(table_idAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_table_id, "table_id")))
      return ::mlir::failure();
  }
  {
    auto tblgen_table_name = (*this)->getAttr(table_nameAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_table_name, "table_name")))
      return ::mlir::failure();
  }
  {
    auto tblgen_num_shards = (*this)->getAttr(num_shardsAttrName());
    if (!tblgen_num_shards)
      return emitOpError("requires attribute 'num_shards'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_num_shards, "num_shards")))
      return ::mlir::failure();
  }
  {
    auto tblgen_shard_id = (*this)->getAttr(shard_idAttrName());
    if (!tblgen_shard_id)
      return emitOpError("requires attribute 'shard_id'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_shard_id, "shard_id")))
      return ::mlir::failure();
  }
  {
    auto tblgen_config = (*this)->getAttr(configAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_config, "config")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void LoadTPUEmbeddingStochasticGradientDescentParametersGradAccumDebugOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  effects.emplace_back(::mlir::MemoryEffects::Write::get(), ::mlir::TF::ResourceEffects::MustExecute::get());
  effects.emplace_back(::mlir::MemoryEffects::Read::get(), ::mlir::TF::ResourceEffects::TPUEmbedding::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::LoadTPUEmbeddingStochasticGradientDescentParametersGradAccumDebugOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::LoadTPUEmbeddingStochasticGradientDescentParametersOp definitions
//===----------------------------------------------------------------------===//

LoadTPUEmbeddingStochasticGradientDescentParametersOpAdaptor::LoadTPUEmbeddingStochasticGradientDescentParametersOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

LoadTPUEmbeddingStochasticGradientDescentParametersOpAdaptor::LoadTPUEmbeddingStochasticGradientDescentParametersOpAdaptor(LoadTPUEmbeddingStochasticGradientDescentParametersOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange LoadTPUEmbeddingStochasticGradientDescentParametersOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> LoadTPUEmbeddingStochasticGradientDescentParametersOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange LoadTPUEmbeddingStochasticGradientDescentParametersOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value LoadTPUEmbeddingStochasticGradientDescentParametersOpAdaptor::parameters() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr LoadTPUEmbeddingStochasticGradientDescentParametersOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::IntegerAttr LoadTPUEmbeddingStochasticGradientDescentParametersOpAdaptor::table_id() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("table_id").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), -1);
  return attr;
}

::mlir::StringAttr LoadTPUEmbeddingStochasticGradientDescentParametersOpAdaptor::table_name() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("table_name").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("");
  return attr;
}

::mlir::IntegerAttr LoadTPUEmbeddingStochasticGradientDescentParametersOpAdaptor::num_shards() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("num_shards").cast<::mlir::IntegerAttr>();
  return attr;
}

::mlir::IntegerAttr LoadTPUEmbeddingStochasticGradientDescentParametersOpAdaptor::shard_id() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("shard_id").cast<::mlir::IntegerAttr>();
  return attr;
}

::mlir::StringAttr LoadTPUEmbeddingStochasticGradientDescentParametersOpAdaptor::config() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("config").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("");
  return attr;
}

::mlir::LogicalResult LoadTPUEmbeddingStochasticGradientDescentParametersOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_table_id = odsAttrs.get("table_id");
    if (tblgen_table_id && !(((tblgen_table_id.isa<::mlir::IntegerAttr>())) && ((tblgen_table_id.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.LoadTPUEmbeddingStochasticGradientDescentParameters' op ""attribute 'table_id' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_table_name = odsAttrs.get("table_name");
    if (tblgen_table_name && !((tblgen_table_name.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.LoadTPUEmbeddingStochasticGradientDescentParameters' op ""attribute 'table_name' failed to satisfy constraint: string attribute");
  }
  {
    auto tblgen_num_shards = odsAttrs.get("num_shards");
    if (!tblgen_num_shards)
      return emitError(loc, "'tf.LoadTPUEmbeddingStochasticGradientDescentParameters' op ""requires attribute 'num_shards'");

    if (tblgen_num_shards && !(((tblgen_num_shards.isa<::mlir::IntegerAttr>())) && ((tblgen_num_shards.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.LoadTPUEmbeddingStochasticGradientDescentParameters' op ""attribute 'num_shards' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_shard_id = odsAttrs.get("shard_id");
    if (!tblgen_shard_id)
      return emitError(loc, "'tf.LoadTPUEmbeddingStochasticGradientDescentParameters' op ""requires attribute 'shard_id'");

    if (tblgen_shard_id && !(((tblgen_shard_id.isa<::mlir::IntegerAttr>())) && ((tblgen_shard_id.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.LoadTPUEmbeddingStochasticGradientDescentParameters' op ""attribute 'shard_id' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_config = odsAttrs.get("config");
    if (tblgen_config && !((tblgen_config.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.LoadTPUEmbeddingStochasticGradientDescentParameters' op ""attribute 'config' failed to satisfy constraint: string attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> LoadTPUEmbeddingStochasticGradientDescentParametersOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range LoadTPUEmbeddingStochasticGradientDescentParametersOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value LoadTPUEmbeddingStochasticGradientDescentParametersOp::parameters() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange LoadTPUEmbeddingStochasticGradientDescentParametersOp::parametersMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> LoadTPUEmbeddingStochasticGradientDescentParametersOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range LoadTPUEmbeddingStochasticGradientDescentParametersOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::IntegerAttr LoadTPUEmbeddingStochasticGradientDescentParametersOp::table_idAttr() {
  return (*this)->getAttr(table_idAttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t LoadTPUEmbeddingStochasticGradientDescentParametersOp::table_id() {
  auto attr = table_idAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), -1).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

::mlir::StringAttr LoadTPUEmbeddingStochasticGradientDescentParametersOp::table_nameAttr() {
  return (*this)->getAttr(table_nameAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef LoadTPUEmbeddingStochasticGradientDescentParametersOp::table_name() {
  auto attr = table_nameAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("").getValue();
  return attr.getValue();
}

::mlir::IntegerAttr LoadTPUEmbeddingStochasticGradientDescentParametersOp::num_shardsAttr() {
  return (*this)->getAttr(num_shardsAttrName()).cast<::mlir::IntegerAttr>();
}

uint64_t LoadTPUEmbeddingStochasticGradientDescentParametersOp::num_shards() {
  auto attr = num_shardsAttr();
  return attr.getValue().getZExtValue();
}

::mlir::IntegerAttr LoadTPUEmbeddingStochasticGradientDescentParametersOp::shard_idAttr() {
  return (*this)->getAttr(shard_idAttrName()).cast<::mlir::IntegerAttr>();
}

uint64_t LoadTPUEmbeddingStochasticGradientDescentParametersOp::shard_id() {
  auto attr = shard_idAttr();
  return attr.getValue().getZExtValue();
}

::mlir::StringAttr LoadTPUEmbeddingStochasticGradientDescentParametersOp::configAttr() {
  return (*this)->getAttr(configAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef LoadTPUEmbeddingStochasticGradientDescentParametersOp::config() {
  auto attr = configAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("").getValue();
  return attr.getValue();
}

void LoadTPUEmbeddingStochasticGradientDescentParametersOp::table_idAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(table_idAttrName(), attr);
}

void LoadTPUEmbeddingStochasticGradientDescentParametersOp::table_nameAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(table_nameAttrName(), attr);
}

void LoadTPUEmbeddingStochasticGradientDescentParametersOp::num_shardsAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(num_shardsAttrName(), attr);
}

void LoadTPUEmbeddingStochasticGradientDescentParametersOp::shard_idAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(shard_idAttrName(), attr);
}

void LoadTPUEmbeddingStochasticGradientDescentParametersOp::configAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(configAttrName(), attr);
}

void LoadTPUEmbeddingStochasticGradientDescentParametersOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value parameters, ::mlir::IntegerAttr table_id, ::mlir::StringAttr table_name, ::mlir::IntegerAttr num_shards, ::mlir::IntegerAttr shard_id, ::mlir::StringAttr config) {
  odsState.addOperands(parameters);
  odsState.addAttribute(table_idAttrName(odsState.name), table_id);
  odsState.addAttribute(table_nameAttrName(odsState.name), table_name);
  odsState.addAttribute(num_shardsAttrName(odsState.name), num_shards);
  odsState.addAttribute(shard_idAttrName(odsState.name), shard_id);
  odsState.addAttribute(configAttrName(odsState.name), config);
}

void LoadTPUEmbeddingStochasticGradientDescentParametersOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value parameters, ::mlir::IntegerAttr table_id, ::mlir::StringAttr table_name, ::mlir::IntegerAttr num_shards, ::mlir::IntegerAttr shard_id, ::mlir::StringAttr config) {
  odsState.addOperands(parameters);
  odsState.addAttribute(table_idAttrName(odsState.name), table_id);
  odsState.addAttribute(table_nameAttrName(odsState.name), table_name);
  odsState.addAttribute(num_shardsAttrName(odsState.name), num_shards);
  odsState.addAttribute(shard_idAttrName(odsState.name), shard_id);
  odsState.addAttribute(configAttrName(odsState.name), config);
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void LoadTPUEmbeddingStochasticGradientDescentParametersOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value parameters, uint64_t table_id, ::llvm::StringRef table_name, uint64_t num_shards, uint64_t shard_id, ::llvm::StringRef config) {
  odsState.addOperands(parameters);
  odsState.addAttribute(table_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), table_id));
  odsState.addAttribute(table_nameAttrName(odsState.name), odsBuilder.getStringAttr(table_name));
  odsState.addAttribute(num_shardsAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), num_shards));
  odsState.addAttribute(shard_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), shard_id));
  odsState.addAttribute(configAttrName(odsState.name), odsBuilder.getStringAttr(config));
}

void LoadTPUEmbeddingStochasticGradientDescentParametersOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value parameters, uint64_t table_id, ::llvm::StringRef table_name, uint64_t num_shards, uint64_t shard_id, ::llvm::StringRef config) {
  odsState.addOperands(parameters);
  odsState.addAttribute(table_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), table_id));
  odsState.addAttribute(table_nameAttrName(odsState.name), odsBuilder.getStringAttr(table_name));
  odsState.addAttribute(num_shardsAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), num_shards));
  odsState.addAttribute(shard_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), shard_id));
  odsState.addAttribute(configAttrName(odsState.name), odsBuilder.getStringAttr(config));
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void LoadTPUEmbeddingStochasticGradientDescentParametersOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 0u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult LoadTPUEmbeddingStochasticGradientDescentParametersOp::verify() {
  {
    auto tblgen_table_id = (*this)->getAttr(table_idAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_table_id, "table_id")))
      return ::mlir::failure();
  }
  {
    auto tblgen_table_name = (*this)->getAttr(table_nameAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_table_name, "table_name")))
      return ::mlir::failure();
  }
  {
    auto tblgen_num_shards = (*this)->getAttr(num_shardsAttrName());
    if (!tblgen_num_shards)
      return emitOpError("requires attribute 'num_shards'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_num_shards, "num_shards")))
      return ::mlir::failure();
  }
  {
    auto tblgen_shard_id = (*this)->getAttr(shard_idAttrName());
    if (!tblgen_shard_id)
      return emitOpError("requires attribute 'shard_id'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_shard_id, "shard_id")))
      return ::mlir::failure();
  }
  {
    auto tblgen_config = (*this)->getAttr(configAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_config, "config")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void LoadTPUEmbeddingStochasticGradientDescentParametersOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  effects.emplace_back(::mlir::MemoryEffects::Write::get(), ::mlir::TF::ResourceEffects::MustExecute::get());
  effects.emplace_back(::mlir::MemoryEffects::Read::get(), ::mlir::TF::ResourceEffects::TPUEmbedding::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::LoadTPUEmbeddingStochasticGradientDescentParametersOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::Log1pOp definitions
//===----------------------------------------------------------------------===//

Log1pOpAdaptor::Log1pOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

Log1pOpAdaptor::Log1pOpAdaptor(Log1pOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange Log1pOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> Log1pOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange Log1pOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value Log1pOpAdaptor::x() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr Log1pOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult Log1pOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> Log1pOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range Log1pOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value Log1pOp::x() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange Log1pOp::xMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> Log1pOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range Log1pOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value Log1pOp::y() {
  return *getODSResults(0).begin();
}

::mlir::Type Log1pOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool Log1pOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr Log1pOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void Log1pOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type y, ::mlir::Value x) {
  odsState.addOperands(x);
  odsState.addTypes(y);
}

void Log1pOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value x) {
  odsState.addOperands(x);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void Log1pOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

void Log1pOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value x) {
  odsState.addOperands(x);
  odsState.addTypes({x.getType()});

}

void Log1pOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  odsState.addTypes({operands[0].getType()});

}

::mlir::LogicalResult Log1pOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops2(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops2(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void Log1pOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::Log1pOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::LogOp definitions
//===----------------------------------------------------------------------===//

LogOpAdaptor::LogOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

LogOpAdaptor::LogOpAdaptor(LogOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange LogOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> LogOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange LogOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value LogOpAdaptor::x() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr LogOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult LogOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> LogOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range LogOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value LogOp::x() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange LogOp::xMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> LogOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range LogOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value LogOp::y() {
  return *getODSResults(0).begin();
}

::mlir::Type LogOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool LogOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr LogOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void LogOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type y, ::mlir::Value x) {
  odsState.addOperands(x);
  odsState.addTypes(y);
}

void LogOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value x) {
  odsState.addOperands(x);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void LogOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

void LogOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value x) {
  odsState.addOperands(x);
  odsState.addTypes({x.getType()});

}

void LogOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  odsState.addTypes({operands[0].getType()});

}

::mlir::LogicalResult LogOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops2(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops2(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void LogOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::LogOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::LogSoftmaxOp definitions
//===----------------------------------------------------------------------===//

LogSoftmaxOpAdaptor::LogSoftmaxOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

LogSoftmaxOpAdaptor::LogSoftmaxOpAdaptor(LogSoftmaxOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange LogSoftmaxOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> LogSoftmaxOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange LogSoftmaxOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value LogSoftmaxOpAdaptor::logits() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr LogSoftmaxOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult LogSoftmaxOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> LogSoftmaxOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range LogSoftmaxOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value LogSoftmaxOp::logits() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange LogSoftmaxOp::logitsMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> LogSoftmaxOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range LogSoftmaxOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value LogSoftmaxOp::logsoftmax() {
  return *getODSResults(0).begin();
}

::mlir::Type LogSoftmaxOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool LogSoftmaxOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr LogSoftmaxOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void LogSoftmaxOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type logsoftmax, ::mlir::Value logits) {
  odsState.addOperands(logits);
  odsState.addTypes(logsoftmax);
}

void LogSoftmaxOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value logits) {
  odsState.addOperands(logits);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void LogSoftmaxOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

void LogSoftmaxOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value logits) {
  odsState.addOperands(logits);
  odsState.addTypes({logits.getType()});

}

void LogSoftmaxOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  odsState.addTypes({operands[0].getType()});

}

::mlir::LogicalResult LogSoftmaxOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void LogSoftmaxOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::LogSoftmaxOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::LogicalAndOp definitions
//===----------------------------------------------------------------------===//

LogicalAndOpAdaptor::LogicalAndOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

LogicalAndOpAdaptor::LogicalAndOpAdaptor(LogicalAndOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange LogicalAndOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> LogicalAndOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange LogicalAndOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value LogicalAndOpAdaptor::x() {
  return *getODSOperands(0).begin();
}

::mlir::Value LogicalAndOpAdaptor::y() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr LogicalAndOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult LogicalAndOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> LogicalAndOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range LogicalAndOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value LogicalAndOp::x() {
  return *getODSOperands(0).begin();
}

::mlir::Value LogicalAndOp::y() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange LogicalAndOp::xMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange LogicalAndOp::yMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> LogicalAndOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range LogicalAndOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value LogicalAndOp::z() {
  return *getODSResults(0).begin();
}

void LogicalAndOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, Value x, Value y) {
  auto resultType =
      OpTrait::util::getBroadcastedType(x.getType(), y.getType());
  if (!resultType)
    mlir::emitError(odsState.location, "non-broadcastable operands");
  return build(odsBuilder, odsState, resultType, x, y);
}

void LogicalAndOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type z, ::mlir::Value x, ::mlir::Value y) {
  odsState.addOperands(x);
  odsState.addOperands(y);
  odsState.addTypes(z);
}

void LogicalAndOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value x, ::mlir::Value y) {
  odsState.addOperands(x);
  odsState.addOperands(y);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void LogicalAndOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult LogicalAndOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops8(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops8(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops8(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void LogicalAndOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::LogicalAndOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::LogicalNotOp definitions
//===----------------------------------------------------------------------===//

LogicalNotOpAdaptor::LogicalNotOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

LogicalNotOpAdaptor::LogicalNotOpAdaptor(LogicalNotOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange LogicalNotOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> LogicalNotOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange LogicalNotOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value LogicalNotOpAdaptor::x() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr LogicalNotOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult LogicalNotOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> LogicalNotOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range LogicalNotOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value LogicalNotOp::x() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange LogicalNotOp::xMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> LogicalNotOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range LogicalNotOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value LogicalNotOp::y() {
  return *getODSResults(0).begin();
}

void LogicalNotOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type y, ::mlir::Value x) {
  odsState.addOperands(x);
  odsState.addTypes(y);
}

void LogicalNotOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value x) {
  odsState.addOperands(x);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void LogicalNotOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

void LogicalNotOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value x) {
  odsState.addOperands(x);
  odsState.addTypes({x.getType()});

}

void LogicalNotOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  odsState.addTypes({operands[0].getType()});

}

::mlir::LogicalResult LogicalNotOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops8(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops8(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void LogicalNotOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::LogicalNotOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::LogicalOrOp definitions
//===----------------------------------------------------------------------===//

LogicalOrOpAdaptor::LogicalOrOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

LogicalOrOpAdaptor::LogicalOrOpAdaptor(LogicalOrOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange LogicalOrOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> LogicalOrOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange LogicalOrOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value LogicalOrOpAdaptor::x() {
  return *getODSOperands(0).begin();
}

::mlir::Value LogicalOrOpAdaptor::y() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr LogicalOrOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult LogicalOrOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> LogicalOrOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range LogicalOrOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value LogicalOrOp::x() {
  return *getODSOperands(0).begin();
}

::mlir::Value LogicalOrOp::y() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange LogicalOrOp::xMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange LogicalOrOp::yMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> LogicalOrOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range LogicalOrOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value LogicalOrOp::z() {
  return *getODSResults(0).begin();
}

void LogicalOrOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, Value x, Value y) {
  auto resultType =
      OpTrait::util::getBroadcastedType(x.getType(), y.getType());
  if (!resultType)
    mlir::emitError(odsState.location, "non-broadcastable operands");
  return build(odsBuilder, odsState, resultType, x, y);
}

void LogicalOrOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type z, ::mlir::Value x, ::mlir::Value y) {
  odsState.addOperands(x);
  odsState.addOperands(y);
  odsState.addTypes(z);
}

void LogicalOrOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value x, ::mlir::Value y) {
  odsState.addOperands(x);
  odsState.addOperands(y);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void LogicalOrOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult LogicalOrOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops8(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops8(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops8(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void LogicalOrOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::LogicalOrOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::LookupTableExportV2Op definitions
//===----------------------------------------------------------------------===//

LookupTableExportV2OpAdaptor::LookupTableExportV2OpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

LookupTableExportV2OpAdaptor::LookupTableExportV2OpAdaptor(LookupTableExportV2Op &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange LookupTableExportV2OpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> LookupTableExportV2OpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange LookupTableExportV2OpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value LookupTableExportV2OpAdaptor::table_handle() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr LookupTableExportV2OpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult LookupTableExportV2OpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

void LookupTableExportV2Op::getAsmResultNames(::mlir::OpAsmSetValueNameFn setNameFn) {
  auto resultGroup0 = getODSResults(0);
  if (!llvm::empty(resultGroup0))
    setNameFn(*resultGroup0.begin(), "keys");
  auto resultGroup1 = getODSResults(1);
  if (!llvm::empty(resultGroup1))
    setNameFn(*resultGroup1.begin(), "values");
}

std::pair<unsigned, unsigned> LookupTableExportV2Op::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range LookupTableExportV2Op::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value LookupTableExportV2Op::table_handle() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange LookupTableExportV2Op::table_handleMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> LookupTableExportV2Op::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range LookupTableExportV2Op::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value LookupTableExportV2Op::keys() {
  return *getODSResults(0).begin();
}

::mlir::Value LookupTableExportV2Op::values() {
  return *getODSResults(1).begin();
}

::mlir::Type LookupTableExportV2Op::Tkeys() {
  return mlir::getElementTypeOrSelf(*getODSResults(0).begin());
}

::mlir::Type LookupTableExportV2Op::Tvalues() {
  return mlir::getElementTypeOrSelf(*getODSResults(1).begin());
}

bool LookupTableExportV2Op::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "Tkeys") return true;
  if (name == "Tvalues") return true;
 return false;
}

::mlir::DictionaryAttr LookupTableExportV2Op::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TkeysAttrName(),
::mlir::TypeAttr::get(Tkeys())},
    {TvaluesAttrName(),
::mlir::TypeAttr::get(Tvalues())}});
}

void LookupTableExportV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type keys, ::mlir::Type values, ::mlir::Value table_handle) {
  odsState.addOperands(table_handle);
  odsState.addTypes(keys);
  odsState.addTypes(values);
}

void LookupTableExportV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value table_handle) {
  odsState.addOperands(table_handle);
  assert(resultTypes.size() == 2u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void LookupTableExportV2Op::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 2u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult LookupTableExportV2Op::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSResults(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void LookupTableExportV2Op::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  for (::mlir::Value value : getODSOperands(0))
    effects.emplace_back(::mlir::MemoryEffects::Read::get(), value, ::mlir::TF::ResourceEffects::LookupTable::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::LookupTableExportV2Op)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::LookupTableFindOp definitions
//===----------------------------------------------------------------------===//

LookupTableFindOpAdaptor::LookupTableFindOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

LookupTableFindOpAdaptor::LookupTableFindOpAdaptor(LookupTableFindOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange LookupTableFindOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> LookupTableFindOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange LookupTableFindOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value LookupTableFindOpAdaptor::table_handle() {
  return *getODSOperands(0).begin();
}

::mlir::Value LookupTableFindOpAdaptor::keys() {
  return *getODSOperands(1).begin();
}

::mlir::Value LookupTableFindOpAdaptor::default_value() {
  return *getODSOperands(2).begin();
}

::mlir::DictionaryAttr LookupTableFindOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult LookupTableFindOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> LookupTableFindOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range LookupTableFindOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value LookupTableFindOp::table_handle() {
  return *getODSOperands(0).begin();
}

::mlir::Value LookupTableFindOp::keys() {
  return *getODSOperands(1).begin();
}

::mlir::Value LookupTableFindOp::default_value() {
  return *getODSOperands(2).begin();
}

::mlir::MutableOperandRange LookupTableFindOp::table_handleMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange LookupTableFindOp::keysMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange LookupTableFindOp::default_valueMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> LookupTableFindOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range LookupTableFindOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value LookupTableFindOp::values() {
  return *getODSResults(0).begin();
}

::mlir::Type LookupTableFindOp::Tin() {
  return mlir::getElementTypeOrSelf(*getODSOperands(1).begin());
}

::mlir::Type LookupTableFindOp::Tout() {
  return mlir::getElementTypeOrSelf(*getODSOperands(2).begin());
}

bool LookupTableFindOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "Tin") return true;
  if (name == "Tout") return true;
 return false;
}

::mlir::DictionaryAttr LookupTableFindOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TinAttrName(),
::mlir::TypeAttr::get(Tin())},
    {ToutAttrName(),
::mlir::TypeAttr::get(Tout())}});
}

void LookupTableFindOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type values, ::mlir::Value table_handle, ::mlir::Value keys, ::mlir::Value default_value) {
  odsState.addOperands(table_handle);
  odsState.addOperands(keys);
  odsState.addOperands(default_value);
  odsState.addTypes(values);
}

void LookupTableFindOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value table_handle, ::mlir::Value keys, ::mlir::Value default_value) {
  odsState.addOperands(table_handle);
  odsState.addOperands(keys);
  odsState.addOperands(default_value);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void LookupTableFindOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 3u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult LookupTableFindOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops19(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void LookupTableFindOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  for (::mlir::Value value : getODSOperands(0))
    effects.emplace_back(::mlir::MemoryEffects::Read::get(), value, ::mlir::TF::ResourceEffects::LookupTable::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::LookupTableFindOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::LookupTableFindV2Op definitions
//===----------------------------------------------------------------------===//

LookupTableFindV2OpAdaptor::LookupTableFindV2OpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

LookupTableFindV2OpAdaptor::LookupTableFindV2OpAdaptor(LookupTableFindV2Op &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange LookupTableFindV2OpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> LookupTableFindV2OpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange LookupTableFindV2OpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value LookupTableFindV2OpAdaptor::table_handle() {
  return *getODSOperands(0).begin();
}

::mlir::Value LookupTableFindV2OpAdaptor::keys() {
  return *getODSOperands(1).begin();
}

::mlir::Value LookupTableFindV2OpAdaptor::default_value() {
  return *getODSOperands(2).begin();
}

::mlir::DictionaryAttr LookupTableFindV2OpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult LookupTableFindV2OpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> LookupTableFindV2Op::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range LookupTableFindV2Op::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value LookupTableFindV2Op::table_handle() {
  return *getODSOperands(0).begin();
}

::mlir::Value LookupTableFindV2Op::keys() {
  return *getODSOperands(1).begin();
}

::mlir::Value LookupTableFindV2Op::default_value() {
  return *getODSOperands(2).begin();
}

::mlir::MutableOperandRange LookupTableFindV2Op::table_handleMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange LookupTableFindV2Op::keysMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange LookupTableFindV2Op::default_valueMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> LookupTableFindV2Op::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range LookupTableFindV2Op::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value LookupTableFindV2Op::values() {
  return *getODSResults(0).begin();
}

::mlir::Type LookupTableFindV2Op::Tin() {
  return mlir::getElementTypeOrSelf(*getODSOperands(1).begin());
}

::mlir::Type LookupTableFindV2Op::Tout() {
  return mlir::getElementTypeOrSelf(*getODSOperands(2).begin());
}

bool LookupTableFindV2Op::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "Tin") return true;
  if (name == "Tout") return true;
 return false;
}

::mlir::DictionaryAttr LookupTableFindV2Op::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TinAttrName(),
::mlir::TypeAttr::get(Tin())},
    {ToutAttrName(),
::mlir::TypeAttr::get(Tout())}});
}

void LookupTableFindV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type values, ::mlir::Value table_handle, ::mlir::Value keys, ::mlir::Value default_value) {
  odsState.addOperands(table_handle);
  odsState.addOperands(keys);
  odsState.addOperands(default_value);
  odsState.addTypes(values);
}

void LookupTableFindV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value table_handle, ::mlir::Value keys, ::mlir::Value default_value) {
  odsState.addOperands(table_handle);
  odsState.addOperands(keys);
  odsState.addOperands(default_value);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void LookupTableFindV2Op::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 3u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult LookupTableFindV2Op::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void LookupTableFindV2Op::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  for (::mlir::Value value : getODSOperands(0))
    effects.emplace_back(::mlir::MemoryEffects::Read::get(), value, ::mlir::TF::ResourceEffects::LookupTable::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::LookupTableFindV2Op)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::LookupTableImportV2Op definitions
//===----------------------------------------------------------------------===//

LookupTableImportV2OpAdaptor::LookupTableImportV2OpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

LookupTableImportV2OpAdaptor::LookupTableImportV2OpAdaptor(LookupTableImportV2Op &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange LookupTableImportV2OpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> LookupTableImportV2OpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange LookupTableImportV2OpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value LookupTableImportV2OpAdaptor::table_handle() {
  return *getODSOperands(0).begin();
}

::mlir::Value LookupTableImportV2OpAdaptor::keys() {
  return *getODSOperands(1).begin();
}

::mlir::Value LookupTableImportV2OpAdaptor::values() {
  return *getODSOperands(2).begin();
}

::mlir::DictionaryAttr LookupTableImportV2OpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult LookupTableImportV2OpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> LookupTableImportV2Op::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range LookupTableImportV2Op::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value LookupTableImportV2Op::table_handle() {
  return *getODSOperands(0).begin();
}

::mlir::Value LookupTableImportV2Op::keys() {
  return *getODSOperands(1).begin();
}

::mlir::Value LookupTableImportV2Op::values() {
  return *getODSOperands(2).begin();
}

::mlir::MutableOperandRange LookupTableImportV2Op::table_handleMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange LookupTableImportV2Op::keysMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange LookupTableImportV2Op::valuesMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> LookupTableImportV2Op::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range LookupTableImportV2Op::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Type LookupTableImportV2Op::Tin() {
  return mlir::getElementTypeOrSelf(*getODSOperands(1).begin());
}

::mlir::Type LookupTableImportV2Op::Tout() {
  return mlir::getElementTypeOrSelf(*getODSOperands(2).begin());
}

bool LookupTableImportV2Op::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "Tin") return true;
  if (name == "Tout") return true;
 return false;
}

::mlir::DictionaryAttr LookupTableImportV2Op::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TinAttrName(),
::mlir::TypeAttr::get(Tin())},
    {ToutAttrName(),
::mlir::TypeAttr::get(Tout())}});
}

void LookupTableImportV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value table_handle, ::mlir::Value keys, ::mlir::Value values) {
  odsState.addOperands(table_handle);
  odsState.addOperands(keys);
  odsState.addOperands(values);
}

void LookupTableImportV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value table_handle, ::mlir::Value keys, ::mlir::Value values) {
  odsState.addOperands(table_handle);
  odsState.addOperands(keys);
  odsState.addOperands(values);
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void LookupTableImportV2Op::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 3u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 0u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult LookupTableImportV2Op::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void LookupTableImportV2Op::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  for (::mlir::Value value : getODSOperands(0))
    effects.emplace_back(::mlir::MemoryEffects::Write::get(), value, ::mlir::TF::ResourceEffects::LookupTable::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::LookupTableImportV2Op)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::LookupTableInsertV2Op definitions
//===----------------------------------------------------------------------===//

LookupTableInsertV2OpAdaptor::LookupTableInsertV2OpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

LookupTableInsertV2OpAdaptor::LookupTableInsertV2OpAdaptor(LookupTableInsertV2Op &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange LookupTableInsertV2OpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> LookupTableInsertV2OpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange LookupTableInsertV2OpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value LookupTableInsertV2OpAdaptor::table_handle() {
  return *getODSOperands(0).begin();
}

::mlir::Value LookupTableInsertV2OpAdaptor::keys() {
  return *getODSOperands(1).begin();
}

::mlir::Value LookupTableInsertV2OpAdaptor::values() {
  return *getODSOperands(2).begin();
}

::mlir::DictionaryAttr LookupTableInsertV2OpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult LookupTableInsertV2OpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> LookupTableInsertV2Op::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range LookupTableInsertV2Op::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value LookupTableInsertV2Op::table_handle() {
  return *getODSOperands(0).begin();
}

::mlir::Value LookupTableInsertV2Op::keys() {
  return *getODSOperands(1).begin();
}

::mlir::Value LookupTableInsertV2Op::values() {
  return *getODSOperands(2).begin();
}

::mlir::MutableOperandRange LookupTableInsertV2Op::table_handleMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange LookupTableInsertV2Op::keysMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange LookupTableInsertV2Op::valuesMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> LookupTableInsertV2Op::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range LookupTableInsertV2Op::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Type LookupTableInsertV2Op::Tin() {
  return mlir::getElementTypeOrSelf(*getODSOperands(1).begin());
}

::mlir::Type LookupTableInsertV2Op::Tout() {
  return mlir::getElementTypeOrSelf(*getODSOperands(2).begin());
}

bool LookupTableInsertV2Op::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "Tin") return true;
  if (name == "Tout") return true;
 return false;
}

::mlir::DictionaryAttr LookupTableInsertV2Op::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TinAttrName(),
::mlir::TypeAttr::get(Tin())},
    {ToutAttrName(),
::mlir::TypeAttr::get(Tout())}});
}

void LookupTableInsertV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value table_handle, ::mlir::Value keys, ::mlir::Value values) {
  odsState.addOperands(table_handle);
  odsState.addOperands(keys);
  odsState.addOperands(values);
}

void LookupTableInsertV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value table_handle, ::mlir::Value keys, ::mlir::Value values) {
  odsState.addOperands(table_handle);
  odsState.addOperands(keys);
  odsState.addOperands(values);
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void LookupTableInsertV2Op::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 3u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 0u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult LookupTableInsertV2Op::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void LookupTableInsertV2Op::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  for (::mlir::Value value : getODSOperands(0))
    effects.emplace_back(::mlir::MemoryEffects::Write::get(), value, ::mlir::TF::ResourceEffects::LookupTable::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::LookupTableInsertV2Op)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::LookupTableRemoveV2Op definitions
//===----------------------------------------------------------------------===//

LookupTableRemoveV2OpAdaptor::LookupTableRemoveV2OpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

LookupTableRemoveV2OpAdaptor::LookupTableRemoveV2OpAdaptor(LookupTableRemoveV2Op &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange LookupTableRemoveV2OpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> LookupTableRemoveV2OpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange LookupTableRemoveV2OpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value LookupTableRemoveV2OpAdaptor::table_handle() {
  return *getODSOperands(0).begin();
}

::mlir::Value LookupTableRemoveV2OpAdaptor::keys() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr LookupTableRemoveV2OpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult LookupTableRemoveV2OpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> LookupTableRemoveV2Op::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range LookupTableRemoveV2Op::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value LookupTableRemoveV2Op::table_handle() {
  return *getODSOperands(0).begin();
}

::mlir::Value LookupTableRemoveV2Op::keys() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange LookupTableRemoveV2Op::table_handleMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange LookupTableRemoveV2Op::keysMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> LookupTableRemoveV2Op::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range LookupTableRemoveV2Op::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Type LookupTableRemoveV2Op::Tin() {
  return mlir::getElementTypeOrSelf(*getODSOperands(1).begin());
}

bool LookupTableRemoveV2Op::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "Tin") return true;
 return false;
}

::mlir::DictionaryAttr LookupTableRemoveV2Op::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TinAttrName(),
::mlir::TypeAttr::get(Tin())}});
}

void LookupTableRemoveV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value table_handle, ::mlir::Value keys) {
  odsState.addOperands(table_handle);
  odsState.addOperands(keys);
}

void LookupTableRemoveV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value table_handle, ::mlir::Value keys) {
  odsState.addOperands(table_handle);
  odsState.addOperands(keys);
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void LookupTableRemoveV2Op::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 0u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult LookupTableRemoveV2Op::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void LookupTableRemoveV2Op::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  for (::mlir::Value value : getODSOperands(0))
    effects.emplace_back(::mlir::MemoryEffects::Write::get(), value, ::mlir::TF::ResourceEffects::LookupTable::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::LookupTableRemoveV2Op)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::LookupTableSizeOp definitions
//===----------------------------------------------------------------------===//

LookupTableSizeOpAdaptor::LookupTableSizeOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

LookupTableSizeOpAdaptor::LookupTableSizeOpAdaptor(LookupTableSizeOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange LookupTableSizeOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> LookupTableSizeOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange LookupTableSizeOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value LookupTableSizeOpAdaptor::table_handle() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr LookupTableSizeOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult LookupTableSizeOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> LookupTableSizeOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range LookupTableSizeOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value LookupTableSizeOp::table_handle() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange LookupTableSizeOp::table_handleMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> LookupTableSizeOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range LookupTableSizeOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value LookupTableSizeOp::size() {
  return *getODSResults(0).begin();
}

void LookupTableSizeOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type size, ::mlir::Value table_handle) {
  odsState.addOperands(table_handle);
  odsState.addTypes(size);
}

void LookupTableSizeOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value table_handle) {
  odsState.addOperands(table_handle);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void LookupTableSizeOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult LookupTableSizeOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops19(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops16(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void LookupTableSizeOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  for (::mlir::Value value : getODSOperands(0))
    effects.emplace_back(::mlir::MemoryEffects::Read::get(), value, ::mlir::TF::ResourceEffects::LookupTable::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::LookupTableSizeOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::LookupTableSizeV2Op definitions
//===----------------------------------------------------------------------===//

LookupTableSizeV2OpAdaptor::LookupTableSizeV2OpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

LookupTableSizeV2OpAdaptor::LookupTableSizeV2OpAdaptor(LookupTableSizeV2Op &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange LookupTableSizeV2OpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> LookupTableSizeV2OpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange LookupTableSizeV2OpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value LookupTableSizeV2OpAdaptor::table_handle() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr LookupTableSizeV2OpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult LookupTableSizeV2OpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> LookupTableSizeV2Op::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range LookupTableSizeV2Op::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value LookupTableSizeV2Op::table_handle() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange LookupTableSizeV2Op::table_handleMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> LookupTableSizeV2Op::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range LookupTableSizeV2Op::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value LookupTableSizeV2Op::size() {
  return *getODSResults(0).begin();
}

void LookupTableSizeV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type size, ::mlir::Value table_handle) {
  odsState.addOperands(table_handle);
  odsState.addTypes(size);
}

void LookupTableSizeV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value table_handle) {
  odsState.addOperands(table_handle);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void LookupTableSizeV2Op::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult LookupTableSizeV2Op::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops16(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void LookupTableSizeV2Op::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  for (::mlir::Value value : getODSOperands(0))
    effects.emplace_back(::mlir::MemoryEffects::Read::get(), value, ::mlir::TF::ResourceEffects::LookupTable::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::LookupTableSizeV2Op)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::LowerBoundOp definitions
//===----------------------------------------------------------------------===//

LowerBoundOpAdaptor::LowerBoundOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

LowerBoundOpAdaptor::LowerBoundOpAdaptor(LowerBoundOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange LowerBoundOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> LowerBoundOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange LowerBoundOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value LowerBoundOpAdaptor::sorted_inputs() {
  return *getODSOperands(0).begin();
}

::mlir::Value LowerBoundOpAdaptor::values() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr LowerBoundOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult LowerBoundOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> LowerBoundOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range LowerBoundOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value LowerBoundOp::sorted_inputs() {
  return *getODSOperands(0).begin();
}

::mlir::Value LowerBoundOp::values() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange LowerBoundOp::sorted_inputsMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange LowerBoundOp::valuesMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> LowerBoundOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range LowerBoundOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value LowerBoundOp::output() {
  return *getODSResults(0).begin();
}

::mlir::Type LowerBoundOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

::mlir::Type LowerBoundOp::out_type() {
  return mlir::getElementTypeOrSelf(*getODSResults(0).begin());
}

bool LowerBoundOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
  if (name == "out_type") return true;
 return false;
}

::mlir::DictionaryAttr LowerBoundOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())},
    {out_typeAttrName(),
::mlir::TypeAttr::get(out_type())}});
}

void LowerBoundOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value sorted_inputs, ::mlir::Value values) {
  odsState.addOperands(sorted_inputs);
  odsState.addOperands(values);
  odsState.addTypes(output);
}

void LowerBoundOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value sorted_inputs, ::mlir::Value values) {
  odsState.addOperands(sorted_inputs);
  odsState.addOperands(values);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void LowerBoundOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult LowerBoundOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void LowerBoundOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::LowerBoundOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::MakeIteratorOp definitions
//===----------------------------------------------------------------------===//

MakeIteratorOpAdaptor::MakeIteratorOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

MakeIteratorOpAdaptor::MakeIteratorOpAdaptor(MakeIteratorOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange MakeIteratorOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> MakeIteratorOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange MakeIteratorOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value MakeIteratorOpAdaptor::dataset() {
  return *getODSOperands(0).begin();
}

::mlir::Value MakeIteratorOpAdaptor::iterator() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr MakeIteratorOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult MakeIteratorOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> MakeIteratorOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range MakeIteratorOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value MakeIteratorOp::dataset() {
  return *getODSOperands(0).begin();
}

::mlir::Value MakeIteratorOp::iterator() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange MakeIteratorOp::datasetMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange MakeIteratorOp::iteratorMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> MakeIteratorOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range MakeIteratorOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

void MakeIteratorOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value dataset, ::mlir::Value iterator) {
  odsState.addOperands(dataset);
  odsState.addOperands(iterator);
}

void MakeIteratorOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value dataset, ::mlir::Value iterator) {
  odsState.addOperands(dataset);
  odsState.addOperands(iterator);
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void MakeIteratorOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 0u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult MakeIteratorOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops15(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void MakeIteratorOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  for (::mlir::Value value : getODSOperands(1))
    effects.emplace_back(::mlir::MemoryEffects::Write::get(), value, ::mlir::TF::ResourceEffects::DatasetIterator::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::MakeIteratorOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::MakeUniqueOp definitions
//===----------------------------------------------------------------------===//

MakeUniqueOpAdaptor::MakeUniqueOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

MakeUniqueOpAdaptor::MakeUniqueOpAdaptor(MakeUniqueOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange MakeUniqueOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> MakeUniqueOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange MakeUniqueOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value MakeUniqueOpAdaptor::input() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr MakeUniqueOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult MakeUniqueOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> MakeUniqueOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range MakeUniqueOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value MakeUniqueOp::input() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange MakeUniqueOp::inputMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> MakeUniqueOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range MakeUniqueOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value MakeUniqueOp::output() {
  return *getODSResults(0).begin();
}

void MakeUniqueOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input) {
  odsState.addOperands(input);
  odsState.addTypes(output);
}

void MakeUniqueOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input) {
  odsState.addOperands(input);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void MakeUniqueOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult MakeUniqueOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void MakeUniqueOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::MakeUniqueOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::MapAndBatchDatasetOp definitions
//===----------------------------------------------------------------------===//

MapAndBatchDatasetOpAdaptor::MapAndBatchDatasetOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

MapAndBatchDatasetOpAdaptor::MapAndBatchDatasetOpAdaptor(MapAndBatchDatasetOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange MapAndBatchDatasetOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> MapAndBatchDatasetOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  bool isVariadic[] = {false, true, false, false, false};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (odsOperands.size() - 4) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::ValueRange MapAndBatchDatasetOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value MapAndBatchDatasetOpAdaptor::input_dataset() {
  return *getODSOperands(0).begin();
}

::mlir::ValueRange MapAndBatchDatasetOpAdaptor::other_arguments() {
  return getODSOperands(1);
}

::mlir::Value MapAndBatchDatasetOpAdaptor::batch_size() {
  return *getODSOperands(2).begin();
}

::mlir::Value MapAndBatchDatasetOpAdaptor::num_parallel_calls() {
  return *getODSOperands(3).begin();
}

::mlir::Value MapAndBatchDatasetOpAdaptor::drop_remainder() {
  return *getODSOperands(4).begin();
}

::mlir::DictionaryAttr MapAndBatchDatasetOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::SymbolRefAttr MapAndBatchDatasetOpAdaptor::f() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::SymbolRefAttr attr = odsAttrs.get("f").cast<::mlir::SymbolRefAttr>();
  return attr;
}

::mlir::ArrayAttr MapAndBatchDatasetOpAdaptor::output_types() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("output_types").cast<::mlir::ArrayAttr>();
  return attr;
}

::mlir::ArrayAttr MapAndBatchDatasetOpAdaptor::output_shapes() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("output_shapes").cast<::mlir::ArrayAttr>();
  return attr;
}

::mlir::BoolAttr MapAndBatchDatasetOpAdaptor::preserve_cardinality() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("preserve_cardinality").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(false);
  return attr;
}

::mlir::StringAttr MapAndBatchDatasetOpAdaptor::metadata() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("metadata").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("");
  return attr;
}

::mlir::LogicalResult MapAndBatchDatasetOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_f = odsAttrs.get("f");
    if (!tblgen_f)
      return emitError(loc, "'tf.MapAndBatchDataset' op ""requires attribute 'f'");

    if (tblgen_f && !((tblgen_f.isa<::mlir::SymbolRefAttr>())))
      return emitError(loc, "'tf.MapAndBatchDataset' op ""attribute 'f' failed to satisfy constraint: symbol reference attribute");
  }
  {
    auto tblgen_output_types = odsAttrs.get("output_types");
    if (!tblgen_output_types)
      return emitError(loc, "'tf.MapAndBatchDataset' op ""requires attribute 'output_types'");

    if (tblgen_output_types && !((((tblgen_output_types.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_output_types.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return ((attr.isa<::mlir::TypeAttr>())) && ((attr.cast<::mlir::TypeAttr>().getValue().isa<::mlir::Type>())); }))) && ((tblgen_output_types.cast<::mlir::ArrayAttr>().size() >= 1))))
      return emitError(loc, "'tf.MapAndBatchDataset' op ""attribute 'output_types' failed to satisfy constraint: type array attribute with at least 1 elements");
  }
  {
    auto tblgen_output_shapes = odsAttrs.get("output_shapes");
    if (!tblgen_output_shapes)
      return emitError(loc, "'tf.MapAndBatchDataset' op ""requires attribute 'output_shapes'");

    if (tblgen_output_shapes && !((((tblgen_output_shapes.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_output_shapes.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return (attr.isa<mlir::TF::ShapeAttr>()); }))) && ((tblgen_output_shapes.cast<::mlir::ArrayAttr>().size() >= 1))))
      return emitError(loc, "'tf.MapAndBatchDataset' op ""attribute 'output_shapes' failed to satisfy constraint: tensorflow shape attribute array with at least 1 elements");
  }
  {
    auto tblgen_preserve_cardinality = odsAttrs.get("preserve_cardinality");
    if (tblgen_preserve_cardinality && !((tblgen_preserve_cardinality.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.MapAndBatchDataset' op ""attribute 'preserve_cardinality' failed to satisfy constraint: bool attribute");
  }
  {
    auto tblgen_metadata = odsAttrs.get("metadata");
    if (tblgen_metadata && !((tblgen_metadata.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.MapAndBatchDataset' op ""attribute 'metadata' failed to satisfy constraint: string attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> MapAndBatchDatasetOp::getODSOperandIndexAndLength(unsigned index) {
  bool isVariadic[] = {false, true, false, false, false};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (getOperation()->getNumOperands() - 4) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::Operation::operand_range MapAndBatchDatasetOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value MapAndBatchDatasetOp::input_dataset() {
  return *getODSOperands(0).begin();
}

::mlir::Operation::operand_range MapAndBatchDatasetOp::other_arguments() {
  return getODSOperands(1);
}

::mlir::Value MapAndBatchDatasetOp::batch_size() {
  return *getODSOperands(2).begin();
}

::mlir::Value MapAndBatchDatasetOp::num_parallel_calls() {
  return *getODSOperands(3).begin();
}

::mlir::Value MapAndBatchDatasetOp::drop_remainder() {
  return *getODSOperands(4).begin();
}

::mlir::MutableOperandRange MapAndBatchDatasetOp::input_datasetMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange MapAndBatchDatasetOp::other_argumentsMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange MapAndBatchDatasetOp::batch_sizeMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange MapAndBatchDatasetOp::num_parallel_callsMutable() {
  auto range = getODSOperandIndexAndLength(3);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange MapAndBatchDatasetOp::drop_remainderMutable() {
  auto range = getODSOperandIndexAndLength(4);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> MapAndBatchDatasetOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range MapAndBatchDatasetOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value MapAndBatchDatasetOp::handle() {
  return *getODSResults(0).begin();
}

::mlir::SymbolRefAttr MapAndBatchDatasetOp::fAttr() {
  return (*this)->getAttr(fAttrName()).cast<::mlir::SymbolRefAttr>();
}

::mlir::SymbolRefAttr MapAndBatchDatasetOp::f() {
  auto attr = fAttr();
  return attr;
}

::mlir::ArrayAttr MapAndBatchDatasetOp::output_typesAttr() {
  return (*this)->getAttr(output_typesAttrName()).cast<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr MapAndBatchDatasetOp::output_types() {
  auto attr = output_typesAttr();
  return attr;
}

::mlir::ArrayAttr MapAndBatchDatasetOp::output_shapesAttr() {
  return (*this)->getAttr(output_shapesAttrName()).cast<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr MapAndBatchDatasetOp::output_shapes() {
  auto attr = output_shapesAttr();
  return attr;
}

::mlir::BoolAttr MapAndBatchDatasetOp::preserve_cardinalityAttr() {
  return (*this)->getAttr(preserve_cardinalityAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool MapAndBatchDatasetOp::preserve_cardinality() {
  auto attr = preserve_cardinalityAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(false).getValue();
  return attr.getValue();
}

::mlir::StringAttr MapAndBatchDatasetOp::metadataAttr() {
  return (*this)->getAttr(metadataAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef MapAndBatchDatasetOp::metadata() {
  auto attr = metadataAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("").getValue();
  return attr.getValue();
}

mlir::OperandElementTypeRange MapAndBatchDatasetOp::Targuments() {
  auto values = getODSOperands(1);
return {mlir::OperandElementTypeIterator(values.begin()), mlir::OperandElementTypeIterator(values.end())};
}

bool MapAndBatchDatasetOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "Targuments") return true;
 return false;
}

::mlir::DictionaryAttr MapAndBatchDatasetOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TargumentsAttrName(),
ArrayAttr::get(ctx, 
    [&]() {
      llvm::SmallVector<Attribute, 4> ret;
      for (auto t : Targuments())
        ret.push_back(TypeAttr::get(t));
      return ret;
    }())}});
}

void MapAndBatchDatasetOp::fAttr(::mlir::SymbolRefAttr attr) {
  (*this)->setAttr(fAttrName(), attr);
}

void MapAndBatchDatasetOp::output_typesAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(output_typesAttrName(), attr);
}

void MapAndBatchDatasetOp::output_shapesAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(output_shapesAttrName(), attr);
}

void MapAndBatchDatasetOp::preserve_cardinalityAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(preserve_cardinalityAttrName(), attr);
}

void MapAndBatchDatasetOp::metadataAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(metadataAttrName(), attr);
}

void MapAndBatchDatasetOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type handle, ::mlir::Value input_dataset, ::mlir::ValueRange other_arguments, ::mlir::Value batch_size, ::mlir::Value num_parallel_calls, ::mlir::Value drop_remainder, ::mlir::SymbolRefAttr f, ::mlir::ArrayAttr output_types, ::mlir::ArrayAttr output_shapes, ::mlir::BoolAttr preserve_cardinality, ::mlir::StringAttr metadata) {
  odsState.addOperands(input_dataset);
  odsState.addOperands(other_arguments);
  odsState.addOperands(batch_size);
  odsState.addOperands(num_parallel_calls);
  odsState.addOperands(drop_remainder);
  odsState.addAttribute(fAttrName(odsState.name), f);
  odsState.addAttribute(output_typesAttrName(odsState.name), output_types);
  odsState.addAttribute(output_shapesAttrName(odsState.name), output_shapes);
  odsState.addAttribute(preserve_cardinalityAttrName(odsState.name), preserve_cardinality);
  odsState.addAttribute(metadataAttrName(odsState.name), metadata);
  odsState.addTypes(handle);
}

void MapAndBatchDatasetOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input_dataset, ::mlir::ValueRange other_arguments, ::mlir::Value batch_size, ::mlir::Value num_parallel_calls, ::mlir::Value drop_remainder, ::mlir::SymbolRefAttr f, ::mlir::ArrayAttr output_types, ::mlir::ArrayAttr output_shapes, ::mlir::BoolAttr preserve_cardinality, ::mlir::StringAttr metadata) {
  odsState.addOperands(input_dataset);
  odsState.addOperands(other_arguments);
  odsState.addOperands(batch_size);
  odsState.addOperands(num_parallel_calls);
  odsState.addOperands(drop_remainder);
  odsState.addAttribute(fAttrName(odsState.name), f);
  odsState.addAttribute(output_typesAttrName(odsState.name), output_types);
  odsState.addAttribute(output_shapesAttrName(odsState.name), output_shapes);
  odsState.addAttribute(preserve_cardinalityAttrName(odsState.name), preserve_cardinality);
  odsState.addAttribute(metadataAttrName(odsState.name), metadata);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void MapAndBatchDatasetOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type handle, ::mlir::Value input_dataset, ::mlir::ValueRange other_arguments, ::mlir::Value batch_size, ::mlir::Value num_parallel_calls, ::mlir::Value drop_remainder, ::mlir::SymbolRefAttr f, ::mlir::ArrayAttr output_types, ::mlir::ArrayAttr output_shapes, bool preserve_cardinality, ::llvm::StringRef metadata) {
  odsState.addOperands(input_dataset);
  odsState.addOperands(other_arguments);
  odsState.addOperands(batch_size);
  odsState.addOperands(num_parallel_calls);
  odsState.addOperands(drop_remainder);
  odsState.addAttribute(fAttrName(odsState.name), f);
  odsState.addAttribute(output_typesAttrName(odsState.name), output_types);
  odsState.addAttribute(output_shapesAttrName(odsState.name), output_shapes);
  odsState.addAttribute(preserve_cardinalityAttrName(odsState.name), odsBuilder.getBoolAttr(preserve_cardinality));
  odsState.addAttribute(metadataAttrName(odsState.name), odsBuilder.getStringAttr(metadata));
  odsState.addTypes(handle);
}

void MapAndBatchDatasetOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input_dataset, ::mlir::ValueRange other_arguments, ::mlir::Value batch_size, ::mlir::Value num_parallel_calls, ::mlir::Value drop_remainder, ::mlir::SymbolRefAttr f, ::mlir::ArrayAttr output_types, ::mlir::ArrayAttr output_shapes, bool preserve_cardinality, ::llvm::StringRef metadata) {
  odsState.addOperands(input_dataset);
  odsState.addOperands(other_arguments);
  odsState.addOperands(batch_size);
  odsState.addOperands(num_parallel_calls);
  odsState.addOperands(drop_remainder);
  odsState.addAttribute(fAttrName(odsState.name), f);
  odsState.addAttribute(output_typesAttrName(odsState.name), output_types);
  odsState.addAttribute(output_shapesAttrName(odsState.name), output_shapes);
  odsState.addAttribute(preserve_cardinalityAttrName(odsState.name), odsBuilder.getBoolAttr(preserve_cardinality));
  odsState.addAttribute(metadataAttrName(odsState.name), odsBuilder.getStringAttr(metadata));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void MapAndBatchDatasetOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() >= 4u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult MapAndBatchDatasetOp::verify() {
  {
    auto tblgen_f = (*this)->getAttr(fAttrName());
    if (!tblgen_f)
      return emitOpError("requires attribute 'f'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops12(*this, tblgen_f, "f")))
      return ::mlir::failure();
  }
  {
    auto tblgen_output_types = (*this)->getAttr(output_typesAttrName());
    if (!tblgen_output_types)
      return emitOpError("requires attribute 'output_types'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops2(*this, tblgen_output_types, "output_types")))
      return ::mlir::failure();
  }
  {
    auto tblgen_output_shapes = (*this)->getAttr(output_shapesAttrName());
    if (!tblgen_output_shapes)
      return emitOpError("requires attribute 'output_shapes'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops3(*this, tblgen_output_shapes, "output_shapes")))
      return ::mlir::failure();
  }
  {
    auto tblgen_preserve_cardinality = (*this)->getAttr(preserve_cardinalityAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_preserve_cardinality, "preserve_cardinality")))
      return ::mlir::failure();
  }
  {
    auto tblgen_metadata = (*this)->getAttr(metadataAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_metadata, "metadata")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops15(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops16(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup3 = getODSOperands(3);

    for (auto v : valueGroup3) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops16(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup4 = getODSOperands(4);

    for (auto v : valueGroup4) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops8(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops15(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void MapAndBatchDatasetOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::MapAndBatchDatasetOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::MapDatasetOp definitions
//===----------------------------------------------------------------------===//

MapDatasetOpAdaptor::MapDatasetOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

MapDatasetOpAdaptor::MapDatasetOpAdaptor(MapDatasetOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange MapDatasetOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> MapDatasetOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  bool isVariadic[] = {false, true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (odsOperands.size() - 1) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::ValueRange MapDatasetOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value MapDatasetOpAdaptor::input_dataset() {
  return *getODSOperands(0).begin();
}

::mlir::ValueRange MapDatasetOpAdaptor::other_arguments() {
  return getODSOperands(1);
}

::mlir::DictionaryAttr MapDatasetOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::SymbolRefAttr MapDatasetOpAdaptor::f() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::SymbolRefAttr attr = odsAttrs.get("f").cast<::mlir::SymbolRefAttr>();
  return attr;
}

::mlir::ArrayAttr MapDatasetOpAdaptor::output_types() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("output_types").cast<::mlir::ArrayAttr>();
  return attr;
}

::mlir::ArrayAttr MapDatasetOpAdaptor::output_shapes() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("output_shapes").cast<::mlir::ArrayAttr>();
  return attr;
}

::mlir::BoolAttr MapDatasetOpAdaptor::use_inter_op_parallelism() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("use_inter_op_parallelism").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(true);
  return attr;
}

::mlir::BoolAttr MapDatasetOpAdaptor::preserve_cardinality() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("preserve_cardinality").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(false);
  return attr;
}

::mlir::StringAttr MapDatasetOpAdaptor::metadata() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("metadata").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("");
  return attr;
}

::mlir::LogicalResult MapDatasetOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_f = odsAttrs.get("f");
    if (!tblgen_f)
      return emitError(loc, "'tf.MapDataset' op ""requires attribute 'f'");

    if (tblgen_f && !((tblgen_f.isa<::mlir::SymbolRefAttr>())))
      return emitError(loc, "'tf.MapDataset' op ""attribute 'f' failed to satisfy constraint: symbol reference attribute");
  }
  {
    auto tblgen_output_types = odsAttrs.get("output_types");
    if (!tblgen_output_types)
      return emitError(loc, "'tf.MapDataset' op ""requires attribute 'output_types'");

    if (tblgen_output_types && !((((tblgen_output_types.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_output_types.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return ((attr.isa<::mlir::TypeAttr>())) && ((attr.cast<::mlir::TypeAttr>().getValue().isa<::mlir::Type>())); }))) && ((tblgen_output_types.cast<::mlir::ArrayAttr>().size() >= 1))))
      return emitError(loc, "'tf.MapDataset' op ""attribute 'output_types' failed to satisfy constraint: type array attribute with at least 1 elements");
  }
  {
    auto tblgen_output_shapes = odsAttrs.get("output_shapes");
    if (!tblgen_output_shapes)
      return emitError(loc, "'tf.MapDataset' op ""requires attribute 'output_shapes'");

    if (tblgen_output_shapes && !((((tblgen_output_shapes.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_output_shapes.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return (attr.isa<mlir::TF::ShapeAttr>()); }))) && ((tblgen_output_shapes.cast<::mlir::ArrayAttr>().size() >= 1))))
      return emitError(loc, "'tf.MapDataset' op ""attribute 'output_shapes' failed to satisfy constraint: tensorflow shape attribute array with at least 1 elements");
  }
  {
    auto tblgen_use_inter_op_parallelism = odsAttrs.get("use_inter_op_parallelism");
    if (tblgen_use_inter_op_parallelism && !((tblgen_use_inter_op_parallelism.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.MapDataset' op ""attribute 'use_inter_op_parallelism' failed to satisfy constraint: bool attribute");
  }
  {
    auto tblgen_preserve_cardinality = odsAttrs.get("preserve_cardinality");
    if (tblgen_preserve_cardinality && !((tblgen_preserve_cardinality.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.MapDataset' op ""attribute 'preserve_cardinality' failed to satisfy constraint: bool attribute");
  }
  {
    auto tblgen_metadata = odsAttrs.get("metadata");
    if (tblgen_metadata && !((tblgen_metadata.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.MapDataset' op ""attribute 'metadata' failed to satisfy constraint: string attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> MapDatasetOp::getODSOperandIndexAndLength(unsigned index) {
  bool isVariadic[] = {false, true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (getOperation()->getNumOperands() - 1) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::Operation::operand_range MapDatasetOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value MapDatasetOp::input_dataset() {
  return *getODSOperands(0).begin();
}

::mlir::Operation::operand_range MapDatasetOp::other_arguments() {
  return getODSOperands(1);
}

::mlir::MutableOperandRange MapDatasetOp::input_datasetMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange MapDatasetOp::other_argumentsMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> MapDatasetOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range MapDatasetOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value MapDatasetOp::handle() {
  return *getODSResults(0).begin();
}

::mlir::SymbolRefAttr MapDatasetOp::fAttr() {
  return (*this)->getAttr(fAttrName()).cast<::mlir::SymbolRefAttr>();
}

::mlir::SymbolRefAttr MapDatasetOp::f() {
  auto attr = fAttr();
  return attr;
}

::mlir::ArrayAttr MapDatasetOp::output_typesAttr() {
  return (*this)->getAttr(output_typesAttrName()).cast<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr MapDatasetOp::output_types() {
  auto attr = output_typesAttr();
  return attr;
}

::mlir::ArrayAttr MapDatasetOp::output_shapesAttr() {
  return (*this)->getAttr(output_shapesAttrName()).cast<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr MapDatasetOp::output_shapes() {
  auto attr = output_shapesAttr();
  return attr;
}

::mlir::BoolAttr MapDatasetOp::use_inter_op_parallelismAttr() {
  return (*this)->getAttr(use_inter_op_parallelismAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool MapDatasetOp::use_inter_op_parallelism() {
  auto attr = use_inter_op_parallelismAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(true).getValue();
  return attr.getValue();
}

::mlir::BoolAttr MapDatasetOp::preserve_cardinalityAttr() {
  return (*this)->getAttr(preserve_cardinalityAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool MapDatasetOp::preserve_cardinality() {
  auto attr = preserve_cardinalityAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(false).getValue();
  return attr.getValue();
}

::mlir::StringAttr MapDatasetOp::metadataAttr() {
  return (*this)->getAttr(metadataAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef MapDatasetOp::metadata() {
  auto attr = metadataAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("").getValue();
  return attr.getValue();
}

mlir::OperandElementTypeRange MapDatasetOp::Targuments() {
  auto values = getODSOperands(1);
return {mlir::OperandElementTypeIterator(values.begin()), mlir::OperandElementTypeIterator(values.end())};
}

bool MapDatasetOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "Targuments") return true;
 return false;
}

::mlir::DictionaryAttr MapDatasetOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TargumentsAttrName(),
ArrayAttr::get(ctx, 
    [&]() {
      llvm::SmallVector<Attribute, 4> ret;
      for (auto t : Targuments())
        ret.push_back(TypeAttr::get(t));
      return ret;
    }())}});
}

void MapDatasetOp::fAttr(::mlir::SymbolRefAttr attr) {
  (*this)->setAttr(fAttrName(), attr);
}

void MapDatasetOp::output_typesAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(output_typesAttrName(), attr);
}

void MapDatasetOp::output_shapesAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(output_shapesAttrName(), attr);
}

void MapDatasetOp::use_inter_op_parallelismAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(use_inter_op_parallelismAttrName(), attr);
}

void MapDatasetOp::preserve_cardinalityAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(preserve_cardinalityAttrName(), attr);
}

void MapDatasetOp::metadataAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(metadataAttrName(), attr);
}

void MapDatasetOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type handle, ::mlir::Value input_dataset, ::mlir::ValueRange other_arguments, ::mlir::SymbolRefAttr f, ::mlir::ArrayAttr output_types, ::mlir::ArrayAttr output_shapes, ::mlir::BoolAttr use_inter_op_parallelism, ::mlir::BoolAttr preserve_cardinality, ::mlir::StringAttr metadata) {
  odsState.addOperands(input_dataset);
  odsState.addOperands(other_arguments);
  odsState.addAttribute(fAttrName(odsState.name), f);
  odsState.addAttribute(output_typesAttrName(odsState.name), output_types);
  odsState.addAttribute(output_shapesAttrName(odsState.name), output_shapes);
  odsState.addAttribute(use_inter_op_parallelismAttrName(odsState.name), use_inter_op_parallelism);
  odsState.addAttribute(preserve_cardinalityAttrName(odsState.name), preserve_cardinality);
  odsState.addAttribute(metadataAttrName(odsState.name), metadata);
  odsState.addTypes(handle);
}

void MapDatasetOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input_dataset, ::mlir::ValueRange other_arguments, ::mlir::SymbolRefAttr f, ::mlir::ArrayAttr output_types, ::mlir::ArrayAttr output_shapes, ::mlir::BoolAttr use_inter_op_parallelism, ::mlir::BoolAttr preserve_cardinality, ::mlir::StringAttr metadata) {
  odsState.addOperands(input_dataset);
  odsState.addOperands(other_arguments);
  odsState.addAttribute(fAttrName(odsState.name), f);
  odsState.addAttribute(output_typesAttrName(odsState.name), output_types);
  odsState.addAttribute(output_shapesAttrName(odsState.name), output_shapes);
  odsState.addAttribute(use_inter_op_parallelismAttrName(odsState.name), use_inter_op_parallelism);
  odsState.addAttribute(preserve_cardinalityAttrName(odsState.name), preserve_cardinality);
  odsState.addAttribute(metadataAttrName(odsState.name), metadata);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void MapDatasetOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type handle, ::mlir::Value input_dataset, ::mlir::ValueRange other_arguments, ::mlir::SymbolRefAttr f, ::mlir::ArrayAttr output_types, ::mlir::ArrayAttr output_shapes, bool use_inter_op_parallelism, bool preserve_cardinality, ::llvm::StringRef metadata) {
  odsState.addOperands(input_dataset);
  odsState.addOperands(other_arguments);
  odsState.addAttribute(fAttrName(odsState.name), f);
  odsState.addAttribute(output_typesAttrName(odsState.name), output_types);
  odsState.addAttribute(output_shapesAttrName(odsState.name), output_shapes);
  odsState.addAttribute(use_inter_op_parallelismAttrName(odsState.name), odsBuilder.getBoolAttr(use_inter_op_parallelism));
  odsState.addAttribute(preserve_cardinalityAttrName(odsState.name), odsBuilder.getBoolAttr(preserve_cardinality));
  odsState.addAttribute(metadataAttrName(odsState.name), odsBuilder.getStringAttr(metadata));
  odsState.addTypes(handle);
}

void MapDatasetOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input_dataset, ::mlir::ValueRange other_arguments, ::mlir::SymbolRefAttr f, ::mlir::ArrayAttr output_types, ::mlir::ArrayAttr output_shapes, bool use_inter_op_parallelism, bool preserve_cardinality, ::llvm::StringRef metadata) {
  odsState.addOperands(input_dataset);
  odsState.addOperands(other_arguments);
  odsState.addAttribute(fAttrName(odsState.name), f);
  odsState.addAttribute(output_typesAttrName(odsState.name), output_types);
  odsState.addAttribute(output_shapesAttrName(odsState.name), output_shapes);
  odsState.addAttribute(use_inter_op_parallelismAttrName(odsState.name), odsBuilder.getBoolAttr(use_inter_op_parallelism));
  odsState.addAttribute(preserve_cardinalityAttrName(odsState.name), odsBuilder.getBoolAttr(preserve_cardinality));
  odsState.addAttribute(metadataAttrName(odsState.name), odsBuilder.getStringAttr(metadata));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void MapDatasetOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() >= 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult MapDatasetOp::verify() {
  {
    auto tblgen_f = (*this)->getAttr(fAttrName());
    if (!tblgen_f)
      return emitOpError("requires attribute 'f'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops12(*this, tblgen_f, "f")))
      return ::mlir::failure();
  }
  {
    auto tblgen_output_types = (*this)->getAttr(output_typesAttrName());
    if (!tblgen_output_types)
      return emitOpError("requires attribute 'output_types'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops2(*this, tblgen_output_types, "output_types")))
      return ::mlir::failure();
  }
  {
    auto tblgen_output_shapes = (*this)->getAttr(output_shapesAttrName());
    if (!tblgen_output_shapes)
      return emitOpError("requires attribute 'output_shapes'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops3(*this, tblgen_output_shapes, "output_shapes")))
      return ::mlir::failure();
  }
  {
    auto tblgen_use_inter_op_parallelism = (*this)->getAttr(use_inter_op_parallelismAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_use_inter_op_parallelism, "use_inter_op_parallelism")))
      return ::mlir::failure();
  }
  {
    auto tblgen_preserve_cardinality = (*this)->getAttr(preserve_cardinalityAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_preserve_cardinality, "preserve_cardinality")))
      return ::mlir::failure();
  }
  {
    auto tblgen_metadata = (*this)->getAttr(metadataAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_metadata, "metadata")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops15(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops15(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void MapDatasetOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::MapDatasetOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::MatMulOp definitions
//===----------------------------------------------------------------------===//

MatMulOpAdaptor::MatMulOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

MatMulOpAdaptor::MatMulOpAdaptor(MatMulOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange MatMulOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> MatMulOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange MatMulOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value MatMulOpAdaptor::a() {
  return *getODSOperands(0).begin();
}

::mlir::Value MatMulOpAdaptor::b() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr MatMulOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::BoolAttr MatMulOpAdaptor::transpose_a() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("transpose_a").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(false);
  return attr;
}

::mlir::BoolAttr MatMulOpAdaptor::transpose_b() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("transpose_b").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(false);
  return attr;
}

::mlir::LogicalResult MatMulOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_transpose_a = odsAttrs.get("transpose_a");
    if (tblgen_transpose_a && !((tblgen_transpose_a.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.MatMul' op ""attribute 'transpose_a' failed to satisfy constraint: bool attribute");
  }
  {
    auto tblgen_transpose_b = odsAttrs.get("transpose_b");
    if (tblgen_transpose_b && !((tblgen_transpose_b.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.MatMul' op ""attribute 'transpose_b' failed to satisfy constraint: bool attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> MatMulOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range MatMulOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value MatMulOp::a() {
  return *getODSOperands(0).begin();
}

::mlir::Value MatMulOp::b() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange MatMulOp::aMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange MatMulOp::bMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> MatMulOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range MatMulOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value MatMulOp::product() {
  return *getODSResults(0).begin();
}

::mlir::BoolAttr MatMulOp::transpose_aAttr() {
  return (*this)->getAttr(transpose_aAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool MatMulOp::transpose_a() {
  auto attr = transpose_aAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(false).getValue();
  return attr.getValue();
}

::mlir::BoolAttr MatMulOp::transpose_bAttr() {
  return (*this)->getAttr(transpose_bAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool MatMulOp::transpose_b() {
  auto attr = transpose_bAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(false).getValue();
  return attr.getValue();
}

::mlir::Type MatMulOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool MatMulOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr MatMulOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void MatMulOp::transpose_aAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(transpose_aAttrName(), attr);
}

void MatMulOp::transpose_bAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(transpose_bAttrName(), attr);
}

void MatMulOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type product, ::mlir::Value a, ::mlir::Value b, ::mlir::BoolAttr transpose_a, ::mlir::BoolAttr transpose_b) {
  odsState.addOperands(a);
  odsState.addOperands(b);
  odsState.addAttribute(transpose_aAttrName(odsState.name), transpose_a);
  odsState.addAttribute(transpose_bAttrName(odsState.name), transpose_b);
  odsState.addTypes(product);
}

void MatMulOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value a, ::mlir::Value b, ::mlir::BoolAttr transpose_a, ::mlir::BoolAttr transpose_b) {
  odsState.addOperands(a);
  odsState.addOperands(b);
  odsState.addAttribute(transpose_aAttrName(odsState.name), transpose_a);
  odsState.addAttribute(transpose_bAttrName(odsState.name), transpose_b);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void MatMulOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type product, ::mlir::Value a, ::mlir::Value b, bool transpose_a, bool transpose_b) {
  odsState.addOperands(a);
  odsState.addOperands(b);
  odsState.addAttribute(transpose_aAttrName(odsState.name), odsBuilder.getBoolAttr(transpose_a));
  odsState.addAttribute(transpose_bAttrName(odsState.name), odsBuilder.getBoolAttr(transpose_b));
  odsState.addTypes(product);
}

void MatMulOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value a, ::mlir::Value b, bool transpose_a, bool transpose_b) {
  odsState.addOperands(a);
  odsState.addOperands(b);
  odsState.addAttribute(transpose_aAttrName(odsState.name), odsBuilder.getBoolAttr(transpose_a));
  odsState.addAttribute(transpose_bAttrName(odsState.name), odsBuilder.getBoolAttr(transpose_b));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void MatMulOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult MatMulOp::verify() {
  {
    auto tblgen_transpose_a = (*this)->getAttr(transpose_aAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_transpose_a, "transpose_a")))
      return ::mlir::failure();
  }
  {
    auto tblgen_transpose_b = (*this)->getAttr(transpose_bAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_transpose_b, "transpose_b")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops22(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops22(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops22(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void MatMulOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::MatMulOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::MatrixBandPartOp definitions
//===----------------------------------------------------------------------===//

MatrixBandPartOpAdaptor::MatrixBandPartOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

MatrixBandPartOpAdaptor::MatrixBandPartOpAdaptor(MatrixBandPartOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange MatrixBandPartOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> MatrixBandPartOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange MatrixBandPartOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value MatrixBandPartOpAdaptor::input() {
  return *getODSOperands(0).begin();
}

::mlir::Value MatrixBandPartOpAdaptor::num_lower() {
  return *getODSOperands(1).begin();
}

::mlir::Value MatrixBandPartOpAdaptor::num_upper() {
  return *getODSOperands(2).begin();
}

::mlir::DictionaryAttr MatrixBandPartOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult MatrixBandPartOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> MatrixBandPartOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range MatrixBandPartOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value MatrixBandPartOp::input() {
  return *getODSOperands(0).begin();
}

::mlir::Value MatrixBandPartOp::num_lower() {
  return *getODSOperands(1).begin();
}

::mlir::Value MatrixBandPartOp::num_upper() {
  return *getODSOperands(2).begin();
}

::mlir::MutableOperandRange MatrixBandPartOp::inputMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange MatrixBandPartOp::num_lowerMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange MatrixBandPartOp::num_upperMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> MatrixBandPartOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range MatrixBandPartOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value MatrixBandPartOp::band() {
  return *getODSResults(0).begin();
}

::mlir::Type MatrixBandPartOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

::mlir::Type MatrixBandPartOp::Tindex() {
  return mlir::getElementTypeOrSelf(*getODSOperands(1).begin());
}

bool MatrixBandPartOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
  if (name == "Tindex") return true;
 return false;
}

::mlir::DictionaryAttr MatrixBandPartOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())},
    {TindexAttrName(),
::mlir::TypeAttr::get(Tindex())}});
}

void MatrixBandPartOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type band, ::mlir::Value input, ::mlir::Value num_lower, ::mlir::Value num_upper) {
  odsState.addOperands(input);
  odsState.addOperands(num_lower);
  odsState.addOperands(num_upper);
  odsState.addTypes(band);
}

void MatrixBandPartOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::Value num_lower, ::mlir::Value num_upper) {
  odsState.addOperands(input);
  odsState.addOperands(num_lower);
  odsState.addOperands(num_upper);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void MatrixBandPartOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 3u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult MatrixBandPartOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  if (!((tf_type::AreCastCompatible(llvm::makeArrayRef({(*this->getODSOperands(0).begin()).getType(), (*this->getODSResults(0).begin()).getType()})))))
    return emitOpError("failed to verify that all of {input, band} have dynamically equal types ");
  return Verify(*this);
}

void MatrixBandPartOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::MatrixBandPartOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::MatrixDiagOp definitions
//===----------------------------------------------------------------------===//

MatrixDiagOpAdaptor::MatrixDiagOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

MatrixDiagOpAdaptor::MatrixDiagOpAdaptor(MatrixDiagOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange MatrixDiagOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> MatrixDiagOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange MatrixDiagOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value MatrixDiagOpAdaptor::diagonal() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr MatrixDiagOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult MatrixDiagOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> MatrixDiagOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range MatrixDiagOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value MatrixDiagOp::diagonal() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange MatrixDiagOp::diagonalMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> MatrixDiagOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range MatrixDiagOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value MatrixDiagOp::output() {
  return *getODSResults(0).begin();
}

::mlir::Type MatrixDiagOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool MatrixDiagOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr MatrixDiagOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void MatrixDiagOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value diagonal) {
  odsState.addOperands(diagonal);
  odsState.addTypes(output);
}

void MatrixDiagOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value diagonal) {
  odsState.addOperands(diagonal);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void MatrixDiagOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult MatrixDiagOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void MatrixDiagOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::MatrixDiagOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::MatrixDiagPartV3Op definitions
//===----------------------------------------------------------------------===//

MatrixDiagPartV3OpAdaptor::MatrixDiagPartV3OpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

MatrixDiagPartV3OpAdaptor::MatrixDiagPartV3OpAdaptor(MatrixDiagPartV3Op &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange MatrixDiagPartV3OpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> MatrixDiagPartV3OpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange MatrixDiagPartV3OpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value MatrixDiagPartV3OpAdaptor::input() {
  return *getODSOperands(0).begin();
}

::mlir::Value MatrixDiagPartV3OpAdaptor::k() {
  return *getODSOperands(1).begin();
}

::mlir::Value MatrixDiagPartV3OpAdaptor::padding_value() {
  return *getODSOperands(2).begin();
}

::mlir::DictionaryAttr MatrixDiagPartV3OpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::StringAttr MatrixDiagPartV3OpAdaptor::align() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("align").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("RIGHT_LEFT");
  return attr;
}

::mlir::LogicalResult MatrixDiagPartV3OpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_align = odsAttrs.get("align");
    if (tblgen_align && !((tblgen_align.cast<StringAttr>().getValue() == "LEFT_RIGHT" || tblgen_align.cast<StringAttr>().getValue() == "RIGHT_LEFT" || tblgen_align.cast<StringAttr>().getValue() == "LEFT_LEFT" || tblgen_align.cast<StringAttr>().getValue() == "RIGHT_RIGHT")))
      return emitError(loc, "'tf.MatrixDiagPartV3' op ""attribute 'align' failed to satisfy constraint: string attribute whose value is LEFT_RIGHT, or RIGHT_LEFT, or LEFT_LEFT, or RIGHT_RIGHT");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> MatrixDiagPartV3Op::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range MatrixDiagPartV3Op::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value MatrixDiagPartV3Op::input() {
  return *getODSOperands(0).begin();
}

::mlir::Value MatrixDiagPartV3Op::k() {
  return *getODSOperands(1).begin();
}

::mlir::Value MatrixDiagPartV3Op::padding_value() {
  return *getODSOperands(2).begin();
}

::mlir::MutableOperandRange MatrixDiagPartV3Op::inputMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange MatrixDiagPartV3Op::kMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange MatrixDiagPartV3Op::padding_valueMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> MatrixDiagPartV3Op::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range MatrixDiagPartV3Op::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value MatrixDiagPartV3Op::diagonal() {
  return *getODSResults(0).begin();
}

::mlir::StringAttr MatrixDiagPartV3Op::alignAttr() {
  return (*this)->getAttr(alignAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef MatrixDiagPartV3Op::align() {
  auto attr = alignAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("RIGHT_LEFT").getValue();
  return attr.getValue();
}

::mlir::Type MatrixDiagPartV3Op::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool MatrixDiagPartV3Op::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr MatrixDiagPartV3Op::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void MatrixDiagPartV3Op::alignAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(alignAttrName(), attr);
}

void MatrixDiagPartV3Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type diagonal, ::mlir::Value input, ::mlir::Value k, ::mlir::Value padding_value, ::mlir::StringAttr align) {
  odsState.addOperands(input);
  odsState.addOperands(k);
  odsState.addOperands(padding_value);
  odsState.addAttribute(alignAttrName(odsState.name), align);
  odsState.addTypes(diagonal);
}

void MatrixDiagPartV3Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::Value k, ::mlir::Value padding_value, ::mlir::StringAttr align) {
  odsState.addOperands(input);
  odsState.addOperands(k);
  odsState.addOperands(padding_value);
  odsState.addAttribute(alignAttrName(odsState.name), align);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void MatrixDiagPartV3Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type diagonal, ::mlir::Value input, ::mlir::Value k, ::mlir::Value padding_value, ::llvm::StringRef align) {
  odsState.addOperands(input);
  odsState.addOperands(k);
  odsState.addOperands(padding_value);
  odsState.addAttribute(alignAttrName(odsState.name), odsBuilder.getStringAttr(align));
  odsState.addTypes(diagonal);
}

void MatrixDiagPartV3Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::Value k, ::mlir::Value padding_value, ::llvm::StringRef align) {
  odsState.addOperands(input);
  odsState.addOperands(k);
  odsState.addOperands(padding_value);
  odsState.addAttribute(alignAttrName(odsState.name), odsBuilder.getStringAttr(align));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void MatrixDiagPartV3Op::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 3u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult MatrixDiagPartV3Op::verify() {
  {
    auto tblgen_align = (*this)->getAttr(alignAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops32(*this, tblgen_align, "align")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops11(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void MatrixDiagPartV3Op::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::MatrixDiagPartV3Op)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::MatrixDiagV2Op definitions
//===----------------------------------------------------------------------===//

MatrixDiagV2OpAdaptor::MatrixDiagV2OpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

MatrixDiagV2OpAdaptor::MatrixDiagV2OpAdaptor(MatrixDiagV2Op &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange MatrixDiagV2OpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> MatrixDiagV2OpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange MatrixDiagV2OpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value MatrixDiagV2OpAdaptor::diagonal() {
  return *getODSOperands(0).begin();
}

::mlir::Value MatrixDiagV2OpAdaptor::k() {
  return *getODSOperands(1).begin();
}

::mlir::Value MatrixDiagV2OpAdaptor::num_rows() {
  return *getODSOperands(2).begin();
}

::mlir::Value MatrixDiagV2OpAdaptor::num_cols() {
  return *getODSOperands(3).begin();
}

::mlir::Value MatrixDiagV2OpAdaptor::padding_value() {
  return *getODSOperands(4).begin();
}

::mlir::DictionaryAttr MatrixDiagV2OpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult MatrixDiagV2OpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> MatrixDiagV2Op::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range MatrixDiagV2Op::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value MatrixDiagV2Op::diagonal() {
  return *getODSOperands(0).begin();
}

::mlir::Value MatrixDiagV2Op::k() {
  return *getODSOperands(1).begin();
}

::mlir::Value MatrixDiagV2Op::num_rows() {
  return *getODSOperands(2).begin();
}

::mlir::Value MatrixDiagV2Op::num_cols() {
  return *getODSOperands(3).begin();
}

::mlir::Value MatrixDiagV2Op::padding_value() {
  return *getODSOperands(4).begin();
}

::mlir::MutableOperandRange MatrixDiagV2Op::diagonalMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange MatrixDiagV2Op::kMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange MatrixDiagV2Op::num_rowsMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange MatrixDiagV2Op::num_colsMutable() {
  auto range = getODSOperandIndexAndLength(3);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange MatrixDiagV2Op::padding_valueMutable() {
  auto range = getODSOperandIndexAndLength(4);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> MatrixDiagV2Op::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range MatrixDiagV2Op::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value MatrixDiagV2Op::output() {
  return *getODSResults(0).begin();
}

::mlir::Type MatrixDiagV2Op::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool MatrixDiagV2Op::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr MatrixDiagV2Op::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void MatrixDiagV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value diagonal, ::mlir::Value k, ::mlir::Value num_rows, ::mlir::Value num_cols, ::mlir::Value padding_value) {
  odsState.addOperands(diagonal);
  odsState.addOperands(k);
  odsState.addOperands(num_rows);
  odsState.addOperands(num_cols);
  odsState.addOperands(padding_value);
  odsState.addTypes(output);
}

void MatrixDiagV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value diagonal, ::mlir::Value k, ::mlir::Value num_rows, ::mlir::Value num_cols, ::mlir::Value padding_value) {
  odsState.addOperands(diagonal);
  odsState.addOperands(k);
  odsState.addOperands(num_rows);
  odsState.addOperands(num_cols);
  odsState.addOperands(padding_value);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void MatrixDiagV2Op::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 5u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult MatrixDiagV2Op::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops11(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops11(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup3 = getODSOperands(3);

    for (auto v : valueGroup3) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops11(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup4 = getODSOperands(4);

    for (auto v : valueGroup4) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void MatrixDiagV2Op::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::MatrixDiagV2Op)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::MatrixDiagV3Op definitions
//===----------------------------------------------------------------------===//

MatrixDiagV3OpAdaptor::MatrixDiagV3OpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

MatrixDiagV3OpAdaptor::MatrixDiagV3OpAdaptor(MatrixDiagV3Op &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange MatrixDiagV3OpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> MatrixDiagV3OpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange MatrixDiagV3OpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value MatrixDiagV3OpAdaptor::diagonal() {
  return *getODSOperands(0).begin();
}

::mlir::Value MatrixDiagV3OpAdaptor::k() {
  return *getODSOperands(1).begin();
}

::mlir::Value MatrixDiagV3OpAdaptor::num_rows() {
  return *getODSOperands(2).begin();
}

::mlir::Value MatrixDiagV3OpAdaptor::num_cols() {
  return *getODSOperands(3).begin();
}

::mlir::Value MatrixDiagV3OpAdaptor::padding_value() {
  return *getODSOperands(4).begin();
}

::mlir::DictionaryAttr MatrixDiagV3OpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::StringAttr MatrixDiagV3OpAdaptor::align() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("align").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("RIGHT_LEFT");
  return attr;
}

::mlir::LogicalResult MatrixDiagV3OpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_align = odsAttrs.get("align");
    if (tblgen_align && !((tblgen_align.cast<StringAttr>().getValue() == "LEFT_RIGHT" || tblgen_align.cast<StringAttr>().getValue() == "RIGHT_LEFT" || tblgen_align.cast<StringAttr>().getValue() == "LEFT_LEFT" || tblgen_align.cast<StringAttr>().getValue() == "RIGHT_RIGHT")))
      return emitError(loc, "'tf.MatrixDiagV3' op ""attribute 'align' failed to satisfy constraint: string attribute whose value is LEFT_RIGHT, or RIGHT_LEFT, or LEFT_LEFT, or RIGHT_RIGHT");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> MatrixDiagV3Op::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range MatrixDiagV3Op::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value MatrixDiagV3Op::diagonal() {
  return *getODSOperands(0).begin();
}

::mlir::Value MatrixDiagV3Op::k() {
  return *getODSOperands(1).begin();
}

::mlir::Value MatrixDiagV3Op::num_rows() {
  return *getODSOperands(2).begin();
}

::mlir::Value MatrixDiagV3Op::num_cols() {
  return *getODSOperands(3).begin();
}

::mlir::Value MatrixDiagV3Op::padding_value() {
  return *getODSOperands(4).begin();
}

::mlir::MutableOperandRange MatrixDiagV3Op::diagonalMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange MatrixDiagV3Op::kMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange MatrixDiagV3Op::num_rowsMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange MatrixDiagV3Op::num_colsMutable() {
  auto range = getODSOperandIndexAndLength(3);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange MatrixDiagV3Op::padding_valueMutable() {
  auto range = getODSOperandIndexAndLength(4);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> MatrixDiagV3Op::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range MatrixDiagV3Op::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value MatrixDiagV3Op::output() {
  return *getODSResults(0).begin();
}

::mlir::StringAttr MatrixDiagV3Op::alignAttr() {
  return (*this)->getAttr(alignAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef MatrixDiagV3Op::align() {
  auto attr = alignAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("RIGHT_LEFT").getValue();
  return attr.getValue();
}

::mlir::Type MatrixDiagV3Op::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool MatrixDiagV3Op::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr MatrixDiagV3Op::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void MatrixDiagV3Op::alignAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(alignAttrName(), attr);
}

void MatrixDiagV3Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value diagonal, ::mlir::Value k, ::mlir::Value num_rows, ::mlir::Value num_cols, ::mlir::Value padding_value, ::mlir::StringAttr align) {
  odsState.addOperands(diagonal);
  odsState.addOperands(k);
  odsState.addOperands(num_rows);
  odsState.addOperands(num_cols);
  odsState.addOperands(padding_value);
  odsState.addAttribute(alignAttrName(odsState.name), align);
  odsState.addTypes(output);
}

void MatrixDiagV3Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value diagonal, ::mlir::Value k, ::mlir::Value num_rows, ::mlir::Value num_cols, ::mlir::Value padding_value, ::mlir::StringAttr align) {
  odsState.addOperands(diagonal);
  odsState.addOperands(k);
  odsState.addOperands(num_rows);
  odsState.addOperands(num_cols);
  odsState.addOperands(padding_value);
  odsState.addAttribute(alignAttrName(odsState.name), align);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void MatrixDiagV3Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value diagonal, ::mlir::Value k, ::mlir::Value num_rows, ::mlir::Value num_cols, ::mlir::Value padding_value, ::llvm::StringRef align) {
  odsState.addOperands(diagonal);
  odsState.addOperands(k);
  odsState.addOperands(num_rows);
  odsState.addOperands(num_cols);
  odsState.addOperands(padding_value);
  odsState.addAttribute(alignAttrName(odsState.name), odsBuilder.getStringAttr(align));
  odsState.addTypes(output);
}

void MatrixDiagV3Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value diagonal, ::mlir::Value k, ::mlir::Value num_rows, ::mlir::Value num_cols, ::mlir::Value padding_value, ::llvm::StringRef align) {
  odsState.addOperands(diagonal);
  odsState.addOperands(k);
  odsState.addOperands(num_rows);
  odsState.addOperands(num_cols);
  odsState.addOperands(padding_value);
  odsState.addAttribute(alignAttrName(odsState.name), odsBuilder.getStringAttr(align));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void MatrixDiagV3Op::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 5u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult MatrixDiagV3Op::verify() {
  {
    auto tblgen_align = (*this)->getAttr(alignAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops32(*this, tblgen_align, "align")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops11(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops11(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup3 = getODSOperands(3);

    for (auto v : valueGroup3) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops11(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup4 = getODSOperands(4);

    for (auto v : valueGroup4) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void MatrixDiagV3Op::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::MatrixDiagV3Op)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::MatrixInverseOp definitions
//===----------------------------------------------------------------------===//

MatrixInverseOpAdaptor::MatrixInverseOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

MatrixInverseOpAdaptor::MatrixInverseOpAdaptor(MatrixInverseOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange MatrixInverseOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> MatrixInverseOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange MatrixInverseOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value MatrixInverseOpAdaptor::input() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr MatrixInverseOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::BoolAttr MatrixInverseOpAdaptor::adjoint() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("adjoint").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(false);
  return attr;
}

::mlir::LogicalResult MatrixInverseOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_adjoint = odsAttrs.get("adjoint");
    if (tblgen_adjoint && !((tblgen_adjoint.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.MatrixInverse' op ""attribute 'adjoint' failed to satisfy constraint: bool attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> MatrixInverseOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range MatrixInverseOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value MatrixInverseOp::input() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange MatrixInverseOp::inputMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> MatrixInverseOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range MatrixInverseOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value MatrixInverseOp::output() {
  return *getODSResults(0).begin();
}

::mlir::BoolAttr MatrixInverseOp::adjointAttr() {
  return (*this)->getAttr(adjointAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool MatrixInverseOp::adjoint() {
  auto attr = adjointAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(false).getValue();
  return attr.getValue();
}

::mlir::Type MatrixInverseOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool MatrixInverseOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr MatrixInverseOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void MatrixInverseOp::adjointAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(adjointAttrName(), attr);
}

void MatrixInverseOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input, ::mlir::BoolAttr adjoint) {
  odsState.addOperands(input);
  odsState.addAttribute(adjointAttrName(odsState.name), adjoint);
  odsState.addTypes(output);
}

void MatrixInverseOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::BoolAttr adjoint) {
  odsState.addOperands(input);
  odsState.addAttribute(adjointAttrName(odsState.name), adjoint);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void MatrixInverseOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input, bool adjoint) {
  odsState.addOperands(input);
  odsState.addAttribute(adjointAttrName(odsState.name), odsBuilder.getBoolAttr(adjoint));
  odsState.addTypes(output);
}

void MatrixInverseOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, bool adjoint) {
  odsState.addOperands(input);
  odsState.addAttribute(adjointAttrName(odsState.name), odsBuilder.getBoolAttr(adjoint));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void MatrixInverseOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult MatrixInverseOp::verify() {
  {
    auto tblgen_adjoint = (*this)->getAttr(adjointAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_adjoint, "adjoint")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops29(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops29(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void MatrixInverseOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::MatrixInverseOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::MatrixSetDiagOp definitions
//===----------------------------------------------------------------------===//

MatrixSetDiagOpAdaptor::MatrixSetDiagOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

MatrixSetDiagOpAdaptor::MatrixSetDiagOpAdaptor(MatrixSetDiagOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange MatrixSetDiagOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> MatrixSetDiagOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange MatrixSetDiagOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value MatrixSetDiagOpAdaptor::input() {
  return *getODSOperands(0).begin();
}

::mlir::Value MatrixSetDiagOpAdaptor::diagonal() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr MatrixSetDiagOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult MatrixSetDiagOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> MatrixSetDiagOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range MatrixSetDiagOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value MatrixSetDiagOp::input() {
  return *getODSOperands(0).begin();
}

::mlir::Value MatrixSetDiagOp::diagonal() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange MatrixSetDiagOp::inputMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange MatrixSetDiagOp::diagonalMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> MatrixSetDiagOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range MatrixSetDiagOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value MatrixSetDiagOp::output() {
  return *getODSResults(0).begin();
}

::mlir::Type MatrixSetDiagOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool MatrixSetDiagOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr MatrixSetDiagOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void MatrixSetDiagOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input, ::mlir::Value diagonal) {
  odsState.addOperands(input);
  odsState.addOperands(diagonal);
  odsState.addTypes(output);
}

void MatrixSetDiagOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::Value diagonal) {
  odsState.addOperands(input);
  odsState.addOperands(diagonal);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void MatrixSetDiagOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult MatrixSetDiagOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void MatrixSetDiagOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::MatrixSetDiagOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::MatrixSetDiagV2Op definitions
//===----------------------------------------------------------------------===//

MatrixSetDiagV2OpAdaptor::MatrixSetDiagV2OpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

MatrixSetDiagV2OpAdaptor::MatrixSetDiagV2OpAdaptor(MatrixSetDiagV2Op &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange MatrixSetDiagV2OpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> MatrixSetDiagV2OpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange MatrixSetDiagV2OpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value MatrixSetDiagV2OpAdaptor::input() {
  return *getODSOperands(0).begin();
}

::mlir::Value MatrixSetDiagV2OpAdaptor::diagonal() {
  return *getODSOperands(1).begin();
}

::mlir::Value MatrixSetDiagV2OpAdaptor::k() {
  return *getODSOperands(2).begin();
}

::mlir::DictionaryAttr MatrixSetDiagV2OpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult MatrixSetDiagV2OpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> MatrixSetDiagV2Op::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range MatrixSetDiagV2Op::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value MatrixSetDiagV2Op::input() {
  return *getODSOperands(0).begin();
}

::mlir::Value MatrixSetDiagV2Op::diagonal() {
  return *getODSOperands(1).begin();
}

::mlir::Value MatrixSetDiagV2Op::k() {
  return *getODSOperands(2).begin();
}

::mlir::MutableOperandRange MatrixSetDiagV2Op::inputMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange MatrixSetDiagV2Op::diagonalMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange MatrixSetDiagV2Op::kMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> MatrixSetDiagV2Op::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range MatrixSetDiagV2Op::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value MatrixSetDiagV2Op::output() {
  return *getODSResults(0).begin();
}

::mlir::Type MatrixSetDiagV2Op::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool MatrixSetDiagV2Op::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr MatrixSetDiagV2Op::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void MatrixSetDiagV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input, ::mlir::Value diagonal, ::mlir::Value k) {
  odsState.addOperands(input);
  odsState.addOperands(diagonal);
  odsState.addOperands(k);
  odsState.addTypes(output);
}

void MatrixSetDiagV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::Value diagonal, ::mlir::Value k) {
  odsState.addOperands(input);
  odsState.addOperands(diagonal);
  odsState.addOperands(k);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void MatrixSetDiagV2Op::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 3u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult MatrixSetDiagV2Op::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops11(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void MatrixSetDiagV2Op::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::MatrixSetDiagV2Op)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::MatrixSetDiagV3Op definitions
//===----------------------------------------------------------------------===//

MatrixSetDiagV3OpAdaptor::MatrixSetDiagV3OpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

MatrixSetDiagV3OpAdaptor::MatrixSetDiagV3OpAdaptor(MatrixSetDiagV3Op &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange MatrixSetDiagV3OpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> MatrixSetDiagV3OpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange MatrixSetDiagV3OpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value MatrixSetDiagV3OpAdaptor::input() {
  return *getODSOperands(0).begin();
}

::mlir::Value MatrixSetDiagV3OpAdaptor::diagonal() {
  return *getODSOperands(1).begin();
}

::mlir::Value MatrixSetDiagV3OpAdaptor::k() {
  return *getODSOperands(2).begin();
}

::mlir::DictionaryAttr MatrixSetDiagV3OpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::StringAttr MatrixSetDiagV3OpAdaptor::align() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("align").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("RIGHT_LEFT");
  return attr;
}

::mlir::LogicalResult MatrixSetDiagV3OpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_align = odsAttrs.get("align");
    if (tblgen_align && !((tblgen_align.cast<StringAttr>().getValue() == "LEFT_RIGHT" || tblgen_align.cast<StringAttr>().getValue() == "RIGHT_LEFT" || tblgen_align.cast<StringAttr>().getValue() == "LEFT_LEFT" || tblgen_align.cast<StringAttr>().getValue() == "RIGHT_RIGHT")))
      return emitError(loc, "'tf.MatrixSetDiagV3' op ""attribute 'align' failed to satisfy constraint: string attribute whose value is LEFT_RIGHT, or RIGHT_LEFT, or LEFT_LEFT, or RIGHT_RIGHT");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> MatrixSetDiagV3Op::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range MatrixSetDiagV3Op::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value MatrixSetDiagV3Op::input() {
  return *getODSOperands(0).begin();
}

::mlir::Value MatrixSetDiagV3Op::diagonal() {
  return *getODSOperands(1).begin();
}

::mlir::Value MatrixSetDiagV3Op::k() {
  return *getODSOperands(2).begin();
}

::mlir::MutableOperandRange MatrixSetDiagV3Op::inputMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange MatrixSetDiagV3Op::diagonalMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange MatrixSetDiagV3Op::kMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> MatrixSetDiagV3Op::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range MatrixSetDiagV3Op::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value MatrixSetDiagV3Op::output() {
  return *getODSResults(0).begin();
}

::mlir::StringAttr MatrixSetDiagV3Op::alignAttr() {
  return (*this)->getAttr(alignAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef MatrixSetDiagV3Op::align() {
  auto attr = alignAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("RIGHT_LEFT").getValue();
  return attr.getValue();
}

::mlir::Type MatrixSetDiagV3Op::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool MatrixSetDiagV3Op::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr MatrixSetDiagV3Op::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void MatrixSetDiagV3Op::alignAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(alignAttrName(), attr);
}

void MatrixSetDiagV3Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input, ::mlir::Value diagonal, ::mlir::Value k, ::mlir::StringAttr align) {
  odsState.addOperands(input);
  odsState.addOperands(diagonal);
  odsState.addOperands(k);
  odsState.addAttribute(alignAttrName(odsState.name), align);
  odsState.addTypes(output);
}

void MatrixSetDiagV3Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::Value diagonal, ::mlir::Value k, ::mlir::StringAttr align) {
  odsState.addOperands(input);
  odsState.addOperands(diagonal);
  odsState.addOperands(k);
  odsState.addAttribute(alignAttrName(odsState.name), align);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void MatrixSetDiagV3Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input, ::mlir::Value diagonal, ::mlir::Value k, ::llvm::StringRef align) {
  odsState.addOperands(input);
  odsState.addOperands(diagonal);
  odsState.addOperands(k);
  odsState.addAttribute(alignAttrName(odsState.name), odsBuilder.getStringAttr(align));
  odsState.addTypes(output);
}

void MatrixSetDiagV3Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::Value diagonal, ::mlir::Value k, ::llvm::StringRef align) {
  odsState.addOperands(input);
  odsState.addOperands(diagonal);
  odsState.addOperands(k);
  odsState.addAttribute(alignAttrName(odsState.name), odsBuilder.getStringAttr(align));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void MatrixSetDiagV3Op::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 3u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult MatrixSetDiagV3Op::verify() {
  {
    auto tblgen_align = (*this)->getAttr(alignAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops32(*this, tblgen_align, "align")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops11(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void MatrixSetDiagV3Op::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::MatrixSetDiagV3Op)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::MatrixSolveOp definitions
//===----------------------------------------------------------------------===//

MatrixSolveOpAdaptor::MatrixSolveOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

MatrixSolveOpAdaptor::MatrixSolveOpAdaptor(MatrixSolveOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange MatrixSolveOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> MatrixSolveOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange MatrixSolveOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value MatrixSolveOpAdaptor::matrix() {
  return *getODSOperands(0).begin();
}

::mlir::Value MatrixSolveOpAdaptor::rhs() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr MatrixSolveOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::BoolAttr MatrixSolveOpAdaptor::adjoint() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("adjoint").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(false);
  return attr;
}

::mlir::LogicalResult MatrixSolveOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_adjoint = odsAttrs.get("adjoint");
    if (tblgen_adjoint && !((tblgen_adjoint.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.MatrixSolve' op ""attribute 'adjoint' failed to satisfy constraint: bool attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> MatrixSolveOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range MatrixSolveOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value MatrixSolveOp::matrix() {
  return *getODSOperands(0).begin();
}

::mlir::Value MatrixSolveOp::rhs() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange MatrixSolveOp::matrixMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange MatrixSolveOp::rhsMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> MatrixSolveOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range MatrixSolveOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value MatrixSolveOp::output() {
  return *getODSResults(0).begin();
}

::mlir::BoolAttr MatrixSolveOp::adjointAttr() {
  return (*this)->getAttr(adjointAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool MatrixSolveOp::adjoint() {
  auto attr = adjointAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(false).getValue();
  return attr.getValue();
}

::mlir::Type MatrixSolveOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool MatrixSolveOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr MatrixSolveOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void MatrixSolveOp::adjointAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(adjointAttrName(), attr);
}

void MatrixSolveOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value matrix, ::mlir::Value rhs, ::mlir::BoolAttr adjoint) {
  odsState.addOperands(matrix);
  odsState.addOperands(rhs);
  odsState.addAttribute(adjointAttrName(odsState.name), adjoint);
  odsState.addTypes(output);
}

void MatrixSolveOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value matrix, ::mlir::Value rhs, ::mlir::BoolAttr adjoint) {
  odsState.addOperands(matrix);
  odsState.addOperands(rhs);
  odsState.addAttribute(adjointAttrName(odsState.name), adjoint);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void MatrixSolveOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value matrix, ::mlir::Value rhs, bool adjoint) {
  odsState.addOperands(matrix);
  odsState.addOperands(rhs);
  odsState.addAttribute(adjointAttrName(odsState.name), odsBuilder.getBoolAttr(adjoint));
  odsState.addTypes(output);
}

void MatrixSolveOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value matrix, ::mlir::Value rhs, bool adjoint) {
  odsState.addOperands(matrix);
  odsState.addOperands(rhs);
  odsState.addAttribute(adjointAttrName(odsState.name), odsBuilder.getBoolAttr(adjoint));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void MatrixSolveOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult MatrixSolveOp::verify() {
  {
    auto tblgen_adjoint = (*this)->getAttr(adjointAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_adjoint, "adjoint")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops29(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops29(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops29(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void MatrixSolveOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::MatrixSolveOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::MatrixTriangularSolveOp definitions
//===----------------------------------------------------------------------===//

MatrixTriangularSolveOpAdaptor::MatrixTriangularSolveOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

MatrixTriangularSolveOpAdaptor::MatrixTriangularSolveOpAdaptor(MatrixTriangularSolveOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange MatrixTriangularSolveOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> MatrixTriangularSolveOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange MatrixTriangularSolveOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value MatrixTriangularSolveOpAdaptor::matrix() {
  return *getODSOperands(0).begin();
}

::mlir::Value MatrixTriangularSolveOpAdaptor::rhs() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr MatrixTriangularSolveOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::BoolAttr MatrixTriangularSolveOpAdaptor::lower() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("lower").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(true);
  return attr;
}

::mlir::BoolAttr MatrixTriangularSolveOpAdaptor::adjoint() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("adjoint").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(false);
  return attr;
}

::mlir::LogicalResult MatrixTriangularSolveOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_lower = odsAttrs.get("lower");
    if (tblgen_lower && !((tblgen_lower.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.MatrixTriangularSolve' op ""attribute 'lower' failed to satisfy constraint: bool attribute");
  }
  {
    auto tblgen_adjoint = odsAttrs.get("adjoint");
    if (tblgen_adjoint && !((tblgen_adjoint.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.MatrixTriangularSolve' op ""attribute 'adjoint' failed to satisfy constraint: bool attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> MatrixTriangularSolveOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range MatrixTriangularSolveOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value MatrixTriangularSolveOp::matrix() {
  return *getODSOperands(0).begin();
}

::mlir::Value MatrixTriangularSolveOp::rhs() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange MatrixTriangularSolveOp::matrixMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange MatrixTriangularSolveOp::rhsMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> MatrixTriangularSolveOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range MatrixTriangularSolveOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value MatrixTriangularSolveOp::output() {
  return *getODSResults(0).begin();
}

::mlir::BoolAttr MatrixTriangularSolveOp::lowerAttr() {
  return (*this)->getAttr(lowerAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool MatrixTriangularSolveOp::lower() {
  auto attr = lowerAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(true).getValue();
  return attr.getValue();
}

::mlir::BoolAttr MatrixTriangularSolveOp::adjointAttr() {
  return (*this)->getAttr(adjointAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool MatrixTriangularSolveOp::adjoint() {
  auto attr = adjointAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(false).getValue();
  return attr.getValue();
}

::mlir::Type MatrixTriangularSolveOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool MatrixTriangularSolveOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr MatrixTriangularSolveOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void MatrixTriangularSolveOp::lowerAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(lowerAttrName(), attr);
}

void MatrixTriangularSolveOp::adjointAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(adjointAttrName(), attr);
}

void MatrixTriangularSolveOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value matrix, ::mlir::Value rhs, ::mlir::BoolAttr lower, ::mlir::BoolAttr adjoint) {
  odsState.addOperands(matrix);
  odsState.addOperands(rhs);
  odsState.addAttribute(lowerAttrName(odsState.name), lower);
  odsState.addAttribute(adjointAttrName(odsState.name), adjoint);
  odsState.addTypes(output);
}

void MatrixTriangularSolveOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value matrix, ::mlir::Value rhs, ::mlir::BoolAttr lower, ::mlir::BoolAttr adjoint) {
  odsState.addOperands(matrix);
  odsState.addOperands(rhs);
  odsState.addAttribute(lowerAttrName(odsState.name), lower);
  odsState.addAttribute(adjointAttrName(odsState.name), adjoint);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void MatrixTriangularSolveOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value matrix, ::mlir::Value rhs, bool lower, bool adjoint) {
  odsState.addOperands(matrix);
  odsState.addOperands(rhs);
  odsState.addAttribute(lowerAttrName(odsState.name), odsBuilder.getBoolAttr(lower));
  odsState.addAttribute(adjointAttrName(odsState.name), odsBuilder.getBoolAttr(adjoint));
  odsState.addTypes(output);
}

void MatrixTriangularSolveOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value matrix, ::mlir::Value rhs, bool lower, bool adjoint) {
  odsState.addOperands(matrix);
  odsState.addOperands(rhs);
  odsState.addAttribute(lowerAttrName(odsState.name), odsBuilder.getBoolAttr(lower));
  odsState.addAttribute(adjointAttrName(odsState.name), odsBuilder.getBoolAttr(adjoint));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void MatrixTriangularSolveOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult MatrixTriangularSolveOp::verify() {
  {
    auto tblgen_lower = (*this)->getAttr(lowerAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_lower, "lower")))
      return ::mlir::failure();
  }
  {
    auto tblgen_adjoint = (*this)->getAttr(adjointAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_adjoint, "adjoint")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops2(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops2(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops2(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void MatrixTriangularSolveOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::MatrixTriangularSolveOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::MaxOp definitions
//===----------------------------------------------------------------------===//

MaxOpAdaptor::MaxOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

MaxOpAdaptor::MaxOpAdaptor(MaxOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange MaxOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> MaxOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange MaxOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value MaxOpAdaptor::input() {
  return *getODSOperands(0).begin();
}

::mlir::Value MaxOpAdaptor::reduction_indices() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr MaxOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::BoolAttr MaxOpAdaptor::keep_dims() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("keep_dims").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(false);
  return attr;
}

::mlir::LogicalResult MaxOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_keep_dims = odsAttrs.get("keep_dims");
    if (tblgen_keep_dims && !((tblgen_keep_dims.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.Max' op ""attribute 'keep_dims' failed to satisfy constraint: bool attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> MaxOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range MaxOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value MaxOp::input() {
  return *getODSOperands(0).begin();
}

::mlir::Value MaxOp::reduction_indices() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange MaxOp::inputMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange MaxOp::reduction_indicesMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> MaxOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range MaxOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value MaxOp::output() {
  return *getODSResults(0).begin();
}

::mlir::BoolAttr MaxOp::keep_dimsAttr() {
  return (*this)->getAttr(keep_dimsAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool MaxOp::keep_dims() {
  auto attr = keep_dimsAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(false).getValue();
  return attr.getValue();
}

::mlir::Type MaxOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

::mlir::Type MaxOp::Tidx() {
  return mlir::getElementTypeOrSelf(*getODSOperands(1).begin());
}

bool MaxOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
  if (name == "Tidx") return true;
 return false;
}

::mlir::DictionaryAttr MaxOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())},
    {TidxAttrName(),
::mlir::TypeAttr::get(Tidx())}});
}

void MaxOp::keep_dimsAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(keep_dimsAttrName(), attr);
}

void MaxOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input, ::mlir::Value reduction_indices, ::mlir::BoolAttr keep_dims) {
  odsState.addOperands(input);
  odsState.addOperands(reduction_indices);
  odsState.addAttribute(keep_dimsAttrName(odsState.name), keep_dims);
  odsState.addTypes(output);
}

void MaxOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::Value reduction_indices, ::mlir::BoolAttr keep_dims) {
  odsState.addOperands(input);
  odsState.addOperands(reduction_indices);
  odsState.addAttribute(keep_dimsAttrName(odsState.name), keep_dims);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void MaxOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input, ::mlir::Value reduction_indices, bool keep_dims) {
  odsState.addOperands(input);
  odsState.addOperands(reduction_indices);
  odsState.addAttribute(keep_dimsAttrName(odsState.name), odsBuilder.getBoolAttr(keep_dims));
  odsState.addTypes(output);
}

void MaxOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::Value reduction_indices, bool keep_dims) {
  odsState.addOperands(input);
  odsState.addOperands(reduction_indices);
  odsState.addAttribute(keep_dimsAttrName(odsState.name), odsBuilder.getBoolAttr(keep_dims));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void MaxOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult MaxOp::verify() {
  {
    auto tblgen_keep_dims = (*this)->getAttr(keep_dimsAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_keep_dims, "keep_dims")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops46(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops46(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void MaxOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::MaxOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::MaxPool3DGradGradOp definitions
//===----------------------------------------------------------------------===//

MaxPool3DGradGradOpAdaptor::MaxPool3DGradGradOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

MaxPool3DGradGradOpAdaptor::MaxPool3DGradGradOpAdaptor(MaxPool3DGradGradOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange MaxPool3DGradGradOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> MaxPool3DGradGradOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange MaxPool3DGradGradOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value MaxPool3DGradGradOpAdaptor::orig_input() {
  return *getODSOperands(0).begin();
}

::mlir::Value MaxPool3DGradGradOpAdaptor::orig_output() {
  return *getODSOperands(1).begin();
}

::mlir::Value MaxPool3DGradGradOpAdaptor::grad() {
  return *getODSOperands(2).begin();
}

::mlir::DictionaryAttr MaxPool3DGradGradOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::ArrayAttr MaxPool3DGradGradOpAdaptor::ksize() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("ksize").cast<::mlir::ArrayAttr>();
  return attr;
}

::mlir::ArrayAttr MaxPool3DGradGradOpAdaptor::strides() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("strides").cast<::mlir::ArrayAttr>();
  return attr;
}

::mlir::StringAttr MaxPool3DGradGradOpAdaptor::padding() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("padding").cast<::mlir::StringAttr>();
  return attr;
}

::mlir::StringAttr MaxPool3DGradGradOpAdaptor::data_format() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("data_format").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("NDHWC");
  return attr;
}

::mlir::LogicalResult MaxPool3DGradGradOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_ksize = odsAttrs.get("ksize");
    if (!tblgen_ksize)
      return emitError(loc, "'tf.MaxPool3DGradGrad' op ""requires attribute 'ksize'");

    if (tblgen_ksize && !((((tblgen_ksize.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_ksize.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return ((attr.isa<::mlir::IntegerAttr>())) && ((attr.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64))); }))) && ((tblgen_ksize.cast<::mlir::ArrayAttr>().size() >= 5))))
      return emitError(loc, "'tf.MaxPool3DGradGrad' op ""attribute 'ksize' failed to satisfy constraint: 64-bit integer array attribute with at least 5 elements");
  }
  {
    auto tblgen_strides = odsAttrs.get("strides");
    if (!tblgen_strides)
      return emitError(loc, "'tf.MaxPool3DGradGrad' op ""requires attribute 'strides'");

    if (tblgen_strides && !((((tblgen_strides.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_strides.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return ((attr.isa<::mlir::IntegerAttr>())) && ((attr.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64))); }))) && ((tblgen_strides.cast<::mlir::ArrayAttr>().size() >= 5))))
      return emitError(loc, "'tf.MaxPool3DGradGrad' op ""attribute 'strides' failed to satisfy constraint: 64-bit integer array attribute with at least 5 elements");
  }
  {
    auto tblgen_padding = odsAttrs.get("padding");
    if (!tblgen_padding)
      return emitError(loc, "'tf.MaxPool3DGradGrad' op ""requires attribute 'padding'");

    if (tblgen_padding && !((tblgen_padding.cast<StringAttr>().getValue() == "SAME" || tblgen_padding.cast<StringAttr>().getValue() == "VALID")))
      return emitError(loc, "'tf.MaxPool3DGradGrad' op ""attribute 'padding' failed to satisfy constraint: string attribute whose value is SAME, or VALID");
  }
  {
    auto tblgen_data_format = odsAttrs.get("data_format");
    if (tblgen_data_format && !((tblgen_data_format.cast<StringAttr>().getValue() == "NDHWC" || tblgen_data_format.cast<StringAttr>().getValue() == "NCDHW")))
      return emitError(loc, "'tf.MaxPool3DGradGrad' op ""attribute 'data_format' failed to satisfy constraint: string attribute whose value is NDHWC, or NCDHW");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> MaxPool3DGradGradOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range MaxPool3DGradGradOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value MaxPool3DGradGradOp::orig_input() {
  return *getODSOperands(0).begin();
}

::mlir::Value MaxPool3DGradGradOp::orig_output() {
  return *getODSOperands(1).begin();
}

::mlir::Value MaxPool3DGradGradOp::grad() {
  return *getODSOperands(2).begin();
}

::mlir::MutableOperandRange MaxPool3DGradGradOp::orig_inputMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange MaxPool3DGradGradOp::orig_outputMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange MaxPool3DGradGradOp::gradMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> MaxPool3DGradGradOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range MaxPool3DGradGradOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value MaxPool3DGradGradOp::output() {
  return *getODSResults(0).begin();
}

::mlir::ArrayAttr MaxPool3DGradGradOp::ksizeAttr() {
  return (*this)->getAttr(ksizeAttrName()).cast<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr MaxPool3DGradGradOp::ksize() {
  auto attr = ksizeAttr();
  return attr;
}

::mlir::ArrayAttr MaxPool3DGradGradOp::stridesAttr() {
  return (*this)->getAttr(stridesAttrName()).cast<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr MaxPool3DGradGradOp::strides() {
  auto attr = stridesAttr();
  return attr;
}

::mlir::StringAttr MaxPool3DGradGradOp::paddingAttr() {
  return (*this)->getAttr(paddingAttrName()).cast<::mlir::StringAttr>();
}

::llvm::StringRef MaxPool3DGradGradOp::padding() {
  auto attr = paddingAttr();
  return attr.getValue();
}

::mlir::StringAttr MaxPool3DGradGradOp::data_formatAttr() {
  return (*this)->getAttr(data_formatAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef MaxPool3DGradGradOp::data_format() {
  auto attr = data_formatAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("NDHWC").getValue();
  return attr.getValue();
}

::mlir::Type MaxPool3DGradGradOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool MaxPool3DGradGradOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr MaxPool3DGradGradOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void MaxPool3DGradGradOp::ksizeAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(ksizeAttrName(), attr);
}

void MaxPool3DGradGradOp::stridesAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(stridesAttrName(), attr);
}

void MaxPool3DGradGradOp::paddingAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(paddingAttrName(), attr);
}

void MaxPool3DGradGradOp::data_formatAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(data_formatAttrName(), attr);
}

void MaxPool3DGradGradOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value orig_input, ::mlir::Value orig_output, ::mlir::Value grad, ::mlir::ArrayAttr ksize, ::mlir::ArrayAttr strides, ::mlir::StringAttr padding, ::mlir::StringAttr data_format) {
  odsState.addOperands(orig_input);
  odsState.addOperands(orig_output);
  odsState.addOperands(grad);
  odsState.addAttribute(ksizeAttrName(odsState.name), ksize);
  odsState.addAttribute(stridesAttrName(odsState.name), strides);
  odsState.addAttribute(paddingAttrName(odsState.name), padding);
  odsState.addAttribute(data_formatAttrName(odsState.name), data_format);
  odsState.addTypes(output);
}

void MaxPool3DGradGradOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value orig_input, ::mlir::Value orig_output, ::mlir::Value grad, ::mlir::ArrayAttr ksize, ::mlir::ArrayAttr strides, ::mlir::StringAttr padding, ::mlir::StringAttr data_format) {
  odsState.addOperands(orig_input);
  odsState.addOperands(orig_output);
  odsState.addOperands(grad);
  odsState.addAttribute(ksizeAttrName(odsState.name), ksize);
  odsState.addAttribute(stridesAttrName(odsState.name), strides);
  odsState.addAttribute(paddingAttrName(odsState.name), padding);
  odsState.addAttribute(data_formatAttrName(odsState.name), data_format);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void MaxPool3DGradGradOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value orig_input, ::mlir::Value orig_output, ::mlir::Value grad, ::mlir::ArrayAttr ksize, ::mlir::ArrayAttr strides, ::llvm::StringRef padding, ::llvm::StringRef data_format) {
  odsState.addOperands(orig_input);
  odsState.addOperands(orig_output);
  odsState.addOperands(grad);
  odsState.addAttribute(ksizeAttrName(odsState.name), ksize);
  odsState.addAttribute(stridesAttrName(odsState.name), strides);
  odsState.addAttribute(paddingAttrName(odsState.name), odsBuilder.getStringAttr(padding));
  odsState.addAttribute(data_formatAttrName(odsState.name), odsBuilder.getStringAttr(data_format));
  odsState.addTypes(output);
}

void MaxPool3DGradGradOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value orig_input, ::mlir::Value orig_output, ::mlir::Value grad, ::mlir::ArrayAttr ksize, ::mlir::ArrayAttr strides, ::llvm::StringRef padding, ::llvm::StringRef data_format) {
  odsState.addOperands(orig_input);
  odsState.addOperands(orig_output);
  odsState.addOperands(grad);
  odsState.addAttribute(ksizeAttrName(odsState.name), ksize);
  odsState.addAttribute(stridesAttrName(odsState.name), strides);
  odsState.addAttribute(paddingAttrName(odsState.name), odsBuilder.getStringAttr(padding));
  odsState.addAttribute(data_formatAttrName(odsState.name), odsBuilder.getStringAttr(data_format));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void MaxPool3DGradGradOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 3u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult MaxPool3DGradGradOp::verify() {
  {
    auto tblgen_ksize = (*this)->getAttr(ksizeAttrName());
    if (!tblgen_ksize)
      return emitOpError("requires attribute 'ksize'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops7(*this, tblgen_ksize, "ksize")))
      return ::mlir::failure();
  }
  {
    auto tblgen_strides = (*this)->getAttr(stridesAttrName());
    if (!tblgen_strides)
      return emitOpError("requires attribute 'strides'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops7(*this, tblgen_strides, "strides")))
      return ::mlir::failure();
  }
  {
    auto tblgen_padding = (*this)->getAttr(paddingAttrName());
    if (!tblgen_padding)
      return emitOpError("requires attribute 'padding'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops8(*this, tblgen_padding, "padding")))
      return ::mlir::failure();
  }
  {
    auto tblgen_data_format = (*this)->getAttr(data_formatAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops9(*this, tblgen_data_format, "data_format")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops35(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops35(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops35(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops35(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void MaxPool3DGradGradOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::MaxPool3DGradGradOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::MaxPool3DGradOp definitions
//===----------------------------------------------------------------------===//

MaxPool3DGradOpAdaptor::MaxPool3DGradOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

MaxPool3DGradOpAdaptor::MaxPool3DGradOpAdaptor(MaxPool3DGradOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange MaxPool3DGradOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> MaxPool3DGradOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange MaxPool3DGradOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value MaxPool3DGradOpAdaptor::orig_input() {
  return *getODSOperands(0).begin();
}

::mlir::Value MaxPool3DGradOpAdaptor::orig_output() {
  return *getODSOperands(1).begin();
}

::mlir::Value MaxPool3DGradOpAdaptor::grad() {
  return *getODSOperands(2).begin();
}

::mlir::DictionaryAttr MaxPool3DGradOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::ArrayAttr MaxPool3DGradOpAdaptor::ksize() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("ksize").cast<::mlir::ArrayAttr>();
  return attr;
}

::mlir::ArrayAttr MaxPool3DGradOpAdaptor::strides() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("strides").cast<::mlir::ArrayAttr>();
  return attr;
}

::mlir::StringAttr MaxPool3DGradOpAdaptor::padding() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("padding").cast<::mlir::StringAttr>();
  return attr;
}

::mlir::StringAttr MaxPool3DGradOpAdaptor::data_format() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("data_format").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("NDHWC");
  return attr;
}

::mlir::LogicalResult MaxPool3DGradOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_ksize = odsAttrs.get("ksize");
    if (!tblgen_ksize)
      return emitError(loc, "'tf.MaxPool3DGrad' op ""requires attribute 'ksize'");

    if (tblgen_ksize && !((((tblgen_ksize.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_ksize.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return ((attr.isa<::mlir::IntegerAttr>())) && ((attr.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64))); }))) && ((tblgen_ksize.cast<::mlir::ArrayAttr>().size() >= 5))))
      return emitError(loc, "'tf.MaxPool3DGrad' op ""attribute 'ksize' failed to satisfy constraint: 64-bit integer array attribute with at least 5 elements");
  }
  {
    auto tblgen_strides = odsAttrs.get("strides");
    if (!tblgen_strides)
      return emitError(loc, "'tf.MaxPool3DGrad' op ""requires attribute 'strides'");

    if (tblgen_strides && !((((tblgen_strides.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_strides.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return ((attr.isa<::mlir::IntegerAttr>())) && ((attr.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64))); }))) && ((tblgen_strides.cast<::mlir::ArrayAttr>().size() >= 5))))
      return emitError(loc, "'tf.MaxPool3DGrad' op ""attribute 'strides' failed to satisfy constraint: 64-bit integer array attribute with at least 5 elements");
  }
  {
    auto tblgen_padding = odsAttrs.get("padding");
    if (!tblgen_padding)
      return emitError(loc, "'tf.MaxPool3DGrad' op ""requires attribute 'padding'");

    if (tblgen_padding && !((tblgen_padding.cast<StringAttr>().getValue() == "SAME" || tblgen_padding.cast<StringAttr>().getValue() == "VALID")))
      return emitError(loc, "'tf.MaxPool3DGrad' op ""attribute 'padding' failed to satisfy constraint: string attribute whose value is SAME, or VALID");
  }
  {
    auto tblgen_data_format = odsAttrs.get("data_format");
    if (tblgen_data_format && !((tblgen_data_format.cast<StringAttr>().getValue() == "NDHWC" || tblgen_data_format.cast<StringAttr>().getValue() == "NCDHW")))
      return emitError(loc, "'tf.MaxPool3DGrad' op ""attribute 'data_format' failed to satisfy constraint: string attribute whose value is NDHWC, or NCDHW");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> MaxPool3DGradOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range MaxPool3DGradOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value MaxPool3DGradOp::orig_input() {
  return *getODSOperands(0).begin();
}

::mlir::Value MaxPool3DGradOp::orig_output() {
  return *getODSOperands(1).begin();
}

::mlir::Value MaxPool3DGradOp::grad() {
  return *getODSOperands(2).begin();
}

::mlir::MutableOperandRange MaxPool3DGradOp::orig_inputMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange MaxPool3DGradOp::orig_outputMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange MaxPool3DGradOp::gradMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> MaxPool3DGradOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range MaxPool3DGradOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value MaxPool3DGradOp::output() {
  return *getODSResults(0).begin();
}

::mlir::ArrayAttr MaxPool3DGradOp::ksizeAttr() {
  return (*this)->getAttr(ksizeAttrName()).cast<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr MaxPool3DGradOp::ksize() {
  auto attr = ksizeAttr();
  return attr;
}

::mlir::ArrayAttr MaxPool3DGradOp::stridesAttr() {
  return (*this)->getAttr(stridesAttrName()).cast<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr MaxPool3DGradOp::strides() {
  auto attr = stridesAttr();
  return attr;
}

::mlir::StringAttr MaxPool3DGradOp::paddingAttr() {
  return (*this)->getAttr(paddingAttrName()).cast<::mlir::StringAttr>();
}

::llvm::StringRef MaxPool3DGradOp::padding() {
  auto attr = paddingAttr();
  return attr.getValue();
}

::mlir::StringAttr MaxPool3DGradOp::data_formatAttr() {
  return (*this)->getAttr(data_formatAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef MaxPool3DGradOp::data_format() {
  auto attr = data_formatAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("NDHWC").getValue();
  return attr.getValue();
}

::mlir::Type MaxPool3DGradOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(2).begin());
}

::mlir::Type MaxPool3DGradOp::TInput() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool MaxPool3DGradOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
  if (name == "TInput") return true;
 return false;
}

::mlir::DictionaryAttr MaxPool3DGradOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())},
    {TInputAttrName(),
::mlir::TypeAttr::get(TInput())}});
}

void MaxPool3DGradOp::ksizeAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(ksizeAttrName(), attr);
}

void MaxPool3DGradOp::stridesAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(stridesAttrName(), attr);
}

void MaxPool3DGradOp::paddingAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(paddingAttrName(), attr);
}

void MaxPool3DGradOp::data_formatAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(data_formatAttrName(), attr);
}

void MaxPool3DGradOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value orig_input, ::mlir::Value orig_output, ::mlir::Value grad, ::mlir::ArrayAttr ksize, ::mlir::ArrayAttr strides, ::mlir::StringAttr padding, ::mlir::StringAttr data_format) {
  odsState.addOperands(orig_input);
  odsState.addOperands(orig_output);
  odsState.addOperands(grad);
  odsState.addAttribute(ksizeAttrName(odsState.name), ksize);
  odsState.addAttribute(stridesAttrName(odsState.name), strides);
  odsState.addAttribute(paddingAttrName(odsState.name), padding);
  odsState.addAttribute(data_formatAttrName(odsState.name), data_format);
  odsState.addTypes(output);
}

void MaxPool3DGradOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value orig_input, ::mlir::Value orig_output, ::mlir::Value grad, ::mlir::ArrayAttr ksize, ::mlir::ArrayAttr strides, ::mlir::StringAttr padding, ::mlir::StringAttr data_format) {
  odsState.addOperands(orig_input);
  odsState.addOperands(orig_output);
  odsState.addOperands(grad);
  odsState.addAttribute(ksizeAttrName(odsState.name), ksize);
  odsState.addAttribute(stridesAttrName(odsState.name), strides);
  odsState.addAttribute(paddingAttrName(odsState.name), padding);
  odsState.addAttribute(data_formatAttrName(odsState.name), data_format);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void MaxPool3DGradOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value orig_input, ::mlir::Value orig_output, ::mlir::Value grad, ::mlir::ArrayAttr ksize, ::mlir::ArrayAttr strides, ::llvm::StringRef padding, ::llvm::StringRef data_format) {
  odsState.addOperands(orig_input);
  odsState.addOperands(orig_output);
  odsState.addOperands(grad);
  odsState.addAttribute(ksizeAttrName(odsState.name), ksize);
  odsState.addAttribute(stridesAttrName(odsState.name), strides);
  odsState.addAttribute(paddingAttrName(odsState.name), odsBuilder.getStringAttr(padding));
  odsState.addAttribute(data_formatAttrName(odsState.name), odsBuilder.getStringAttr(data_format));
  odsState.addTypes(output);
}

void MaxPool3DGradOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value orig_input, ::mlir::Value orig_output, ::mlir::Value grad, ::mlir::ArrayAttr ksize, ::mlir::ArrayAttr strides, ::llvm::StringRef padding, ::llvm::StringRef data_format) {
  odsState.addOperands(orig_input);
  odsState.addOperands(orig_output);
  odsState.addOperands(grad);
  odsState.addAttribute(ksizeAttrName(odsState.name), ksize);
  odsState.addAttribute(stridesAttrName(odsState.name), strides);
  odsState.addAttribute(paddingAttrName(odsState.name), odsBuilder.getStringAttr(padding));
  odsState.addAttribute(data_formatAttrName(odsState.name), odsBuilder.getStringAttr(data_format));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void MaxPool3DGradOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 3u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult MaxPool3DGradOp::verify() {
  {
    auto tblgen_ksize = (*this)->getAttr(ksizeAttrName());
    if (!tblgen_ksize)
      return emitOpError("requires attribute 'ksize'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops7(*this, tblgen_ksize, "ksize")))
      return ::mlir::failure();
  }
  {
    auto tblgen_strides = (*this)->getAttr(stridesAttrName());
    if (!tblgen_strides)
      return emitOpError("requires attribute 'strides'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops7(*this, tblgen_strides, "strides")))
      return ::mlir::failure();
  }
  {
    auto tblgen_padding = (*this)->getAttr(paddingAttrName());
    if (!tblgen_padding)
      return emitOpError("requires attribute 'padding'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops8(*this, tblgen_padding, "padding")))
      return ::mlir::failure();
  }
  {
    auto tblgen_data_format = (*this)->getAttr(data_formatAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops9(*this, tblgen_data_format, "data_format")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops44(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops44(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops44(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops44(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void MaxPool3DGradOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::MaxPool3DGradOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::MaxPool3DOp definitions
//===----------------------------------------------------------------------===//

MaxPool3DOpAdaptor::MaxPool3DOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

MaxPool3DOpAdaptor::MaxPool3DOpAdaptor(MaxPool3DOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange MaxPool3DOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> MaxPool3DOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange MaxPool3DOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value MaxPool3DOpAdaptor::input() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr MaxPool3DOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::ArrayAttr MaxPool3DOpAdaptor::ksize() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("ksize").cast<::mlir::ArrayAttr>();
  return attr;
}

::mlir::ArrayAttr MaxPool3DOpAdaptor::strides() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("strides").cast<::mlir::ArrayAttr>();
  return attr;
}

::mlir::StringAttr MaxPool3DOpAdaptor::padding() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("padding").cast<::mlir::StringAttr>();
  return attr;
}

::mlir::StringAttr MaxPool3DOpAdaptor::data_format() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("data_format").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("NDHWC");
  return attr;
}

::mlir::LogicalResult MaxPool3DOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_ksize = odsAttrs.get("ksize");
    if (!tblgen_ksize)
      return emitError(loc, "'tf.MaxPool3D' op ""requires attribute 'ksize'");

    if (tblgen_ksize && !((((tblgen_ksize.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_ksize.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return ((attr.isa<::mlir::IntegerAttr>())) && ((attr.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64))); }))) && ((tblgen_ksize.cast<::mlir::ArrayAttr>().size() >= 5))))
      return emitError(loc, "'tf.MaxPool3D' op ""attribute 'ksize' failed to satisfy constraint: 64-bit integer array attribute with at least 5 elements");
  }
  {
    auto tblgen_strides = odsAttrs.get("strides");
    if (!tblgen_strides)
      return emitError(loc, "'tf.MaxPool3D' op ""requires attribute 'strides'");

    if (tblgen_strides && !((((tblgen_strides.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_strides.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return ((attr.isa<::mlir::IntegerAttr>())) && ((attr.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64))); }))) && ((tblgen_strides.cast<::mlir::ArrayAttr>().size() >= 5))))
      return emitError(loc, "'tf.MaxPool3D' op ""attribute 'strides' failed to satisfy constraint: 64-bit integer array attribute with at least 5 elements");
  }
  {
    auto tblgen_padding = odsAttrs.get("padding");
    if (!tblgen_padding)
      return emitError(loc, "'tf.MaxPool3D' op ""requires attribute 'padding'");

    if (tblgen_padding && !((tblgen_padding.cast<StringAttr>().getValue() == "SAME" || tblgen_padding.cast<StringAttr>().getValue() == "VALID")))
      return emitError(loc, "'tf.MaxPool3D' op ""attribute 'padding' failed to satisfy constraint: string attribute whose value is SAME, or VALID");
  }
  {
    auto tblgen_data_format = odsAttrs.get("data_format");
    if (tblgen_data_format && !((tblgen_data_format.cast<StringAttr>().getValue() == "NDHWC" || tblgen_data_format.cast<StringAttr>().getValue() == "NCDHW")))
      return emitError(loc, "'tf.MaxPool3D' op ""attribute 'data_format' failed to satisfy constraint: string attribute whose value is NDHWC, or NCDHW");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> MaxPool3DOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range MaxPool3DOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value MaxPool3DOp::input() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange MaxPool3DOp::inputMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> MaxPool3DOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range MaxPool3DOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value MaxPool3DOp::output() {
  return *getODSResults(0).begin();
}

::mlir::ArrayAttr MaxPool3DOp::ksizeAttr() {
  return (*this)->getAttr(ksizeAttrName()).cast<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr MaxPool3DOp::ksize() {
  auto attr = ksizeAttr();
  return attr;
}

::mlir::ArrayAttr MaxPool3DOp::stridesAttr() {
  return (*this)->getAttr(stridesAttrName()).cast<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr MaxPool3DOp::strides() {
  auto attr = stridesAttr();
  return attr;
}

::mlir::StringAttr MaxPool3DOp::paddingAttr() {
  return (*this)->getAttr(paddingAttrName()).cast<::mlir::StringAttr>();
}

::llvm::StringRef MaxPool3DOp::padding() {
  auto attr = paddingAttr();
  return attr.getValue();
}

::mlir::StringAttr MaxPool3DOp::data_formatAttr() {
  return (*this)->getAttr(data_formatAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef MaxPool3DOp::data_format() {
  auto attr = data_formatAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("NDHWC").getValue();
  return attr.getValue();
}

::mlir::Type MaxPool3DOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool MaxPool3DOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr MaxPool3DOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void MaxPool3DOp::ksizeAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(ksizeAttrName(), attr);
}

void MaxPool3DOp::stridesAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(stridesAttrName(), attr);
}

void MaxPool3DOp::paddingAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(paddingAttrName(), attr);
}

void MaxPool3DOp::data_formatAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(data_formatAttrName(), attr);
}

void MaxPool3DOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input, ::mlir::ArrayAttr ksize, ::mlir::ArrayAttr strides, ::mlir::StringAttr padding, ::mlir::StringAttr data_format) {
  odsState.addOperands(input);
  odsState.addAttribute(ksizeAttrName(odsState.name), ksize);
  odsState.addAttribute(stridesAttrName(odsState.name), strides);
  odsState.addAttribute(paddingAttrName(odsState.name), padding);
  odsState.addAttribute(data_formatAttrName(odsState.name), data_format);
  odsState.addTypes(output);
}

void MaxPool3DOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::ArrayAttr ksize, ::mlir::ArrayAttr strides, ::mlir::StringAttr padding, ::mlir::StringAttr data_format) {
  odsState.addOperands(input);
  odsState.addAttribute(ksizeAttrName(odsState.name), ksize);
  odsState.addAttribute(stridesAttrName(odsState.name), strides);
  odsState.addAttribute(paddingAttrName(odsState.name), padding);
  odsState.addAttribute(data_formatAttrName(odsState.name), data_format);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void MaxPool3DOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input, ::mlir::ArrayAttr ksize, ::mlir::ArrayAttr strides, ::llvm::StringRef padding, ::llvm::StringRef data_format) {
  odsState.addOperands(input);
  odsState.addAttribute(ksizeAttrName(odsState.name), ksize);
  odsState.addAttribute(stridesAttrName(odsState.name), strides);
  odsState.addAttribute(paddingAttrName(odsState.name), odsBuilder.getStringAttr(padding));
  odsState.addAttribute(data_formatAttrName(odsState.name), odsBuilder.getStringAttr(data_format));
  odsState.addTypes(output);
}

void MaxPool3DOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::ArrayAttr ksize, ::mlir::ArrayAttr strides, ::llvm::StringRef padding, ::llvm::StringRef data_format) {
  odsState.addOperands(input);
  odsState.addAttribute(ksizeAttrName(odsState.name), ksize);
  odsState.addAttribute(stridesAttrName(odsState.name), strides);
  odsState.addAttribute(paddingAttrName(odsState.name), odsBuilder.getStringAttr(padding));
  odsState.addAttribute(data_formatAttrName(odsState.name), odsBuilder.getStringAttr(data_format));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void MaxPool3DOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult MaxPool3DOp::verify() {
  {
    auto tblgen_ksize = (*this)->getAttr(ksizeAttrName());
    if (!tblgen_ksize)
      return emitOpError("requires attribute 'ksize'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops7(*this, tblgen_ksize, "ksize")))
      return ::mlir::failure();
  }
  {
    auto tblgen_strides = (*this)->getAttr(stridesAttrName());
    if (!tblgen_strides)
      return emitOpError("requires attribute 'strides'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops7(*this, tblgen_strides, "strides")))
      return ::mlir::failure();
  }
  {
    auto tblgen_padding = (*this)->getAttr(paddingAttrName());
    if (!tblgen_padding)
      return emitOpError("requires attribute 'padding'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops8(*this, tblgen_padding, "padding")))
      return ::mlir::failure();
  }
  {
    auto tblgen_data_format = (*this)->getAttr(data_formatAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops9(*this, tblgen_data_format, "data_format")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops44(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops44(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void MaxPool3DOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::MaxPool3DOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::MaxPoolGradGradOp definitions
//===----------------------------------------------------------------------===//

MaxPoolGradGradOpAdaptor::MaxPoolGradGradOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

MaxPoolGradGradOpAdaptor::MaxPoolGradGradOpAdaptor(MaxPoolGradGradOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange MaxPoolGradGradOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> MaxPoolGradGradOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange MaxPoolGradGradOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value MaxPoolGradGradOpAdaptor::orig_input() {
  return *getODSOperands(0).begin();
}

::mlir::Value MaxPoolGradGradOpAdaptor::orig_output() {
  return *getODSOperands(1).begin();
}

::mlir::Value MaxPoolGradGradOpAdaptor::grad() {
  return *getODSOperands(2).begin();
}

::mlir::DictionaryAttr MaxPoolGradGradOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::ArrayAttr MaxPoolGradGradOpAdaptor::ksize() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("ksize").cast<::mlir::ArrayAttr>();
  return attr;
}

::mlir::ArrayAttr MaxPoolGradGradOpAdaptor::strides() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("strides").cast<::mlir::ArrayAttr>();
  return attr;
}

::mlir::StringAttr MaxPoolGradGradOpAdaptor::padding() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("padding").cast<::mlir::StringAttr>();
  return attr;
}

::mlir::StringAttr MaxPoolGradGradOpAdaptor::data_format() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("data_format").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("NHWC");
  return attr;
}

::mlir::LogicalResult MaxPoolGradGradOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_ksize = odsAttrs.get("ksize");
    if (!tblgen_ksize)
      return emitError(loc, "'tf.MaxPoolGradGrad' op ""requires attribute 'ksize'");

    if (tblgen_ksize && !((((tblgen_ksize.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_ksize.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return ((attr.isa<::mlir::IntegerAttr>())) && ((attr.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64))); }))) && ((tblgen_ksize.cast<::mlir::ArrayAttr>().size() >= 4))))
      return emitError(loc, "'tf.MaxPoolGradGrad' op ""attribute 'ksize' failed to satisfy constraint: 64-bit integer array attribute with at least 4 elements");
  }
  {
    auto tblgen_strides = odsAttrs.get("strides");
    if (!tblgen_strides)
      return emitError(loc, "'tf.MaxPoolGradGrad' op ""requires attribute 'strides'");

    if (tblgen_strides && !((((tblgen_strides.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_strides.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return ((attr.isa<::mlir::IntegerAttr>())) && ((attr.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64))); }))) && ((tblgen_strides.cast<::mlir::ArrayAttr>().size() >= 4))))
      return emitError(loc, "'tf.MaxPoolGradGrad' op ""attribute 'strides' failed to satisfy constraint: 64-bit integer array attribute with at least 4 elements");
  }
  {
    auto tblgen_padding = odsAttrs.get("padding");
    if (!tblgen_padding)
      return emitError(loc, "'tf.MaxPoolGradGrad' op ""requires attribute 'padding'");

    if (tblgen_padding && !((tblgen_padding.cast<StringAttr>().getValue() == "SAME" || tblgen_padding.cast<StringAttr>().getValue() == "VALID")))
      return emitError(loc, "'tf.MaxPoolGradGrad' op ""attribute 'padding' failed to satisfy constraint: string attribute whose value is SAME, or VALID");
  }
  {
    auto tblgen_data_format = odsAttrs.get("data_format");
    if (tblgen_data_format && !((tblgen_data_format.cast<StringAttr>().getValue() == "NHWC" || tblgen_data_format.cast<StringAttr>().getValue() == "NCHW")))
      return emitError(loc, "'tf.MaxPoolGradGrad' op ""attribute 'data_format' failed to satisfy constraint: 'NHWC' or 'NCHW' convnet data format");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> MaxPoolGradGradOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range MaxPoolGradGradOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value MaxPoolGradGradOp::orig_input() {
  return *getODSOperands(0).begin();
}

::mlir::Value MaxPoolGradGradOp::orig_output() {
  return *getODSOperands(1).begin();
}

::mlir::Value MaxPoolGradGradOp::grad() {
  return *getODSOperands(2).begin();
}

::mlir::MutableOperandRange MaxPoolGradGradOp::orig_inputMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange MaxPoolGradGradOp::orig_outputMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange MaxPoolGradGradOp::gradMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> MaxPoolGradGradOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range MaxPoolGradGradOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value MaxPoolGradGradOp::output() {
  return *getODSResults(0).begin();
}

::mlir::ArrayAttr MaxPoolGradGradOp::ksizeAttr() {
  return (*this)->getAttr(ksizeAttrName()).cast<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr MaxPoolGradGradOp::ksize() {
  auto attr = ksizeAttr();
  return attr;
}

::mlir::ArrayAttr MaxPoolGradGradOp::stridesAttr() {
  return (*this)->getAttr(stridesAttrName()).cast<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr MaxPoolGradGradOp::strides() {
  auto attr = stridesAttr();
  return attr;
}

::mlir::StringAttr MaxPoolGradGradOp::paddingAttr() {
  return (*this)->getAttr(paddingAttrName()).cast<::mlir::StringAttr>();
}

::llvm::StringRef MaxPoolGradGradOp::padding() {
  auto attr = paddingAttr();
  return attr.getValue();
}

::mlir::StringAttr MaxPoolGradGradOp::data_formatAttr() {
  return (*this)->getAttr(data_formatAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef MaxPoolGradGradOp::data_format() {
  auto attr = data_formatAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("NHWC").getValue();
  return attr.getValue();
}

::mlir::Type MaxPoolGradGradOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool MaxPoolGradGradOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr MaxPoolGradGradOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void MaxPoolGradGradOp::ksizeAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(ksizeAttrName(), attr);
}

void MaxPoolGradGradOp::stridesAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(stridesAttrName(), attr);
}

void MaxPoolGradGradOp::paddingAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(paddingAttrName(), attr);
}

void MaxPoolGradGradOp::data_formatAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(data_formatAttrName(), attr);
}

void MaxPoolGradGradOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value orig_input, ::mlir::Value orig_output, ::mlir::Value grad, ::mlir::ArrayAttr ksize, ::mlir::ArrayAttr strides, ::mlir::StringAttr padding, ::mlir::StringAttr data_format) {
  odsState.addOperands(orig_input);
  odsState.addOperands(orig_output);
  odsState.addOperands(grad);
  odsState.addAttribute(ksizeAttrName(odsState.name), ksize);
  odsState.addAttribute(stridesAttrName(odsState.name), strides);
  odsState.addAttribute(paddingAttrName(odsState.name), padding);
  odsState.addAttribute(data_formatAttrName(odsState.name), data_format);
  odsState.addTypes(output);
}

void MaxPoolGradGradOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value orig_input, ::mlir::Value orig_output, ::mlir::Value grad, ::mlir::ArrayAttr ksize, ::mlir::ArrayAttr strides, ::mlir::StringAttr padding, ::mlir::StringAttr data_format) {
  odsState.addOperands(orig_input);
  odsState.addOperands(orig_output);
  odsState.addOperands(grad);
  odsState.addAttribute(ksizeAttrName(odsState.name), ksize);
  odsState.addAttribute(stridesAttrName(odsState.name), strides);
  odsState.addAttribute(paddingAttrName(odsState.name), padding);
  odsState.addAttribute(data_formatAttrName(odsState.name), data_format);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void MaxPoolGradGradOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value orig_input, ::mlir::Value orig_output, ::mlir::Value grad, ::mlir::ArrayAttr ksize, ::mlir::ArrayAttr strides, ::llvm::StringRef padding, ::llvm::StringRef data_format) {
  odsState.addOperands(orig_input);
  odsState.addOperands(orig_output);
  odsState.addOperands(grad);
  odsState.addAttribute(ksizeAttrName(odsState.name), ksize);
  odsState.addAttribute(stridesAttrName(odsState.name), strides);
  odsState.addAttribute(paddingAttrName(odsState.name), odsBuilder.getStringAttr(padding));
  odsState.addAttribute(data_formatAttrName(odsState.name), odsBuilder.getStringAttr(data_format));
  odsState.addTypes(output);
}

void MaxPoolGradGradOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value orig_input, ::mlir::Value orig_output, ::mlir::Value grad, ::mlir::ArrayAttr ksize, ::mlir::ArrayAttr strides, ::llvm::StringRef padding, ::llvm::StringRef data_format) {
  odsState.addOperands(orig_input);
  odsState.addOperands(orig_output);
  odsState.addOperands(grad);
  odsState.addAttribute(ksizeAttrName(odsState.name), ksize);
  odsState.addAttribute(stridesAttrName(odsState.name), strides);
  odsState.addAttribute(paddingAttrName(odsState.name), odsBuilder.getStringAttr(padding));
  odsState.addAttribute(data_formatAttrName(odsState.name), odsBuilder.getStringAttr(data_format));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void MaxPoolGradGradOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 3u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult MaxPoolGradGradOp::verify() {
  {
    auto tblgen_ksize = (*this)->getAttr(ksizeAttrName());
    if (!tblgen_ksize)
      return emitOpError("requires attribute 'ksize'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops10(*this, tblgen_ksize, "ksize")))
      return ::mlir::failure();
  }
  {
    auto tblgen_strides = (*this)->getAttr(stridesAttrName());
    if (!tblgen_strides)
      return emitOpError("requires attribute 'strides'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops10(*this, tblgen_strides, "strides")))
      return ::mlir::failure();
  }
  {
    auto tblgen_padding = (*this)->getAttr(paddingAttrName());
    if (!tblgen_padding)
      return emitOpError("requires attribute 'padding'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops8(*this, tblgen_padding, "padding")))
      return ::mlir::failure();
  }
  {
    auto tblgen_data_format = (*this)->getAttr(data_formatAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops11(*this, tblgen_data_format, "data_format")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops35(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops35(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops35(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops35(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void MaxPoolGradGradOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::MaxPoolGradGradOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::MaxPoolGradGradV2Op definitions
//===----------------------------------------------------------------------===//

MaxPoolGradGradV2OpAdaptor::MaxPoolGradGradV2OpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

MaxPoolGradGradV2OpAdaptor::MaxPoolGradGradV2OpAdaptor(MaxPoolGradGradV2Op &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange MaxPoolGradGradV2OpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> MaxPoolGradGradV2OpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange MaxPoolGradGradV2OpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value MaxPoolGradGradV2OpAdaptor::orig_input() {
  return *getODSOperands(0).begin();
}

::mlir::Value MaxPoolGradGradV2OpAdaptor::orig_output() {
  return *getODSOperands(1).begin();
}

::mlir::Value MaxPoolGradGradV2OpAdaptor::grad() {
  return *getODSOperands(2).begin();
}

::mlir::Value MaxPoolGradGradV2OpAdaptor::ksize() {
  return *getODSOperands(3).begin();
}

::mlir::Value MaxPoolGradGradV2OpAdaptor::strides() {
  return *getODSOperands(4).begin();
}

::mlir::DictionaryAttr MaxPoolGradGradV2OpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::StringAttr MaxPoolGradGradV2OpAdaptor::padding() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("padding").cast<::mlir::StringAttr>();
  return attr;
}

::mlir::StringAttr MaxPoolGradGradV2OpAdaptor::data_format() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("data_format").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("NHWC");
  return attr;
}

::mlir::LogicalResult MaxPoolGradGradV2OpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_padding = odsAttrs.get("padding");
    if (!tblgen_padding)
      return emitError(loc, "'tf.MaxPoolGradGradV2' op ""requires attribute 'padding'");

    if (tblgen_padding && !((tblgen_padding.cast<StringAttr>().getValue() == "SAME" || tblgen_padding.cast<StringAttr>().getValue() == "VALID")))
      return emitError(loc, "'tf.MaxPoolGradGradV2' op ""attribute 'padding' failed to satisfy constraint: string attribute whose value is SAME, or VALID");
  }
  {
    auto tblgen_data_format = odsAttrs.get("data_format");
    if (tblgen_data_format && !((tblgen_data_format.cast<StringAttr>().getValue() == "NHWC" || tblgen_data_format.cast<StringAttr>().getValue() == "NCHW")))
      return emitError(loc, "'tf.MaxPoolGradGradV2' op ""attribute 'data_format' failed to satisfy constraint: 'NHWC' or 'NCHW' convnet data format");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> MaxPoolGradGradV2Op::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range MaxPoolGradGradV2Op::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value MaxPoolGradGradV2Op::orig_input() {
  return *getODSOperands(0).begin();
}

::mlir::Value MaxPoolGradGradV2Op::orig_output() {
  return *getODSOperands(1).begin();
}

::mlir::Value MaxPoolGradGradV2Op::grad() {
  return *getODSOperands(2).begin();
}

::mlir::Value MaxPoolGradGradV2Op::ksize() {
  return *getODSOperands(3).begin();
}

::mlir::Value MaxPoolGradGradV2Op::strides() {
  return *getODSOperands(4).begin();
}

::mlir::MutableOperandRange MaxPoolGradGradV2Op::orig_inputMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange MaxPoolGradGradV2Op::orig_outputMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange MaxPoolGradGradV2Op::gradMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange MaxPoolGradGradV2Op::ksizeMutable() {
  auto range = getODSOperandIndexAndLength(3);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange MaxPoolGradGradV2Op::stridesMutable() {
  auto range = getODSOperandIndexAndLength(4);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> MaxPoolGradGradV2Op::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range MaxPoolGradGradV2Op::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value MaxPoolGradGradV2Op::output() {
  return *getODSResults(0).begin();
}

::mlir::StringAttr MaxPoolGradGradV2Op::paddingAttr() {
  return (*this)->getAttr(paddingAttrName()).cast<::mlir::StringAttr>();
}

::llvm::StringRef MaxPoolGradGradV2Op::padding() {
  auto attr = paddingAttr();
  return attr.getValue();
}

::mlir::StringAttr MaxPoolGradGradV2Op::data_formatAttr() {
  return (*this)->getAttr(data_formatAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef MaxPoolGradGradV2Op::data_format() {
  auto attr = data_formatAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("NHWC").getValue();
  return attr.getValue();
}

::mlir::Type MaxPoolGradGradV2Op::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool MaxPoolGradGradV2Op::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr MaxPoolGradGradV2Op::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void MaxPoolGradGradV2Op::paddingAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(paddingAttrName(), attr);
}

void MaxPoolGradGradV2Op::data_formatAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(data_formatAttrName(), attr);
}

void MaxPoolGradGradV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value orig_input, ::mlir::Value orig_output, ::mlir::Value grad, ::mlir::Value ksize, ::mlir::Value strides, ::mlir::StringAttr padding, ::mlir::StringAttr data_format) {
  odsState.addOperands(orig_input);
  odsState.addOperands(orig_output);
  odsState.addOperands(grad);
  odsState.addOperands(ksize);
  odsState.addOperands(strides);
  odsState.addAttribute(paddingAttrName(odsState.name), padding);
  odsState.addAttribute(data_formatAttrName(odsState.name), data_format);
  odsState.addTypes(output);
}

void MaxPoolGradGradV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value orig_input, ::mlir::Value orig_output, ::mlir::Value grad, ::mlir::Value ksize, ::mlir::Value strides, ::mlir::StringAttr padding, ::mlir::StringAttr data_format) {
  odsState.addOperands(orig_input);
  odsState.addOperands(orig_output);
  odsState.addOperands(grad);
  odsState.addOperands(ksize);
  odsState.addOperands(strides);
  odsState.addAttribute(paddingAttrName(odsState.name), padding);
  odsState.addAttribute(data_formatAttrName(odsState.name), data_format);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void MaxPoolGradGradV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value orig_input, ::mlir::Value orig_output, ::mlir::Value grad, ::mlir::Value ksize, ::mlir::Value strides, ::llvm::StringRef padding, ::llvm::StringRef data_format) {
  odsState.addOperands(orig_input);
  odsState.addOperands(orig_output);
  odsState.addOperands(grad);
  odsState.addOperands(ksize);
  odsState.addOperands(strides);
  odsState.addAttribute(paddingAttrName(odsState.name), odsBuilder.getStringAttr(padding));
  odsState.addAttribute(data_formatAttrName(odsState.name), odsBuilder.getStringAttr(data_format));
  odsState.addTypes(output);
}

void MaxPoolGradGradV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value orig_input, ::mlir::Value orig_output, ::mlir::Value grad, ::mlir::Value ksize, ::mlir::Value strides, ::llvm::StringRef padding, ::llvm::StringRef data_format) {
  odsState.addOperands(orig_input);
  odsState.addOperands(orig_output);
  odsState.addOperands(grad);
  odsState.addOperands(ksize);
  odsState.addOperands(strides);
  odsState.addAttribute(paddingAttrName(odsState.name), odsBuilder.getStringAttr(padding));
  odsState.addAttribute(data_formatAttrName(odsState.name), odsBuilder.getStringAttr(data_format));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void MaxPoolGradGradV2Op::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 5u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult MaxPoolGradGradV2Op::verify() {
  {
    auto tblgen_padding = (*this)->getAttr(paddingAttrName());
    if (!tblgen_padding)
      return emitOpError("requires attribute 'padding'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops8(*this, tblgen_padding, "padding")))
      return ::mlir::failure();
  }
  {
    auto tblgen_data_format = (*this)->getAttr(data_formatAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops11(*this, tblgen_data_format, "data_format")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops35(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops35(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops35(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup3 = getODSOperands(3);

    for (auto v : valueGroup3) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops11(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup4 = getODSOperands(4);

    for (auto v : valueGroup4) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops11(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops35(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void MaxPoolGradGradV2Op::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::MaxPoolGradGradV2Op)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::MaxPoolGradOp definitions
//===----------------------------------------------------------------------===//

MaxPoolGradOpAdaptor::MaxPoolGradOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

MaxPoolGradOpAdaptor::MaxPoolGradOpAdaptor(MaxPoolGradOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange MaxPoolGradOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> MaxPoolGradOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange MaxPoolGradOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value MaxPoolGradOpAdaptor::orig_input() {
  return *getODSOperands(0).begin();
}

::mlir::Value MaxPoolGradOpAdaptor::orig_output() {
  return *getODSOperands(1).begin();
}

::mlir::Value MaxPoolGradOpAdaptor::grad() {
  return *getODSOperands(2).begin();
}

::mlir::DictionaryAttr MaxPoolGradOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::ArrayAttr MaxPoolGradOpAdaptor::ksize() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("ksize").cast<::mlir::ArrayAttr>();
  return attr;
}

::mlir::ArrayAttr MaxPoolGradOpAdaptor::strides() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("strides").cast<::mlir::ArrayAttr>();
  return attr;
}

::mlir::StringAttr MaxPoolGradOpAdaptor::padding() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("padding").cast<::mlir::StringAttr>();
  return attr;
}

::mlir::ArrayAttr MaxPoolGradOpAdaptor::explicit_paddings() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("explicit_paddings").dyn_cast_or_null<::mlir::ArrayAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getI64ArrayAttr({});
  return attr;
}

::mlir::StringAttr MaxPoolGradOpAdaptor::data_format() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("data_format").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("NHWC");
  return attr;
}

::mlir::LogicalResult MaxPoolGradOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_ksize = odsAttrs.get("ksize");
    if (!tblgen_ksize)
      return emitError(loc, "'tf.MaxPoolGrad' op ""requires attribute 'ksize'");

    if (tblgen_ksize && !((((tblgen_ksize.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_ksize.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return ((attr.isa<::mlir::IntegerAttr>())) && ((attr.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64))); }))) && ((tblgen_ksize.cast<::mlir::ArrayAttr>().size() >= 4))))
      return emitError(loc, "'tf.MaxPoolGrad' op ""attribute 'ksize' failed to satisfy constraint: 64-bit integer array attribute with at least 4 elements");
  }
  {
    auto tblgen_strides = odsAttrs.get("strides");
    if (!tblgen_strides)
      return emitError(loc, "'tf.MaxPoolGrad' op ""requires attribute 'strides'");

    if (tblgen_strides && !((((tblgen_strides.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_strides.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return ((attr.isa<::mlir::IntegerAttr>())) && ((attr.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64))); }))) && ((tblgen_strides.cast<::mlir::ArrayAttr>().size() >= 4))))
      return emitError(loc, "'tf.MaxPoolGrad' op ""attribute 'strides' failed to satisfy constraint: 64-bit integer array attribute with at least 4 elements");
  }
  {
    auto tblgen_padding = odsAttrs.get("padding");
    if (!tblgen_padding)
      return emitError(loc, "'tf.MaxPoolGrad' op ""requires attribute 'padding'");

    if (tblgen_padding && !((tblgen_padding.cast<StringAttr>().getValue() == "SAME" || tblgen_padding.cast<StringAttr>().getValue() == "VALID" || tblgen_padding.cast<StringAttr>().getValue() == "EXPLICIT")))
      return emitError(loc, "'tf.MaxPoolGrad' op ""attribute 'padding' failed to satisfy constraint: string attribute whose value is SAME, or VALID, or EXPLICIT");
  }
  {
    auto tblgen_explicit_paddings = odsAttrs.get("explicit_paddings");
    if (tblgen_explicit_paddings && !(((tblgen_explicit_paddings.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_explicit_paddings.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return ((attr.isa<::mlir::IntegerAttr>())) && ((attr.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64))); }))))
      return emitError(loc, "'tf.MaxPoolGrad' op ""attribute 'explicit_paddings' failed to satisfy constraint: 64-bit integer array attribute");
  }
  {
    auto tblgen_data_format = odsAttrs.get("data_format");
    if (tblgen_data_format && !((tblgen_data_format.cast<StringAttr>().getValue() == "NHWC" || tblgen_data_format.cast<StringAttr>().getValue() == "NCHW")))
      return emitError(loc, "'tf.MaxPoolGrad' op ""attribute 'data_format' failed to satisfy constraint: 'NHWC' or 'NCHW' convnet data format");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> MaxPoolGradOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range MaxPoolGradOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value MaxPoolGradOp::orig_input() {
  return *getODSOperands(0).begin();
}

::mlir::Value MaxPoolGradOp::orig_output() {
  return *getODSOperands(1).begin();
}

::mlir::Value MaxPoolGradOp::grad() {
  return *getODSOperands(2).begin();
}

::mlir::MutableOperandRange MaxPoolGradOp::orig_inputMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange MaxPoolGradOp::orig_outputMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange MaxPoolGradOp::gradMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> MaxPoolGradOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range MaxPoolGradOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value MaxPoolGradOp::output() {
  return *getODSResults(0).begin();
}

::mlir::ArrayAttr MaxPoolGradOp::ksizeAttr() {
  return (*this)->getAttr(ksizeAttrName()).cast<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr MaxPoolGradOp::ksize() {
  auto attr = ksizeAttr();
  return attr;
}

::mlir::ArrayAttr MaxPoolGradOp::stridesAttr() {
  return (*this)->getAttr(stridesAttrName()).cast<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr MaxPoolGradOp::strides() {
  auto attr = stridesAttr();
  return attr;
}

::mlir::StringAttr MaxPoolGradOp::paddingAttr() {
  return (*this)->getAttr(paddingAttrName()).cast<::mlir::StringAttr>();
}

::llvm::StringRef MaxPoolGradOp::padding() {
  auto attr = paddingAttr();
  return attr.getValue();
}

::mlir::ArrayAttr MaxPoolGradOp::explicit_paddingsAttr() {
  return (*this)->getAttr(explicit_paddingsAttrName()).dyn_cast_or_null<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr MaxPoolGradOp::explicit_paddings() {
  auto attr = explicit_paddingsAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getI64ArrayAttr({});
  return attr;
}

::mlir::StringAttr MaxPoolGradOp::data_formatAttr() {
  return (*this)->getAttr(data_formatAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef MaxPoolGradOp::data_format() {
  auto attr = data_formatAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("NHWC").getValue();
  return attr.getValue();
}

::mlir::Type MaxPoolGradOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool MaxPoolGradOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr MaxPoolGradOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void MaxPoolGradOp::ksizeAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(ksizeAttrName(), attr);
}

void MaxPoolGradOp::stridesAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(stridesAttrName(), attr);
}

void MaxPoolGradOp::paddingAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(paddingAttrName(), attr);
}

void MaxPoolGradOp::explicit_paddingsAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(explicit_paddingsAttrName(), attr);
}

void MaxPoolGradOp::data_formatAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(data_formatAttrName(), attr);
}

void MaxPoolGradOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value orig_input, ::mlir::Value orig_output, ::mlir::Value grad, ::mlir::ArrayAttr ksize, ::mlir::ArrayAttr strides, ::mlir::StringAttr padding, ::mlir::ArrayAttr explicit_paddings, ::mlir::StringAttr data_format) {
  odsState.addOperands(orig_input);
  odsState.addOperands(orig_output);
  odsState.addOperands(grad);
  odsState.addAttribute(ksizeAttrName(odsState.name), ksize);
  odsState.addAttribute(stridesAttrName(odsState.name), strides);
  odsState.addAttribute(paddingAttrName(odsState.name), padding);
  odsState.addAttribute(explicit_paddingsAttrName(odsState.name), explicit_paddings);
  odsState.addAttribute(data_formatAttrName(odsState.name), data_format);
  odsState.addTypes(output);
}

void MaxPoolGradOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value orig_input, ::mlir::Value orig_output, ::mlir::Value grad, ::mlir::ArrayAttr ksize, ::mlir::ArrayAttr strides, ::mlir::StringAttr padding, ::mlir::ArrayAttr explicit_paddings, ::mlir::StringAttr data_format) {
  odsState.addOperands(orig_input);
  odsState.addOperands(orig_output);
  odsState.addOperands(grad);
  odsState.addAttribute(ksizeAttrName(odsState.name), ksize);
  odsState.addAttribute(stridesAttrName(odsState.name), strides);
  odsState.addAttribute(paddingAttrName(odsState.name), padding);
  odsState.addAttribute(explicit_paddingsAttrName(odsState.name), explicit_paddings);
  odsState.addAttribute(data_formatAttrName(odsState.name), data_format);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void MaxPoolGradOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value orig_input, ::mlir::Value orig_output, ::mlir::Value grad, ::mlir::ArrayAttr ksize, ::mlir::ArrayAttr strides, ::llvm::StringRef padding, ::mlir::ArrayAttr explicit_paddings, ::llvm::StringRef data_format) {
  odsState.addOperands(orig_input);
  odsState.addOperands(orig_output);
  odsState.addOperands(grad);
  odsState.addAttribute(ksizeAttrName(odsState.name), ksize);
  odsState.addAttribute(stridesAttrName(odsState.name), strides);
  odsState.addAttribute(paddingAttrName(odsState.name), odsBuilder.getStringAttr(padding));
  odsState.addAttribute(explicit_paddingsAttrName(odsState.name), explicit_paddings);
  odsState.addAttribute(data_formatAttrName(odsState.name), odsBuilder.getStringAttr(data_format));
  odsState.addTypes(output);
}

void MaxPoolGradOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value orig_input, ::mlir::Value orig_output, ::mlir::Value grad, ::mlir::ArrayAttr ksize, ::mlir::ArrayAttr strides, ::llvm::StringRef padding, ::mlir::ArrayAttr explicit_paddings, ::llvm::StringRef data_format) {
  odsState.addOperands(orig_input);
  odsState.addOperands(orig_output);
  odsState.addOperands(grad);
  odsState.addAttribute(ksizeAttrName(odsState.name), ksize);
  odsState.addAttribute(stridesAttrName(odsState.name), strides);
  odsState.addAttribute(paddingAttrName(odsState.name), odsBuilder.getStringAttr(padding));
  odsState.addAttribute(explicit_paddingsAttrName(odsState.name), explicit_paddings);
  odsState.addAttribute(data_formatAttrName(odsState.name), odsBuilder.getStringAttr(data_format));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void MaxPoolGradOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 3u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult MaxPoolGradOp::verify() {
  {
    auto tblgen_ksize = (*this)->getAttr(ksizeAttrName());
    if (!tblgen_ksize)
      return emitOpError("requires attribute 'ksize'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops10(*this, tblgen_ksize, "ksize")))
      return ::mlir::failure();
  }
  {
    auto tblgen_strides = (*this)->getAttr(stridesAttrName());
    if (!tblgen_strides)
      return emitOpError("requires attribute 'strides'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops10(*this, tblgen_strides, "strides")))
      return ::mlir::failure();
  }
  {
    auto tblgen_padding = (*this)->getAttr(paddingAttrName());
    if (!tblgen_padding)
      return emitOpError("requires attribute 'padding'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops21(*this, tblgen_padding, "padding")))
      return ::mlir::failure();
  }
  {
    auto tblgen_explicit_paddings = (*this)->getAttr(explicit_paddingsAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops13(*this, tblgen_explicit_paddings, "explicit_paddings")))
      return ::mlir::failure();
  }
  {
    auto tblgen_data_format = (*this)->getAttr(data_formatAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops11(*this, tblgen_data_format, "data_format")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops35(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops35(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops35(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops35(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return Verify(*this);
}

void MaxPoolGradOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::MaxPoolGradOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::MaxPoolGradV2Op definitions
//===----------------------------------------------------------------------===//

MaxPoolGradV2OpAdaptor::MaxPoolGradV2OpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

MaxPoolGradV2OpAdaptor::MaxPoolGradV2OpAdaptor(MaxPoolGradV2Op &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange MaxPoolGradV2OpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> MaxPoolGradV2OpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange MaxPoolGradV2OpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value MaxPoolGradV2OpAdaptor::orig_input() {
  return *getODSOperands(0).begin();
}

::mlir::Value MaxPoolGradV2OpAdaptor::orig_output() {
  return *getODSOperands(1).begin();
}

::mlir::Value MaxPoolGradV2OpAdaptor::grad() {
  return *getODSOperands(2).begin();
}

::mlir::Value MaxPoolGradV2OpAdaptor::ksize() {
  return *getODSOperands(3).begin();
}

::mlir::Value MaxPoolGradV2OpAdaptor::strides() {
  return *getODSOperands(4).begin();
}

::mlir::DictionaryAttr MaxPoolGradV2OpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::StringAttr MaxPoolGradV2OpAdaptor::padding() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("padding").cast<::mlir::StringAttr>();
  return attr;
}

::mlir::StringAttr MaxPoolGradV2OpAdaptor::data_format() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("data_format").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("NHWC");
  return attr;
}

::mlir::LogicalResult MaxPoolGradV2OpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_padding = odsAttrs.get("padding");
    if (!tblgen_padding)
      return emitError(loc, "'tf.MaxPoolGradV2' op ""requires attribute 'padding'");

    if (tblgen_padding && !((tblgen_padding.cast<StringAttr>().getValue() == "SAME" || tblgen_padding.cast<StringAttr>().getValue() == "VALID")))
      return emitError(loc, "'tf.MaxPoolGradV2' op ""attribute 'padding' failed to satisfy constraint: string attribute whose value is SAME, or VALID");
  }
  {
    auto tblgen_data_format = odsAttrs.get("data_format");
    if (tblgen_data_format && !((tblgen_data_format.cast<StringAttr>().getValue() == "NHWC" || tblgen_data_format.cast<StringAttr>().getValue() == "NCHW")))
      return emitError(loc, "'tf.MaxPoolGradV2' op ""attribute 'data_format' failed to satisfy constraint: 'NHWC' or 'NCHW' convnet data format");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> MaxPoolGradV2Op::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range MaxPoolGradV2Op::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value MaxPoolGradV2Op::orig_input() {
  return *getODSOperands(0).begin();
}

::mlir::Value MaxPoolGradV2Op::orig_output() {
  return *getODSOperands(1).begin();
}

::mlir::Value MaxPoolGradV2Op::grad() {
  return *getODSOperands(2).begin();
}

::mlir::Value MaxPoolGradV2Op::ksize() {
  return *getODSOperands(3).begin();
}

::mlir::Value MaxPoolGradV2Op::strides() {
  return *getODSOperands(4).begin();
}

::mlir::MutableOperandRange MaxPoolGradV2Op::orig_inputMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange MaxPoolGradV2Op::orig_outputMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange MaxPoolGradV2Op::gradMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange MaxPoolGradV2Op::ksizeMutable() {
  auto range = getODSOperandIndexAndLength(3);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange MaxPoolGradV2Op::stridesMutable() {
  auto range = getODSOperandIndexAndLength(4);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> MaxPoolGradV2Op::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range MaxPoolGradV2Op::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value MaxPoolGradV2Op::output() {
  return *getODSResults(0).begin();
}

::mlir::StringAttr MaxPoolGradV2Op::paddingAttr() {
  return (*this)->getAttr(paddingAttrName()).cast<::mlir::StringAttr>();
}

::llvm::StringRef MaxPoolGradV2Op::padding() {
  auto attr = paddingAttr();
  return attr.getValue();
}

::mlir::StringAttr MaxPoolGradV2Op::data_formatAttr() {
  return (*this)->getAttr(data_formatAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef MaxPoolGradV2Op::data_format() {
  auto attr = data_formatAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("NHWC").getValue();
  return attr.getValue();
}

::mlir::Type MaxPoolGradV2Op::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool MaxPoolGradV2Op::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr MaxPoolGradV2Op::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void MaxPoolGradV2Op::paddingAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(paddingAttrName(), attr);
}

void MaxPoolGradV2Op::data_formatAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(data_formatAttrName(), attr);
}

void MaxPoolGradV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value orig_input, ::mlir::Value orig_output, ::mlir::Value grad, ::mlir::Value ksize, ::mlir::Value strides, ::mlir::StringAttr padding, ::mlir::StringAttr data_format) {
  odsState.addOperands(orig_input);
  odsState.addOperands(orig_output);
  odsState.addOperands(grad);
  odsState.addOperands(ksize);
  odsState.addOperands(strides);
  odsState.addAttribute(paddingAttrName(odsState.name), padding);
  odsState.addAttribute(data_formatAttrName(odsState.name), data_format);
  odsState.addTypes(output);
}

void MaxPoolGradV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value orig_input, ::mlir::Value orig_output, ::mlir::Value grad, ::mlir::Value ksize, ::mlir::Value strides, ::mlir::StringAttr padding, ::mlir::StringAttr data_format) {
  odsState.addOperands(orig_input);
  odsState.addOperands(orig_output);
  odsState.addOperands(grad);
  odsState.addOperands(ksize);
  odsState.addOperands(strides);
  odsState.addAttribute(paddingAttrName(odsState.name), padding);
  odsState.addAttribute(data_formatAttrName(odsState.name), data_format);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void MaxPoolGradV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value orig_input, ::mlir::Value orig_output, ::mlir::Value grad, ::mlir::Value ksize, ::mlir::Value strides, ::llvm::StringRef padding, ::llvm::StringRef data_format) {
  odsState.addOperands(orig_input);
  odsState.addOperands(orig_output);
  odsState.addOperands(grad);
  odsState.addOperands(ksize);
  odsState.addOperands(strides);
  odsState.addAttribute(paddingAttrName(odsState.name), odsBuilder.getStringAttr(padding));
  odsState.addAttribute(data_formatAttrName(odsState.name), odsBuilder.getStringAttr(data_format));
  odsState.addTypes(output);
}

void MaxPoolGradV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value orig_input, ::mlir::Value orig_output, ::mlir::Value grad, ::mlir::Value ksize, ::mlir::Value strides, ::llvm::StringRef padding, ::llvm::StringRef data_format) {
  odsState.addOperands(orig_input);
  odsState.addOperands(orig_output);
  odsState.addOperands(grad);
  odsState.addOperands(ksize);
  odsState.addOperands(strides);
  odsState.addAttribute(paddingAttrName(odsState.name), odsBuilder.getStringAttr(padding));
  odsState.addAttribute(data_formatAttrName(odsState.name), odsBuilder.getStringAttr(data_format));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void MaxPoolGradV2Op::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 5u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult MaxPoolGradV2Op::verify() {
  {
    auto tblgen_padding = (*this)->getAttr(paddingAttrName());
    if (!tblgen_padding)
      return emitOpError("requires attribute 'padding'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops8(*this, tblgen_padding, "padding")))
      return ::mlir::failure();
  }
  {
    auto tblgen_data_format = (*this)->getAttr(data_formatAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops11(*this, tblgen_data_format, "data_format")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops35(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops35(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops35(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup3 = getODSOperands(3);

    for (auto v : valueGroup3) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops11(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup4 = getODSOperands(4);

    for (auto v : valueGroup4) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops11(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops35(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void MaxPoolGradV2Op::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::MaxPoolGradV2Op)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::MaxPoolOp definitions
//===----------------------------------------------------------------------===//

MaxPoolOpAdaptor::MaxPoolOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

MaxPoolOpAdaptor::MaxPoolOpAdaptor(MaxPoolOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange MaxPoolOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> MaxPoolOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange MaxPoolOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value MaxPoolOpAdaptor::input() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr MaxPoolOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::ArrayAttr MaxPoolOpAdaptor::ksize() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("ksize").cast<::mlir::ArrayAttr>();
  return attr;
}

::mlir::ArrayAttr MaxPoolOpAdaptor::strides() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("strides").cast<::mlir::ArrayAttr>();
  return attr;
}

::mlir::StringAttr MaxPoolOpAdaptor::padding() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("padding").cast<::mlir::StringAttr>();
  return attr;
}

::mlir::ArrayAttr MaxPoolOpAdaptor::explicit_paddings() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("explicit_paddings").dyn_cast_or_null<::mlir::ArrayAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getI64ArrayAttr({});
  return attr;
}

::mlir::StringAttr MaxPoolOpAdaptor::data_format() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("data_format").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("NHWC");
  return attr;
}

::mlir::LogicalResult MaxPoolOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_ksize = odsAttrs.get("ksize");
    if (!tblgen_ksize)
      return emitError(loc, "'tf.MaxPool' op ""requires attribute 'ksize'");

    if (tblgen_ksize && !((((tblgen_ksize.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_ksize.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return ((attr.isa<::mlir::IntegerAttr>())) && ((attr.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64))); }))) && ((tblgen_ksize.cast<::mlir::ArrayAttr>().size() >= 4))))
      return emitError(loc, "'tf.MaxPool' op ""attribute 'ksize' failed to satisfy constraint: 64-bit integer array attribute with at least 4 elements");
  }
  {
    auto tblgen_strides = odsAttrs.get("strides");
    if (!tblgen_strides)
      return emitError(loc, "'tf.MaxPool' op ""requires attribute 'strides'");

    if (tblgen_strides && !((((tblgen_strides.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_strides.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return ((attr.isa<::mlir::IntegerAttr>())) && ((attr.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64))); }))) && ((tblgen_strides.cast<::mlir::ArrayAttr>().size() >= 4))))
      return emitError(loc, "'tf.MaxPool' op ""attribute 'strides' failed to satisfy constraint: 64-bit integer array attribute with at least 4 elements");
  }
  {
    auto tblgen_padding = odsAttrs.get("padding");
    if (!tblgen_padding)
      return emitError(loc, "'tf.MaxPool' op ""requires attribute 'padding'");

    if (tblgen_padding && !((tblgen_padding.cast<StringAttr>().getValue() == "SAME" || tblgen_padding.cast<StringAttr>().getValue() == "VALID" || tblgen_padding.cast<StringAttr>().getValue() == "EXPLICIT")))
      return emitError(loc, "'tf.MaxPool' op ""attribute 'padding' failed to satisfy constraint: string attribute whose value is SAME, or VALID, or EXPLICIT");
  }
  {
    auto tblgen_explicit_paddings = odsAttrs.get("explicit_paddings");
    if (tblgen_explicit_paddings && !(((tblgen_explicit_paddings.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_explicit_paddings.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return ((attr.isa<::mlir::IntegerAttr>())) && ((attr.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64))); }))))
      return emitError(loc, "'tf.MaxPool' op ""attribute 'explicit_paddings' failed to satisfy constraint: 64-bit integer array attribute");
  }
  {
    auto tblgen_data_format = odsAttrs.get("data_format");
    if (tblgen_data_format && !((tblgen_data_format.cast<StringAttr>().getValue() == "NHWC" || tblgen_data_format.cast<StringAttr>().getValue() == "NCHW" || tblgen_data_format.cast<StringAttr>().getValue() == "NCHW_VECT_C")))
      return emitError(loc, "'tf.MaxPool' op ""attribute 'data_format' failed to satisfy constraint: string attribute whose value is NHWC, or NCHW, or NCHW_VECT_C");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> MaxPoolOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range MaxPoolOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value MaxPoolOp::input() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange MaxPoolOp::inputMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> MaxPoolOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range MaxPoolOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value MaxPoolOp::output() {
  return *getODSResults(0).begin();
}

::mlir::ArrayAttr MaxPoolOp::ksizeAttr() {
  return (*this)->getAttr(ksizeAttrName()).cast<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr MaxPoolOp::ksize() {
  auto attr = ksizeAttr();
  return attr;
}

::mlir::ArrayAttr MaxPoolOp::stridesAttr() {
  return (*this)->getAttr(stridesAttrName()).cast<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr MaxPoolOp::strides() {
  auto attr = stridesAttr();
  return attr;
}

::mlir::StringAttr MaxPoolOp::paddingAttr() {
  return (*this)->getAttr(paddingAttrName()).cast<::mlir::StringAttr>();
}

::llvm::StringRef MaxPoolOp::padding() {
  auto attr = paddingAttr();
  return attr.getValue();
}

::mlir::ArrayAttr MaxPoolOp::explicit_paddingsAttr() {
  return (*this)->getAttr(explicit_paddingsAttrName()).dyn_cast_or_null<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr MaxPoolOp::explicit_paddings() {
  auto attr = explicit_paddingsAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getI64ArrayAttr({});
  return attr;
}

::mlir::StringAttr MaxPoolOp::data_formatAttr() {
  return (*this)->getAttr(data_formatAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef MaxPoolOp::data_format() {
  auto attr = data_formatAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("NHWC").getValue();
  return attr.getValue();
}

::mlir::Type MaxPoolOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool MaxPoolOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr MaxPoolOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void MaxPoolOp::ksizeAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(ksizeAttrName(), attr);
}

void MaxPoolOp::stridesAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(stridesAttrName(), attr);
}

void MaxPoolOp::paddingAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(paddingAttrName(), attr);
}

void MaxPoolOp::explicit_paddingsAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(explicit_paddingsAttrName(), attr);
}

void MaxPoolOp::data_formatAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(data_formatAttrName(), attr);
}

void MaxPoolOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input, ::mlir::ArrayAttr ksize, ::mlir::ArrayAttr strides, ::mlir::StringAttr padding, ::mlir::ArrayAttr explicit_paddings, ::mlir::StringAttr data_format) {
  odsState.addOperands(input);
  odsState.addAttribute(ksizeAttrName(odsState.name), ksize);
  odsState.addAttribute(stridesAttrName(odsState.name), strides);
  odsState.addAttribute(paddingAttrName(odsState.name), padding);
  odsState.addAttribute(explicit_paddingsAttrName(odsState.name), explicit_paddings);
  odsState.addAttribute(data_formatAttrName(odsState.name), data_format);
  odsState.addTypes(output);
}

void MaxPoolOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::ArrayAttr ksize, ::mlir::ArrayAttr strides, ::mlir::StringAttr padding, ::mlir::ArrayAttr explicit_paddings, ::mlir::StringAttr data_format) {
  odsState.addOperands(input);
  odsState.addAttribute(ksizeAttrName(odsState.name), ksize);
  odsState.addAttribute(stridesAttrName(odsState.name), strides);
  odsState.addAttribute(paddingAttrName(odsState.name), padding);
  odsState.addAttribute(explicit_paddingsAttrName(odsState.name), explicit_paddings);
  odsState.addAttribute(data_formatAttrName(odsState.name), data_format);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void MaxPoolOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input, ::mlir::ArrayAttr ksize, ::mlir::ArrayAttr strides, ::llvm::StringRef padding, ::mlir::ArrayAttr explicit_paddings, ::llvm::StringRef data_format) {
  odsState.addOperands(input);
  odsState.addAttribute(ksizeAttrName(odsState.name), ksize);
  odsState.addAttribute(stridesAttrName(odsState.name), strides);
  odsState.addAttribute(paddingAttrName(odsState.name), odsBuilder.getStringAttr(padding));
  odsState.addAttribute(explicit_paddingsAttrName(odsState.name), explicit_paddings);
  odsState.addAttribute(data_formatAttrName(odsState.name), odsBuilder.getStringAttr(data_format));
  odsState.addTypes(output);
}

void MaxPoolOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::ArrayAttr ksize, ::mlir::ArrayAttr strides, ::llvm::StringRef padding, ::mlir::ArrayAttr explicit_paddings, ::llvm::StringRef data_format) {
  odsState.addOperands(input);
  odsState.addAttribute(ksizeAttrName(odsState.name), ksize);
  odsState.addAttribute(stridesAttrName(odsState.name), strides);
  odsState.addAttribute(paddingAttrName(odsState.name), odsBuilder.getStringAttr(padding));
  odsState.addAttribute(explicit_paddingsAttrName(odsState.name), explicit_paddings);
  odsState.addAttribute(data_formatAttrName(odsState.name), odsBuilder.getStringAttr(data_format));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void MaxPoolOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult MaxPoolOp::verify() {
  {
    auto tblgen_ksize = (*this)->getAttr(ksizeAttrName());
    if (!tblgen_ksize)
      return emitOpError("requires attribute 'ksize'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops10(*this, tblgen_ksize, "ksize")))
      return ::mlir::failure();
  }
  {
    auto tblgen_strides = (*this)->getAttr(stridesAttrName());
    if (!tblgen_strides)
      return emitOpError("requires attribute 'strides'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops10(*this, tblgen_strides, "strides")))
      return ::mlir::failure();
  }
  {
    auto tblgen_padding = (*this)->getAttr(paddingAttrName());
    if (!tblgen_padding)
      return emitOpError("requires attribute 'padding'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops21(*this, tblgen_padding, "padding")))
      return ::mlir::failure();
  }
  {
    auto tblgen_explicit_paddings = (*this)->getAttr(explicit_paddingsAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops13(*this, tblgen_explicit_paddings, "explicit_paddings")))
      return ::mlir::failure();
  }
  {
    auto tblgen_data_format = (*this)->getAttr(data_formatAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops23(*this, tblgen_data_format, "data_format")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops47(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops47(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void MaxPoolOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::MaxPoolOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::MaxPoolV2Op definitions
//===----------------------------------------------------------------------===//

MaxPoolV2OpAdaptor::MaxPoolV2OpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

MaxPoolV2OpAdaptor::MaxPoolV2OpAdaptor(MaxPoolV2Op &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange MaxPoolV2OpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> MaxPoolV2OpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange MaxPoolV2OpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value MaxPoolV2OpAdaptor::input() {
  return *getODSOperands(0).begin();
}

::mlir::Value MaxPoolV2OpAdaptor::ksize() {
  return *getODSOperands(1).begin();
}

::mlir::Value MaxPoolV2OpAdaptor::strides() {
  return *getODSOperands(2).begin();
}

::mlir::DictionaryAttr MaxPoolV2OpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::StringAttr MaxPoolV2OpAdaptor::padding() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("padding").cast<::mlir::StringAttr>();
  return attr;
}

::mlir::StringAttr MaxPoolV2OpAdaptor::data_format() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("data_format").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("NHWC");
  return attr;
}

::mlir::LogicalResult MaxPoolV2OpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_padding = odsAttrs.get("padding");
    if (!tblgen_padding)
      return emitError(loc, "'tf.MaxPoolV2' op ""requires attribute 'padding'");

    if (tblgen_padding && !((tblgen_padding.cast<StringAttr>().getValue() == "SAME" || tblgen_padding.cast<StringAttr>().getValue() == "VALID")))
      return emitError(loc, "'tf.MaxPoolV2' op ""attribute 'padding' failed to satisfy constraint: string attribute whose value is SAME, or VALID");
  }
  {
    auto tblgen_data_format = odsAttrs.get("data_format");
    if (tblgen_data_format && !((tblgen_data_format.cast<StringAttr>().getValue() == "NHWC" || tblgen_data_format.cast<StringAttr>().getValue() == "NCHW" || tblgen_data_format.cast<StringAttr>().getValue() == "NCHW_VECT_C")))
      return emitError(loc, "'tf.MaxPoolV2' op ""attribute 'data_format' failed to satisfy constraint: string attribute whose value is NHWC, or NCHW, or NCHW_VECT_C");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> MaxPoolV2Op::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range MaxPoolV2Op::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value MaxPoolV2Op::input() {
  return *getODSOperands(0).begin();
}

::mlir::Value MaxPoolV2Op::ksize() {
  return *getODSOperands(1).begin();
}

::mlir::Value MaxPoolV2Op::strides() {
  return *getODSOperands(2).begin();
}

::mlir::MutableOperandRange MaxPoolV2Op::inputMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange MaxPoolV2Op::ksizeMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange MaxPoolV2Op::stridesMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> MaxPoolV2Op::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range MaxPoolV2Op::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value MaxPoolV2Op::output() {
  return *getODSResults(0).begin();
}

::mlir::StringAttr MaxPoolV2Op::paddingAttr() {
  return (*this)->getAttr(paddingAttrName()).cast<::mlir::StringAttr>();
}

::llvm::StringRef MaxPoolV2Op::padding() {
  auto attr = paddingAttr();
  return attr.getValue();
}

::mlir::StringAttr MaxPoolV2Op::data_formatAttr() {
  return (*this)->getAttr(data_formatAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef MaxPoolV2Op::data_format() {
  auto attr = data_formatAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("NHWC").getValue();
  return attr.getValue();
}

::mlir::Type MaxPoolV2Op::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool MaxPoolV2Op::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr MaxPoolV2Op::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void MaxPoolV2Op::paddingAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(paddingAttrName(), attr);
}

void MaxPoolV2Op::data_formatAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(data_formatAttrName(), attr);
}

void MaxPoolV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input, ::mlir::Value ksize, ::mlir::Value strides, ::mlir::StringAttr padding, ::mlir::StringAttr data_format) {
  odsState.addOperands(input);
  odsState.addOperands(ksize);
  odsState.addOperands(strides);
  odsState.addAttribute(paddingAttrName(odsState.name), padding);
  odsState.addAttribute(data_formatAttrName(odsState.name), data_format);
  odsState.addTypes(output);
}

void MaxPoolV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::Value ksize, ::mlir::Value strides, ::mlir::StringAttr padding, ::mlir::StringAttr data_format) {
  odsState.addOperands(input);
  odsState.addOperands(ksize);
  odsState.addOperands(strides);
  odsState.addAttribute(paddingAttrName(odsState.name), padding);
  odsState.addAttribute(data_formatAttrName(odsState.name), data_format);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void MaxPoolV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input, ::mlir::Value ksize, ::mlir::Value strides, ::llvm::StringRef padding, ::llvm::StringRef data_format) {
  odsState.addOperands(input);
  odsState.addOperands(ksize);
  odsState.addOperands(strides);
  odsState.addAttribute(paddingAttrName(odsState.name), odsBuilder.getStringAttr(padding));
  odsState.addAttribute(data_formatAttrName(odsState.name), odsBuilder.getStringAttr(data_format));
  odsState.addTypes(output);
}

void MaxPoolV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::Value ksize, ::mlir::Value strides, ::llvm::StringRef padding, ::llvm::StringRef data_format) {
  odsState.addOperands(input);
  odsState.addOperands(ksize);
  odsState.addOperands(strides);
  odsState.addAttribute(paddingAttrName(odsState.name), odsBuilder.getStringAttr(padding));
  odsState.addAttribute(data_formatAttrName(odsState.name), odsBuilder.getStringAttr(data_format));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void MaxPoolV2Op::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 3u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult MaxPoolV2Op::verify() {
  {
    auto tblgen_padding = (*this)->getAttr(paddingAttrName());
    if (!tblgen_padding)
      return emitOpError("requires attribute 'padding'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops8(*this, tblgen_padding, "padding")))
      return ::mlir::failure();
  }
  {
    auto tblgen_data_format = (*this)->getAttr(data_formatAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops23(*this, tblgen_data_format, "data_format")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops47(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops11(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops11(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops47(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void MaxPoolV2Op::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::MaxPoolV2Op)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::MaximumOp definitions
//===----------------------------------------------------------------------===//

MaximumOpAdaptor::MaximumOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

MaximumOpAdaptor::MaximumOpAdaptor(MaximumOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange MaximumOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> MaximumOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange MaximumOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value MaximumOpAdaptor::x() {
  return *getODSOperands(0).begin();
}

::mlir::Value MaximumOpAdaptor::y() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr MaximumOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult MaximumOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> MaximumOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range MaximumOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value MaximumOp::x() {
  return *getODSOperands(0).begin();
}

::mlir::Value MaximumOp::y() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange MaximumOp::xMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange MaximumOp::yMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> MaximumOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range MaximumOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value MaximumOp::z() {
  return *getODSResults(0).begin();
}

::mlir::Type MaximumOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool MaximumOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr MaximumOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void MaximumOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, Value x, Value y) {
  auto resultType =
      OpTrait::util::getBroadcastedType(x.getType(), y.getType());
  if (!resultType)
    mlir::emitError(odsState.location, "non-broadcastable operands");
  return build(odsBuilder, odsState, resultType, x, y);
}

void MaximumOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type z, ::mlir::Value x, ::mlir::Value y) {
  odsState.addOperands(x);
  odsState.addOperands(y);
  odsState.addTypes(z);
}

void MaximumOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value x, ::mlir::Value y) {
  odsState.addOperands(x);
  odsState.addOperands(y);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void MaximumOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult MaximumOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops35(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops35(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops35(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void MaximumOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::MaximumOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::MeanOp definitions
//===----------------------------------------------------------------------===//

MeanOpAdaptor::MeanOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

MeanOpAdaptor::MeanOpAdaptor(MeanOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange MeanOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> MeanOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange MeanOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value MeanOpAdaptor::input() {
  return *getODSOperands(0).begin();
}

::mlir::Value MeanOpAdaptor::reduction_indices() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr MeanOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::BoolAttr MeanOpAdaptor::keep_dims() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("keep_dims").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(false);
  return attr;
}

::mlir::LogicalResult MeanOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_keep_dims = odsAttrs.get("keep_dims");
    if (tblgen_keep_dims && !((tblgen_keep_dims.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.Mean' op ""attribute 'keep_dims' failed to satisfy constraint: bool attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> MeanOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range MeanOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value MeanOp::input() {
  return *getODSOperands(0).begin();
}

::mlir::Value MeanOp::reduction_indices() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange MeanOp::inputMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange MeanOp::reduction_indicesMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> MeanOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range MeanOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value MeanOp::output() {
  return *getODSResults(0).begin();
}

::mlir::BoolAttr MeanOp::keep_dimsAttr() {
  return (*this)->getAttr(keep_dimsAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool MeanOp::keep_dims() {
  auto attr = keep_dimsAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(false).getValue();
  return attr.getValue();
}

::mlir::Type MeanOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

::mlir::Type MeanOp::Tidx() {
  return mlir::getElementTypeOrSelf(*getODSOperands(1).begin());
}

bool MeanOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
  if (name == "Tidx") return true;
 return false;
}

::mlir::DictionaryAttr MeanOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())},
    {TidxAttrName(),
::mlir::TypeAttr::get(Tidx())}});
}

void MeanOp::keep_dimsAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(keep_dimsAttrName(), attr);
}

void MeanOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input, ::mlir::Value reduction_indices, ::mlir::BoolAttr keep_dims) {
  odsState.addOperands(input);
  odsState.addOperands(reduction_indices);
  odsState.addAttribute(keep_dimsAttrName(odsState.name), keep_dims);
  odsState.addTypes(output);
}

void MeanOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::Value reduction_indices, ::mlir::BoolAttr keep_dims) {
  odsState.addOperands(input);
  odsState.addOperands(reduction_indices);
  odsState.addAttribute(keep_dimsAttrName(odsState.name), keep_dims);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void MeanOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input, ::mlir::Value reduction_indices, bool keep_dims) {
  odsState.addOperands(input);
  odsState.addOperands(reduction_indices);
  odsState.addAttribute(keep_dimsAttrName(odsState.name), odsBuilder.getBoolAttr(keep_dims));
  odsState.addTypes(output);
}

void MeanOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::Value reduction_indices, bool keep_dims) {
  odsState.addOperands(input);
  odsState.addOperands(reduction_indices);
  odsState.addAttribute(keep_dimsAttrName(odsState.name), odsBuilder.getBoolAttr(keep_dims));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void MeanOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult MeanOp::verify() {
  {
    auto tblgen_keep_dims = (*this)->getAttr(keep_dimsAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_keep_dims, "keep_dims")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void MeanOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::MeanOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::MergeSummaryOp definitions
//===----------------------------------------------------------------------===//

MergeSummaryOpAdaptor::MergeSummaryOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

MergeSummaryOpAdaptor::MergeSummaryOpAdaptor(MergeSummaryOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange MergeSummaryOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> MergeSummaryOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  bool isVariadic[] = {true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (odsOperands.size() - 0) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::ValueRange MergeSummaryOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::ValueRange MergeSummaryOpAdaptor::inputs() {
  return getODSOperands(0);
}

::mlir::DictionaryAttr MergeSummaryOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult MergeSummaryOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> MergeSummaryOp::getODSOperandIndexAndLength(unsigned index) {
  bool isVariadic[] = {true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (getOperation()->getNumOperands() - 0) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::Operation::operand_range MergeSummaryOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Operation::operand_range MergeSummaryOp::inputs() {
  return getODSOperands(0);
}

::mlir::MutableOperandRange MergeSummaryOp::inputsMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> MergeSummaryOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range MergeSummaryOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value MergeSummaryOp::summary() {
  return *getODSResults(0).begin();
}

size_t MergeSummaryOp::N() {
  auto range = getODSOperands(0);
return std::distance(range.begin(), range.end());
}

bool MergeSummaryOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "N") return true;
 return false;
}

::mlir::DictionaryAttr MergeSummaryOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {NAttrName(),
odsBuilder.getI64IntegerAttr(N())}});
}

void MergeSummaryOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type summary, ::mlir::ValueRange inputs) {
  odsState.addOperands(inputs);
  odsState.addTypes(summary);
}

void MergeSummaryOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

void MergeSummaryOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  odsState.addTypes({operands[0].getType()});

}

::mlir::LogicalResult MergeSummaryOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops19(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops19(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void MergeSummaryOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::MergeSummaryOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::MergeV2CheckpointsOp definitions
//===----------------------------------------------------------------------===//

MergeV2CheckpointsOpAdaptor::MergeV2CheckpointsOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

MergeV2CheckpointsOpAdaptor::MergeV2CheckpointsOpAdaptor(MergeV2CheckpointsOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange MergeV2CheckpointsOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> MergeV2CheckpointsOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange MergeV2CheckpointsOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value MergeV2CheckpointsOpAdaptor::checkpoint_prefixes() {
  return *getODSOperands(0).begin();
}

::mlir::Value MergeV2CheckpointsOpAdaptor::destination_prefix() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr MergeV2CheckpointsOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::BoolAttr MergeV2CheckpointsOpAdaptor::delete_old_dirs() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("delete_old_dirs").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(true);
  return attr;
}

::mlir::LogicalResult MergeV2CheckpointsOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_delete_old_dirs = odsAttrs.get("delete_old_dirs");
    if (tblgen_delete_old_dirs && !((tblgen_delete_old_dirs.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.MergeV2Checkpoints' op ""attribute 'delete_old_dirs' failed to satisfy constraint: bool attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> MergeV2CheckpointsOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range MergeV2CheckpointsOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value MergeV2CheckpointsOp::checkpoint_prefixes() {
  return *getODSOperands(0).begin();
}

::mlir::Value MergeV2CheckpointsOp::destination_prefix() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange MergeV2CheckpointsOp::checkpoint_prefixesMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange MergeV2CheckpointsOp::destination_prefixMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> MergeV2CheckpointsOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range MergeV2CheckpointsOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::BoolAttr MergeV2CheckpointsOp::delete_old_dirsAttr() {
  return (*this)->getAttr(delete_old_dirsAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool MergeV2CheckpointsOp::delete_old_dirs() {
  auto attr = delete_old_dirsAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(true).getValue();
  return attr.getValue();
}

void MergeV2CheckpointsOp::delete_old_dirsAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(delete_old_dirsAttrName(), attr);
}

void MergeV2CheckpointsOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value checkpoint_prefixes, ::mlir::Value destination_prefix, ::mlir::BoolAttr delete_old_dirs) {
  odsState.addOperands(checkpoint_prefixes);
  odsState.addOperands(destination_prefix);
  odsState.addAttribute(delete_old_dirsAttrName(odsState.name), delete_old_dirs);
}

void MergeV2CheckpointsOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value checkpoint_prefixes, ::mlir::Value destination_prefix, ::mlir::BoolAttr delete_old_dirs) {
  odsState.addOperands(checkpoint_prefixes);
  odsState.addOperands(destination_prefix);
  odsState.addAttribute(delete_old_dirsAttrName(odsState.name), delete_old_dirs);
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void MergeV2CheckpointsOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value checkpoint_prefixes, ::mlir::Value destination_prefix, bool delete_old_dirs) {
  odsState.addOperands(checkpoint_prefixes);
  odsState.addOperands(destination_prefix);
  odsState.addAttribute(delete_old_dirsAttrName(odsState.name), odsBuilder.getBoolAttr(delete_old_dirs));
}

void MergeV2CheckpointsOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value checkpoint_prefixes, ::mlir::Value destination_prefix, bool delete_old_dirs) {
  odsState.addOperands(checkpoint_prefixes);
  odsState.addOperands(destination_prefix);
  odsState.addAttribute(delete_old_dirsAttrName(odsState.name), odsBuilder.getBoolAttr(delete_old_dirs));
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void MergeV2CheckpointsOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 0u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult MergeV2CheckpointsOp::verify() {
  {
    auto tblgen_delete_old_dirs = (*this)->getAttr(delete_old_dirsAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_delete_old_dirs, "delete_old_dirs")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops19(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops19(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::MergeV2CheckpointsOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::MinOp definitions
//===----------------------------------------------------------------------===//

MinOpAdaptor::MinOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

MinOpAdaptor::MinOpAdaptor(MinOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange MinOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> MinOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange MinOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value MinOpAdaptor::input() {
  return *getODSOperands(0).begin();
}

::mlir::Value MinOpAdaptor::reduction_indices() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr MinOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::BoolAttr MinOpAdaptor::keep_dims() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("keep_dims").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(false);
  return attr;
}

::mlir::LogicalResult MinOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_keep_dims = odsAttrs.get("keep_dims");
    if (tblgen_keep_dims && !((tblgen_keep_dims.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.Min' op ""attribute 'keep_dims' failed to satisfy constraint: bool attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> MinOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range MinOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value MinOp::input() {
  return *getODSOperands(0).begin();
}

::mlir::Value MinOp::reduction_indices() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange MinOp::inputMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange MinOp::reduction_indicesMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> MinOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range MinOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value MinOp::output() {
  return *getODSResults(0).begin();
}

::mlir::BoolAttr MinOp::keep_dimsAttr() {
  return (*this)->getAttr(keep_dimsAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool MinOp::keep_dims() {
  auto attr = keep_dimsAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(false).getValue();
  return attr.getValue();
}

::mlir::Type MinOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

::mlir::Type MinOp::Tidx() {
  return mlir::getElementTypeOrSelf(*getODSOperands(1).begin());
}

bool MinOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
  if (name == "Tidx") return true;
 return false;
}

::mlir::DictionaryAttr MinOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())},
    {TidxAttrName(),
::mlir::TypeAttr::get(Tidx())}});
}

void MinOp::keep_dimsAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(keep_dimsAttrName(), attr);
}

void MinOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input, ::mlir::Value reduction_indices, ::mlir::BoolAttr keep_dims) {
  odsState.addOperands(input);
  odsState.addOperands(reduction_indices);
  odsState.addAttribute(keep_dimsAttrName(odsState.name), keep_dims);
  odsState.addTypes(output);
}

void MinOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::Value reduction_indices, ::mlir::BoolAttr keep_dims) {
  odsState.addOperands(input);
  odsState.addOperands(reduction_indices);
  odsState.addAttribute(keep_dimsAttrName(odsState.name), keep_dims);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void MinOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input, ::mlir::Value reduction_indices, bool keep_dims) {
  odsState.addOperands(input);
  odsState.addOperands(reduction_indices);
  odsState.addAttribute(keep_dimsAttrName(odsState.name), odsBuilder.getBoolAttr(keep_dims));
  odsState.addTypes(output);
}

void MinOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::Value reduction_indices, bool keep_dims) {
  odsState.addOperands(input);
  odsState.addOperands(reduction_indices);
  odsState.addAttribute(keep_dimsAttrName(odsState.name), odsBuilder.getBoolAttr(keep_dims));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void MinOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult MinOp::verify() {
  {
    auto tblgen_keep_dims = (*this)->getAttr(keep_dimsAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_keep_dims, "keep_dims")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops46(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops46(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void MinOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::MinOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::MinimumOp definitions
//===----------------------------------------------------------------------===//

MinimumOpAdaptor::MinimumOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

MinimumOpAdaptor::MinimumOpAdaptor(MinimumOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange MinimumOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> MinimumOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange MinimumOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value MinimumOpAdaptor::x() {
  return *getODSOperands(0).begin();
}

::mlir::Value MinimumOpAdaptor::y() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr MinimumOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult MinimumOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> MinimumOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range MinimumOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value MinimumOp::x() {
  return *getODSOperands(0).begin();
}

::mlir::Value MinimumOp::y() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange MinimumOp::xMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange MinimumOp::yMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> MinimumOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range MinimumOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value MinimumOp::z() {
  return *getODSResults(0).begin();
}

::mlir::Type MinimumOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool MinimumOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr MinimumOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void MinimumOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, Value x, Value y) {
  auto resultType =
      OpTrait::util::getBroadcastedType(x.getType(), y.getType());
  if (!resultType)
    mlir::emitError(odsState.location, "non-broadcastable operands");
  return build(odsBuilder, odsState, resultType, x, y);
}

void MinimumOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type z, ::mlir::Value x, ::mlir::Value y) {
  odsState.addOperands(x);
  odsState.addOperands(y);
  odsState.addTypes(z);
}

void MinimumOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value x, ::mlir::Value y) {
  odsState.addOperands(x);
  odsState.addOperands(y);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void MinimumOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult MinimumOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops35(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops35(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops35(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void MinimumOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::MinimumOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::MirrorPadGradOp definitions
//===----------------------------------------------------------------------===//

MirrorPadGradOpAdaptor::MirrorPadGradOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

MirrorPadGradOpAdaptor::MirrorPadGradOpAdaptor(MirrorPadGradOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange MirrorPadGradOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> MirrorPadGradOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange MirrorPadGradOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value MirrorPadGradOpAdaptor::input() {
  return *getODSOperands(0).begin();
}

::mlir::Value MirrorPadGradOpAdaptor::paddings() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr MirrorPadGradOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::StringAttr MirrorPadGradOpAdaptor::mode() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("mode").cast<::mlir::StringAttr>();
  return attr;
}

::mlir::LogicalResult MirrorPadGradOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_mode = odsAttrs.get("mode");
    if (!tblgen_mode)
      return emitError(loc, "'tf.MirrorPadGrad' op ""requires attribute 'mode'");

    if (tblgen_mode && !((tblgen_mode.cast<StringAttr>().getValue() == "REFLECT" || tblgen_mode.cast<StringAttr>().getValue() == "SYMMETRIC")))
      return emitError(loc, "'tf.MirrorPadGrad' op ""attribute 'mode' failed to satisfy constraint: string attribute whose value is REFLECT, or SYMMETRIC");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> MirrorPadGradOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range MirrorPadGradOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value MirrorPadGradOp::input() {
  return *getODSOperands(0).begin();
}

::mlir::Value MirrorPadGradOp::paddings() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange MirrorPadGradOp::inputMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange MirrorPadGradOp::paddingsMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> MirrorPadGradOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range MirrorPadGradOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value MirrorPadGradOp::output() {
  return *getODSResults(0).begin();
}

::mlir::StringAttr MirrorPadGradOp::modeAttr() {
  return (*this)->getAttr(modeAttrName()).cast<::mlir::StringAttr>();
}

::llvm::StringRef MirrorPadGradOp::mode() {
  auto attr = modeAttr();
  return attr.getValue();
}

::mlir::Type MirrorPadGradOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

::mlir::Type MirrorPadGradOp::Tpaddings() {
  return mlir::getElementTypeOrSelf(*getODSOperands(1).begin());
}

bool MirrorPadGradOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
  if (name == "Tpaddings") return true;
 return false;
}

::mlir::DictionaryAttr MirrorPadGradOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())},
    {TpaddingsAttrName(),
::mlir::TypeAttr::get(Tpaddings())}});
}

void MirrorPadGradOp::modeAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(modeAttrName(), attr);
}

void MirrorPadGradOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input, ::mlir::Value paddings, ::mlir::StringAttr mode) {
  odsState.addOperands(input);
  odsState.addOperands(paddings);
  odsState.addAttribute(modeAttrName(odsState.name), mode);
  odsState.addTypes(output);
}

void MirrorPadGradOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::Value paddings, ::mlir::StringAttr mode) {
  odsState.addOperands(input);
  odsState.addOperands(paddings);
  odsState.addAttribute(modeAttrName(odsState.name), mode);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void MirrorPadGradOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input, ::mlir::Value paddings, ::llvm::StringRef mode) {
  odsState.addOperands(input);
  odsState.addOperands(paddings);
  odsState.addAttribute(modeAttrName(odsState.name), odsBuilder.getStringAttr(mode));
  odsState.addTypes(output);
}

void MirrorPadGradOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::Value paddings, ::llvm::StringRef mode) {
  odsState.addOperands(input);
  odsState.addOperands(paddings);
  odsState.addAttribute(modeAttrName(odsState.name), odsBuilder.getStringAttr(mode));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void MirrorPadGradOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult MirrorPadGradOp::verify() {
  {
    auto tblgen_mode = (*this)->getAttr(modeAttrName());
    if (!tblgen_mode)
      return emitOpError("requires attribute 'mode'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops33(*this, tblgen_mode, "mode")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  if (!((((*this->getOperation()).getOperand(1).getType().isa<UnrankedTensorType>())) || (((*this->getOperation()).getOperand(1).getType().cast<ShapedType>().getRank() == 2))))
    return emitOpError("failed to verify that operand 1 is 2-D");
  return ::mlir::success();
}

void MirrorPadGradOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::MirrorPadGradOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::MirrorPadOp definitions
//===----------------------------------------------------------------------===//

MirrorPadOpAdaptor::MirrorPadOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

MirrorPadOpAdaptor::MirrorPadOpAdaptor(MirrorPadOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange MirrorPadOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> MirrorPadOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange MirrorPadOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value MirrorPadOpAdaptor::input() {
  return *getODSOperands(0).begin();
}

::mlir::Value MirrorPadOpAdaptor::paddings() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr MirrorPadOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::StringAttr MirrorPadOpAdaptor::mode() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("mode").cast<::mlir::StringAttr>();
  return attr;
}

::mlir::LogicalResult MirrorPadOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_mode = odsAttrs.get("mode");
    if (!tblgen_mode)
      return emitError(loc, "'tf.MirrorPad' op ""requires attribute 'mode'");

    if (tblgen_mode && !((tblgen_mode.cast<StringAttr>().getValue() == "REFLECT" || tblgen_mode.cast<StringAttr>().getValue() == "SYMMETRIC")))
      return emitError(loc, "'tf.MirrorPad' op ""attribute 'mode' failed to satisfy constraint: string attribute whose value is REFLECT, or SYMMETRIC");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> MirrorPadOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range MirrorPadOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value MirrorPadOp::input() {
  return *getODSOperands(0).begin();
}

::mlir::Value MirrorPadOp::paddings() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange MirrorPadOp::inputMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange MirrorPadOp::paddingsMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> MirrorPadOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range MirrorPadOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value MirrorPadOp::output() {
  return *getODSResults(0).begin();
}

::mlir::StringAttr MirrorPadOp::modeAttr() {
  return (*this)->getAttr(modeAttrName()).cast<::mlir::StringAttr>();
}

::llvm::StringRef MirrorPadOp::mode() {
  auto attr = modeAttr();
  return attr.getValue();
}

::mlir::Type MirrorPadOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

::mlir::Type MirrorPadOp::Tpaddings() {
  return mlir::getElementTypeOrSelf(*getODSOperands(1).begin());
}

bool MirrorPadOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
  if (name == "Tpaddings") return true;
 return false;
}

::mlir::DictionaryAttr MirrorPadOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())},
    {TpaddingsAttrName(),
::mlir::TypeAttr::get(Tpaddings())}});
}

void MirrorPadOp::modeAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(modeAttrName(), attr);
}

void MirrorPadOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input, ::mlir::Value paddings, ::mlir::StringAttr mode) {
  odsState.addOperands(input);
  odsState.addOperands(paddings);
  odsState.addAttribute(modeAttrName(odsState.name), mode);
  odsState.addTypes(output);
}

void MirrorPadOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::Value paddings, ::mlir::StringAttr mode) {
  odsState.addOperands(input);
  odsState.addOperands(paddings);
  odsState.addAttribute(modeAttrName(odsState.name), mode);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void MirrorPadOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input, ::mlir::Value paddings, ::llvm::StringRef mode) {
  odsState.addOperands(input);
  odsState.addOperands(paddings);
  odsState.addAttribute(modeAttrName(odsState.name), odsBuilder.getStringAttr(mode));
  odsState.addTypes(output);
}

void MirrorPadOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::Value paddings, ::llvm::StringRef mode) {
  odsState.addOperands(input);
  odsState.addOperands(paddings);
  odsState.addAttribute(modeAttrName(odsState.name), odsBuilder.getStringAttr(mode));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void MirrorPadOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult MirrorPadOp::verify() {
  {
    auto tblgen_mode = (*this)->getAttr(modeAttrName());
    if (!tblgen_mode)
      return emitOpError("requires attribute 'mode'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops33(*this, tblgen_mode, "mode")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  if (!((((*this->getOperation()).getOperand(1).getType().isa<UnrankedTensorType>())) || (((*this->getOperation()).getOperand(1).getType().cast<ShapedType>().getRank() == 2))))
    return emitOpError("failed to verify that operand 1 is 2-D");
  return ::mlir::success();
}

void MirrorPadOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::MirrorPadOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::MlirLocalVarOp definitions
//===----------------------------------------------------------------------===//

MlirLocalVarOpAdaptor::MlirLocalVarOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

MlirLocalVarOpAdaptor::MlirLocalVarOpAdaptor(MlirLocalVarOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange MlirLocalVarOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> MlirLocalVarOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange MlirLocalVarOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::DictionaryAttr MlirLocalVarOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult MlirLocalVarOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> MlirLocalVarOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range MlirLocalVarOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

std::pair<unsigned, unsigned> MlirLocalVarOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range MlirLocalVarOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value MlirLocalVarOp::resource() {
  return *getODSResults(0).begin();
}

void MlirLocalVarOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type resource) {
  odsState.addTypes(resource);
}

void MlirLocalVarOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes) {
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void MlirLocalVarOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 0u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult MlirLocalVarOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void MlirLocalVarOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  for (::mlir::Value value : getODSResults(0))
    effects.emplace_back(::mlir::MemoryEffects::Allocate::get(), value, ::mlir::TF::ResourceEffects::Variable::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::MlirLocalVarOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::MlirPassthroughOp definitions
//===----------------------------------------------------------------------===//

MlirPassthroughOpAdaptor::MlirPassthroughOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

MlirPassthroughOpAdaptor::MlirPassthroughOpAdaptor(MlirPassthroughOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange MlirPassthroughOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> MlirPassthroughOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  bool isVariadic[] = {true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (odsOperands.size() - 0) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::ValueRange MlirPassthroughOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::ValueRange MlirPassthroughOpAdaptor::inputs() {
  return getODSOperands(0);
}

::mlir::DictionaryAttr MlirPassthroughOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::StringAttr MlirPassthroughOpAdaptor::mlir_module() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("mlir_module").cast<::mlir::StringAttr>();
  return attr;
}

::mlir::LogicalResult MlirPassthroughOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_mlir_module = odsAttrs.get("mlir_module");
    if (!tblgen_mlir_module)
      return emitError(loc, "'tf.MlirPassthroughOp' op ""requires attribute 'mlir_module'");

    if (tblgen_mlir_module && !((tblgen_mlir_module.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.MlirPassthroughOp' op ""attribute 'mlir_module' failed to satisfy constraint: string attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> MlirPassthroughOp::getODSOperandIndexAndLength(unsigned index) {
  bool isVariadic[] = {true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (getOperation()->getNumOperands() - 0) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::Operation::operand_range MlirPassthroughOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Operation::operand_range MlirPassthroughOp::inputs() {
  return getODSOperands(0);
}

::mlir::MutableOperandRange MlirPassthroughOp::inputsMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> MlirPassthroughOp::getODSResultIndexAndLength(unsigned index) {
  bool isVariadic[] = {true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (getOperation()->getNumResults() - 0) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::Operation::result_range MlirPassthroughOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Operation::result_range MlirPassthroughOp::outputs() {
  return getODSResults(0);
}

::mlir::StringAttr MlirPassthroughOp::mlir_moduleAttr() {
  return (*this)->getAttr(mlir_moduleAttrName()).cast<::mlir::StringAttr>();
}

::llvm::StringRef MlirPassthroughOp::mlir_module() {
  auto attr = mlir_moduleAttr();
  return attr.getValue();
}

mlir::OperandElementTypeRange MlirPassthroughOp::Tinputs() {
  auto values = getODSOperands(0);
return {mlir::OperandElementTypeIterator(values.begin()), mlir::OperandElementTypeIterator(values.end())};
}

mlir::ResultElementTypeRange MlirPassthroughOp::Toutputs() {
  auto values = getODSResults(0);
return {mlir::ResultElementTypeIterator(values.begin()), mlir::ResultElementTypeIterator(values.end())};
}

bool MlirPassthroughOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "Tinputs") return true;
  if (name == "Toutputs") return true;
 return false;
}

::mlir::DictionaryAttr MlirPassthroughOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TinputsAttrName(),
ArrayAttr::get(ctx, 
    [&]() {
      llvm::SmallVector<Attribute, 4> ret;
      for (auto t : Tinputs())
        ret.push_back(TypeAttr::get(t));
      return ret;
    }())},
    {ToutputsAttrName(),
ArrayAttr::get(ctx, 
    [&]() {
      llvm::SmallVector<Attribute, 4> ret;
      for (auto t : Toutputs())
        ret.push_back(TypeAttr::get(t));
      return ret;
    }())}});
}

void MlirPassthroughOp::mlir_moduleAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(mlir_moduleAttrName(), attr);
}

void MlirPassthroughOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange outputs, ::mlir::ValueRange inputs, ::mlir::StringAttr mlir_module) {
  odsState.addOperands(inputs);
  odsState.addAttribute(mlir_moduleAttrName(odsState.name), mlir_module);
  odsState.addTypes(outputs);
}

void MlirPassthroughOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange outputs, ::mlir::ValueRange inputs, ::llvm::StringRef mlir_module) {
  odsState.addOperands(inputs);
  odsState.addAttribute(mlir_moduleAttrName(odsState.name), odsBuilder.getStringAttr(mlir_module));
  odsState.addTypes(outputs);
}

void MlirPassthroughOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult MlirPassthroughOp::verify() {
  {
    auto tblgen_mlir_module = (*this)->getAttr(mlir_moduleAttrName());
    if (!tblgen_mlir_module)
      return emitOpError("requires attribute 'mlir_module'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_mlir_module, "mlir_module")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void MlirPassthroughOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::MlirPassthroughOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::ModOp definitions
//===----------------------------------------------------------------------===//

ModOpAdaptor::ModOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

ModOpAdaptor::ModOpAdaptor(ModOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange ModOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> ModOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange ModOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ModOpAdaptor::x() {
  return *getODSOperands(0).begin();
}

::mlir::Value ModOpAdaptor::y() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr ModOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult ModOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> ModOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range ModOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ModOp::x() {
  return *getODSOperands(0).begin();
}

::mlir::Value ModOp::y() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange ModOp::xMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ModOp::yMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> ModOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range ModOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ModOp::z() {
  return *getODSResults(0).begin();
}

::mlir::Type ModOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool ModOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr ModOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void ModOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, Value x, Value y) {
  auto resultType =
      OpTrait::util::getBroadcastedType(x.getType(), y.getType());
  if (!resultType)
    mlir::emitError(odsState.location, "non-broadcastable operands");
  return build(odsBuilder, odsState, resultType, x, y);
}

void ModOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type z, ::mlir::Value x, ::mlir::Value y) {
  odsState.addOperands(x);
  odsState.addOperands(y);
  odsState.addTypes(z);
}

void ModOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value x, ::mlir::Value y) {
  odsState.addOperands(x);
  odsState.addOperands(y);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void ModOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult ModOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops32(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops32(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops32(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void ModOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::ModOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::ModelDatasetOp definitions
//===----------------------------------------------------------------------===//

ModelDatasetOpAdaptor::ModelDatasetOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

ModelDatasetOpAdaptor::ModelDatasetOpAdaptor(ModelDatasetOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange ModelDatasetOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> ModelDatasetOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange ModelDatasetOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ModelDatasetOpAdaptor::input_dataset() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr ModelDatasetOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::IntegerAttr ModelDatasetOpAdaptor::algorithm() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("algorithm").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), 0);
  return attr;
}

::mlir::IntegerAttr ModelDatasetOpAdaptor::cpu_budget() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("cpu_budget").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), 0);
  return attr;
}

::mlir::IntegerAttr ModelDatasetOpAdaptor::ram_budget() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("ram_budget").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), 0);
  return attr;
}

::mlir::ArrayAttr ModelDatasetOpAdaptor::output_types() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("output_types").cast<::mlir::ArrayAttr>();
  return attr;
}

::mlir::ArrayAttr ModelDatasetOpAdaptor::output_shapes() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("output_shapes").cast<::mlir::ArrayAttr>();
  return attr;
}

::mlir::LogicalResult ModelDatasetOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_algorithm = odsAttrs.get("algorithm");
    if (tblgen_algorithm && !(((tblgen_algorithm.isa<::mlir::IntegerAttr>())) && ((tblgen_algorithm.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.ModelDataset' op ""attribute 'algorithm' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_cpu_budget = odsAttrs.get("cpu_budget");
    if (tblgen_cpu_budget && !(((tblgen_cpu_budget.isa<::mlir::IntegerAttr>())) && ((tblgen_cpu_budget.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.ModelDataset' op ""attribute 'cpu_budget' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_ram_budget = odsAttrs.get("ram_budget");
    if (tblgen_ram_budget && !(((tblgen_ram_budget.isa<::mlir::IntegerAttr>())) && ((tblgen_ram_budget.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.ModelDataset' op ""attribute 'ram_budget' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_output_types = odsAttrs.get("output_types");
    if (!tblgen_output_types)
      return emitError(loc, "'tf.ModelDataset' op ""requires attribute 'output_types'");

    if (tblgen_output_types && !((((tblgen_output_types.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_output_types.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return ((attr.isa<::mlir::TypeAttr>())) && ((attr.cast<::mlir::TypeAttr>().getValue().isa<::mlir::Type>())); }))) && ((tblgen_output_types.cast<::mlir::ArrayAttr>().size() >= 1))))
      return emitError(loc, "'tf.ModelDataset' op ""attribute 'output_types' failed to satisfy constraint: type array attribute with at least 1 elements");
  }
  {
    auto tblgen_output_shapes = odsAttrs.get("output_shapes");
    if (!tblgen_output_shapes)
      return emitError(loc, "'tf.ModelDataset' op ""requires attribute 'output_shapes'");

    if (tblgen_output_shapes && !((((tblgen_output_shapes.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_output_shapes.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return (attr.isa<mlir::TF::ShapeAttr>()); }))) && ((tblgen_output_shapes.cast<::mlir::ArrayAttr>().size() >= 1))))
      return emitError(loc, "'tf.ModelDataset' op ""attribute 'output_shapes' failed to satisfy constraint: tensorflow shape attribute array with at least 1 elements");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> ModelDatasetOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range ModelDatasetOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ModelDatasetOp::input_dataset() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange ModelDatasetOp::input_datasetMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> ModelDatasetOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range ModelDatasetOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ModelDatasetOp::handle() {
  return *getODSResults(0).begin();
}

::mlir::IntegerAttr ModelDatasetOp::algorithmAttr() {
  return (*this)->getAttr(algorithmAttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t ModelDatasetOp::algorithm() {
  auto attr = algorithmAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), 0).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

::mlir::IntegerAttr ModelDatasetOp::cpu_budgetAttr() {
  return (*this)->getAttr(cpu_budgetAttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t ModelDatasetOp::cpu_budget() {
  auto attr = cpu_budgetAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), 0).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

::mlir::IntegerAttr ModelDatasetOp::ram_budgetAttr() {
  return (*this)->getAttr(ram_budgetAttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t ModelDatasetOp::ram_budget() {
  auto attr = ram_budgetAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), 0).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

::mlir::ArrayAttr ModelDatasetOp::output_typesAttr() {
  return (*this)->getAttr(output_typesAttrName()).cast<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr ModelDatasetOp::output_types() {
  auto attr = output_typesAttr();
  return attr;
}

::mlir::ArrayAttr ModelDatasetOp::output_shapesAttr() {
  return (*this)->getAttr(output_shapesAttrName()).cast<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr ModelDatasetOp::output_shapes() {
  auto attr = output_shapesAttr();
  return attr;
}

void ModelDatasetOp::algorithmAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(algorithmAttrName(), attr);
}

void ModelDatasetOp::cpu_budgetAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(cpu_budgetAttrName(), attr);
}

void ModelDatasetOp::ram_budgetAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(ram_budgetAttrName(), attr);
}

void ModelDatasetOp::output_typesAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(output_typesAttrName(), attr);
}

void ModelDatasetOp::output_shapesAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(output_shapesAttrName(), attr);
}

void ModelDatasetOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type handle, ::mlir::Value input_dataset, ::mlir::IntegerAttr algorithm, ::mlir::IntegerAttr cpu_budget, ::mlir::IntegerAttr ram_budget, ::mlir::ArrayAttr output_types, ::mlir::ArrayAttr output_shapes) {
  odsState.addOperands(input_dataset);
  odsState.addAttribute(algorithmAttrName(odsState.name), algorithm);
  odsState.addAttribute(cpu_budgetAttrName(odsState.name), cpu_budget);
  odsState.addAttribute(ram_budgetAttrName(odsState.name), ram_budget);
  odsState.addAttribute(output_typesAttrName(odsState.name), output_types);
  odsState.addAttribute(output_shapesAttrName(odsState.name), output_shapes);
  odsState.addTypes(handle);
}

void ModelDatasetOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input_dataset, ::mlir::IntegerAttr algorithm, ::mlir::IntegerAttr cpu_budget, ::mlir::IntegerAttr ram_budget, ::mlir::ArrayAttr output_types, ::mlir::ArrayAttr output_shapes) {
  odsState.addOperands(input_dataset);
  odsState.addAttribute(algorithmAttrName(odsState.name), algorithm);
  odsState.addAttribute(cpu_budgetAttrName(odsState.name), cpu_budget);
  odsState.addAttribute(ram_budgetAttrName(odsState.name), ram_budget);
  odsState.addAttribute(output_typesAttrName(odsState.name), output_types);
  odsState.addAttribute(output_shapesAttrName(odsState.name), output_shapes);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void ModelDatasetOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type handle, ::mlir::Value input_dataset, uint64_t algorithm, uint64_t cpu_budget, uint64_t ram_budget, ::mlir::ArrayAttr output_types, ::mlir::ArrayAttr output_shapes) {
  odsState.addOperands(input_dataset);
  odsState.addAttribute(algorithmAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), algorithm));
  odsState.addAttribute(cpu_budgetAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), cpu_budget));
  odsState.addAttribute(ram_budgetAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), ram_budget));
  odsState.addAttribute(output_typesAttrName(odsState.name), output_types);
  odsState.addAttribute(output_shapesAttrName(odsState.name), output_shapes);
  odsState.addTypes(handle);
}

void ModelDatasetOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input_dataset, uint64_t algorithm, uint64_t cpu_budget, uint64_t ram_budget, ::mlir::ArrayAttr output_types, ::mlir::ArrayAttr output_shapes) {
  odsState.addOperands(input_dataset);
  odsState.addAttribute(algorithmAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), algorithm));
  odsState.addAttribute(cpu_budgetAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), cpu_budget));
  odsState.addAttribute(ram_budgetAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), ram_budget));
  odsState.addAttribute(output_typesAttrName(odsState.name), output_types);
  odsState.addAttribute(output_shapesAttrName(odsState.name), output_shapes);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void ModelDatasetOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult ModelDatasetOp::verify() {
  {
    auto tblgen_algorithm = (*this)->getAttr(algorithmAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_algorithm, "algorithm")))
      return ::mlir::failure();
  }
  {
    auto tblgen_cpu_budget = (*this)->getAttr(cpu_budgetAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_cpu_budget, "cpu_budget")))
      return ::mlir::failure();
  }
  {
    auto tblgen_ram_budget = (*this)->getAttr(ram_budgetAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_ram_budget, "ram_budget")))
      return ::mlir::failure();
  }
  {
    auto tblgen_output_types = (*this)->getAttr(output_typesAttrName());
    if (!tblgen_output_types)
      return emitOpError("requires attribute 'output_types'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops2(*this, tblgen_output_types, "output_types")))
      return ::mlir::failure();
  }
  {
    auto tblgen_output_shapes = (*this)->getAttr(output_shapesAttrName());
    if (!tblgen_output_shapes)
      return emitOpError("requires attribute 'output_shapes'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops3(*this, tblgen_output_shapes, "output_shapes")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops15(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops15(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void ModelDatasetOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::ModelDatasetOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::MulNoNanOp definitions
//===----------------------------------------------------------------------===//

MulNoNanOpAdaptor::MulNoNanOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

MulNoNanOpAdaptor::MulNoNanOpAdaptor(MulNoNanOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange MulNoNanOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> MulNoNanOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange MulNoNanOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value MulNoNanOpAdaptor::x() {
  return *getODSOperands(0).begin();
}

::mlir::Value MulNoNanOpAdaptor::y() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr MulNoNanOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult MulNoNanOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> MulNoNanOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range MulNoNanOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value MulNoNanOp::x() {
  return *getODSOperands(0).begin();
}

::mlir::Value MulNoNanOp::y() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange MulNoNanOp::xMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange MulNoNanOp::yMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> MulNoNanOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range MulNoNanOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value MulNoNanOp::z() {
  return *getODSResults(0).begin();
}

::mlir::Type MulNoNanOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool MulNoNanOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr MulNoNanOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void MulNoNanOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, Value x, Value y) {
  auto resultType =
      OpTrait::util::getBroadcastedType(x.getType(), y.getType());
  if (!resultType)
    mlir::emitError(odsState.location, "non-broadcastable operands");
  return build(odsBuilder, odsState, resultType, x, y);
}

void MulNoNanOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type z, ::mlir::Value x, ::mlir::Value y) {
  odsState.addOperands(x);
  odsState.addOperands(y);
  odsState.addTypes(z);
}

void MulNoNanOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value x, ::mlir::Value y) {
  odsState.addOperands(x);
  odsState.addOperands(y);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void MulNoNanOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult MulNoNanOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops2(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops2(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops2(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void MulNoNanOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::MulNoNanOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::MulOp definitions
//===----------------------------------------------------------------------===//

MulOpAdaptor::MulOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

MulOpAdaptor::MulOpAdaptor(MulOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange MulOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> MulOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange MulOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value MulOpAdaptor::x() {
  return *getODSOperands(0).begin();
}

::mlir::Value MulOpAdaptor::y() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr MulOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult MulOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> MulOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range MulOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value MulOp::x() {
  return *getODSOperands(0).begin();
}

::mlir::Value MulOp::y() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange MulOp::xMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange MulOp::yMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> MulOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range MulOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value MulOp::z() {
  return *getODSResults(0).begin();
}

::mlir::Type MulOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool MulOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr MulOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void MulOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, Value x, Value y) {
  auto resultType =
      OpTrait::util::getBroadcastedType(x.getType(), y.getType());
  if (!resultType)
    mlir::emitError(odsState.location, "non-broadcastable operands");
  return build(odsBuilder, odsState, resultType, x, y);
}

void MulOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type z, ::mlir::Value x, ::mlir::Value y) {
  odsState.addOperands(x);
  odsState.addOperands(y);
  odsState.addTypes(z);
}

void MulOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value x, ::mlir::Value y) {
  odsState.addOperands(x);
  odsState.addOperands(y);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void MulOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult MulOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops5(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops5(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops5(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void MulOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::MulOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::MultiDeviceIteratorFromStringHandleOp definitions
//===----------------------------------------------------------------------===//

MultiDeviceIteratorFromStringHandleOpAdaptor::MultiDeviceIteratorFromStringHandleOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

MultiDeviceIteratorFromStringHandleOpAdaptor::MultiDeviceIteratorFromStringHandleOpAdaptor(MultiDeviceIteratorFromStringHandleOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange MultiDeviceIteratorFromStringHandleOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> MultiDeviceIteratorFromStringHandleOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange MultiDeviceIteratorFromStringHandleOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value MultiDeviceIteratorFromStringHandleOpAdaptor::string_handle() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr MultiDeviceIteratorFromStringHandleOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::ArrayAttr MultiDeviceIteratorFromStringHandleOpAdaptor::output_types() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("output_types").dyn_cast_or_null<::mlir::ArrayAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getTypeArrayAttr({});
  return attr;
}

::mlir::ArrayAttr MultiDeviceIteratorFromStringHandleOpAdaptor::output_shapes() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("output_shapes").dyn_cast_or_null<::mlir::ArrayAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getArrayAttr({});
  return attr;
}

::mlir::LogicalResult MultiDeviceIteratorFromStringHandleOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_output_types = odsAttrs.get("output_types");
    if (tblgen_output_types && !(((tblgen_output_types.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_output_types.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return ((attr.isa<::mlir::TypeAttr>())) && ((attr.cast<::mlir::TypeAttr>().getValue().isa<::mlir::Type>())); }))))
      return emitError(loc, "'tf.MultiDeviceIteratorFromStringHandle' op ""attribute 'output_types' failed to satisfy constraint: type array attribute");
  }
  {
    auto tblgen_output_shapes = odsAttrs.get("output_shapes");
    if (tblgen_output_shapes && !(((tblgen_output_shapes.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_output_shapes.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return (attr.isa<mlir::TF::ShapeAttr>()); }))))
      return emitError(loc, "'tf.MultiDeviceIteratorFromStringHandle' op ""attribute 'output_shapes' failed to satisfy constraint: tensorflow shape attribute array");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> MultiDeviceIteratorFromStringHandleOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range MultiDeviceIteratorFromStringHandleOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value MultiDeviceIteratorFromStringHandleOp::string_handle() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange MultiDeviceIteratorFromStringHandleOp::string_handleMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> MultiDeviceIteratorFromStringHandleOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range MultiDeviceIteratorFromStringHandleOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value MultiDeviceIteratorFromStringHandleOp::multi_device_iterator() {
  return *getODSResults(0).begin();
}

::mlir::ArrayAttr MultiDeviceIteratorFromStringHandleOp::output_typesAttr() {
  return (*this)->getAttr(output_typesAttrName()).dyn_cast_or_null<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr MultiDeviceIteratorFromStringHandleOp::output_types() {
  auto attr = output_typesAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getTypeArrayAttr({});
  return attr;
}

::mlir::ArrayAttr MultiDeviceIteratorFromStringHandleOp::output_shapesAttr() {
  return (*this)->getAttr(output_shapesAttrName()).dyn_cast_or_null<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr MultiDeviceIteratorFromStringHandleOp::output_shapes() {
  auto attr = output_shapesAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getArrayAttr({});
  return attr;
}

void MultiDeviceIteratorFromStringHandleOp::output_typesAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(output_typesAttrName(), attr);
}

void MultiDeviceIteratorFromStringHandleOp::output_shapesAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(output_shapesAttrName(), attr);
}

void MultiDeviceIteratorFromStringHandleOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type multi_device_iterator, ::mlir::Value string_handle, ::mlir::ArrayAttr output_types, ::mlir::ArrayAttr output_shapes) {
  odsState.addOperands(string_handle);
  odsState.addAttribute(output_typesAttrName(odsState.name), output_types);
  odsState.addAttribute(output_shapesAttrName(odsState.name), output_shapes);
  odsState.addTypes(multi_device_iterator);
}

void MultiDeviceIteratorFromStringHandleOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value string_handle, ::mlir::ArrayAttr output_types, ::mlir::ArrayAttr output_shapes) {
  odsState.addOperands(string_handle);
  odsState.addAttribute(output_typesAttrName(odsState.name), output_types);
  odsState.addAttribute(output_shapesAttrName(odsState.name), output_shapes);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void MultiDeviceIteratorFromStringHandleOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult MultiDeviceIteratorFromStringHandleOp::verify() {
  {
    auto tblgen_output_types = (*this)->getAttr(output_typesAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops31(*this, tblgen_output_types, "output_types")))
      return ::mlir::failure();
  }
  {
    auto tblgen_output_shapes = (*this)->getAttr(output_shapesAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops28(*this, tblgen_output_shapes, "output_shapes")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops19(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void MultiDeviceIteratorFromStringHandleOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  for (::mlir::Value value : getODSResults(0))
    effects.emplace_back(::mlir::MemoryEffects::Allocate::get(), value, ::mlir::TF::ResourceEffects::DatasetIterator::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::MultiDeviceIteratorFromStringHandleOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::MultiDeviceIteratorGetNextFromShardOp definitions
//===----------------------------------------------------------------------===//

MultiDeviceIteratorGetNextFromShardOpAdaptor::MultiDeviceIteratorGetNextFromShardOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

MultiDeviceIteratorGetNextFromShardOpAdaptor::MultiDeviceIteratorGetNextFromShardOpAdaptor(MultiDeviceIteratorGetNextFromShardOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange MultiDeviceIteratorGetNextFromShardOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> MultiDeviceIteratorGetNextFromShardOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange MultiDeviceIteratorGetNextFromShardOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value MultiDeviceIteratorGetNextFromShardOpAdaptor::multi_device_iterator() {
  return *getODSOperands(0).begin();
}

::mlir::Value MultiDeviceIteratorGetNextFromShardOpAdaptor::shard_num() {
  return *getODSOperands(1).begin();
}

::mlir::Value MultiDeviceIteratorGetNextFromShardOpAdaptor::incarnation_id() {
  return *getODSOperands(2).begin();
}

::mlir::DictionaryAttr MultiDeviceIteratorGetNextFromShardOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult MultiDeviceIteratorGetNextFromShardOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> MultiDeviceIteratorGetNextFromShardOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range MultiDeviceIteratorGetNextFromShardOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value MultiDeviceIteratorGetNextFromShardOp::multi_device_iterator() {
  return *getODSOperands(0).begin();
}

::mlir::Value MultiDeviceIteratorGetNextFromShardOp::shard_num() {
  return *getODSOperands(1).begin();
}

::mlir::Value MultiDeviceIteratorGetNextFromShardOp::incarnation_id() {
  return *getODSOperands(2).begin();
}

::mlir::MutableOperandRange MultiDeviceIteratorGetNextFromShardOp::multi_device_iteratorMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange MultiDeviceIteratorGetNextFromShardOp::shard_numMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange MultiDeviceIteratorGetNextFromShardOp::incarnation_idMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> MultiDeviceIteratorGetNextFromShardOp::getODSResultIndexAndLength(unsigned index) {
  bool isVariadic[] = {true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (getOperation()->getNumResults() - 0) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::Operation::result_range MultiDeviceIteratorGetNextFromShardOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Operation::result_range MultiDeviceIteratorGetNextFromShardOp::components() {
  return getODSResults(0);
}

mlir::TF::ResultShapeRange MultiDeviceIteratorGetNextFromShardOp::output_shapes() {
  auto values = getODSResults(0);
return {mlir::TF::ResultShapeIterator(values.begin()), mlir::TF::ResultShapeIterator(values.end())};
}

mlir::ResultElementTypeRange MultiDeviceIteratorGetNextFromShardOp::output_types() {
  auto values = getODSResults(0);
return {mlir::ResultElementTypeIterator(values.begin()), mlir::ResultElementTypeIterator(values.end())};
}

bool MultiDeviceIteratorGetNextFromShardOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "output_shapes") return true;
  if (name == "output_types") return true;
 return false;
}

::mlir::DictionaryAttr MultiDeviceIteratorGetNextFromShardOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {output_shapesAttrName(),
ArrayAttr::get(ctx,
      [&](){
        llvm::SmallVector<Attribute, 4> ret;
        for (auto shape : output_shapes())
          ret.push_back(mlir::TF::ShapeAttr::get(ctx, shape));
        return ret;
      }())},
    {output_typesAttrName(),
ArrayAttr::get(ctx, 
    [&]() {
      llvm::SmallVector<Attribute, 4> ret;
      for (auto t : output_types())
        ret.push_back(TypeAttr::get(t));
      return ret;
    }())}});
}

void MultiDeviceIteratorGetNextFromShardOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange components, ::mlir::Value multi_device_iterator, ::mlir::Value shard_num, ::mlir::Value incarnation_id) {
  odsState.addOperands(multi_device_iterator);
  odsState.addOperands(shard_num);
  odsState.addOperands(incarnation_id);
  odsState.addTypes(components);
}

void MultiDeviceIteratorGetNextFromShardOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 3u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult MultiDeviceIteratorGetNextFromShardOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops11(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops16(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void MultiDeviceIteratorGetNextFromShardOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  for (::mlir::Value value : getODSOperands(0))
    effects.emplace_back(::mlir::MemoryEffects::Read::get(), value, ::mlir::TF::ResourceEffects::DatasetIterator::get());
  for (::mlir::Value value : getODSOperands(0))
    effects.emplace_back(::mlir::MemoryEffects::Write::get(), value, ::mlir::TF::ResourceEffects::DatasetIterator::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::MultiDeviceIteratorGetNextFromShardOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::MultiDeviceIteratorInitOp definitions
//===----------------------------------------------------------------------===//

MultiDeviceIteratorInitOpAdaptor::MultiDeviceIteratorInitOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

MultiDeviceIteratorInitOpAdaptor::MultiDeviceIteratorInitOpAdaptor(MultiDeviceIteratorInitOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange MultiDeviceIteratorInitOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> MultiDeviceIteratorInitOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange MultiDeviceIteratorInitOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value MultiDeviceIteratorInitOpAdaptor::dataset() {
  return *getODSOperands(0).begin();
}

::mlir::Value MultiDeviceIteratorInitOpAdaptor::multi_device_iterator() {
  return *getODSOperands(1).begin();
}

::mlir::Value MultiDeviceIteratorInitOpAdaptor::max_buffer_size() {
  return *getODSOperands(2).begin();
}

::mlir::DictionaryAttr MultiDeviceIteratorInitOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult MultiDeviceIteratorInitOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> MultiDeviceIteratorInitOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range MultiDeviceIteratorInitOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value MultiDeviceIteratorInitOp::dataset() {
  return *getODSOperands(0).begin();
}

::mlir::Value MultiDeviceIteratorInitOp::multi_device_iterator() {
  return *getODSOperands(1).begin();
}

::mlir::Value MultiDeviceIteratorInitOp::max_buffer_size() {
  return *getODSOperands(2).begin();
}

::mlir::MutableOperandRange MultiDeviceIteratorInitOp::datasetMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange MultiDeviceIteratorInitOp::multi_device_iteratorMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange MultiDeviceIteratorInitOp::max_buffer_sizeMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> MultiDeviceIteratorInitOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range MultiDeviceIteratorInitOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value MultiDeviceIteratorInitOp::incarnation_id() {
  return *getODSResults(0).begin();
}

void MultiDeviceIteratorInitOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type incarnation_id, ::mlir::Value dataset, ::mlir::Value multi_device_iterator, ::mlir::Value max_buffer_size) {
  odsState.addOperands(dataset);
  odsState.addOperands(multi_device_iterator);
  odsState.addOperands(max_buffer_size);
  odsState.addTypes(incarnation_id);
}

void MultiDeviceIteratorInitOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value dataset, ::mlir::Value multi_device_iterator, ::mlir::Value max_buffer_size) {
  odsState.addOperands(dataset);
  odsState.addOperands(multi_device_iterator);
  odsState.addOperands(max_buffer_size);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void MultiDeviceIteratorInitOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 3u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult MultiDeviceIteratorInitOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops15(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops16(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops16(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void MultiDeviceIteratorInitOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  for (::mlir::Value value : getODSOperands(1))
    effects.emplace_back(::mlir::MemoryEffects::Write::get(), value, ::mlir::TF::ResourceEffects::DatasetIterator::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::MultiDeviceIteratorInitOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::MultiDeviceIteratorOp definitions
//===----------------------------------------------------------------------===//

MultiDeviceIteratorOpAdaptor::MultiDeviceIteratorOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

MultiDeviceIteratorOpAdaptor::MultiDeviceIteratorOpAdaptor(MultiDeviceIteratorOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange MultiDeviceIteratorOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> MultiDeviceIteratorOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange MultiDeviceIteratorOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::DictionaryAttr MultiDeviceIteratorOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::ArrayAttr MultiDeviceIteratorOpAdaptor::devices() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("devices").cast<::mlir::ArrayAttr>();
  return attr;
}

::mlir::StringAttr MultiDeviceIteratorOpAdaptor::shared_name() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("shared_name").cast<::mlir::StringAttr>();
  return attr;
}

::mlir::StringAttr MultiDeviceIteratorOpAdaptor::container() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("container").cast<::mlir::StringAttr>();
  return attr;
}

::mlir::ArrayAttr MultiDeviceIteratorOpAdaptor::output_types() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("output_types").cast<::mlir::ArrayAttr>();
  return attr;
}

::mlir::ArrayAttr MultiDeviceIteratorOpAdaptor::output_shapes() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("output_shapes").cast<::mlir::ArrayAttr>();
  return attr;
}

::mlir::LogicalResult MultiDeviceIteratorOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_devices = odsAttrs.get("devices");
    if (!tblgen_devices)
      return emitError(loc, "'tf.MultiDeviceIterator' op ""requires attribute 'devices'");

    if (tblgen_devices && !((((tblgen_devices.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_devices.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return (attr.isa<::mlir::StringAttr>()); }))) && ((tblgen_devices.cast<::mlir::ArrayAttr>().size() >= 1))))
      return emitError(loc, "'tf.MultiDeviceIterator' op ""attribute 'devices' failed to satisfy constraint: string array attribute with at least 1 elements");
  }
  {
    auto tblgen_shared_name = odsAttrs.get("shared_name");
    if (!tblgen_shared_name)
      return emitError(loc, "'tf.MultiDeviceIterator' op ""requires attribute 'shared_name'");

    if (tblgen_shared_name && !((tblgen_shared_name.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.MultiDeviceIterator' op ""attribute 'shared_name' failed to satisfy constraint: string attribute");
  }
  {
    auto tblgen_container = odsAttrs.get("container");
    if (!tblgen_container)
      return emitError(loc, "'tf.MultiDeviceIterator' op ""requires attribute 'container'");

    if (tblgen_container && !((tblgen_container.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.MultiDeviceIterator' op ""attribute 'container' failed to satisfy constraint: string attribute");
  }
  {
    auto tblgen_output_types = odsAttrs.get("output_types");
    if (!tblgen_output_types)
      return emitError(loc, "'tf.MultiDeviceIterator' op ""requires attribute 'output_types'");

    if (tblgen_output_types && !((((tblgen_output_types.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_output_types.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return ((attr.isa<::mlir::TypeAttr>())) && ((attr.cast<::mlir::TypeAttr>().getValue().isa<::mlir::Type>())); }))) && ((tblgen_output_types.cast<::mlir::ArrayAttr>().size() >= 1))))
      return emitError(loc, "'tf.MultiDeviceIterator' op ""attribute 'output_types' failed to satisfy constraint: type array attribute with at least 1 elements");
  }
  {
    auto tblgen_output_shapes = odsAttrs.get("output_shapes");
    if (!tblgen_output_shapes)
      return emitError(loc, "'tf.MultiDeviceIterator' op ""requires attribute 'output_shapes'");

    if (tblgen_output_shapes && !((((tblgen_output_shapes.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_output_shapes.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return (attr.isa<mlir::TF::ShapeAttr>()); }))) && ((tblgen_output_shapes.cast<::mlir::ArrayAttr>().size() >= 1))))
      return emitError(loc, "'tf.MultiDeviceIterator' op ""attribute 'output_shapes' failed to satisfy constraint: tensorflow shape attribute array with at least 1 elements");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> MultiDeviceIteratorOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range MultiDeviceIteratorOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

std::pair<unsigned, unsigned> MultiDeviceIteratorOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range MultiDeviceIteratorOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value MultiDeviceIteratorOp::handle() {
  return *getODSResults(0).begin();
}

::mlir::ArrayAttr MultiDeviceIteratorOp::devicesAttr() {
  return (*this)->getAttr(devicesAttrName()).cast<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr MultiDeviceIteratorOp::devices() {
  auto attr = devicesAttr();
  return attr;
}

::mlir::StringAttr MultiDeviceIteratorOp::shared_nameAttr() {
  return (*this)->getAttr(shared_nameAttrName()).cast<::mlir::StringAttr>();
}

::llvm::StringRef MultiDeviceIteratorOp::shared_name() {
  auto attr = shared_nameAttr();
  return attr.getValue();
}

::mlir::StringAttr MultiDeviceIteratorOp::containerAttr() {
  return (*this)->getAttr(containerAttrName()).cast<::mlir::StringAttr>();
}

::llvm::StringRef MultiDeviceIteratorOp::container() {
  auto attr = containerAttr();
  return attr.getValue();
}

::mlir::ArrayAttr MultiDeviceIteratorOp::output_typesAttr() {
  return (*this)->getAttr(output_typesAttrName()).cast<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr MultiDeviceIteratorOp::output_types() {
  auto attr = output_typesAttr();
  return attr;
}

::mlir::ArrayAttr MultiDeviceIteratorOp::output_shapesAttr() {
  return (*this)->getAttr(output_shapesAttrName()).cast<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr MultiDeviceIteratorOp::output_shapes() {
  auto attr = output_shapesAttr();
  return attr;
}

void MultiDeviceIteratorOp::devicesAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(devicesAttrName(), attr);
}

void MultiDeviceIteratorOp::shared_nameAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(shared_nameAttrName(), attr);
}

void MultiDeviceIteratorOp::containerAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(containerAttrName(), attr);
}

void MultiDeviceIteratorOp::output_typesAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(output_typesAttrName(), attr);
}

void MultiDeviceIteratorOp::output_shapesAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(output_shapesAttrName(), attr);
}

void MultiDeviceIteratorOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type handle, ::mlir::ArrayAttr devices, ::mlir::StringAttr shared_name, ::mlir::StringAttr container, ::mlir::ArrayAttr output_types, ::mlir::ArrayAttr output_shapes) {
  odsState.addAttribute(devicesAttrName(odsState.name), devices);
  odsState.addAttribute(shared_nameAttrName(odsState.name), shared_name);
  odsState.addAttribute(containerAttrName(odsState.name), container);
  odsState.addAttribute(output_typesAttrName(odsState.name), output_types);
  odsState.addAttribute(output_shapesAttrName(odsState.name), output_shapes);
  odsState.addTypes(handle);
}

void MultiDeviceIteratorOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ArrayAttr devices, ::mlir::StringAttr shared_name, ::mlir::StringAttr container, ::mlir::ArrayAttr output_types, ::mlir::ArrayAttr output_shapes) {
  odsState.addAttribute(devicesAttrName(odsState.name), devices);
  odsState.addAttribute(shared_nameAttrName(odsState.name), shared_name);
  odsState.addAttribute(containerAttrName(odsState.name), container);
  odsState.addAttribute(output_typesAttrName(odsState.name), output_types);
  odsState.addAttribute(output_shapesAttrName(odsState.name), output_shapes);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void MultiDeviceIteratorOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type handle, ::mlir::ArrayAttr devices, ::llvm::StringRef shared_name, ::llvm::StringRef container, ::mlir::ArrayAttr output_types, ::mlir::ArrayAttr output_shapes) {
  odsState.addAttribute(devicesAttrName(odsState.name), devices);
  odsState.addAttribute(shared_nameAttrName(odsState.name), odsBuilder.getStringAttr(shared_name));
  odsState.addAttribute(containerAttrName(odsState.name), odsBuilder.getStringAttr(container));
  odsState.addAttribute(output_typesAttrName(odsState.name), output_types);
  odsState.addAttribute(output_shapesAttrName(odsState.name), output_shapes);
  odsState.addTypes(handle);
}

void MultiDeviceIteratorOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ArrayAttr devices, ::llvm::StringRef shared_name, ::llvm::StringRef container, ::mlir::ArrayAttr output_types, ::mlir::ArrayAttr output_shapes) {
  odsState.addAttribute(devicesAttrName(odsState.name), devices);
  odsState.addAttribute(shared_nameAttrName(odsState.name), odsBuilder.getStringAttr(shared_name));
  odsState.addAttribute(containerAttrName(odsState.name), odsBuilder.getStringAttr(container));
  odsState.addAttribute(output_typesAttrName(odsState.name), output_types);
  odsState.addAttribute(output_shapesAttrName(odsState.name), output_shapes);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void MultiDeviceIteratorOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 0u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult MultiDeviceIteratorOp::verify() {
  {
    auto tblgen_devices = (*this)->getAttr(devicesAttrName());
    if (!tblgen_devices)
      return emitOpError("requires attribute 'devices'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops4(*this, tblgen_devices, "devices")))
      return ::mlir::failure();
  }
  {
    auto tblgen_shared_name = (*this)->getAttr(shared_nameAttrName());
    if (!tblgen_shared_name)
      return emitOpError("requires attribute 'shared_name'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_shared_name, "shared_name")))
      return ::mlir::failure();
  }
  {
    auto tblgen_container = (*this)->getAttr(containerAttrName());
    if (!tblgen_container)
      return emitOpError("requires attribute 'container'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_container, "container")))
      return ::mlir::failure();
  }
  {
    auto tblgen_output_types = (*this)->getAttr(output_typesAttrName());
    if (!tblgen_output_types)
      return emitOpError("requires attribute 'output_types'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops2(*this, tblgen_output_types, "output_types")))
      return ::mlir::failure();
  }
  {
    auto tblgen_output_shapes = (*this)->getAttr(output_shapesAttrName());
    if (!tblgen_output_shapes)
      return emitOpError("requires attribute 'output_shapes'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops3(*this, tblgen_output_shapes, "output_shapes")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void MultiDeviceIteratorOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  for (::mlir::Value value : getODSResults(0))
    effects.emplace_back(::mlir::MemoryEffects::Allocate::get(), value, ::mlir::TF::ResourceEffects::DatasetIterator::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::MultiDeviceIteratorOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::MultiDeviceIteratorToStringHandleOp definitions
//===----------------------------------------------------------------------===//

MultiDeviceIteratorToStringHandleOpAdaptor::MultiDeviceIteratorToStringHandleOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

MultiDeviceIteratorToStringHandleOpAdaptor::MultiDeviceIteratorToStringHandleOpAdaptor(MultiDeviceIteratorToStringHandleOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange MultiDeviceIteratorToStringHandleOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> MultiDeviceIteratorToStringHandleOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange MultiDeviceIteratorToStringHandleOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value MultiDeviceIteratorToStringHandleOpAdaptor::multi_device_iterator() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr MultiDeviceIteratorToStringHandleOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult MultiDeviceIteratorToStringHandleOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> MultiDeviceIteratorToStringHandleOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range MultiDeviceIteratorToStringHandleOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value MultiDeviceIteratorToStringHandleOp::multi_device_iterator() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange MultiDeviceIteratorToStringHandleOp::multi_device_iteratorMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> MultiDeviceIteratorToStringHandleOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range MultiDeviceIteratorToStringHandleOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value MultiDeviceIteratorToStringHandleOp::string_handle() {
  return *getODSResults(0).begin();
}

void MultiDeviceIteratorToStringHandleOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type string_handle, ::mlir::Value multi_device_iterator) {
  odsState.addOperands(multi_device_iterator);
  odsState.addTypes(string_handle);
}

void MultiDeviceIteratorToStringHandleOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value multi_device_iterator) {
  odsState.addOperands(multi_device_iterator);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void MultiDeviceIteratorToStringHandleOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult MultiDeviceIteratorToStringHandleOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops19(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void MultiDeviceIteratorToStringHandleOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  for (::mlir::Value value : getODSOperands(0))
    effects.emplace_back(::mlir::MemoryEffects::Read::get(), value, ::mlir::TF::ResourceEffects::DatasetIterator::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::MultiDeviceIteratorToStringHandleOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::MultinomialOp definitions
//===----------------------------------------------------------------------===//

MultinomialOpAdaptor::MultinomialOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

MultinomialOpAdaptor::MultinomialOpAdaptor(MultinomialOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange MultinomialOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> MultinomialOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange MultinomialOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value MultinomialOpAdaptor::logits() {
  return *getODSOperands(0).begin();
}

::mlir::Value MultinomialOpAdaptor::num_samples() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr MultinomialOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::IntegerAttr MultinomialOpAdaptor::seed() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("seed").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), 0);
  return attr;
}

::mlir::IntegerAttr MultinomialOpAdaptor::seed2() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("seed2").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), 0);
  return attr;
}

::mlir::LogicalResult MultinomialOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_seed = odsAttrs.get("seed");
    if (tblgen_seed && !(((tblgen_seed.isa<::mlir::IntegerAttr>())) && ((tblgen_seed.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.Multinomial' op ""attribute 'seed' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_seed2 = odsAttrs.get("seed2");
    if (tblgen_seed2 && !(((tblgen_seed2.isa<::mlir::IntegerAttr>())) && ((tblgen_seed2.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.Multinomial' op ""attribute 'seed2' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> MultinomialOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range MultinomialOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value MultinomialOp::logits() {
  return *getODSOperands(0).begin();
}

::mlir::Value MultinomialOp::num_samples() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange MultinomialOp::logitsMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange MultinomialOp::num_samplesMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> MultinomialOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range MultinomialOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value MultinomialOp::output() {
  return *getODSResults(0).begin();
}

::mlir::IntegerAttr MultinomialOp::seedAttr() {
  return (*this)->getAttr(seedAttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t MultinomialOp::seed() {
  auto attr = seedAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), 0).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

::mlir::IntegerAttr MultinomialOp::seed2Attr() {
  return (*this)->getAttr(seed2AttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t MultinomialOp::seed2() {
  auto attr = seed2Attr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), 0).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

::mlir::Type MultinomialOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

::mlir::Type MultinomialOp::output_dtype() {
  return mlir::getElementTypeOrSelf(*getODSResults(0).begin());
}

bool MultinomialOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
  if (name == "output_dtype") return true;
 return false;
}

::mlir::DictionaryAttr MultinomialOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())},
    {output_dtypeAttrName(),
::mlir::TypeAttr::get(output_dtype())}});
}

void MultinomialOp::seedAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(seedAttrName(), attr);
}

void MultinomialOp::seed2Attr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(seed2AttrName(), attr);
}

void MultinomialOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value logits, ::mlir::Value num_samples, ::mlir::IntegerAttr seed, ::mlir::IntegerAttr seed2) {
  odsState.addOperands(logits);
  odsState.addOperands(num_samples);
  odsState.addAttribute(seedAttrName(odsState.name), seed);
  odsState.addAttribute(seed2AttrName(odsState.name), seed2);
  odsState.addTypes(output);
}

void MultinomialOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value logits, ::mlir::Value num_samples, ::mlir::IntegerAttr seed, ::mlir::IntegerAttr seed2) {
  odsState.addOperands(logits);
  odsState.addOperands(num_samples);
  odsState.addAttribute(seedAttrName(odsState.name), seed);
  odsState.addAttribute(seed2AttrName(odsState.name), seed2);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void MultinomialOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value logits, ::mlir::Value num_samples, uint64_t seed, uint64_t seed2) {
  odsState.addOperands(logits);
  odsState.addOperands(num_samples);
  odsState.addAttribute(seedAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), seed));
  odsState.addAttribute(seed2AttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), seed2));
  odsState.addTypes(output);
}

void MultinomialOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value logits, ::mlir::Value num_samples, uint64_t seed, uint64_t seed2) {
  odsState.addOperands(logits);
  odsState.addOperands(num_samples);
  odsState.addAttribute(seedAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), seed));
  odsState.addAttribute(seed2AttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), seed2));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void MultinomialOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult MultinomialOp::verify() {
  {
    auto tblgen_seed = (*this)->getAttr(seedAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_seed, "seed")))
      return ::mlir::failure();
  }
  {
    auto tblgen_seed2 = (*this)->getAttr(seed2AttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_seed2, "seed2")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops35(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops11(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::MultinomialOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::MutableDenseHashTableV2Op definitions
//===----------------------------------------------------------------------===//

MutableDenseHashTableV2OpAdaptor::MutableDenseHashTableV2OpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

MutableDenseHashTableV2OpAdaptor::MutableDenseHashTableV2OpAdaptor(MutableDenseHashTableV2Op &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange MutableDenseHashTableV2OpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> MutableDenseHashTableV2OpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange MutableDenseHashTableV2OpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value MutableDenseHashTableV2OpAdaptor::empty_key() {
  return *getODSOperands(0).begin();
}

::mlir::Value MutableDenseHashTableV2OpAdaptor::deleted_key() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr MutableDenseHashTableV2OpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::StringAttr MutableDenseHashTableV2OpAdaptor::container() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("container").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("");
  return attr;
}

::mlir::StringAttr MutableDenseHashTableV2OpAdaptor::shared_name() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("shared_name").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("");
  return attr;
}

::mlir::BoolAttr MutableDenseHashTableV2OpAdaptor::use_node_name_sharing() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("use_node_name_sharing").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(false);
  return attr;
}

::mlir::TypeAttr MutableDenseHashTableV2OpAdaptor::value_dtype() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::TypeAttr attr = odsAttrs.get("value_dtype").cast<::mlir::TypeAttr>();
  return attr;
}

::mlir::Attribute MutableDenseHashTableV2OpAdaptor::value_shape() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::Attribute attr = odsAttrs.get("value_shape").dyn_cast_or_null<::mlir::Attribute>();
  if (!attr)
    attr = mlir::TF::ShapeAttr::get(::mlir::Builder(odsAttrs.getContext()).getContext(), llvm::ArrayRef<int64_t>({}));
  return attr;
}

::mlir::IntegerAttr MutableDenseHashTableV2OpAdaptor::initial_num_buckets() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("initial_num_buckets").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), 131072);
  return attr;
}

::mlir::FloatAttr MutableDenseHashTableV2OpAdaptor::max_load_factor() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::FloatAttr attr = odsAttrs.get("max_load_factor").dyn_cast_or_null<::mlir::FloatAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getFloatAttr(::mlir::Builder(odsAttrs.getContext()).getF32Type(), 0.8f);
  return attr;
}

::mlir::LogicalResult MutableDenseHashTableV2OpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_container = odsAttrs.get("container");
    if (tblgen_container && !((tblgen_container.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.MutableDenseHashTableV2' op ""attribute 'container' failed to satisfy constraint: string attribute");
  }
  {
    auto tblgen_shared_name = odsAttrs.get("shared_name");
    if (tblgen_shared_name && !((tblgen_shared_name.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.MutableDenseHashTableV2' op ""attribute 'shared_name' failed to satisfy constraint: string attribute");
  }
  {
    auto tblgen_use_node_name_sharing = odsAttrs.get("use_node_name_sharing");
    if (tblgen_use_node_name_sharing && !((tblgen_use_node_name_sharing.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.MutableDenseHashTableV2' op ""attribute 'use_node_name_sharing' failed to satisfy constraint: bool attribute");
  }
  {
    auto tblgen_value_dtype = odsAttrs.get("value_dtype");
    if (!tblgen_value_dtype)
      return emitError(loc, "'tf.MutableDenseHashTableV2' op ""requires attribute 'value_dtype'");

    if (tblgen_value_dtype && !(((tblgen_value_dtype.isa<::mlir::TypeAttr>())) && ((tblgen_value_dtype.cast<::mlir::TypeAttr>().getValue().isa<::mlir::Type>()))))
      return emitError(loc, "'tf.MutableDenseHashTableV2' op ""attribute 'value_dtype' failed to satisfy constraint: any type attribute");
  }
  {
    auto tblgen_value_shape = odsAttrs.get("value_shape");
    if (tblgen_value_shape && !((tblgen_value_shape.isa<mlir::TF::ShapeAttr>())))
      return emitError(loc, "'tf.MutableDenseHashTableV2' op ""attribute 'value_shape' failed to satisfy constraint: TensorFlow shape attribute");
  }
  {
    auto tblgen_initial_num_buckets = odsAttrs.get("initial_num_buckets");
    if (tblgen_initial_num_buckets && !(((tblgen_initial_num_buckets.isa<::mlir::IntegerAttr>())) && ((tblgen_initial_num_buckets.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.MutableDenseHashTableV2' op ""attribute 'initial_num_buckets' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_max_load_factor = odsAttrs.get("max_load_factor");
    if (tblgen_max_load_factor && !(((tblgen_max_load_factor.isa<::mlir::FloatAttr>())) && ((tblgen_max_load_factor.cast<::mlir::FloatAttr>().getType().isF32()))))
      return emitError(loc, "'tf.MutableDenseHashTableV2' op ""attribute 'max_load_factor' failed to satisfy constraint: 32-bit float attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> MutableDenseHashTableV2Op::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range MutableDenseHashTableV2Op::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value MutableDenseHashTableV2Op::empty_key() {
  return *getODSOperands(0).begin();
}

::mlir::Value MutableDenseHashTableV2Op::deleted_key() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange MutableDenseHashTableV2Op::empty_keyMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange MutableDenseHashTableV2Op::deleted_keyMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> MutableDenseHashTableV2Op::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range MutableDenseHashTableV2Op::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value MutableDenseHashTableV2Op::table_handle() {
  return *getODSResults(0).begin();
}

::mlir::StringAttr MutableDenseHashTableV2Op::containerAttr() {
  return (*this)->getAttr(containerAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef MutableDenseHashTableV2Op::container() {
  auto attr = containerAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("").getValue();
  return attr.getValue();
}

::mlir::StringAttr MutableDenseHashTableV2Op::shared_nameAttr() {
  return (*this)->getAttr(shared_nameAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef MutableDenseHashTableV2Op::shared_name() {
  auto attr = shared_nameAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("").getValue();
  return attr.getValue();
}

::mlir::BoolAttr MutableDenseHashTableV2Op::use_node_name_sharingAttr() {
  return (*this)->getAttr(use_node_name_sharingAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool MutableDenseHashTableV2Op::use_node_name_sharing() {
  auto attr = use_node_name_sharingAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(false).getValue();
  return attr.getValue();
}

::mlir::TypeAttr MutableDenseHashTableV2Op::value_dtypeAttr() {
  return (*this)->getAttr(value_dtypeAttrName()).cast<::mlir::TypeAttr>();
}

::mlir::Type MutableDenseHashTableV2Op::value_dtype() {
  auto attr = value_dtypeAttr();
  return attr.getValue().cast<::mlir::Type>();
}

::mlir::Attribute MutableDenseHashTableV2Op::value_shapeAttr() {
  return (*this)->getAttr(value_shapeAttrName()).dyn_cast_or_null<::mlir::Attribute>();
}

llvm::Optional<llvm::ArrayRef<int64_t>> MutableDenseHashTableV2Op::value_shape() {
  auto attr = value_shapeAttr();
    if (!attr)
      return mlir::TF::ShapeAttr::get(::mlir::Builder((*this)->getContext()).getContext(), llvm::ArrayRef<int64_t>({})).cast<mlir::TF::ShapeAttr>().getValue();
  return attr.cast<mlir::TF::ShapeAttr>().getValue();
}

::mlir::IntegerAttr MutableDenseHashTableV2Op::initial_num_bucketsAttr() {
  return (*this)->getAttr(initial_num_bucketsAttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t MutableDenseHashTableV2Op::initial_num_buckets() {
  auto attr = initial_num_bucketsAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), 131072).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

::mlir::FloatAttr MutableDenseHashTableV2Op::max_load_factorAttr() {
  return (*this)->getAttr(max_load_factorAttrName()).dyn_cast_or_null<::mlir::FloatAttr>();
}

::llvm::APFloat MutableDenseHashTableV2Op::max_load_factor() {
  auto attr = max_load_factorAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getFloatAttr(::mlir::Builder((*this)->getContext()).getF32Type(), 0.8f).getValue();
  return attr.getValue();
}

::mlir::Type MutableDenseHashTableV2Op::key_dtype() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool MutableDenseHashTableV2Op::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "key_dtype") return true;
 return false;
}

::mlir::DictionaryAttr MutableDenseHashTableV2Op::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {key_dtypeAttrName(),
::mlir::TypeAttr::get(key_dtype())}});
}

void MutableDenseHashTableV2Op::containerAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(containerAttrName(), attr);
}

void MutableDenseHashTableV2Op::shared_nameAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(shared_nameAttrName(), attr);
}

void MutableDenseHashTableV2Op::use_node_name_sharingAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(use_node_name_sharingAttrName(), attr);
}

void MutableDenseHashTableV2Op::value_dtypeAttr(::mlir::TypeAttr attr) {
  (*this)->setAttr(value_dtypeAttrName(), attr);
}

void MutableDenseHashTableV2Op::value_shapeAttr(::mlir::Attribute attr) {
  (*this)->setAttr(value_shapeAttrName(), attr);
}

void MutableDenseHashTableV2Op::initial_num_bucketsAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(initial_num_bucketsAttrName(), attr);
}

void MutableDenseHashTableV2Op::max_load_factorAttr(::mlir::FloatAttr attr) {
  (*this)->setAttr(max_load_factorAttrName(), attr);
}

void MutableDenseHashTableV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type table_handle, ::mlir::Value empty_key, ::mlir::Value deleted_key, ::mlir::StringAttr container, ::mlir::StringAttr shared_name, ::mlir::BoolAttr use_node_name_sharing, ::mlir::TypeAttr value_dtype, ::mlir::Attribute value_shape, ::mlir::IntegerAttr initial_num_buckets, ::mlir::FloatAttr max_load_factor) {
  odsState.addOperands(empty_key);
  odsState.addOperands(deleted_key);
  odsState.addAttribute(containerAttrName(odsState.name), container);
  odsState.addAttribute(shared_nameAttrName(odsState.name), shared_name);
  odsState.addAttribute(use_node_name_sharingAttrName(odsState.name), use_node_name_sharing);
  odsState.addAttribute(value_dtypeAttrName(odsState.name), value_dtype);
  odsState.addAttribute(value_shapeAttrName(odsState.name), value_shape);
  odsState.addAttribute(initial_num_bucketsAttrName(odsState.name), initial_num_buckets);
  odsState.addAttribute(max_load_factorAttrName(odsState.name), max_load_factor);
  odsState.addTypes(table_handle);
}

void MutableDenseHashTableV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value empty_key, ::mlir::Value deleted_key, ::mlir::StringAttr container, ::mlir::StringAttr shared_name, ::mlir::BoolAttr use_node_name_sharing, ::mlir::TypeAttr value_dtype, ::mlir::Attribute value_shape, ::mlir::IntegerAttr initial_num_buckets, ::mlir::FloatAttr max_load_factor) {
  odsState.addOperands(empty_key);
  odsState.addOperands(deleted_key);
  odsState.addAttribute(containerAttrName(odsState.name), container);
  odsState.addAttribute(shared_nameAttrName(odsState.name), shared_name);
  odsState.addAttribute(use_node_name_sharingAttrName(odsState.name), use_node_name_sharing);
  odsState.addAttribute(value_dtypeAttrName(odsState.name), value_dtype);
  odsState.addAttribute(value_shapeAttrName(odsState.name), value_shape);
  odsState.addAttribute(initial_num_bucketsAttrName(odsState.name), initial_num_buckets);
  odsState.addAttribute(max_load_factorAttrName(odsState.name), max_load_factor);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void MutableDenseHashTableV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type table_handle, ::mlir::Value empty_key, ::mlir::Value deleted_key, ::llvm::StringRef container, ::llvm::StringRef shared_name, bool use_node_name_sharing, ::mlir::Type value_dtype, llvm::Optional<llvm::ArrayRef<int64_t>> value_shape, uint64_t initial_num_buckets, ::llvm::APFloat max_load_factor) {
  odsState.addOperands(empty_key);
  odsState.addOperands(deleted_key);
  odsState.addAttribute(containerAttrName(odsState.name), odsBuilder.getStringAttr(container));
  odsState.addAttribute(shared_nameAttrName(odsState.name), odsBuilder.getStringAttr(shared_name));
  odsState.addAttribute(use_node_name_sharingAttrName(odsState.name), odsBuilder.getBoolAttr(use_node_name_sharing));
  odsState.addAttribute(value_dtypeAttrName(odsState.name), ::mlir::TypeAttr::get(value_dtype));
  odsState.addAttribute(value_shapeAttrName(odsState.name), mlir::TF::ShapeAttr::get(odsBuilder.getContext(), value_shape));
  odsState.addAttribute(initial_num_bucketsAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), initial_num_buckets));
  odsState.addAttribute(max_load_factorAttrName(odsState.name), odsBuilder.getFloatAttr(odsBuilder.getF32Type(), max_load_factor));
  odsState.addTypes(table_handle);
}

void MutableDenseHashTableV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value empty_key, ::mlir::Value deleted_key, ::llvm::StringRef container, ::llvm::StringRef shared_name, bool use_node_name_sharing, ::mlir::Type value_dtype, llvm::Optional<llvm::ArrayRef<int64_t>> value_shape, uint64_t initial_num_buckets, ::llvm::APFloat max_load_factor) {
  odsState.addOperands(empty_key);
  odsState.addOperands(deleted_key);
  odsState.addAttribute(containerAttrName(odsState.name), odsBuilder.getStringAttr(container));
  odsState.addAttribute(shared_nameAttrName(odsState.name), odsBuilder.getStringAttr(shared_name));
  odsState.addAttribute(use_node_name_sharingAttrName(odsState.name), odsBuilder.getBoolAttr(use_node_name_sharing));
  odsState.addAttribute(value_dtypeAttrName(odsState.name), ::mlir::TypeAttr::get(value_dtype));
  odsState.addAttribute(value_shapeAttrName(odsState.name), mlir::TF::ShapeAttr::get(odsBuilder.getContext(), value_shape));
  odsState.addAttribute(initial_num_bucketsAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), initial_num_buckets));
  odsState.addAttribute(max_load_factorAttrName(odsState.name), odsBuilder.getFloatAttr(odsBuilder.getF32Type(), max_load_factor));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void MutableDenseHashTableV2Op::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult MutableDenseHashTableV2Op::verify() {
  {
    auto tblgen_container = (*this)->getAttr(containerAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_container, "container")))
      return ::mlir::failure();
  }
  {
    auto tblgen_shared_name = (*this)->getAttr(shared_nameAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_shared_name, "shared_name")))
      return ::mlir::failure();
  }
  {
    auto tblgen_use_node_name_sharing = (*this)->getAttr(use_node_name_sharingAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_use_node_name_sharing, "use_node_name_sharing")))
      return ::mlir::failure();
  }
  {
    auto tblgen_value_dtype = (*this)->getAttr(value_dtypeAttrName());
    if (!tblgen_value_dtype)
      return emitOpError("requires attribute 'value_dtype'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops26(*this, tblgen_value_dtype, "value_dtype")))
      return ::mlir::failure();
  }
  {
    auto tblgen_value_shape = (*this)->getAttr(value_shapeAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops17(*this, tblgen_value_shape, "value_shape")))
      return ::mlir::failure();
  }
  {
    auto tblgen_initial_num_buckets = (*this)->getAttr(initial_num_bucketsAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_initial_num_buckets, "initial_num_buckets")))
      return ::mlir::failure();
  }
  {
    auto tblgen_max_load_factor = (*this)->getAttr(max_load_factorAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops5(*this, tblgen_max_load_factor, "max_load_factor")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void MutableDenseHashTableV2Op::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  for (::mlir::Value value : getODSResults(0))
    effects.emplace_back(::mlir::MemoryEffects::Allocate::get(), value, ::mlir::TF::ResourceEffects::LookupTable::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::MutableDenseHashTableV2Op)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::MutableHashTableOfTensorsV2Op definitions
//===----------------------------------------------------------------------===//

MutableHashTableOfTensorsV2OpAdaptor::MutableHashTableOfTensorsV2OpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

MutableHashTableOfTensorsV2OpAdaptor::MutableHashTableOfTensorsV2OpAdaptor(MutableHashTableOfTensorsV2Op &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange MutableHashTableOfTensorsV2OpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> MutableHashTableOfTensorsV2OpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange MutableHashTableOfTensorsV2OpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::DictionaryAttr MutableHashTableOfTensorsV2OpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::StringAttr MutableHashTableOfTensorsV2OpAdaptor::container() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("container").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("");
  return attr;
}

::mlir::StringAttr MutableHashTableOfTensorsV2OpAdaptor::shared_name() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("shared_name").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("");
  return attr;
}

::mlir::BoolAttr MutableHashTableOfTensorsV2OpAdaptor::use_node_name_sharing() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("use_node_name_sharing").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(false);
  return attr;
}

::mlir::TypeAttr MutableHashTableOfTensorsV2OpAdaptor::key_dtype() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::TypeAttr attr = odsAttrs.get("key_dtype").cast<::mlir::TypeAttr>();
  return attr;
}

::mlir::TypeAttr MutableHashTableOfTensorsV2OpAdaptor::value_dtype() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::TypeAttr attr = odsAttrs.get("value_dtype").cast<::mlir::TypeAttr>();
  return attr;
}

::mlir::Attribute MutableHashTableOfTensorsV2OpAdaptor::value_shape() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::Attribute attr = odsAttrs.get("value_shape").dyn_cast_or_null<::mlir::Attribute>();
  if (!attr)
    attr = mlir::TF::ShapeAttr::get(::mlir::Builder(odsAttrs.getContext()).getContext(), llvm::ArrayRef<int64_t>({}));
  return attr;
}

::mlir::LogicalResult MutableHashTableOfTensorsV2OpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_container = odsAttrs.get("container");
    if (tblgen_container && !((tblgen_container.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.MutableHashTableOfTensorsV2' op ""attribute 'container' failed to satisfy constraint: string attribute");
  }
  {
    auto tblgen_shared_name = odsAttrs.get("shared_name");
    if (tblgen_shared_name && !((tblgen_shared_name.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.MutableHashTableOfTensorsV2' op ""attribute 'shared_name' failed to satisfy constraint: string attribute");
  }
  {
    auto tblgen_use_node_name_sharing = odsAttrs.get("use_node_name_sharing");
    if (tblgen_use_node_name_sharing && !((tblgen_use_node_name_sharing.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.MutableHashTableOfTensorsV2' op ""attribute 'use_node_name_sharing' failed to satisfy constraint: bool attribute");
  }
  {
    auto tblgen_key_dtype = odsAttrs.get("key_dtype");
    if (!tblgen_key_dtype)
      return emitError(loc, "'tf.MutableHashTableOfTensorsV2' op ""requires attribute 'key_dtype'");

    if (tblgen_key_dtype && !(((tblgen_key_dtype.isa<::mlir::TypeAttr>())) && ((tblgen_key_dtype.cast<::mlir::TypeAttr>().getValue().isa<::mlir::Type>()))))
      return emitError(loc, "'tf.MutableHashTableOfTensorsV2' op ""attribute 'key_dtype' failed to satisfy constraint: any type attribute");
  }
  {
    auto tblgen_value_dtype = odsAttrs.get("value_dtype");
    if (!tblgen_value_dtype)
      return emitError(loc, "'tf.MutableHashTableOfTensorsV2' op ""requires attribute 'value_dtype'");

    if (tblgen_value_dtype && !(((tblgen_value_dtype.isa<::mlir::TypeAttr>())) && ((tblgen_value_dtype.cast<::mlir::TypeAttr>().getValue().isa<::mlir::Type>()))))
      return emitError(loc, "'tf.MutableHashTableOfTensorsV2' op ""attribute 'value_dtype' failed to satisfy constraint: any type attribute");
  }
  {
    auto tblgen_value_shape = odsAttrs.get("value_shape");
    if (tblgen_value_shape && !((tblgen_value_shape.isa<mlir::TF::ShapeAttr>())))
      return emitError(loc, "'tf.MutableHashTableOfTensorsV2' op ""attribute 'value_shape' failed to satisfy constraint: TensorFlow shape attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> MutableHashTableOfTensorsV2Op::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range MutableHashTableOfTensorsV2Op::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

std::pair<unsigned, unsigned> MutableHashTableOfTensorsV2Op::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range MutableHashTableOfTensorsV2Op::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value MutableHashTableOfTensorsV2Op::table_handle() {
  return *getODSResults(0).begin();
}

::mlir::StringAttr MutableHashTableOfTensorsV2Op::containerAttr() {
  return (*this)->getAttr(containerAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef MutableHashTableOfTensorsV2Op::container() {
  auto attr = containerAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("").getValue();
  return attr.getValue();
}

::mlir::StringAttr MutableHashTableOfTensorsV2Op::shared_nameAttr() {
  return (*this)->getAttr(shared_nameAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef MutableHashTableOfTensorsV2Op::shared_name() {
  auto attr = shared_nameAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("").getValue();
  return attr.getValue();
}

::mlir::BoolAttr MutableHashTableOfTensorsV2Op::use_node_name_sharingAttr() {
  return (*this)->getAttr(use_node_name_sharingAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool MutableHashTableOfTensorsV2Op::use_node_name_sharing() {
  auto attr = use_node_name_sharingAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(false).getValue();
  return attr.getValue();
}

::mlir::TypeAttr MutableHashTableOfTensorsV2Op::key_dtypeAttr() {
  return (*this)->getAttr(key_dtypeAttrName()).cast<::mlir::TypeAttr>();
}

::mlir::Type MutableHashTableOfTensorsV2Op::key_dtype() {
  auto attr = key_dtypeAttr();
  return attr.getValue().cast<::mlir::Type>();
}

::mlir::TypeAttr MutableHashTableOfTensorsV2Op::value_dtypeAttr() {
  return (*this)->getAttr(value_dtypeAttrName()).cast<::mlir::TypeAttr>();
}

::mlir::Type MutableHashTableOfTensorsV2Op::value_dtype() {
  auto attr = value_dtypeAttr();
  return attr.getValue().cast<::mlir::Type>();
}

::mlir::Attribute MutableHashTableOfTensorsV2Op::value_shapeAttr() {
  return (*this)->getAttr(value_shapeAttrName()).dyn_cast_or_null<::mlir::Attribute>();
}

llvm::Optional<llvm::ArrayRef<int64_t>> MutableHashTableOfTensorsV2Op::value_shape() {
  auto attr = value_shapeAttr();
    if (!attr)
      return mlir::TF::ShapeAttr::get(::mlir::Builder((*this)->getContext()).getContext(), llvm::ArrayRef<int64_t>({})).cast<mlir::TF::ShapeAttr>().getValue();
  return attr.cast<mlir::TF::ShapeAttr>().getValue();
}

void MutableHashTableOfTensorsV2Op::containerAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(containerAttrName(), attr);
}

void MutableHashTableOfTensorsV2Op::shared_nameAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(shared_nameAttrName(), attr);
}

void MutableHashTableOfTensorsV2Op::use_node_name_sharingAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(use_node_name_sharingAttrName(), attr);
}

void MutableHashTableOfTensorsV2Op::key_dtypeAttr(::mlir::TypeAttr attr) {
  (*this)->setAttr(key_dtypeAttrName(), attr);
}

void MutableHashTableOfTensorsV2Op::value_dtypeAttr(::mlir::TypeAttr attr) {
  (*this)->setAttr(value_dtypeAttrName(), attr);
}

void MutableHashTableOfTensorsV2Op::value_shapeAttr(::mlir::Attribute attr) {
  (*this)->setAttr(value_shapeAttrName(), attr);
}

void MutableHashTableOfTensorsV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type table_handle, ::mlir::StringAttr container, ::mlir::StringAttr shared_name, ::mlir::BoolAttr use_node_name_sharing, ::mlir::TypeAttr key_dtype, ::mlir::TypeAttr value_dtype, ::mlir::Attribute value_shape) {
  odsState.addAttribute(containerAttrName(odsState.name), container);
  odsState.addAttribute(shared_nameAttrName(odsState.name), shared_name);
  odsState.addAttribute(use_node_name_sharingAttrName(odsState.name), use_node_name_sharing);
  odsState.addAttribute(key_dtypeAttrName(odsState.name), key_dtype);
  odsState.addAttribute(value_dtypeAttrName(odsState.name), value_dtype);
  odsState.addAttribute(value_shapeAttrName(odsState.name), value_shape);
  odsState.addTypes(table_handle);
}

void MutableHashTableOfTensorsV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::StringAttr container, ::mlir::StringAttr shared_name, ::mlir::BoolAttr use_node_name_sharing, ::mlir::TypeAttr key_dtype, ::mlir::TypeAttr value_dtype, ::mlir::Attribute value_shape) {
  odsState.addAttribute(containerAttrName(odsState.name), container);
  odsState.addAttribute(shared_nameAttrName(odsState.name), shared_name);
  odsState.addAttribute(use_node_name_sharingAttrName(odsState.name), use_node_name_sharing);
  odsState.addAttribute(key_dtypeAttrName(odsState.name), key_dtype);
  odsState.addAttribute(value_dtypeAttrName(odsState.name), value_dtype);
  odsState.addAttribute(value_shapeAttrName(odsState.name), value_shape);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void MutableHashTableOfTensorsV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type table_handle, ::llvm::StringRef container, ::llvm::StringRef shared_name, bool use_node_name_sharing, ::mlir::Type key_dtype, ::mlir::Type value_dtype, llvm::Optional<llvm::ArrayRef<int64_t>> value_shape) {
  odsState.addAttribute(containerAttrName(odsState.name), odsBuilder.getStringAttr(container));
  odsState.addAttribute(shared_nameAttrName(odsState.name), odsBuilder.getStringAttr(shared_name));
  odsState.addAttribute(use_node_name_sharingAttrName(odsState.name), odsBuilder.getBoolAttr(use_node_name_sharing));
  odsState.addAttribute(key_dtypeAttrName(odsState.name), ::mlir::TypeAttr::get(key_dtype));
  odsState.addAttribute(value_dtypeAttrName(odsState.name), ::mlir::TypeAttr::get(value_dtype));
  odsState.addAttribute(value_shapeAttrName(odsState.name), mlir::TF::ShapeAttr::get(odsBuilder.getContext(), value_shape));
  odsState.addTypes(table_handle);
}

void MutableHashTableOfTensorsV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::llvm::StringRef container, ::llvm::StringRef shared_name, bool use_node_name_sharing, ::mlir::Type key_dtype, ::mlir::Type value_dtype, llvm::Optional<llvm::ArrayRef<int64_t>> value_shape) {
  odsState.addAttribute(containerAttrName(odsState.name), odsBuilder.getStringAttr(container));
  odsState.addAttribute(shared_nameAttrName(odsState.name), odsBuilder.getStringAttr(shared_name));
  odsState.addAttribute(use_node_name_sharingAttrName(odsState.name), odsBuilder.getBoolAttr(use_node_name_sharing));
  odsState.addAttribute(key_dtypeAttrName(odsState.name), ::mlir::TypeAttr::get(key_dtype));
  odsState.addAttribute(value_dtypeAttrName(odsState.name), ::mlir::TypeAttr::get(value_dtype));
  odsState.addAttribute(value_shapeAttrName(odsState.name), mlir::TF::ShapeAttr::get(odsBuilder.getContext(), value_shape));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void MutableHashTableOfTensorsV2Op::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 0u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult MutableHashTableOfTensorsV2Op::verify() {
  {
    auto tblgen_container = (*this)->getAttr(containerAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_container, "container")))
      return ::mlir::failure();
  }
  {
    auto tblgen_shared_name = (*this)->getAttr(shared_nameAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_shared_name, "shared_name")))
      return ::mlir::failure();
  }
  {
    auto tblgen_use_node_name_sharing = (*this)->getAttr(use_node_name_sharingAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_use_node_name_sharing, "use_node_name_sharing")))
      return ::mlir::failure();
  }
  {
    auto tblgen_key_dtype = (*this)->getAttr(key_dtypeAttrName());
    if (!tblgen_key_dtype)
      return emitOpError("requires attribute 'key_dtype'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops26(*this, tblgen_key_dtype, "key_dtype")))
      return ::mlir::failure();
  }
  {
    auto tblgen_value_dtype = (*this)->getAttr(value_dtypeAttrName());
    if (!tblgen_value_dtype)
      return emitOpError("requires attribute 'value_dtype'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops26(*this, tblgen_value_dtype, "value_dtype")))
      return ::mlir::failure();
  }
  {
    auto tblgen_value_shape = (*this)->getAttr(value_shapeAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops17(*this, tblgen_value_shape, "value_shape")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void MutableHashTableOfTensorsV2Op::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  for (::mlir::Value value : getODSResults(0))
    effects.emplace_back(::mlir::MemoryEffects::Allocate::get(), value, ::mlir::TF::ResourceEffects::LookupTable::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::MutableHashTableOfTensorsV2Op)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::MutableHashTableV2Op definitions
//===----------------------------------------------------------------------===//

MutableHashTableV2OpAdaptor::MutableHashTableV2OpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

MutableHashTableV2OpAdaptor::MutableHashTableV2OpAdaptor(MutableHashTableV2Op &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange MutableHashTableV2OpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> MutableHashTableV2OpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange MutableHashTableV2OpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::DictionaryAttr MutableHashTableV2OpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::StringAttr MutableHashTableV2OpAdaptor::container() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("container").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("");
  return attr;
}

::mlir::StringAttr MutableHashTableV2OpAdaptor::shared_name() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("shared_name").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("");
  return attr;
}

::mlir::BoolAttr MutableHashTableV2OpAdaptor::use_node_name_sharing() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("use_node_name_sharing").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(false);
  return attr;
}

::mlir::TypeAttr MutableHashTableV2OpAdaptor::key_dtype() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::TypeAttr attr = odsAttrs.get("key_dtype").cast<::mlir::TypeAttr>();
  return attr;
}

::mlir::TypeAttr MutableHashTableV2OpAdaptor::value_dtype() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::TypeAttr attr = odsAttrs.get("value_dtype").cast<::mlir::TypeAttr>();
  return attr;
}

::mlir::LogicalResult MutableHashTableV2OpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_container = odsAttrs.get("container");
    if (tblgen_container && !((tblgen_container.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.MutableHashTableV2' op ""attribute 'container' failed to satisfy constraint: string attribute");
  }
  {
    auto tblgen_shared_name = odsAttrs.get("shared_name");
    if (tblgen_shared_name && !((tblgen_shared_name.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.MutableHashTableV2' op ""attribute 'shared_name' failed to satisfy constraint: string attribute");
  }
  {
    auto tblgen_use_node_name_sharing = odsAttrs.get("use_node_name_sharing");
    if (tblgen_use_node_name_sharing && !((tblgen_use_node_name_sharing.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.MutableHashTableV2' op ""attribute 'use_node_name_sharing' failed to satisfy constraint: bool attribute");
  }
  {
    auto tblgen_key_dtype = odsAttrs.get("key_dtype");
    if (!tblgen_key_dtype)
      return emitError(loc, "'tf.MutableHashTableV2' op ""requires attribute 'key_dtype'");

    if (tblgen_key_dtype && !(((tblgen_key_dtype.isa<::mlir::TypeAttr>())) && ((tblgen_key_dtype.cast<::mlir::TypeAttr>().getValue().isa<::mlir::Type>()))))
      return emitError(loc, "'tf.MutableHashTableV2' op ""attribute 'key_dtype' failed to satisfy constraint: any type attribute");
  }
  {
    auto tblgen_value_dtype = odsAttrs.get("value_dtype");
    if (!tblgen_value_dtype)
      return emitError(loc, "'tf.MutableHashTableV2' op ""requires attribute 'value_dtype'");

    if (tblgen_value_dtype && !(((tblgen_value_dtype.isa<::mlir::TypeAttr>())) && ((tblgen_value_dtype.cast<::mlir::TypeAttr>().getValue().isa<::mlir::Type>()))))
      return emitError(loc, "'tf.MutableHashTableV2' op ""attribute 'value_dtype' failed to satisfy constraint: any type attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> MutableHashTableV2Op::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range MutableHashTableV2Op::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

std::pair<unsigned, unsigned> MutableHashTableV2Op::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range MutableHashTableV2Op::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value MutableHashTableV2Op::table_handle() {
  return *getODSResults(0).begin();
}

::mlir::StringAttr MutableHashTableV2Op::containerAttr() {
  return (*this)->getAttr(containerAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef MutableHashTableV2Op::container() {
  auto attr = containerAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("").getValue();
  return attr.getValue();
}

::mlir::StringAttr MutableHashTableV2Op::shared_nameAttr() {
  return (*this)->getAttr(shared_nameAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef MutableHashTableV2Op::shared_name() {
  auto attr = shared_nameAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("").getValue();
  return attr.getValue();
}

::mlir::BoolAttr MutableHashTableV2Op::use_node_name_sharingAttr() {
  return (*this)->getAttr(use_node_name_sharingAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool MutableHashTableV2Op::use_node_name_sharing() {
  auto attr = use_node_name_sharingAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(false).getValue();
  return attr.getValue();
}

::mlir::TypeAttr MutableHashTableV2Op::key_dtypeAttr() {
  return (*this)->getAttr(key_dtypeAttrName()).cast<::mlir::TypeAttr>();
}

::mlir::Type MutableHashTableV2Op::key_dtype() {
  auto attr = key_dtypeAttr();
  return attr.getValue().cast<::mlir::Type>();
}

::mlir::TypeAttr MutableHashTableV2Op::value_dtypeAttr() {
  return (*this)->getAttr(value_dtypeAttrName()).cast<::mlir::TypeAttr>();
}

::mlir::Type MutableHashTableV2Op::value_dtype() {
  auto attr = value_dtypeAttr();
  return attr.getValue().cast<::mlir::Type>();
}

void MutableHashTableV2Op::containerAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(containerAttrName(), attr);
}

void MutableHashTableV2Op::shared_nameAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(shared_nameAttrName(), attr);
}

void MutableHashTableV2Op::use_node_name_sharingAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(use_node_name_sharingAttrName(), attr);
}

void MutableHashTableV2Op::key_dtypeAttr(::mlir::TypeAttr attr) {
  (*this)->setAttr(key_dtypeAttrName(), attr);
}

void MutableHashTableV2Op::value_dtypeAttr(::mlir::TypeAttr attr) {
  (*this)->setAttr(value_dtypeAttrName(), attr);
}

void MutableHashTableV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type table_handle, ::mlir::StringAttr container, ::mlir::StringAttr shared_name, ::mlir::BoolAttr use_node_name_sharing, ::mlir::TypeAttr key_dtype, ::mlir::TypeAttr value_dtype) {
  odsState.addAttribute(containerAttrName(odsState.name), container);
  odsState.addAttribute(shared_nameAttrName(odsState.name), shared_name);
  odsState.addAttribute(use_node_name_sharingAttrName(odsState.name), use_node_name_sharing);
  odsState.addAttribute(key_dtypeAttrName(odsState.name), key_dtype);
  odsState.addAttribute(value_dtypeAttrName(odsState.name), value_dtype);
  odsState.addTypes(table_handle);
}

void MutableHashTableV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::StringAttr container, ::mlir::StringAttr shared_name, ::mlir::BoolAttr use_node_name_sharing, ::mlir::TypeAttr key_dtype, ::mlir::TypeAttr value_dtype) {
  odsState.addAttribute(containerAttrName(odsState.name), container);
  odsState.addAttribute(shared_nameAttrName(odsState.name), shared_name);
  odsState.addAttribute(use_node_name_sharingAttrName(odsState.name), use_node_name_sharing);
  odsState.addAttribute(key_dtypeAttrName(odsState.name), key_dtype);
  odsState.addAttribute(value_dtypeAttrName(odsState.name), value_dtype);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void MutableHashTableV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type table_handle, ::llvm::StringRef container, ::llvm::StringRef shared_name, bool use_node_name_sharing, ::mlir::Type key_dtype, ::mlir::Type value_dtype) {
  odsState.addAttribute(containerAttrName(odsState.name), odsBuilder.getStringAttr(container));
  odsState.addAttribute(shared_nameAttrName(odsState.name), odsBuilder.getStringAttr(shared_name));
  odsState.addAttribute(use_node_name_sharingAttrName(odsState.name), odsBuilder.getBoolAttr(use_node_name_sharing));
  odsState.addAttribute(key_dtypeAttrName(odsState.name), ::mlir::TypeAttr::get(key_dtype));
  odsState.addAttribute(value_dtypeAttrName(odsState.name), ::mlir::TypeAttr::get(value_dtype));
  odsState.addTypes(table_handle);
}

void MutableHashTableV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::llvm::StringRef container, ::llvm::StringRef shared_name, bool use_node_name_sharing, ::mlir::Type key_dtype, ::mlir::Type value_dtype) {
  odsState.addAttribute(containerAttrName(odsState.name), odsBuilder.getStringAttr(container));
  odsState.addAttribute(shared_nameAttrName(odsState.name), odsBuilder.getStringAttr(shared_name));
  odsState.addAttribute(use_node_name_sharingAttrName(odsState.name), odsBuilder.getBoolAttr(use_node_name_sharing));
  odsState.addAttribute(key_dtypeAttrName(odsState.name), ::mlir::TypeAttr::get(key_dtype));
  odsState.addAttribute(value_dtypeAttrName(odsState.name), ::mlir::TypeAttr::get(value_dtype));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void MutableHashTableV2Op::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 0u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult MutableHashTableV2Op::verify() {
  {
    auto tblgen_container = (*this)->getAttr(containerAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_container, "container")))
      return ::mlir::failure();
  }
  {
    auto tblgen_shared_name = (*this)->getAttr(shared_nameAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_shared_name, "shared_name")))
      return ::mlir::failure();
  }
  {
    auto tblgen_use_node_name_sharing = (*this)->getAttr(use_node_name_sharingAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_use_node_name_sharing, "use_node_name_sharing")))
      return ::mlir::failure();
  }
  {
    auto tblgen_key_dtype = (*this)->getAttr(key_dtypeAttrName());
    if (!tblgen_key_dtype)
      return emitOpError("requires attribute 'key_dtype'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops26(*this, tblgen_key_dtype, "key_dtype")))
      return ::mlir::failure();
  }
  {
    auto tblgen_value_dtype = (*this)->getAttr(value_dtypeAttrName());
    if (!tblgen_value_dtype)
      return emitOpError("requires attribute 'value_dtype'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops26(*this, tblgen_value_dtype, "value_dtype")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void MutableHashTableV2Op::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  for (::mlir::Value value : getODSResults(0))
    effects.emplace_back(::mlir::MemoryEffects::Allocate::get(), value, ::mlir::TF::ResourceEffects::LookupTable::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::MutableHashTableV2Op)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::NdtriOp definitions
//===----------------------------------------------------------------------===//

NdtriOpAdaptor::NdtriOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

NdtriOpAdaptor::NdtriOpAdaptor(NdtriOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange NdtriOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> NdtriOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange NdtriOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value NdtriOpAdaptor::x() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr NdtriOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult NdtriOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> NdtriOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range NdtriOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value NdtriOp::x() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange NdtriOp::xMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> NdtriOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range NdtriOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value NdtriOp::y() {
  return *getODSResults(0).begin();
}

::mlir::Type NdtriOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool NdtriOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr NdtriOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void NdtriOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type y, ::mlir::Value x) {
  odsState.addOperands(x);
  odsState.addTypes(y);
}

void NdtriOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value x) {
  odsState.addOperands(x);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void NdtriOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult NdtriOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void NdtriOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::NdtriOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::NegOp definitions
//===----------------------------------------------------------------------===//

NegOpAdaptor::NegOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

NegOpAdaptor::NegOpAdaptor(NegOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange NegOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> NegOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange NegOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value NegOpAdaptor::x() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr NegOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult NegOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> NegOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range NegOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value NegOp::x() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange NegOp::xMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> NegOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range NegOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value NegOp::y() {
  return *getODSResults(0).begin();
}

::mlir::Type NegOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool NegOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr NegOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void NegOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type y, ::mlir::Value x) {
  odsState.addOperands(x);
  odsState.addTypes(y);
}

void NegOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value x) {
  odsState.addOperands(x);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void NegOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

void NegOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value x) {
  odsState.addOperands(x);
  odsState.addTypes({x.getType()});

}

void NegOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  odsState.addTypes({operands[0].getType()});

}

::mlir::LogicalResult NegOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops1(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops1(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void NegOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::NegOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::NextAfterOp definitions
//===----------------------------------------------------------------------===//

NextAfterOpAdaptor::NextAfterOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

NextAfterOpAdaptor::NextAfterOpAdaptor(NextAfterOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange NextAfterOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> NextAfterOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange NextAfterOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value NextAfterOpAdaptor::x1() {
  return *getODSOperands(0).begin();
}

::mlir::Value NextAfterOpAdaptor::x2() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr NextAfterOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult NextAfterOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> NextAfterOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range NextAfterOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value NextAfterOp::x1() {
  return *getODSOperands(0).begin();
}

::mlir::Value NextAfterOp::x2() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange NextAfterOp::x1Mutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange NextAfterOp::x2Mutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> NextAfterOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range NextAfterOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value NextAfterOp::output() {
  return *getODSResults(0).begin();
}

::mlir::Type NextAfterOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool NextAfterOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr NextAfterOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void NextAfterOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, Value x, Value y) {
  auto resultType =
      OpTrait::util::getBroadcastedType(x.getType(), y.getType());
  if (!resultType)
    mlir::emitError(odsState.location, "non-broadcastable operands");
  return build(odsBuilder, odsState, resultType, x, y);
}

void NextAfterOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value x1, ::mlir::Value x2) {
  odsState.addOperands(x1);
  odsState.addOperands(x2);
  odsState.addTypes(output);
}

void NextAfterOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value x1, ::mlir::Value x2) {
  odsState.addOperands(x1);
  odsState.addOperands(x2);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void NextAfterOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult NextAfterOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops13(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops13(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops13(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void NextAfterOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::NextAfterOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::NoOp definitions
//===----------------------------------------------------------------------===//

NoOpAdaptor::NoOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

NoOpAdaptor::NoOpAdaptor(NoOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange NoOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> NoOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange NoOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::DictionaryAttr NoOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult NoOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> NoOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range NoOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

std::pair<unsigned, unsigned> NoOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range NoOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

void NoOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState) {
}

void NoOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes) {
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void NoOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 0u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 0u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult NoOp::verify() {
  return ::mlir::success();
}

void NoOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::NoOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::NonMaxSuppressionV3Op definitions
//===----------------------------------------------------------------------===//

NonMaxSuppressionV3OpAdaptor::NonMaxSuppressionV3OpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

NonMaxSuppressionV3OpAdaptor::NonMaxSuppressionV3OpAdaptor(NonMaxSuppressionV3Op &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange NonMaxSuppressionV3OpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> NonMaxSuppressionV3OpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange NonMaxSuppressionV3OpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value NonMaxSuppressionV3OpAdaptor::boxes() {
  return *getODSOperands(0).begin();
}

::mlir::Value NonMaxSuppressionV3OpAdaptor::scores() {
  return *getODSOperands(1).begin();
}

::mlir::Value NonMaxSuppressionV3OpAdaptor::max_output_size() {
  return *getODSOperands(2).begin();
}

::mlir::Value NonMaxSuppressionV3OpAdaptor::iou_threshold() {
  return *getODSOperands(3).begin();
}

::mlir::Value NonMaxSuppressionV3OpAdaptor::score_threshold() {
  return *getODSOperands(4).begin();
}

::mlir::DictionaryAttr NonMaxSuppressionV3OpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult NonMaxSuppressionV3OpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> NonMaxSuppressionV3Op::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range NonMaxSuppressionV3Op::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value NonMaxSuppressionV3Op::boxes() {
  return *getODSOperands(0).begin();
}

::mlir::Value NonMaxSuppressionV3Op::scores() {
  return *getODSOperands(1).begin();
}

::mlir::Value NonMaxSuppressionV3Op::max_output_size() {
  return *getODSOperands(2).begin();
}

::mlir::Value NonMaxSuppressionV3Op::iou_threshold() {
  return *getODSOperands(3).begin();
}

::mlir::Value NonMaxSuppressionV3Op::score_threshold() {
  return *getODSOperands(4).begin();
}

::mlir::MutableOperandRange NonMaxSuppressionV3Op::boxesMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange NonMaxSuppressionV3Op::scoresMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange NonMaxSuppressionV3Op::max_output_sizeMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange NonMaxSuppressionV3Op::iou_thresholdMutable() {
  auto range = getODSOperandIndexAndLength(3);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange NonMaxSuppressionV3Op::score_thresholdMutable() {
  auto range = getODSOperandIndexAndLength(4);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> NonMaxSuppressionV3Op::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range NonMaxSuppressionV3Op::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value NonMaxSuppressionV3Op::selected_indices() {
  return *getODSResults(0).begin();
}

::mlir::Type NonMaxSuppressionV3Op::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

::mlir::Type NonMaxSuppressionV3Op::T_threshold() {
  return mlir::getElementTypeOrSelf(*getODSOperands(3).begin());
}

bool NonMaxSuppressionV3Op::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
  if (name == "T_threshold") return true;
 return false;
}

::mlir::DictionaryAttr NonMaxSuppressionV3Op::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())},
    {T_thresholdAttrName(),
::mlir::TypeAttr::get(T_threshold())}});
}

void NonMaxSuppressionV3Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type selected_indices, ::mlir::Value boxes, ::mlir::Value scores, ::mlir::Value max_output_size, ::mlir::Value iou_threshold, ::mlir::Value score_threshold) {
  odsState.addOperands(boxes);
  odsState.addOperands(scores);
  odsState.addOperands(max_output_size);
  odsState.addOperands(iou_threshold);
  odsState.addOperands(score_threshold);
  odsState.addTypes(selected_indices);
}

void NonMaxSuppressionV3Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value boxes, ::mlir::Value scores, ::mlir::Value max_output_size, ::mlir::Value iou_threshold, ::mlir::Value score_threshold) {
  odsState.addOperands(boxes);
  odsState.addOperands(scores);
  odsState.addOperands(max_output_size);
  odsState.addOperands(iou_threshold);
  odsState.addOperands(score_threshold);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void NonMaxSuppressionV3Op::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 5u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult NonMaxSuppressionV3Op::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops6(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops6(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops11(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup3 = getODSOperands(3);

    for (auto v : valueGroup3) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops6(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup4 = getODSOperands(4);

    for (auto v : valueGroup4) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops6(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops11(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void NonMaxSuppressionV3Op::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::NonMaxSuppressionV3Op)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::NonMaxSuppressionV4Op definitions
//===----------------------------------------------------------------------===//

NonMaxSuppressionV4OpAdaptor::NonMaxSuppressionV4OpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

NonMaxSuppressionV4OpAdaptor::NonMaxSuppressionV4OpAdaptor(NonMaxSuppressionV4Op &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange NonMaxSuppressionV4OpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> NonMaxSuppressionV4OpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange NonMaxSuppressionV4OpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value NonMaxSuppressionV4OpAdaptor::boxes() {
  return *getODSOperands(0).begin();
}

::mlir::Value NonMaxSuppressionV4OpAdaptor::scores() {
  return *getODSOperands(1).begin();
}

::mlir::Value NonMaxSuppressionV4OpAdaptor::max_output_size() {
  return *getODSOperands(2).begin();
}

::mlir::Value NonMaxSuppressionV4OpAdaptor::iou_threshold() {
  return *getODSOperands(3).begin();
}

::mlir::Value NonMaxSuppressionV4OpAdaptor::score_threshold() {
  return *getODSOperands(4).begin();
}

::mlir::DictionaryAttr NonMaxSuppressionV4OpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::BoolAttr NonMaxSuppressionV4OpAdaptor::pad_to_max_output_size() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("pad_to_max_output_size").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(false);
  return attr;
}

::mlir::LogicalResult NonMaxSuppressionV4OpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_pad_to_max_output_size = odsAttrs.get("pad_to_max_output_size");
    if (tblgen_pad_to_max_output_size && !((tblgen_pad_to_max_output_size.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.NonMaxSuppressionV4' op ""attribute 'pad_to_max_output_size' failed to satisfy constraint: bool attribute");
  }
  return ::mlir::success();
}

void NonMaxSuppressionV4Op::getAsmResultNames(::mlir::OpAsmSetValueNameFn setNameFn) {
  auto resultGroup0 = getODSResults(0);
  if (!llvm::empty(resultGroup0))
    setNameFn(*resultGroup0.begin(), "selected_indices");
  auto resultGroup1 = getODSResults(1);
  if (!llvm::empty(resultGroup1))
    setNameFn(*resultGroup1.begin(), "valid_outputs");
}

std::pair<unsigned, unsigned> NonMaxSuppressionV4Op::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range NonMaxSuppressionV4Op::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value NonMaxSuppressionV4Op::boxes() {
  return *getODSOperands(0).begin();
}

::mlir::Value NonMaxSuppressionV4Op::scores() {
  return *getODSOperands(1).begin();
}

::mlir::Value NonMaxSuppressionV4Op::max_output_size() {
  return *getODSOperands(2).begin();
}

::mlir::Value NonMaxSuppressionV4Op::iou_threshold() {
  return *getODSOperands(3).begin();
}

::mlir::Value NonMaxSuppressionV4Op::score_threshold() {
  return *getODSOperands(4).begin();
}

::mlir::MutableOperandRange NonMaxSuppressionV4Op::boxesMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange NonMaxSuppressionV4Op::scoresMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange NonMaxSuppressionV4Op::max_output_sizeMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange NonMaxSuppressionV4Op::iou_thresholdMutable() {
  auto range = getODSOperandIndexAndLength(3);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange NonMaxSuppressionV4Op::score_thresholdMutable() {
  auto range = getODSOperandIndexAndLength(4);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> NonMaxSuppressionV4Op::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range NonMaxSuppressionV4Op::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value NonMaxSuppressionV4Op::selected_indices() {
  return *getODSResults(0).begin();
}

::mlir::Value NonMaxSuppressionV4Op::valid_outputs() {
  return *getODSResults(1).begin();
}

::mlir::BoolAttr NonMaxSuppressionV4Op::pad_to_max_output_sizeAttr() {
  return (*this)->getAttr(pad_to_max_output_sizeAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool NonMaxSuppressionV4Op::pad_to_max_output_size() {
  auto attr = pad_to_max_output_sizeAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(false).getValue();
  return attr.getValue();
}

::mlir::Type NonMaxSuppressionV4Op::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

::mlir::Type NonMaxSuppressionV4Op::T_threshold() {
  return mlir::getElementTypeOrSelf(*getODSOperands(3).begin());
}

bool NonMaxSuppressionV4Op::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
  if (name == "T_threshold") return true;
 return false;
}

::mlir::DictionaryAttr NonMaxSuppressionV4Op::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())},
    {T_thresholdAttrName(),
::mlir::TypeAttr::get(T_threshold())}});
}

void NonMaxSuppressionV4Op::pad_to_max_output_sizeAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(pad_to_max_output_sizeAttrName(), attr);
}

void NonMaxSuppressionV4Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type selected_indices, ::mlir::Type valid_outputs, ::mlir::Value boxes, ::mlir::Value scores, ::mlir::Value max_output_size, ::mlir::Value iou_threshold, ::mlir::Value score_threshold, ::mlir::BoolAttr pad_to_max_output_size) {
  odsState.addOperands(boxes);
  odsState.addOperands(scores);
  odsState.addOperands(max_output_size);
  odsState.addOperands(iou_threshold);
  odsState.addOperands(score_threshold);
  odsState.addAttribute(pad_to_max_output_sizeAttrName(odsState.name), pad_to_max_output_size);
  odsState.addTypes(selected_indices);
  odsState.addTypes(valid_outputs);
}

void NonMaxSuppressionV4Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value boxes, ::mlir::Value scores, ::mlir::Value max_output_size, ::mlir::Value iou_threshold, ::mlir::Value score_threshold, ::mlir::BoolAttr pad_to_max_output_size) {
  odsState.addOperands(boxes);
  odsState.addOperands(scores);
  odsState.addOperands(max_output_size);
  odsState.addOperands(iou_threshold);
  odsState.addOperands(score_threshold);
  odsState.addAttribute(pad_to_max_output_sizeAttrName(odsState.name), pad_to_max_output_size);
  assert(resultTypes.size() == 2u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void NonMaxSuppressionV4Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type selected_indices, ::mlir::Type valid_outputs, ::mlir::Value boxes, ::mlir::Value scores, ::mlir::Value max_output_size, ::mlir::Value iou_threshold, ::mlir::Value score_threshold, bool pad_to_max_output_size) {
  odsState.addOperands(boxes);
  odsState.addOperands(scores);
  odsState.addOperands(max_output_size);
  odsState.addOperands(iou_threshold);
  odsState.addOperands(score_threshold);
  odsState.addAttribute(pad_to_max_output_sizeAttrName(odsState.name), odsBuilder.getBoolAttr(pad_to_max_output_size));
  odsState.addTypes(selected_indices);
  odsState.addTypes(valid_outputs);
}

void NonMaxSuppressionV4Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value boxes, ::mlir::Value scores, ::mlir::Value max_output_size, ::mlir::Value iou_threshold, ::mlir::Value score_threshold, bool pad_to_max_output_size) {
  odsState.addOperands(boxes);
  odsState.addOperands(scores);
  odsState.addOperands(max_output_size);
  odsState.addOperands(iou_threshold);
  odsState.addOperands(score_threshold);
  odsState.addAttribute(pad_to_max_output_sizeAttrName(odsState.name), odsBuilder.getBoolAttr(pad_to_max_output_size));
  assert(resultTypes.size() == 2u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void NonMaxSuppressionV4Op::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 5u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 2u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult NonMaxSuppressionV4Op::verify() {
  {
    auto tblgen_pad_to_max_output_size = (*this)->getAttr(pad_to_max_output_sizeAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_pad_to_max_output_size, "pad_to_max_output_size")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops6(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops6(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops11(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup3 = getODSOperands(3);

    for (auto v : valueGroup3) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops6(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup4 = getODSOperands(4);

    for (auto v : valueGroup4) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops6(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops11(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSResults(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops11(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void NonMaxSuppressionV4Op::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::NonMaxSuppressionV4Op)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::NonMaxSuppressionV5Op definitions
//===----------------------------------------------------------------------===//

NonMaxSuppressionV5OpAdaptor::NonMaxSuppressionV5OpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

NonMaxSuppressionV5OpAdaptor::NonMaxSuppressionV5OpAdaptor(NonMaxSuppressionV5Op &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange NonMaxSuppressionV5OpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> NonMaxSuppressionV5OpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange NonMaxSuppressionV5OpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value NonMaxSuppressionV5OpAdaptor::boxes() {
  return *getODSOperands(0).begin();
}

::mlir::Value NonMaxSuppressionV5OpAdaptor::scores() {
  return *getODSOperands(1).begin();
}

::mlir::Value NonMaxSuppressionV5OpAdaptor::max_output_size() {
  return *getODSOperands(2).begin();
}

::mlir::Value NonMaxSuppressionV5OpAdaptor::iou_threshold() {
  return *getODSOperands(3).begin();
}

::mlir::Value NonMaxSuppressionV5OpAdaptor::score_threshold() {
  return *getODSOperands(4).begin();
}

::mlir::Value NonMaxSuppressionV5OpAdaptor::soft_nms_sigma() {
  return *getODSOperands(5).begin();
}

::mlir::DictionaryAttr NonMaxSuppressionV5OpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::BoolAttr NonMaxSuppressionV5OpAdaptor::pad_to_max_output_size() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("pad_to_max_output_size").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(false);
  return attr;
}

::mlir::LogicalResult NonMaxSuppressionV5OpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_pad_to_max_output_size = odsAttrs.get("pad_to_max_output_size");
    if (tblgen_pad_to_max_output_size && !((tblgen_pad_to_max_output_size.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.NonMaxSuppressionV5' op ""attribute 'pad_to_max_output_size' failed to satisfy constraint: bool attribute");
  }
  return ::mlir::success();
}

void NonMaxSuppressionV5Op::getAsmResultNames(::mlir::OpAsmSetValueNameFn setNameFn) {
  auto resultGroup0 = getODSResults(0);
  if (!llvm::empty(resultGroup0))
    setNameFn(*resultGroup0.begin(), "selected_indices");
  auto resultGroup1 = getODSResults(1);
  if (!llvm::empty(resultGroup1))
    setNameFn(*resultGroup1.begin(), "selected_scores");
  auto resultGroup2 = getODSResults(2);
  if (!llvm::empty(resultGroup2))
    setNameFn(*resultGroup2.begin(), "valid_outputs");
}

std::pair<unsigned, unsigned> NonMaxSuppressionV5Op::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range NonMaxSuppressionV5Op::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value NonMaxSuppressionV5Op::boxes() {
  return *getODSOperands(0).begin();
}

::mlir::Value NonMaxSuppressionV5Op::scores() {
  return *getODSOperands(1).begin();
}

::mlir::Value NonMaxSuppressionV5Op::max_output_size() {
  return *getODSOperands(2).begin();
}

::mlir::Value NonMaxSuppressionV5Op::iou_threshold() {
  return *getODSOperands(3).begin();
}

::mlir::Value NonMaxSuppressionV5Op::score_threshold() {
  return *getODSOperands(4).begin();
}

::mlir::Value NonMaxSuppressionV5Op::soft_nms_sigma() {
  return *getODSOperands(5).begin();
}

::mlir::MutableOperandRange NonMaxSuppressionV5Op::boxesMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange NonMaxSuppressionV5Op::scoresMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange NonMaxSuppressionV5Op::max_output_sizeMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange NonMaxSuppressionV5Op::iou_thresholdMutable() {
  auto range = getODSOperandIndexAndLength(3);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange NonMaxSuppressionV5Op::score_thresholdMutable() {
  auto range = getODSOperandIndexAndLength(4);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange NonMaxSuppressionV5Op::soft_nms_sigmaMutable() {
  auto range = getODSOperandIndexAndLength(5);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> NonMaxSuppressionV5Op::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range NonMaxSuppressionV5Op::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value NonMaxSuppressionV5Op::selected_indices() {
  return *getODSResults(0).begin();
}

::mlir::Value NonMaxSuppressionV5Op::selected_scores() {
  return *getODSResults(1).begin();
}

::mlir::Value NonMaxSuppressionV5Op::valid_outputs() {
  return *getODSResults(2).begin();
}

::mlir::BoolAttr NonMaxSuppressionV5Op::pad_to_max_output_sizeAttr() {
  return (*this)->getAttr(pad_to_max_output_sizeAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool NonMaxSuppressionV5Op::pad_to_max_output_size() {
  auto attr = pad_to_max_output_sizeAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(false).getValue();
  return attr.getValue();
}

::mlir::Type NonMaxSuppressionV5Op::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool NonMaxSuppressionV5Op::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr NonMaxSuppressionV5Op::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void NonMaxSuppressionV5Op::pad_to_max_output_sizeAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(pad_to_max_output_sizeAttrName(), attr);
}

void NonMaxSuppressionV5Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type selected_indices, ::mlir::Type selected_scores, ::mlir::Type valid_outputs, ::mlir::Value boxes, ::mlir::Value scores, ::mlir::Value max_output_size, ::mlir::Value iou_threshold, ::mlir::Value score_threshold, ::mlir::Value soft_nms_sigma, ::mlir::BoolAttr pad_to_max_output_size) {
  odsState.addOperands(boxes);
  odsState.addOperands(scores);
  odsState.addOperands(max_output_size);
  odsState.addOperands(iou_threshold);
  odsState.addOperands(score_threshold);
  odsState.addOperands(soft_nms_sigma);
  odsState.addAttribute(pad_to_max_output_sizeAttrName(odsState.name), pad_to_max_output_size);
  odsState.addTypes(selected_indices);
  odsState.addTypes(selected_scores);
  odsState.addTypes(valid_outputs);
}

void NonMaxSuppressionV5Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value boxes, ::mlir::Value scores, ::mlir::Value max_output_size, ::mlir::Value iou_threshold, ::mlir::Value score_threshold, ::mlir::Value soft_nms_sigma, ::mlir::BoolAttr pad_to_max_output_size) {
  odsState.addOperands(boxes);
  odsState.addOperands(scores);
  odsState.addOperands(max_output_size);
  odsState.addOperands(iou_threshold);
  odsState.addOperands(score_threshold);
  odsState.addOperands(soft_nms_sigma);
  odsState.addAttribute(pad_to_max_output_sizeAttrName(odsState.name), pad_to_max_output_size);
  assert(resultTypes.size() == 3u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void NonMaxSuppressionV5Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type selected_indices, ::mlir::Type selected_scores, ::mlir::Type valid_outputs, ::mlir::Value boxes, ::mlir::Value scores, ::mlir::Value max_output_size, ::mlir::Value iou_threshold, ::mlir::Value score_threshold, ::mlir::Value soft_nms_sigma, bool pad_to_max_output_size) {
  odsState.addOperands(boxes);
  odsState.addOperands(scores);
  odsState.addOperands(max_output_size);
  odsState.addOperands(iou_threshold);
  odsState.addOperands(score_threshold);
  odsState.addOperands(soft_nms_sigma);
  odsState.addAttribute(pad_to_max_output_sizeAttrName(odsState.name), odsBuilder.getBoolAttr(pad_to_max_output_size));
  odsState.addTypes(selected_indices);
  odsState.addTypes(selected_scores);
  odsState.addTypes(valid_outputs);
}

void NonMaxSuppressionV5Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value boxes, ::mlir::Value scores, ::mlir::Value max_output_size, ::mlir::Value iou_threshold, ::mlir::Value score_threshold, ::mlir::Value soft_nms_sigma, bool pad_to_max_output_size) {
  odsState.addOperands(boxes);
  odsState.addOperands(scores);
  odsState.addOperands(max_output_size);
  odsState.addOperands(iou_threshold);
  odsState.addOperands(score_threshold);
  odsState.addOperands(soft_nms_sigma);
  odsState.addAttribute(pad_to_max_output_sizeAttrName(odsState.name), odsBuilder.getBoolAttr(pad_to_max_output_size));
  assert(resultTypes.size() == 3u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void NonMaxSuppressionV5Op::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 6u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 3u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult NonMaxSuppressionV5Op::verify() {
  {
    auto tblgen_pad_to_max_output_size = (*this)->getAttr(pad_to_max_output_sizeAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_pad_to_max_output_size, "pad_to_max_output_size")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops6(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops6(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops11(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup3 = getODSOperands(3);

    for (auto v : valueGroup3) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops6(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup4 = getODSOperands(4);

    for (auto v : valueGroup4) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops6(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup5 = getODSOperands(5);

    for (auto v : valueGroup5) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops6(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops11(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSResults(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops6(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSResults(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops11(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void NonMaxSuppressionV5Op::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::NonMaxSuppressionV5Op)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::NotEqualOp definitions
//===----------------------------------------------------------------------===//

NotEqualOpAdaptor::NotEqualOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

NotEqualOpAdaptor::NotEqualOpAdaptor(NotEqualOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange NotEqualOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> NotEqualOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange NotEqualOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value NotEqualOpAdaptor::x() {
  return *getODSOperands(0).begin();
}

::mlir::Value NotEqualOpAdaptor::y() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr NotEqualOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::BoolAttr NotEqualOpAdaptor::incompatible_shape_error() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("incompatible_shape_error").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(true);
  return attr;
}

::mlir::LogicalResult NotEqualOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_incompatible_shape_error = odsAttrs.get("incompatible_shape_error");
    if (tblgen_incompatible_shape_error && !((tblgen_incompatible_shape_error.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.NotEqual' op ""attribute 'incompatible_shape_error' failed to satisfy constraint: bool attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> NotEqualOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range NotEqualOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value NotEqualOp::x() {
  return *getODSOperands(0).begin();
}

::mlir::Value NotEqualOp::y() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange NotEqualOp::xMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange NotEqualOp::yMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> NotEqualOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range NotEqualOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value NotEqualOp::z() {
  return *getODSResults(0).begin();
}

::mlir::BoolAttr NotEqualOp::incompatible_shape_errorAttr() {
  return (*this)->getAttr(incompatible_shape_errorAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool NotEqualOp::incompatible_shape_error() {
  auto attr = incompatible_shape_errorAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(true).getValue();
  return attr.getValue();
}

::mlir::Type NotEqualOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool NotEqualOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr NotEqualOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void NotEqualOp::incompatible_shape_errorAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(incompatible_shape_errorAttrName(), attr);
}

void NotEqualOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type z, ::mlir::Value x, ::mlir::Value y, ::mlir::BoolAttr incompatible_shape_error) {
  odsState.addOperands(x);
  odsState.addOperands(y);
  odsState.addAttribute(incompatible_shape_errorAttrName(odsState.name), incompatible_shape_error);
  odsState.addTypes(z);
}

void NotEqualOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value x, ::mlir::Value y, ::mlir::BoolAttr incompatible_shape_error) {
  odsState.addOperands(x);
  odsState.addOperands(y);
  odsState.addAttribute(incompatible_shape_errorAttrName(odsState.name), incompatible_shape_error);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void NotEqualOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type z, ::mlir::Value x, ::mlir::Value y, bool incompatible_shape_error) {
  odsState.addOperands(x);
  odsState.addOperands(y);
  odsState.addAttribute(incompatible_shape_errorAttrName(odsState.name), odsBuilder.getBoolAttr(incompatible_shape_error));
  odsState.addTypes(z);
}

void NotEqualOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value x, ::mlir::Value y, bool incompatible_shape_error) {
  odsState.addOperands(x);
  odsState.addOperands(y);
  odsState.addAttribute(incompatible_shape_errorAttrName(odsState.name), odsBuilder.getBoolAttr(incompatible_shape_error));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void NotEqualOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult NotEqualOp::verify() {
  {
    auto tblgen_incompatible_shape_error = (*this)->getAttr(incompatible_shape_errorAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_incompatible_shape_error, "incompatible_shape_error")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops8(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return Verify(*this);
}

void NotEqualOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::NotEqualOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::OneHotOp definitions
//===----------------------------------------------------------------------===//

OneHotOpAdaptor::OneHotOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

OneHotOpAdaptor::OneHotOpAdaptor(OneHotOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange OneHotOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> OneHotOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange OneHotOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value OneHotOpAdaptor::indices() {
  return *getODSOperands(0).begin();
}

::mlir::Value OneHotOpAdaptor::depth() {
  return *getODSOperands(1).begin();
}

::mlir::Value OneHotOpAdaptor::on_value() {
  return *getODSOperands(2).begin();
}

::mlir::Value OneHotOpAdaptor::off_value() {
  return *getODSOperands(3).begin();
}

::mlir::DictionaryAttr OneHotOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::IntegerAttr OneHotOpAdaptor::axis() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("axis").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), -1);
  return attr;
}

::mlir::LogicalResult OneHotOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_axis = odsAttrs.get("axis");
    if (tblgen_axis && !(((tblgen_axis.isa<::mlir::IntegerAttr>())) && ((tblgen_axis.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.OneHot' op ""attribute 'axis' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> OneHotOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range OneHotOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value OneHotOp::indices() {
  return *getODSOperands(0).begin();
}

::mlir::Value OneHotOp::depth() {
  return *getODSOperands(1).begin();
}

::mlir::Value OneHotOp::on_value() {
  return *getODSOperands(2).begin();
}

::mlir::Value OneHotOp::off_value() {
  return *getODSOperands(3).begin();
}

::mlir::MutableOperandRange OneHotOp::indicesMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange OneHotOp::depthMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange OneHotOp::on_valueMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange OneHotOp::off_valueMutable() {
  auto range = getODSOperandIndexAndLength(3);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> OneHotOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range OneHotOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value OneHotOp::output() {
  return *getODSResults(0).begin();
}

::mlir::IntegerAttr OneHotOp::axisAttr() {
  return (*this)->getAttr(axisAttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t OneHotOp::axis() {
  auto attr = axisAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), -1).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

::mlir::Type OneHotOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(2).begin());
}

::mlir::Type OneHotOp::TI() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool OneHotOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
  if (name == "TI") return true;
 return false;
}

::mlir::DictionaryAttr OneHotOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())},
    {TIAttrName(),
::mlir::TypeAttr::get(TI())}});
}

void OneHotOp::axisAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(axisAttrName(), attr);
}

void OneHotOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value indices, ::mlir::Value depth, ::mlir::Value on_value, ::mlir::Value off_value, ::mlir::IntegerAttr axis) {
  odsState.addOperands(indices);
  odsState.addOperands(depth);
  odsState.addOperands(on_value);
  odsState.addOperands(off_value);
  odsState.addAttribute(axisAttrName(odsState.name), axis);
  odsState.addTypes(output);
}

void OneHotOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value indices, ::mlir::Value depth, ::mlir::Value on_value, ::mlir::Value off_value, ::mlir::IntegerAttr axis) {
  odsState.addOperands(indices);
  odsState.addOperands(depth);
  odsState.addOperands(on_value);
  odsState.addOperands(off_value);
  odsState.addAttribute(axisAttrName(odsState.name), axis);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void OneHotOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value indices, ::mlir::Value depth, ::mlir::Value on_value, ::mlir::Value off_value, uint64_t axis) {
  odsState.addOperands(indices);
  odsState.addOperands(depth);
  odsState.addOperands(on_value);
  odsState.addOperands(off_value);
  odsState.addAttribute(axisAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), axis));
  odsState.addTypes(output);
}

void OneHotOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value indices, ::mlir::Value depth, ::mlir::Value on_value, ::mlir::Value off_value, uint64_t axis) {
  odsState.addOperands(indices);
  odsState.addOperands(depth);
  odsState.addOperands(on_value);
  odsState.addOperands(off_value);
  odsState.addAttribute(axisAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), axis));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void OneHotOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 4u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult OneHotOp::verify() {
  {
    auto tblgen_axis = (*this)->getAttr(axisAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_axis, "axis")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops48(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops11(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup3 = getODSOperands(3);

    for (auto v : valueGroup3) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return Verify(*this);
}

void OneHotOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::OneHotOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::OneShotIteratorOp definitions
//===----------------------------------------------------------------------===//

OneShotIteratorOpAdaptor::OneShotIteratorOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

OneShotIteratorOpAdaptor::OneShotIteratorOpAdaptor(OneShotIteratorOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange OneShotIteratorOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> OneShotIteratorOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange OneShotIteratorOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::DictionaryAttr OneShotIteratorOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::SymbolRefAttr OneShotIteratorOpAdaptor::dataset_factory() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::SymbolRefAttr attr = odsAttrs.get("dataset_factory").cast<::mlir::SymbolRefAttr>();
  return attr;
}

::mlir::ArrayAttr OneShotIteratorOpAdaptor::output_types() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("output_types").cast<::mlir::ArrayAttr>();
  return attr;
}

::mlir::ArrayAttr OneShotIteratorOpAdaptor::output_shapes() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("output_shapes").cast<::mlir::ArrayAttr>();
  return attr;
}

::mlir::StringAttr OneShotIteratorOpAdaptor::container() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("container").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("");
  return attr;
}

::mlir::StringAttr OneShotIteratorOpAdaptor::shared_name() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("shared_name").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("");
  return attr;
}

::mlir::LogicalResult OneShotIteratorOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_dataset_factory = odsAttrs.get("dataset_factory");
    if (!tblgen_dataset_factory)
      return emitError(loc, "'tf.OneShotIterator' op ""requires attribute 'dataset_factory'");

    if (tblgen_dataset_factory && !((tblgen_dataset_factory.isa<::mlir::SymbolRefAttr>())))
      return emitError(loc, "'tf.OneShotIterator' op ""attribute 'dataset_factory' failed to satisfy constraint: symbol reference attribute");
  }
  {
    auto tblgen_output_types = odsAttrs.get("output_types");
    if (!tblgen_output_types)
      return emitError(loc, "'tf.OneShotIterator' op ""requires attribute 'output_types'");

    if (tblgen_output_types && !((((tblgen_output_types.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_output_types.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return ((attr.isa<::mlir::TypeAttr>())) && ((attr.cast<::mlir::TypeAttr>().getValue().isa<::mlir::Type>())); }))) && ((tblgen_output_types.cast<::mlir::ArrayAttr>().size() >= 1))))
      return emitError(loc, "'tf.OneShotIterator' op ""attribute 'output_types' failed to satisfy constraint: type array attribute with at least 1 elements");
  }
  {
    auto tblgen_output_shapes = odsAttrs.get("output_shapes");
    if (!tblgen_output_shapes)
      return emitError(loc, "'tf.OneShotIterator' op ""requires attribute 'output_shapes'");

    if (tblgen_output_shapes && !((((tblgen_output_shapes.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_output_shapes.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return (attr.isa<mlir::TF::ShapeAttr>()); }))) && ((tblgen_output_shapes.cast<::mlir::ArrayAttr>().size() >= 1))))
      return emitError(loc, "'tf.OneShotIterator' op ""attribute 'output_shapes' failed to satisfy constraint: tensorflow shape attribute array with at least 1 elements");
  }
  {
    auto tblgen_container = odsAttrs.get("container");
    if (tblgen_container && !((tblgen_container.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.OneShotIterator' op ""attribute 'container' failed to satisfy constraint: string attribute");
  }
  {
    auto tblgen_shared_name = odsAttrs.get("shared_name");
    if (tblgen_shared_name && !((tblgen_shared_name.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.OneShotIterator' op ""attribute 'shared_name' failed to satisfy constraint: string attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> OneShotIteratorOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range OneShotIteratorOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

std::pair<unsigned, unsigned> OneShotIteratorOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range OneShotIteratorOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value OneShotIteratorOp::handle() {
  return *getODSResults(0).begin();
}

::mlir::SymbolRefAttr OneShotIteratorOp::dataset_factoryAttr() {
  return (*this)->getAttr(dataset_factoryAttrName()).cast<::mlir::SymbolRefAttr>();
}

::mlir::SymbolRefAttr OneShotIteratorOp::dataset_factory() {
  auto attr = dataset_factoryAttr();
  return attr;
}

::mlir::ArrayAttr OneShotIteratorOp::output_typesAttr() {
  return (*this)->getAttr(output_typesAttrName()).cast<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr OneShotIteratorOp::output_types() {
  auto attr = output_typesAttr();
  return attr;
}

::mlir::ArrayAttr OneShotIteratorOp::output_shapesAttr() {
  return (*this)->getAttr(output_shapesAttrName()).cast<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr OneShotIteratorOp::output_shapes() {
  auto attr = output_shapesAttr();
  return attr;
}

::mlir::StringAttr OneShotIteratorOp::containerAttr() {
  return (*this)->getAttr(containerAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef OneShotIteratorOp::container() {
  auto attr = containerAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("").getValue();
  return attr.getValue();
}

::mlir::StringAttr OneShotIteratorOp::shared_nameAttr() {
  return (*this)->getAttr(shared_nameAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef OneShotIteratorOp::shared_name() {
  auto attr = shared_nameAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("").getValue();
  return attr.getValue();
}

void OneShotIteratorOp::dataset_factoryAttr(::mlir::SymbolRefAttr attr) {
  (*this)->setAttr(dataset_factoryAttrName(), attr);
}

void OneShotIteratorOp::output_typesAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(output_typesAttrName(), attr);
}

void OneShotIteratorOp::output_shapesAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(output_shapesAttrName(), attr);
}

void OneShotIteratorOp::containerAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(containerAttrName(), attr);
}

void OneShotIteratorOp::shared_nameAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(shared_nameAttrName(), attr);
}

void OneShotIteratorOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type handle, ::mlir::SymbolRefAttr dataset_factory, ::mlir::ArrayAttr output_types, ::mlir::ArrayAttr output_shapes, ::mlir::StringAttr container, ::mlir::StringAttr shared_name) {
  odsState.addAttribute(dataset_factoryAttrName(odsState.name), dataset_factory);
  odsState.addAttribute(output_typesAttrName(odsState.name), output_types);
  odsState.addAttribute(output_shapesAttrName(odsState.name), output_shapes);
  odsState.addAttribute(containerAttrName(odsState.name), container);
  odsState.addAttribute(shared_nameAttrName(odsState.name), shared_name);
  odsState.addTypes(handle);
}

void OneShotIteratorOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::SymbolRefAttr dataset_factory, ::mlir::ArrayAttr output_types, ::mlir::ArrayAttr output_shapes, ::mlir::StringAttr container, ::mlir::StringAttr shared_name) {
  odsState.addAttribute(dataset_factoryAttrName(odsState.name), dataset_factory);
  odsState.addAttribute(output_typesAttrName(odsState.name), output_types);
  odsState.addAttribute(output_shapesAttrName(odsState.name), output_shapes);
  odsState.addAttribute(containerAttrName(odsState.name), container);
  odsState.addAttribute(shared_nameAttrName(odsState.name), shared_name);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void OneShotIteratorOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type handle, ::mlir::SymbolRefAttr dataset_factory, ::mlir::ArrayAttr output_types, ::mlir::ArrayAttr output_shapes, ::llvm::StringRef container, ::llvm::StringRef shared_name) {
  odsState.addAttribute(dataset_factoryAttrName(odsState.name), dataset_factory);
  odsState.addAttribute(output_typesAttrName(odsState.name), output_types);
  odsState.addAttribute(output_shapesAttrName(odsState.name), output_shapes);
  odsState.addAttribute(containerAttrName(odsState.name), odsBuilder.getStringAttr(container));
  odsState.addAttribute(shared_nameAttrName(odsState.name), odsBuilder.getStringAttr(shared_name));
  odsState.addTypes(handle);
}

void OneShotIteratorOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::SymbolRefAttr dataset_factory, ::mlir::ArrayAttr output_types, ::mlir::ArrayAttr output_shapes, ::llvm::StringRef container, ::llvm::StringRef shared_name) {
  odsState.addAttribute(dataset_factoryAttrName(odsState.name), dataset_factory);
  odsState.addAttribute(output_typesAttrName(odsState.name), output_types);
  odsState.addAttribute(output_shapesAttrName(odsState.name), output_shapes);
  odsState.addAttribute(containerAttrName(odsState.name), odsBuilder.getStringAttr(container));
  odsState.addAttribute(shared_nameAttrName(odsState.name), odsBuilder.getStringAttr(shared_name));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void OneShotIteratorOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 0u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult OneShotIteratorOp::verify() {
  {
    auto tblgen_dataset_factory = (*this)->getAttr(dataset_factoryAttrName());
    if (!tblgen_dataset_factory)
      return emitOpError("requires attribute 'dataset_factory'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops12(*this, tblgen_dataset_factory, "dataset_factory")))
      return ::mlir::failure();
  }
  {
    auto tblgen_output_types = (*this)->getAttr(output_typesAttrName());
    if (!tblgen_output_types)
      return emitOpError("requires attribute 'output_types'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops2(*this, tblgen_output_types, "output_types")))
      return ::mlir::failure();
  }
  {
    auto tblgen_output_shapes = (*this)->getAttr(output_shapesAttrName());
    if (!tblgen_output_shapes)
      return emitOpError("requires attribute 'output_shapes'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops3(*this, tblgen_output_shapes, "output_shapes")))
      return ::mlir::failure();
  }
  {
    auto tblgen_container = (*this)->getAttr(containerAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_container, "container")))
      return ::mlir::failure();
  }
  {
    auto tblgen_shared_name = (*this)->getAttr(shared_nameAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_shared_name, "shared_name")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void OneShotIteratorOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  for (::mlir::Value value : getODSResults(0))
    effects.emplace_back(::mlir::MemoryEffects::Allocate::get(), value, ::mlir::TF::ResourceEffects::DatasetIterator::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::OneShotIteratorOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::OnesLikeOp definitions
//===----------------------------------------------------------------------===//

OnesLikeOpAdaptor::OnesLikeOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

OnesLikeOpAdaptor::OnesLikeOpAdaptor(OnesLikeOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange OnesLikeOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> OnesLikeOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange OnesLikeOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value OnesLikeOpAdaptor::x() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr OnesLikeOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult OnesLikeOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> OnesLikeOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range OnesLikeOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value OnesLikeOp::x() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange OnesLikeOp::xMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> OnesLikeOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range OnesLikeOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value OnesLikeOp::y() {
  return *getODSResults(0).begin();
}

::mlir::Type OnesLikeOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool OnesLikeOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr OnesLikeOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void OnesLikeOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type y, ::mlir::Value x) {
  odsState.addOperands(x);
  odsState.addTypes(y);
}

void OnesLikeOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value x) {
  odsState.addOperands(x);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void OnesLikeOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

void OnesLikeOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value x) {
  odsState.addOperands(x);
  odsState.addTypes({x.getType()});

}

void OnesLikeOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  odsState.addTypes({operands[0].getType()});

}

::mlir::LogicalResult OnesLikeOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops43(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops43(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void OnesLikeOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::OnesLikeOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::OptimizeDatasetV2Op definitions
//===----------------------------------------------------------------------===//

OptimizeDatasetV2OpAdaptor::OptimizeDatasetV2OpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

OptimizeDatasetV2OpAdaptor::OptimizeDatasetV2OpAdaptor(OptimizeDatasetV2Op &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange OptimizeDatasetV2OpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> OptimizeDatasetV2OpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange OptimizeDatasetV2OpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value OptimizeDatasetV2OpAdaptor::input_dataset() {
  return *getODSOperands(0).begin();
}

::mlir::Value OptimizeDatasetV2OpAdaptor::optimizations_enabled() {
  return *getODSOperands(1).begin();
}

::mlir::Value OptimizeDatasetV2OpAdaptor::optimizations_disabled() {
  return *getODSOperands(2).begin();
}

::mlir::Value OptimizeDatasetV2OpAdaptor::optimizations_default() {
  return *getODSOperands(3).begin();
}

::mlir::DictionaryAttr OptimizeDatasetV2OpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::ArrayAttr OptimizeDatasetV2OpAdaptor::output_types() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("output_types").cast<::mlir::ArrayAttr>();
  return attr;
}

::mlir::ArrayAttr OptimizeDatasetV2OpAdaptor::output_shapes() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("output_shapes").cast<::mlir::ArrayAttr>();
  return attr;
}

::mlir::ArrayAttr OptimizeDatasetV2OpAdaptor::optimization_configs() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("optimization_configs").dyn_cast_or_null<::mlir::ArrayAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStrArrayAttr({});
  return attr;
}

::mlir::LogicalResult OptimizeDatasetV2OpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_output_types = odsAttrs.get("output_types");
    if (!tblgen_output_types)
      return emitError(loc, "'tf.OptimizeDatasetV2' op ""requires attribute 'output_types'");

    if (tblgen_output_types && !((((tblgen_output_types.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_output_types.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return ((attr.isa<::mlir::TypeAttr>())) && ((attr.cast<::mlir::TypeAttr>().getValue().isa<::mlir::Type>())); }))) && ((tblgen_output_types.cast<::mlir::ArrayAttr>().size() >= 1))))
      return emitError(loc, "'tf.OptimizeDatasetV2' op ""attribute 'output_types' failed to satisfy constraint: type array attribute with at least 1 elements");
  }
  {
    auto tblgen_output_shapes = odsAttrs.get("output_shapes");
    if (!tblgen_output_shapes)
      return emitError(loc, "'tf.OptimizeDatasetV2' op ""requires attribute 'output_shapes'");

    if (tblgen_output_shapes && !((((tblgen_output_shapes.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_output_shapes.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return (attr.isa<mlir::TF::ShapeAttr>()); }))) && ((tblgen_output_shapes.cast<::mlir::ArrayAttr>().size() >= 1))))
      return emitError(loc, "'tf.OptimizeDatasetV2' op ""attribute 'output_shapes' failed to satisfy constraint: tensorflow shape attribute array with at least 1 elements");
  }
  {
    auto tblgen_optimization_configs = odsAttrs.get("optimization_configs");
    if (tblgen_optimization_configs && !(((tblgen_optimization_configs.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_optimization_configs.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return (attr.isa<::mlir::StringAttr>()); }))))
      return emitError(loc, "'tf.OptimizeDatasetV2' op ""attribute 'optimization_configs' failed to satisfy constraint: string array attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> OptimizeDatasetV2Op::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range OptimizeDatasetV2Op::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value OptimizeDatasetV2Op::input_dataset() {
  return *getODSOperands(0).begin();
}

::mlir::Value OptimizeDatasetV2Op::optimizations_enabled() {
  return *getODSOperands(1).begin();
}

::mlir::Value OptimizeDatasetV2Op::optimizations_disabled() {
  return *getODSOperands(2).begin();
}

::mlir::Value OptimizeDatasetV2Op::optimizations_default() {
  return *getODSOperands(3).begin();
}

::mlir::MutableOperandRange OptimizeDatasetV2Op::input_datasetMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange OptimizeDatasetV2Op::optimizations_enabledMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange OptimizeDatasetV2Op::optimizations_disabledMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange OptimizeDatasetV2Op::optimizations_defaultMutable() {
  auto range = getODSOperandIndexAndLength(3);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> OptimizeDatasetV2Op::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range OptimizeDatasetV2Op::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value OptimizeDatasetV2Op::handle() {
  return *getODSResults(0).begin();
}

::mlir::ArrayAttr OptimizeDatasetV2Op::output_typesAttr() {
  return (*this)->getAttr(output_typesAttrName()).cast<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr OptimizeDatasetV2Op::output_types() {
  auto attr = output_typesAttr();
  return attr;
}

::mlir::ArrayAttr OptimizeDatasetV2Op::output_shapesAttr() {
  return (*this)->getAttr(output_shapesAttrName()).cast<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr OptimizeDatasetV2Op::output_shapes() {
  auto attr = output_shapesAttr();
  return attr;
}

::mlir::ArrayAttr OptimizeDatasetV2Op::optimization_configsAttr() {
  return (*this)->getAttr(optimization_configsAttrName()).dyn_cast_or_null<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr OptimizeDatasetV2Op::optimization_configs() {
  auto attr = optimization_configsAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStrArrayAttr({});
  return attr;
}

void OptimizeDatasetV2Op::output_typesAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(output_typesAttrName(), attr);
}

void OptimizeDatasetV2Op::output_shapesAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(output_shapesAttrName(), attr);
}

void OptimizeDatasetV2Op::optimization_configsAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(optimization_configsAttrName(), attr);
}

void OptimizeDatasetV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type handle, ::mlir::Value input_dataset, ::mlir::Value optimizations_enabled, ::mlir::Value optimizations_disabled, ::mlir::Value optimizations_default, ::mlir::ArrayAttr output_types, ::mlir::ArrayAttr output_shapes, ::mlir::ArrayAttr optimization_configs) {
  odsState.addOperands(input_dataset);
  odsState.addOperands(optimizations_enabled);
  odsState.addOperands(optimizations_disabled);
  odsState.addOperands(optimizations_default);
  odsState.addAttribute(output_typesAttrName(odsState.name), output_types);
  odsState.addAttribute(output_shapesAttrName(odsState.name), output_shapes);
  odsState.addAttribute(optimization_configsAttrName(odsState.name), optimization_configs);
  odsState.addTypes(handle);
}

void OptimizeDatasetV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input_dataset, ::mlir::Value optimizations_enabled, ::mlir::Value optimizations_disabled, ::mlir::Value optimizations_default, ::mlir::ArrayAttr output_types, ::mlir::ArrayAttr output_shapes, ::mlir::ArrayAttr optimization_configs) {
  odsState.addOperands(input_dataset);
  odsState.addOperands(optimizations_enabled);
  odsState.addOperands(optimizations_disabled);
  odsState.addOperands(optimizations_default);
  odsState.addAttribute(output_typesAttrName(odsState.name), output_types);
  odsState.addAttribute(output_shapesAttrName(odsState.name), output_shapes);
  odsState.addAttribute(optimization_configsAttrName(odsState.name), optimization_configs);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void OptimizeDatasetV2Op::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 4u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult OptimizeDatasetV2Op::verify() {
  {
    auto tblgen_output_types = (*this)->getAttr(output_typesAttrName());
    if (!tblgen_output_types)
      return emitOpError("requires attribute 'output_types'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops2(*this, tblgen_output_types, "output_types")))
      return ::mlir::failure();
  }
  {
    auto tblgen_output_shapes = (*this)->getAttr(output_shapesAttrName());
    if (!tblgen_output_shapes)
      return emitOpError("requires attribute 'output_shapes'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops3(*this, tblgen_output_shapes, "output_shapes")))
      return ::mlir::failure();
  }
  {
    auto tblgen_optimization_configs = (*this)->getAttr(optimization_configsAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops22(*this, tblgen_optimization_configs, "optimization_configs")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops15(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops19(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops19(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup3 = getODSOperands(3);

    for (auto v : valueGroup3) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops19(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops15(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void OptimizeDatasetV2Op::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::OptimizeDatasetV2Op)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::OptionalFromValueOp definitions
//===----------------------------------------------------------------------===//

OptionalFromValueOpAdaptor::OptionalFromValueOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

OptionalFromValueOpAdaptor::OptionalFromValueOpAdaptor(OptionalFromValueOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange OptionalFromValueOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> OptionalFromValueOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  bool isVariadic[] = {true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (odsOperands.size() - 0) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::ValueRange OptionalFromValueOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::ValueRange OptionalFromValueOpAdaptor::components() {
  return getODSOperands(0);
}

::mlir::DictionaryAttr OptionalFromValueOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult OptionalFromValueOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> OptionalFromValueOp::getODSOperandIndexAndLength(unsigned index) {
  bool isVariadic[] = {true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (getOperation()->getNumOperands() - 0) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::Operation::operand_range OptionalFromValueOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Operation::operand_range OptionalFromValueOp::components() {
  return getODSOperands(0);
}

::mlir::MutableOperandRange OptionalFromValueOp::componentsMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> OptionalFromValueOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range OptionalFromValueOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value OptionalFromValueOp::optional() {
  return *getODSResults(0).begin();
}

mlir::OperandElementTypeRange OptionalFromValueOp::Toutput_types() {
  auto values = getODSOperands(0);
return {mlir::OperandElementTypeIterator(values.begin()), mlir::OperandElementTypeIterator(values.end())};
}

bool OptionalFromValueOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "Toutput_types") return true;
 return false;
}

::mlir::DictionaryAttr OptionalFromValueOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {Toutput_typesAttrName(),
ArrayAttr::get(ctx, 
    [&]() {
      llvm::SmallVector<Attribute, 4> ret;
      for (auto t : Toutput_types())
        ret.push_back(TypeAttr::get(t));
      return ret;
    }())}});
}

void OptionalFromValueOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type optional, ::mlir::ValueRange components) {
  odsState.addOperands(components);
  odsState.addTypes(optional);
}

void OptionalFromValueOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult OptionalFromValueOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops15(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void OptionalFromValueOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::OptionalFromValueOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::OptionalGetValueOp definitions
//===----------------------------------------------------------------------===//

OptionalGetValueOpAdaptor::OptionalGetValueOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

OptionalGetValueOpAdaptor::OptionalGetValueOpAdaptor(OptionalGetValueOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange OptionalGetValueOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> OptionalGetValueOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange OptionalGetValueOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value OptionalGetValueOpAdaptor::optional() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr OptionalGetValueOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult OptionalGetValueOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> OptionalGetValueOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range OptionalGetValueOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value OptionalGetValueOp::optional() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange OptionalGetValueOp::optionalMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> OptionalGetValueOp::getODSResultIndexAndLength(unsigned index) {
  bool isVariadic[] = {true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (getOperation()->getNumResults() - 0) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::Operation::result_range OptionalGetValueOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Operation::result_range OptionalGetValueOp::components() {
  return getODSResults(0);
}

mlir::TF::ResultShapeRange OptionalGetValueOp::output_shapes() {
  auto values = getODSResults(0);
return {mlir::TF::ResultShapeIterator(values.begin()), mlir::TF::ResultShapeIterator(values.end())};
}

mlir::ResultElementTypeRange OptionalGetValueOp::output_types() {
  auto values = getODSResults(0);
return {mlir::ResultElementTypeIterator(values.begin()), mlir::ResultElementTypeIterator(values.end())};
}

bool OptionalGetValueOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "output_shapes") return true;
  if (name == "output_types") return true;
 return false;
}

::mlir::DictionaryAttr OptionalGetValueOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {output_shapesAttrName(),
ArrayAttr::get(ctx,
      [&](){
        llvm::SmallVector<Attribute, 4> ret;
        for (auto shape : output_shapes())
          ret.push_back(mlir::TF::ShapeAttr::get(ctx, shape));
        return ret;
      }())},
    {output_typesAttrName(),
ArrayAttr::get(ctx, 
    [&]() {
      llvm::SmallVector<Attribute, 4> ret;
      for (auto t : output_types())
        ret.push_back(TypeAttr::get(t));
      return ret;
    }())}});
}

void OptionalGetValueOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange components, ::mlir::Value optional) {
  odsState.addOperands(optional);
  odsState.addTypes(components);
}

void OptionalGetValueOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult OptionalGetValueOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops15(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void OptionalGetValueOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::OptionalGetValueOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::OptionalHasValueOp definitions
//===----------------------------------------------------------------------===//

OptionalHasValueOpAdaptor::OptionalHasValueOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

OptionalHasValueOpAdaptor::OptionalHasValueOpAdaptor(OptionalHasValueOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange OptionalHasValueOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> OptionalHasValueOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange OptionalHasValueOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value OptionalHasValueOpAdaptor::optional() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr OptionalHasValueOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult OptionalHasValueOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> OptionalHasValueOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range OptionalHasValueOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value OptionalHasValueOp::optional() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange OptionalHasValueOp::optionalMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> OptionalHasValueOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range OptionalHasValueOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value OptionalHasValueOp::has_value() {
  return *getODSResults(0).begin();
}

void OptionalHasValueOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type has_value, ::mlir::Value optional) {
  odsState.addOperands(optional);
  odsState.addTypes(has_value);
}

void OptionalHasValueOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value optional) {
  odsState.addOperands(optional);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void OptionalHasValueOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult OptionalHasValueOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops15(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops8(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void OptionalHasValueOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::OptionalHasValueOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::OptionalNoneOp definitions
//===----------------------------------------------------------------------===//

OptionalNoneOpAdaptor::OptionalNoneOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

OptionalNoneOpAdaptor::OptionalNoneOpAdaptor(OptionalNoneOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange OptionalNoneOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> OptionalNoneOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange OptionalNoneOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::DictionaryAttr OptionalNoneOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult OptionalNoneOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> OptionalNoneOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range OptionalNoneOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

std::pair<unsigned, unsigned> OptionalNoneOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range OptionalNoneOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value OptionalNoneOp::optional() {
  return *getODSResults(0).begin();
}

void OptionalNoneOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type optional) {
  odsState.addTypes(optional);
}

void OptionalNoneOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes) {
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void OptionalNoneOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 0u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult OptionalNoneOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops15(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void OptionalNoneOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::OptionalNoneOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::OutfeedEnqueueTupleOp definitions
//===----------------------------------------------------------------------===//

OutfeedEnqueueTupleOpAdaptor::OutfeedEnqueueTupleOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

OutfeedEnqueueTupleOpAdaptor::OutfeedEnqueueTupleOpAdaptor(OutfeedEnqueueTupleOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange OutfeedEnqueueTupleOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> OutfeedEnqueueTupleOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  bool isVariadic[] = {true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (odsOperands.size() - 0) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::ValueRange OutfeedEnqueueTupleOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::ValueRange OutfeedEnqueueTupleOpAdaptor::inputs() {
  return getODSOperands(0);
}

::mlir::DictionaryAttr OutfeedEnqueueTupleOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult OutfeedEnqueueTupleOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> OutfeedEnqueueTupleOp::getODSOperandIndexAndLength(unsigned index) {
  bool isVariadic[] = {true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (getOperation()->getNumOperands() - 0) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::Operation::operand_range OutfeedEnqueueTupleOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Operation::operand_range OutfeedEnqueueTupleOp::inputs() {
  return getODSOperands(0);
}

::mlir::MutableOperandRange OutfeedEnqueueTupleOp::inputsMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> OutfeedEnqueueTupleOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range OutfeedEnqueueTupleOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

mlir::OperandElementTypeRange OutfeedEnqueueTupleOp::dtypes() {
  auto values = getODSOperands(0);
return {mlir::OperandElementTypeIterator(values.begin()), mlir::OperandElementTypeIterator(values.end())};
}

bool OutfeedEnqueueTupleOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "dtypes") return true;
 return false;
}

::mlir::DictionaryAttr OutfeedEnqueueTupleOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {dtypesAttrName(),
ArrayAttr::get(ctx, 
    [&]() {
      llvm::SmallVector<Attribute, 4> ret;
      for (auto t : dtypes())
        ret.push_back(TypeAttr::get(t));
      return ret;
    }())}});
}

void OutfeedEnqueueTupleOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange inputs) {
  odsState.addOperands(inputs);
}

void OutfeedEnqueueTupleOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 0u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult OutfeedEnqueueTupleOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::OutfeedEnqueueTupleOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::PackOp definitions
//===----------------------------------------------------------------------===//

PackOpAdaptor::PackOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

PackOpAdaptor::PackOpAdaptor(PackOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange PackOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> PackOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  bool isVariadic[] = {true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (odsOperands.size() - 0) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::ValueRange PackOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::ValueRange PackOpAdaptor::values() {
  return getODSOperands(0);
}

::mlir::DictionaryAttr PackOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::IntegerAttr PackOpAdaptor::axis() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("axis").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), 0);
  return attr;
}

::mlir::LogicalResult PackOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_axis = odsAttrs.get("axis");
    if (tblgen_axis && !(((tblgen_axis.isa<::mlir::IntegerAttr>())) && ((tblgen_axis.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.Pack' op ""attribute 'axis' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> PackOp::getODSOperandIndexAndLength(unsigned index) {
  bool isVariadic[] = {true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (getOperation()->getNumOperands() - 0) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::Operation::operand_range PackOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Operation::operand_range PackOp::values() {
  return getODSOperands(0);
}

::mlir::MutableOperandRange PackOp::valuesMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> PackOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range PackOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value PackOp::output() {
  return *getODSResults(0).begin();
}

::mlir::IntegerAttr PackOp::axisAttr() {
  return (*this)->getAttr(axisAttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t PackOp::axis() {
  auto attr = axisAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), 0).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

size_t PackOp::N() {
  auto range = getODSOperands(0);
return std::distance(range.begin(), range.end());
}

::mlir::Type PackOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool PackOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "N") return true;
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr PackOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {NAttrName(),
odsBuilder.getI64IntegerAttr(N())},
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void PackOp::axisAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(axisAttrName(), attr);
}

void PackOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::ValueRange values, ::mlir::IntegerAttr axis) {
  odsState.addOperands(values);
  odsState.addAttribute(axisAttrName(odsState.name), axis);
  odsState.addTypes(output);
}

void PackOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange values, ::mlir::IntegerAttr axis) {
  odsState.addOperands(values);
  odsState.addAttribute(axisAttrName(odsState.name), axis);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void PackOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::ValueRange values, uint64_t axis) {
  odsState.addOperands(values);
  odsState.addAttribute(axisAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), axis));
  odsState.addTypes(output);
}

void PackOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange values, uint64_t axis) {
  odsState.addOperands(values);
  odsState.addAttribute(axisAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), axis));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void PackOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult PackOp::verify() {
  {
    auto tblgen_axis = (*this)->getAttr(axisAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_axis, "axis")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return Verify(*this);
}

void PackOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::PackOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::PadOp definitions
//===----------------------------------------------------------------------===//

PadOpAdaptor::PadOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

PadOpAdaptor::PadOpAdaptor(PadOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange PadOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> PadOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange PadOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value PadOpAdaptor::input() {
  return *getODSOperands(0).begin();
}

::mlir::Value PadOpAdaptor::paddings() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr PadOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult PadOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> PadOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range PadOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value PadOp::input() {
  return *getODSOperands(0).begin();
}

::mlir::Value PadOp::paddings() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange PadOp::inputMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange PadOp::paddingsMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> PadOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range PadOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value PadOp::output() {
  return *getODSResults(0).begin();
}

::mlir::Type PadOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

::mlir::Type PadOp::Tpaddings() {
  return mlir::getElementTypeOrSelf(*getODSOperands(1).begin());
}

bool PadOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
  if (name == "Tpaddings") return true;
 return false;
}

::mlir::DictionaryAttr PadOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())},
    {TpaddingsAttrName(),
::mlir::TypeAttr::get(Tpaddings())}});
}

void PadOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input, ::mlir::Value paddings) {
  odsState.addOperands(input);
  odsState.addOperands(paddings);
  odsState.addTypes(output);
}

void PadOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::Value paddings) {
  odsState.addOperands(input);
  odsState.addOperands(paddings);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void PadOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult PadOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  if (!((((*this->getOperation()).getOperand(1).getType().isa<UnrankedTensorType>())) || (((*this->getOperation()).getOperand(1).getType().cast<ShapedType>().getRank() == 2))))
    return emitOpError("failed to verify that operand 1 is 2-D");
  return ::mlir::success();
}

void PadOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::PadOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::PadV2Op definitions
//===----------------------------------------------------------------------===//

PadV2OpAdaptor::PadV2OpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

PadV2OpAdaptor::PadV2OpAdaptor(PadV2Op &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange PadV2OpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> PadV2OpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange PadV2OpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value PadV2OpAdaptor::input() {
  return *getODSOperands(0).begin();
}

::mlir::Value PadV2OpAdaptor::paddings() {
  return *getODSOperands(1).begin();
}

::mlir::Value PadV2OpAdaptor::constant_values() {
  return *getODSOperands(2).begin();
}

::mlir::DictionaryAttr PadV2OpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult PadV2OpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> PadV2Op::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range PadV2Op::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value PadV2Op::input() {
  return *getODSOperands(0).begin();
}

::mlir::Value PadV2Op::paddings() {
  return *getODSOperands(1).begin();
}

::mlir::Value PadV2Op::constant_values() {
  return *getODSOperands(2).begin();
}

::mlir::MutableOperandRange PadV2Op::inputMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange PadV2Op::paddingsMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange PadV2Op::constant_valuesMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> PadV2Op::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range PadV2Op::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value PadV2Op::output() {
  return *getODSResults(0).begin();
}

::mlir::Type PadV2Op::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

::mlir::Type PadV2Op::Tpaddings() {
  return mlir::getElementTypeOrSelf(*getODSOperands(1).begin());
}

bool PadV2Op::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
  if (name == "Tpaddings") return true;
 return false;
}

::mlir::DictionaryAttr PadV2Op::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())},
    {TpaddingsAttrName(),
::mlir::TypeAttr::get(Tpaddings())}});
}

void PadV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input, ::mlir::Value paddings, ::mlir::Value constant_values) {
  odsState.addOperands(input);
  odsState.addOperands(paddings);
  odsState.addOperands(constant_values);
  odsState.addTypes(output);
}

void PadV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::Value paddings, ::mlir::Value constant_values) {
  odsState.addOperands(input);
  odsState.addOperands(paddings);
  odsState.addOperands(constant_values);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void PadV2Op::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 3u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult PadV2Op::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  if (!((((*this->getOperation()).getOperand(1).getType().isa<UnrankedTensorType>())) || (((*this->getOperation()).getOperand(1).getType().cast<ShapedType>().getRank() == 2))))
    return emitOpError("failed to verify that operand 1 is 2-D");
  return ::mlir::success();
}

void PadV2Op::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::PadV2Op)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::ParallelDynamicStitchOp definitions
//===----------------------------------------------------------------------===//

ParallelDynamicStitchOpAdaptor::ParallelDynamicStitchOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

ParallelDynamicStitchOpAdaptor::ParallelDynamicStitchOpAdaptor(ParallelDynamicStitchOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange ParallelDynamicStitchOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> ParallelDynamicStitchOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  bool isVariadic[] = {true, true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (odsOperands.size() - 0) / 2;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::ValueRange ParallelDynamicStitchOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::ValueRange ParallelDynamicStitchOpAdaptor::indices() {
  return getODSOperands(0);
}

::mlir::ValueRange ParallelDynamicStitchOpAdaptor::data() {
  return getODSOperands(1);
}

::mlir::DictionaryAttr ParallelDynamicStitchOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult ParallelDynamicStitchOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> ParallelDynamicStitchOp::getODSOperandIndexAndLength(unsigned index) {
  bool isVariadic[] = {true, true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (getOperation()->getNumOperands() - 0) / 2;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::Operation::operand_range ParallelDynamicStitchOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Operation::operand_range ParallelDynamicStitchOp::indices() {
  return getODSOperands(0);
}

::mlir::Operation::operand_range ParallelDynamicStitchOp::data() {
  return getODSOperands(1);
}

::mlir::MutableOperandRange ParallelDynamicStitchOp::indicesMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ParallelDynamicStitchOp::dataMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> ParallelDynamicStitchOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range ParallelDynamicStitchOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ParallelDynamicStitchOp::merged() {
  return *getODSResults(0).begin();
}

size_t ParallelDynamicStitchOp::N() {
  auto range = getODSOperands(0);
return std::distance(range.begin(), range.end());
}

::mlir::Type ParallelDynamicStitchOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(1).begin());
}

bool ParallelDynamicStitchOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "N") return true;
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr ParallelDynamicStitchOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {NAttrName(),
odsBuilder.getI64IntegerAttr(N())},
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void ParallelDynamicStitchOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type merged, ::mlir::ValueRange indices, ::mlir::ValueRange data) {
  odsState.addOperands(indices);
  odsState.addOperands(data);
  odsState.addTypes(merged);
}

void ParallelDynamicStitchOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange indices, ::mlir::ValueRange data) {
  odsState.addOperands(indices);
  odsState.addOperands(data);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void ParallelDynamicStitchOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult ParallelDynamicStitchOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops11(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void ParallelDynamicStitchOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::ParallelDynamicStitchOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::ParallelMapDatasetOp definitions
//===----------------------------------------------------------------------===//

ParallelMapDatasetOpAdaptor::ParallelMapDatasetOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

ParallelMapDatasetOpAdaptor::ParallelMapDatasetOpAdaptor(ParallelMapDatasetOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange ParallelMapDatasetOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> ParallelMapDatasetOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  bool isVariadic[] = {false, true, false};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (odsOperands.size() - 2) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::ValueRange ParallelMapDatasetOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ParallelMapDatasetOpAdaptor::input_dataset() {
  return *getODSOperands(0).begin();
}

::mlir::ValueRange ParallelMapDatasetOpAdaptor::other_arguments() {
  return getODSOperands(1);
}

::mlir::Value ParallelMapDatasetOpAdaptor::num_parallel_calls() {
  return *getODSOperands(2).begin();
}

::mlir::DictionaryAttr ParallelMapDatasetOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::SymbolRefAttr ParallelMapDatasetOpAdaptor::f() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::SymbolRefAttr attr = odsAttrs.get("f").cast<::mlir::SymbolRefAttr>();
  return attr;
}

::mlir::ArrayAttr ParallelMapDatasetOpAdaptor::output_types() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("output_types").cast<::mlir::ArrayAttr>();
  return attr;
}

::mlir::ArrayAttr ParallelMapDatasetOpAdaptor::output_shapes() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("output_shapes").cast<::mlir::ArrayAttr>();
  return attr;
}

::mlir::BoolAttr ParallelMapDatasetOpAdaptor::use_inter_op_parallelism() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("use_inter_op_parallelism").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(true);
  return attr;
}

::mlir::BoolAttr ParallelMapDatasetOpAdaptor::sloppy() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("sloppy").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(false);
  return attr;
}

::mlir::BoolAttr ParallelMapDatasetOpAdaptor::preserve_cardinality() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("preserve_cardinality").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(false);
  return attr;
}

::mlir::StringAttr ParallelMapDatasetOpAdaptor::metadata() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("metadata").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("");
  return attr;
}

::mlir::LogicalResult ParallelMapDatasetOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_f = odsAttrs.get("f");
    if (!tblgen_f)
      return emitError(loc, "'tf.ParallelMapDataset' op ""requires attribute 'f'");

    if (tblgen_f && !((tblgen_f.isa<::mlir::SymbolRefAttr>())))
      return emitError(loc, "'tf.ParallelMapDataset' op ""attribute 'f' failed to satisfy constraint: symbol reference attribute");
  }
  {
    auto tblgen_output_types = odsAttrs.get("output_types");
    if (!tblgen_output_types)
      return emitError(loc, "'tf.ParallelMapDataset' op ""requires attribute 'output_types'");

    if (tblgen_output_types && !((((tblgen_output_types.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_output_types.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return ((attr.isa<::mlir::TypeAttr>())) && ((attr.cast<::mlir::TypeAttr>().getValue().isa<::mlir::Type>())); }))) && ((tblgen_output_types.cast<::mlir::ArrayAttr>().size() >= 1))))
      return emitError(loc, "'tf.ParallelMapDataset' op ""attribute 'output_types' failed to satisfy constraint: type array attribute with at least 1 elements");
  }
  {
    auto tblgen_output_shapes = odsAttrs.get("output_shapes");
    if (!tblgen_output_shapes)
      return emitError(loc, "'tf.ParallelMapDataset' op ""requires attribute 'output_shapes'");

    if (tblgen_output_shapes && !((((tblgen_output_shapes.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_output_shapes.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return (attr.isa<mlir::TF::ShapeAttr>()); }))) && ((tblgen_output_shapes.cast<::mlir::ArrayAttr>().size() >= 1))))
      return emitError(loc, "'tf.ParallelMapDataset' op ""attribute 'output_shapes' failed to satisfy constraint: tensorflow shape attribute array with at least 1 elements");
  }
  {
    auto tblgen_use_inter_op_parallelism = odsAttrs.get("use_inter_op_parallelism");
    if (tblgen_use_inter_op_parallelism && !((tblgen_use_inter_op_parallelism.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.ParallelMapDataset' op ""attribute 'use_inter_op_parallelism' failed to satisfy constraint: bool attribute");
  }
  {
    auto tblgen_sloppy = odsAttrs.get("sloppy");
    if (tblgen_sloppy && !((tblgen_sloppy.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.ParallelMapDataset' op ""attribute 'sloppy' failed to satisfy constraint: bool attribute");
  }
  {
    auto tblgen_preserve_cardinality = odsAttrs.get("preserve_cardinality");
    if (tblgen_preserve_cardinality && !((tblgen_preserve_cardinality.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.ParallelMapDataset' op ""attribute 'preserve_cardinality' failed to satisfy constraint: bool attribute");
  }
  {
    auto tblgen_metadata = odsAttrs.get("metadata");
    if (tblgen_metadata && !((tblgen_metadata.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.ParallelMapDataset' op ""attribute 'metadata' failed to satisfy constraint: string attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> ParallelMapDatasetOp::getODSOperandIndexAndLength(unsigned index) {
  bool isVariadic[] = {false, true, false};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (getOperation()->getNumOperands() - 2) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::Operation::operand_range ParallelMapDatasetOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ParallelMapDatasetOp::input_dataset() {
  return *getODSOperands(0).begin();
}

::mlir::Operation::operand_range ParallelMapDatasetOp::other_arguments() {
  return getODSOperands(1);
}

::mlir::Value ParallelMapDatasetOp::num_parallel_calls() {
  return *getODSOperands(2).begin();
}

::mlir::MutableOperandRange ParallelMapDatasetOp::input_datasetMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ParallelMapDatasetOp::other_argumentsMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ParallelMapDatasetOp::num_parallel_callsMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> ParallelMapDatasetOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range ParallelMapDatasetOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ParallelMapDatasetOp::handle() {
  return *getODSResults(0).begin();
}

::mlir::SymbolRefAttr ParallelMapDatasetOp::fAttr() {
  return (*this)->getAttr(fAttrName()).cast<::mlir::SymbolRefAttr>();
}

::mlir::SymbolRefAttr ParallelMapDatasetOp::f() {
  auto attr = fAttr();
  return attr;
}

::mlir::ArrayAttr ParallelMapDatasetOp::output_typesAttr() {
  return (*this)->getAttr(output_typesAttrName()).cast<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr ParallelMapDatasetOp::output_types() {
  auto attr = output_typesAttr();
  return attr;
}

::mlir::ArrayAttr ParallelMapDatasetOp::output_shapesAttr() {
  return (*this)->getAttr(output_shapesAttrName()).cast<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr ParallelMapDatasetOp::output_shapes() {
  auto attr = output_shapesAttr();
  return attr;
}

::mlir::BoolAttr ParallelMapDatasetOp::use_inter_op_parallelismAttr() {
  return (*this)->getAttr(use_inter_op_parallelismAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool ParallelMapDatasetOp::use_inter_op_parallelism() {
  auto attr = use_inter_op_parallelismAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(true).getValue();
  return attr.getValue();
}

::mlir::BoolAttr ParallelMapDatasetOp::sloppyAttr() {
  return (*this)->getAttr(sloppyAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool ParallelMapDatasetOp::sloppy() {
  auto attr = sloppyAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(false).getValue();
  return attr.getValue();
}

::mlir::BoolAttr ParallelMapDatasetOp::preserve_cardinalityAttr() {
  return (*this)->getAttr(preserve_cardinalityAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool ParallelMapDatasetOp::preserve_cardinality() {
  auto attr = preserve_cardinalityAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(false).getValue();
  return attr.getValue();
}

::mlir::StringAttr ParallelMapDatasetOp::metadataAttr() {
  return (*this)->getAttr(metadataAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef ParallelMapDatasetOp::metadata() {
  auto attr = metadataAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("").getValue();
  return attr.getValue();
}

mlir::OperandElementTypeRange ParallelMapDatasetOp::Targuments() {
  auto values = getODSOperands(1);
return {mlir::OperandElementTypeIterator(values.begin()), mlir::OperandElementTypeIterator(values.end())};
}

bool ParallelMapDatasetOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "Targuments") return true;
 return false;
}

::mlir::DictionaryAttr ParallelMapDatasetOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TargumentsAttrName(),
ArrayAttr::get(ctx, 
    [&]() {
      llvm::SmallVector<Attribute, 4> ret;
      for (auto t : Targuments())
        ret.push_back(TypeAttr::get(t));
      return ret;
    }())}});
}

void ParallelMapDatasetOp::fAttr(::mlir::SymbolRefAttr attr) {
  (*this)->setAttr(fAttrName(), attr);
}

void ParallelMapDatasetOp::output_typesAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(output_typesAttrName(), attr);
}

void ParallelMapDatasetOp::output_shapesAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(output_shapesAttrName(), attr);
}

void ParallelMapDatasetOp::use_inter_op_parallelismAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(use_inter_op_parallelismAttrName(), attr);
}

void ParallelMapDatasetOp::sloppyAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(sloppyAttrName(), attr);
}

void ParallelMapDatasetOp::preserve_cardinalityAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(preserve_cardinalityAttrName(), attr);
}

void ParallelMapDatasetOp::metadataAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(metadataAttrName(), attr);
}

void ParallelMapDatasetOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type handle, ::mlir::Value input_dataset, ::mlir::ValueRange other_arguments, ::mlir::Value num_parallel_calls, ::mlir::SymbolRefAttr f, ::mlir::ArrayAttr output_types, ::mlir::ArrayAttr output_shapes, ::mlir::BoolAttr use_inter_op_parallelism, ::mlir::BoolAttr sloppy, ::mlir::BoolAttr preserve_cardinality, ::mlir::StringAttr metadata) {
  odsState.addOperands(input_dataset);
  odsState.addOperands(other_arguments);
  odsState.addOperands(num_parallel_calls);
  odsState.addAttribute(fAttrName(odsState.name), f);
  odsState.addAttribute(output_typesAttrName(odsState.name), output_types);
  odsState.addAttribute(output_shapesAttrName(odsState.name), output_shapes);
  odsState.addAttribute(use_inter_op_parallelismAttrName(odsState.name), use_inter_op_parallelism);
  odsState.addAttribute(sloppyAttrName(odsState.name), sloppy);
  odsState.addAttribute(preserve_cardinalityAttrName(odsState.name), preserve_cardinality);
  odsState.addAttribute(metadataAttrName(odsState.name), metadata);
  odsState.addTypes(handle);
}

void ParallelMapDatasetOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input_dataset, ::mlir::ValueRange other_arguments, ::mlir::Value num_parallel_calls, ::mlir::SymbolRefAttr f, ::mlir::ArrayAttr output_types, ::mlir::ArrayAttr output_shapes, ::mlir::BoolAttr use_inter_op_parallelism, ::mlir::BoolAttr sloppy, ::mlir::BoolAttr preserve_cardinality, ::mlir::StringAttr metadata) {
  odsState.addOperands(input_dataset);
  odsState.addOperands(other_arguments);
  odsState.addOperands(num_parallel_calls);
  odsState.addAttribute(fAttrName(odsState.name), f);
  odsState.addAttribute(output_typesAttrName(odsState.name), output_types);
  odsState.addAttribute(output_shapesAttrName(odsState.name), output_shapes);
  odsState.addAttribute(use_inter_op_parallelismAttrName(odsState.name), use_inter_op_parallelism);
  odsState.addAttribute(sloppyAttrName(odsState.name), sloppy);
  odsState.addAttribute(preserve_cardinalityAttrName(odsState.name), preserve_cardinality);
  odsState.addAttribute(metadataAttrName(odsState.name), metadata);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void ParallelMapDatasetOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type handle, ::mlir::Value input_dataset, ::mlir::ValueRange other_arguments, ::mlir::Value num_parallel_calls, ::mlir::SymbolRefAttr f, ::mlir::ArrayAttr output_types, ::mlir::ArrayAttr output_shapes, bool use_inter_op_parallelism, bool sloppy, bool preserve_cardinality, ::llvm::StringRef metadata) {
  odsState.addOperands(input_dataset);
  odsState.addOperands(other_arguments);
  odsState.addOperands(num_parallel_calls);
  odsState.addAttribute(fAttrName(odsState.name), f);
  odsState.addAttribute(output_typesAttrName(odsState.name), output_types);
  odsState.addAttribute(output_shapesAttrName(odsState.name), output_shapes);
  odsState.addAttribute(use_inter_op_parallelismAttrName(odsState.name), odsBuilder.getBoolAttr(use_inter_op_parallelism));
  odsState.addAttribute(sloppyAttrName(odsState.name), odsBuilder.getBoolAttr(sloppy));
  odsState.addAttribute(preserve_cardinalityAttrName(odsState.name), odsBuilder.getBoolAttr(preserve_cardinality));
  odsState.addAttribute(metadataAttrName(odsState.name), odsBuilder.getStringAttr(metadata));
  odsState.addTypes(handle);
}

void ParallelMapDatasetOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input_dataset, ::mlir::ValueRange other_arguments, ::mlir::Value num_parallel_calls, ::mlir::SymbolRefAttr f, ::mlir::ArrayAttr output_types, ::mlir::ArrayAttr output_shapes, bool use_inter_op_parallelism, bool sloppy, bool preserve_cardinality, ::llvm::StringRef metadata) {
  odsState.addOperands(input_dataset);
  odsState.addOperands(other_arguments);
  odsState.addOperands(num_parallel_calls);
  odsState.addAttribute(fAttrName(odsState.name), f);
  odsState.addAttribute(output_typesAttrName(odsState.name), output_types);
  odsState.addAttribute(output_shapesAttrName(odsState.name), output_shapes);
  odsState.addAttribute(use_inter_op_parallelismAttrName(odsState.name), odsBuilder.getBoolAttr(use_inter_op_parallelism));
  odsState.addAttribute(sloppyAttrName(odsState.name), odsBuilder.getBoolAttr(sloppy));
  odsState.addAttribute(preserve_cardinalityAttrName(odsState.name), odsBuilder.getBoolAttr(preserve_cardinality));
  odsState.addAttribute(metadataAttrName(odsState.name), odsBuilder.getStringAttr(metadata));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void ParallelMapDatasetOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() >= 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult ParallelMapDatasetOp::verify() {
  {
    auto tblgen_f = (*this)->getAttr(fAttrName());
    if (!tblgen_f)
      return emitOpError("requires attribute 'f'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops12(*this, tblgen_f, "f")))
      return ::mlir::failure();
  }
  {
    auto tblgen_output_types = (*this)->getAttr(output_typesAttrName());
    if (!tblgen_output_types)
      return emitOpError("requires attribute 'output_types'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops2(*this, tblgen_output_types, "output_types")))
      return ::mlir::failure();
  }
  {
    auto tblgen_output_shapes = (*this)->getAttr(output_shapesAttrName());
    if (!tblgen_output_shapes)
      return emitOpError("requires attribute 'output_shapes'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops3(*this, tblgen_output_shapes, "output_shapes")))
      return ::mlir::failure();
  }
  {
    auto tblgen_use_inter_op_parallelism = (*this)->getAttr(use_inter_op_parallelismAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_use_inter_op_parallelism, "use_inter_op_parallelism")))
      return ::mlir::failure();
  }
  {
    auto tblgen_sloppy = (*this)->getAttr(sloppyAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_sloppy, "sloppy")))
      return ::mlir::failure();
  }
  {
    auto tblgen_preserve_cardinality = (*this)->getAttr(preserve_cardinalityAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_preserve_cardinality, "preserve_cardinality")))
      return ::mlir::failure();
  }
  {
    auto tblgen_metadata = (*this)->getAttr(metadataAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_metadata, "metadata")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops15(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops11(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops15(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void ParallelMapDatasetOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::ParallelMapDatasetOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::ParallelMapDatasetV2Op definitions
//===----------------------------------------------------------------------===//

ParallelMapDatasetV2OpAdaptor::ParallelMapDatasetV2OpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

ParallelMapDatasetV2OpAdaptor::ParallelMapDatasetV2OpAdaptor(ParallelMapDatasetV2Op &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange ParallelMapDatasetV2OpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> ParallelMapDatasetV2OpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  bool isVariadic[] = {false, true, false};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (odsOperands.size() - 2) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::ValueRange ParallelMapDatasetV2OpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ParallelMapDatasetV2OpAdaptor::input_dataset() {
  return *getODSOperands(0).begin();
}

::mlir::ValueRange ParallelMapDatasetV2OpAdaptor::other_arguments() {
  return getODSOperands(1);
}

::mlir::Value ParallelMapDatasetV2OpAdaptor::num_parallel_calls() {
  return *getODSOperands(2).begin();
}

::mlir::DictionaryAttr ParallelMapDatasetV2OpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::SymbolRefAttr ParallelMapDatasetV2OpAdaptor::f() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::SymbolRefAttr attr = odsAttrs.get("f").cast<::mlir::SymbolRefAttr>();
  return attr;
}

::mlir::ArrayAttr ParallelMapDatasetV2OpAdaptor::output_types() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("output_types").cast<::mlir::ArrayAttr>();
  return attr;
}

::mlir::ArrayAttr ParallelMapDatasetV2OpAdaptor::output_shapes() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("output_shapes").cast<::mlir::ArrayAttr>();
  return attr;
}

::mlir::BoolAttr ParallelMapDatasetV2OpAdaptor::use_inter_op_parallelism() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("use_inter_op_parallelism").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(true);
  return attr;
}

::mlir::StringAttr ParallelMapDatasetV2OpAdaptor::deterministic() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("deterministic").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("default");
  return attr;
}

::mlir::BoolAttr ParallelMapDatasetV2OpAdaptor::preserve_cardinality() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("preserve_cardinality").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(false);
  return attr;
}

::mlir::StringAttr ParallelMapDatasetV2OpAdaptor::metadata() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("metadata").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("");
  return attr;
}

::mlir::LogicalResult ParallelMapDatasetV2OpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_f = odsAttrs.get("f");
    if (!tblgen_f)
      return emitError(loc, "'tf.ParallelMapDatasetV2' op ""requires attribute 'f'");

    if (tblgen_f && !((tblgen_f.isa<::mlir::SymbolRefAttr>())))
      return emitError(loc, "'tf.ParallelMapDatasetV2' op ""attribute 'f' failed to satisfy constraint: symbol reference attribute");
  }
  {
    auto tblgen_output_types = odsAttrs.get("output_types");
    if (!tblgen_output_types)
      return emitError(loc, "'tf.ParallelMapDatasetV2' op ""requires attribute 'output_types'");

    if (tblgen_output_types && !((((tblgen_output_types.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_output_types.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return ((attr.isa<::mlir::TypeAttr>())) && ((attr.cast<::mlir::TypeAttr>().getValue().isa<::mlir::Type>())); }))) && ((tblgen_output_types.cast<::mlir::ArrayAttr>().size() >= 1))))
      return emitError(loc, "'tf.ParallelMapDatasetV2' op ""attribute 'output_types' failed to satisfy constraint: type array attribute with at least 1 elements");
  }
  {
    auto tblgen_output_shapes = odsAttrs.get("output_shapes");
    if (!tblgen_output_shapes)
      return emitError(loc, "'tf.ParallelMapDatasetV2' op ""requires attribute 'output_shapes'");

    if (tblgen_output_shapes && !((((tblgen_output_shapes.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_output_shapes.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return (attr.isa<mlir::TF::ShapeAttr>()); }))) && ((tblgen_output_shapes.cast<::mlir::ArrayAttr>().size() >= 1))))
      return emitError(loc, "'tf.ParallelMapDatasetV2' op ""attribute 'output_shapes' failed to satisfy constraint: tensorflow shape attribute array with at least 1 elements");
  }
  {
    auto tblgen_use_inter_op_parallelism = odsAttrs.get("use_inter_op_parallelism");
    if (tblgen_use_inter_op_parallelism && !((tblgen_use_inter_op_parallelism.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.ParallelMapDatasetV2' op ""attribute 'use_inter_op_parallelism' failed to satisfy constraint: bool attribute");
  }
  {
    auto tblgen_deterministic = odsAttrs.get("deterministic");
    if (tblgen_deterministic && !((tblgen_deterministic.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.ParallelMapDatasetV2' op ""attribute 'deterministic' failed to satisfy constraint: string attribute");
  }
  {
    auto tblgen_preserve_cardinality = odsAttrs.get("preserve_cardinality");
    if (tblgen_preserve_cardinality && !((tblgen_preserve_cardinality.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.ParallelMapDatasetV2' op ""attribute 'preserve_cardinality' failed to satisfy constraint: bool attribute");
  }
  {
    auto tblgen_metadata = odsAttrs.get("metadata");
    if (tblgen_metadata && !((tblgen_metadata.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.ParallelMapDatasetV2' op ""attribute 'metadata' failed to satisfy constraint: string attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> ParallelMapDatasetV2Op::getODSOperandIndexAndLength(unsigned index) {
  bool isVariadic[] = {false, true, false};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (getOperation()->getNumOperands() - 2) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::Operation::operand_range ParallelMapDatasetV2Op::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ParallelMapDatasetV2Op::input_dataset() {
  return *getODSOperands(0).begin();
}

::mlir::Operation::operand_range ParallelMapDatasetV2Op::other_arguments() {
  return getODSOperands(1);
}

::mlir::Value ParallelMapDatasetV2Op::num_parallel_calls() {
  return *getODSOperands(2).begin();
}

::mlir::MutableOperandRange ParallelMapDatasetV2Op::input_datasetMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ParallelMapDatasetV2Op::other_argumentsMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ParallelMapDatasetV2Op::num_parallel_callsMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> ParallelMapDatasetV2Op::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range ParallelMapDatasetV2Op::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ParallelMapDatasetV2Op::handle() {
  return *getODSResults(0).begin();
}

::mlir::SymbolRefAttr ParallelMapDatasetV2Op::fAttr() {
  return (*this)->getAttr(fAttrName()).cast<::mlir::SymbolRefAttr>();
}

::mlir::SymbolRefAttr ParallelMapDatasetV2Op::f() {
  auto attr = fAttr();
  return attr;
}

::mlir::ArrayAttr ParallelMapDatasetV2Op::output_typesAttr() {
  return (*this)->getAttr(output_typesAttrName()).cast<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr ParallelMapDatasetV2Op::output_types() {
  auto attr = output_typesAttr();
  return attr;
}

::mlir::ArrayAttr ParallelMapDatasetV2Op::output_shapesAttr() {
  return (*this)->getAttr(output_shapesAttrName()).cast<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr ParallelMapDatasetV2Op::output_shapes() {
  auto attr = output_shapesAttr();
  return attr;
}

::mlir::BoolAttr ParallelMapDatasetV2Op::use_inter_op_parallelismAttr() {
  return (*this)->getAttr(use_inter_op_parallelismAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool ParallelMapDatasetV2Op::use_inter_op_parallelism() {
  auto attr = use_inter_op_parallelismAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(true).getValue();
  return attr.getValue();
}

::mlir::StringAttr ParallelMapDatasetV2Op::deterministicAttr() {
  return (*this)->getAttr(deterministicAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef ParallelMapDatasetV2Op::deterministic() {
  auto attr = deterministicAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("default").getValue();
  return attr.getValue();
}

::mlir::BoolAttr ParallelMapDatasetV2Op::preserve_cardinalityAttr() {
  return (*this)->getAttr(preserve_cardinalityAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool ParallelMapDatasetV2Op::preserve_cardinality() {
  auto attr = preserve_cardinalityAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(false).getValue();
  return attr.getValue();
}

::mlir::StringAttr ParallelMapDatasetV2Op::metadataAttr() {
  return (*this)->getAttr(metadataAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef ParallelMapDatasetV2Op::metadata() {
  auto attr = metadataAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("").getValue();
  return attr.getValue();
}

mlir::OperandElementTypeRange ParallelMapDatasetV2Op::Targuments() {
  auto values = getODSOperands(1);
return {mlir::OperandElementTypeIterator(values.begin()), mlir::OperandElementTypeIterator(values.end())};
}

bool ParallelMapDatasetV2Op::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "Targuments") return true;
 return false;
}

::mlir::DictionaryAttr ParallelMapDatasetV2Op::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TargumentsAttrName(),
ArrayAttr::get(ctx, 
    [&]() {
      llvm::SmallVector<Attribute, 4> ret;
      for (auto t : Targuments())
        ret.push_back(TypeAttr::get(t));
      return ret;
    }())}});
}

void ParallelMapDatasetV2Op::fAttr(::mlir::SymbolRefAttr attr) {
  (*this)->setAttr(fAttrName(), attr);
}

void ParallelMapDatasetV2Op::output_typesAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(output_typesAttrName(), attr);
}

void ParallelMapDatasetV2Op::output_shapesAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(output_shapesAttrName(), attr);
}

void ParallelMapDatasetV2Op::use_inter_op_parallelismAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(use_inter_op_parallelismAttrName(), attr);
}

void ParallelMapDatasetV2Op::deterministicAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(deterministicAttrName(), attr);
}

void ParallelMapDatasetV2Op::preserve_cardinalityAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(preserve_cardinalityAttrName(), attr);
}

void ParallelMapDatasetV2Op::metadataAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(metadataAttrName(), attr);
}

void ParallelMapDatasetV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type handle, ::mlir::Value input_dataset, ::mlir::ValueRange other_arguments, ::mlir::Value num_parallel_calls, ::mlir::SymbolRefAttr f, ::mlir::ArrayAttr output_types, ::mlir::ArrayAttr output_shapes, ::mlir::BoolAttr use_inter_op_parallelism, ::mlir::StringAttr deterministic, ::mlir::BoolAttr preserve_cardinality, ::mlir::StringAttr metadata) {
  odsState.addOperands(input_dataset);
  odsState.addOperands(other_arguments);
  odsState.addOperands(num_parallel_calls);
  odsState.addAttribute(fAttrName(odsState.name), f);
  odsState.addAttribute(output_typesAttrName(odsState.name), output_types);
  odsState.addAttribute(output_shapesAttrName(odsState.name), output_shapes);
  odsState.addAttribute(use_inter_op_parallelismAttrName(odsState.name), use_inter_op_parallelism);
  odsState.addAttribute(deterministicAttrName(odsState.name), deterministic);
  odsState.addAttribute(preserve_cardinalityAttrName(odsState.name), preserve_cardinality);
  odsState.addAttribute(metadataAttrName(odsState.name), metadata);
  odsState.addTypes(handle);
}

void ParallelMapDatasetV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input_dataset, ::mlir::ValueRange other_arguments, ::mlir::Value num_parallel_calls, ::mlir::SymbolRefAttr f, ::mlir::ArrayAttr output_types, ::mlir::ArrayAttr output_shapes, ::mlir::BoolAttr use_inter_op_parallelism, ::mlir::StringAttr deterministic, ::mlir::BoolAttr preserve_cardinality, ::mlir::StringAttr metadata) {
  odsState.addOperands(input_dataset);
  odsState.addOperands(other_arguments);
  odsState.addOperands(num_parallel_calls);
  odsState.addAttribute(fAttrName(odsState.name), f);
  odsState.addAttribute(output_typesAttrName(odsState.name), output_types);
  odsState.addAttribute(output_shapesAttrName(odsState.name), output_shapes);
  odsState.addAttribute(use_inter_op_parallelismAttrName(odsState.name), use_inter_op_parallelism);
  odsState.addAttribute(deterministicAttrName(odsState.name), deterministic);
  odsState.addAttribute(preserve_cardinalityAttrName(odsState.name), preserve_cardinality);
  odsState.addAttribute(metadataAttrName(odsState.name), metadata);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void ParallelMapDatasetV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type handle, ::mlir::Value input_dataset, ::mlir::ValueRange other_arguments, ::mlir::Value num_parallel_calls, ::mlir::SymbolRefAttr f, ::mlir::ArrayAttr output_types, ::mlir::ArrayAttr output_shapes, bool use_inter_op_parallelism, ::llvm::StringRef deterministic, bool preserve_cardinality, ::llvm::StringRef metadata) {
  odsState.addOperands(input_dataset);
  odsState.addOperands(other_arguments);
  odsState.addOperands(num_parallel_calls);
  odsState.addAttribute(fAttrName(odsState.name), f);
  odsState.addAttribute(output_typesAttrName(odsState.name), output_types);
  odsState.addAttribute(output_shapesAttrName(odsState.name), output_shapes);
  odsState.addAttribute(use_inter_op_parallelismAttrName(odsState.name), odsBuilder.getBoolAttr(use_inter_op_parallelism));
  odsState.addAttribute(deterministicAttrName(odsState.name), odsBuilder.getStringAttr(deterministic));
  odsState.addAttribute(preserve_cardinalityAttrName(odsState.name), odsBuilder.getBoolAttr(preserve_cardinality));
  odsState.addAttribute(metadataAttrName(odsState.name), odsBuilder.getStringAttr(metadata));
  odsState.addTypes(handle);
}

void ParallelMapDatasetV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input_dataset, ::mlir::ValueRange other_arguments, ::mlir::Value num_parallel_calls, ::mlir::SymbolRefAttr f, ::mlir::ArrayAttr output_types, ::mlir::ArrayAttr output_shapes, bool use_inter_op_parallelism, ::llvm::StringRef deterministic, bool preserve_cardinality, ::llvm::StringRef metadata) {
  odsState.addOperands(input_dataset);
  odsState.addOperands(other_arguments);
  odsState.addOperands(num_parallel_calls);
  odsState.addAttribute(fAttrName(odsState.name), f);
  odsState.addAttribute(output_typesAttrName(odsState.name), output_types);
  odsState.addAttribute(output_shapesAttrName(odsState.name), output_shapes);
  odsState.addAttribute(use_inter_op_parallelismAttrName(odsState.name), odsBuilder.getBoolAttr(use_inter_op_parallelism));
  odsState.addAttribute(deterministicAttrName(odsState.name), odsBuilder.getStringAttr(deterministic));
  odsState.addAttribute(preserve_cardinalityAttrName(odsState.name), odsBuilder.getBoolAttr(preserve_cardinality));
  odsState.addAttribute(metadataAttrName(odsState.name), odsBuilder.getStringAttr(metadata));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void ParallelMapDatasetV2Op::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() >= 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult ParallelMapDatasetV2Op::verify() {
  {
    auto tblgen_f = (*this)->getAttr(fAttrName());
    if (!tblgen_f)
      return emitOpError("requires attribute 'f'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops12(*this, tblgen_f, "f")))
      return ::mlir::failure();
  }
  {
    auto tblgen_output_types = (*this)->getAttr(output_typesAttrName());
    if (!tblgen_output_types)
      return emitOpError("requires attribute 'output_types'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops2(*this, tblgen_output_types, "output_types")))
      return ::mlir::failure();
  }
  {
    auto tblgen_output_shapes = (*this)->getAttr(output_shapesAttrName());
    if (!tblgen_output_shapes)
      return emitOpError("requires attribute 'output_shapes'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops3(*this, tblgen_output_shapes, "output_shapes")))
      return ::mlir::failure();
  }
  {
    auto tblgen_use_inter_op_parallelism = (*this)->getAttr(use_inter_op_parallelismAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_use_inter_op_parallelism, "use_inter_op_parallelism")))
      return ::mlir::failure();
  }
  {
    auto tblgen_deterministic = (*this)->getAttr(deterministicAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_deterministic, "deterministic")))
      return ::mlir::failure();
  }
  {
    auto tblgen_preserve_cardinality = (*this)->getAttr(preserve_cardinalityAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_preserve_cardinality, "preserve_cardinality")))
      return ::mlir::failure();
  }
  {
    auto tblgen_metadata = (*this)->getAttr(metadataAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_metadata, "metadata")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops15(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops16(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops15(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void ParallelMapDatasetV2Op::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::ParallelMapDatasetV2Op)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::ParameterizedTruncatedNormalOp definitions
//===----------------------------------------------------------------------===//

ParameterizedTruncatedNormalOpAdaptor::ParameterizedTruncatedNormalOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

ParameterizedTruncatedNormalOpAdaptor::ParameterizedTruncatedNormalOpAdaptor(ParameterizedTruncatedNormalOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange ParameterizedTruncatedNormalOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> ParameterizedTruncatedNormalOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange ParameterizedTruncatedNormalOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ParameterizedTruncatedNormalOpAdaptor::shape() {
  return *getODSOperands(0).begin();
}

::mlir::Value ParameterizedTruncatedNormalOpAdaptor::means() {
  return *getODSOperands(1).begin();
}

::mlir::Value ParameterizedTruncatedNormalOpAdaptor::stdevs() {
  return *getODSOperands(2).begin();
}

::mlir::Value ParameterizedTruncatedNormalOpAdaptor::minvals() {
  return *getODSOperands(3).begin();
}

::mlir::Value ParameterizedTruncatedNormalOpAdaptor::maxvals() {
  return *getODSOperands(4).begin();
}

::mlir::DictionaryAttr ParameterizedTruncatedNormalOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::IntegerAttr ParameterizedTruncatedNormalOpAdaptor::seed() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("seed").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), 0);
  return attr;
}

::mlir::IntegerAttr ParameterizedTruncatedNormalOpAdaptor::seed2() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("seed2").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), 0);
  return attr;
}

::mlir::LogicalResult ParameterizedTruncatedNormalOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_seed = odsAttrs.get("seed");
    if (tblgen_seed && !(((tblgen_seed.isa<::mlir::IntegerAttr>())) && ((tblgen_seed.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.ParameterizedTruncatedNormal' op ""attribute 'seed' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_seed2 = odsAttrs.get("seed2");
    if (tblgen_seed2 && !(((tblgen_seed2.isa<::mlir::IntegerAttr>())) && ((tblgen_seed2.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.ParameterizedTruncatedNormal' op ""attribute 'seed2' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> ParameterizedTruncatedNormalOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range ParameterizedTruncatedNormalOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ParameterizedTruncatedNormalOp::shape() {
  return *getODSOperands(0).begin();
}

::mlir::Value ParameterizedTruncatedNormalOp::means() {
  return *getODSOperands(1).begin();
}

::mlir::Value ParameterizedTruncatedNormalOp::stdevs() {
  return *getODSOperands(2).begin();
}

::mlir::Value ParameterizedTruncatedNormalOp::minvals() {
  return *getODSOperands(3).begin();
}

::mlir::Value ParameterizedTruncatedNormalOp::maxvals() {
  return *getODSOperands(4).begin();
}

::mlir::MutableOperandRange ParameterizedTruncatedNormalOp::shapeMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ParameterizedTruncatedNormalOp::meansMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ParameterizedTruncatedNormalOp::stdevsMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ParameterizedTruncatedNormalOp::minvalsMutable() {
  auto range = getODSOperandIndexAndLength(3);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ParameterizedTruncatedNormalOp::maxvalsMutable() {
  auto range = getODSOperandIndexAndLength(4);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> ParameterizedTruncatedNormalOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range ParameterizedTruncatedNormalOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ParameterizedTruncatedNormalOp::output() {
  return *getODSResults(0).begin();
}

::mlir::IntegerAttr ParameterizedTruncatedNormalOp::seedAttr() {
  return (*this)->getAttr(seedAttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t ParameterizedTruncatedNormalOp::seed() {
  auto attr = seedAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), 0).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

::mlir::IntegerAttr ParameterizedTruncatedNormalOp::seed2Attr() {
  return (*this)->getAttr(seed2AttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t ParameterizedTruncatedNormalOp::seed2() {
  auto attr = seed2Attr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), 0).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

::mlir::Type ParameterizedTruncatedNormalOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

::mlir::Type ParameterizedTruncatedNormalOp::dtype() {
  return mlir::getElementTypeOrSelf(*getODSOperands(1).begin());
}

bool ParameterizedTruncatedNormalOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
  if (name == "dtype") return true;
 return false;
}

::mlir::DictionaryAttr ParameterizedTruncatedNormalOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())},
    {dtypeAttrName(),
::mlir::TypeAttr::get(dtype())}});
}

void ParameterizedTruncatedNormalOp::seedAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(seedAttrName(), attr);
}

void ParameterizedTruncatedNormalOp::seed2Attr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(seed2AttrName(), attr);
}

void ParameterizedTruncatedNormalOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value shape, ::mlir::Value means, ::mlir::Value stdevs, ::mlir::Value minvals, ::mlir::Value maxvals, ::mlir::IntegerAttr seed, ::mlir::IntegerAttr seed2) {
  odsState.addOperands(shape);
  odsState.addOperands(means);
  odsState.addOperands(stdevs);
  odsState.addOperands(minvals);
  odsState.addOperands(maxvals);
  odsState.addAttribute(seedAttrName(odsState.name), seed);
  odsState.addAttribute(seed2AttrName(odsState.name), seed2);
  odsState.addTypes(output);
}

void ParameterizedTruncatedNormalOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value shape, ::mlir::Value means, ::mlir::Value stdevs, ::mlir::Value minvals, ::mlir::Value maxvals, ::mlir::IntegerAttr seed, ::mlir::IntegerAttr seed2) {
  odsState.addOperands(shape);
  odsState.addOperands(means);
  odsState.addOperands(stdevs);
  odsState.addOperands(minvals);
  odsState.addOperands(maxvals);
  odsState.addAttribute(seedAttrName(odsState.name), seed);
  odsState.addAttribute(seed2AttrName(odsState.name), seed2);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void ParameterizedTruncatedNormalOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value shape, ::mlir::Value means, ::mlir::Value stdevs, ::mlir::Value minvals, ::mlir::Value maxvals, uint64_t seed, uint64_t seed2) {
  odsState.addOperands(shape);
  odsState.addOperands(means);
  odsState.addOperands(stdevs);
  odsState.addOperands(minvals);
  odsState.addOperands(maxvals);
  odsState.addAttribute(seedAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), seed));
  odsState.addAttribute(seed2AttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), seed2));
  odsState.addTypes(output);
}

void ParameterizedTruncatedNormalOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value shape, ::mlir::Value means, ::mlir::Value stdevs, ::mlir::Value minvals, ::mlir::Value maxvals, uint64_t seed, uint64_t seed2) {
  odsState.addOperands(shape);
  odsState.addOperands(means);
  odsState.addOperands(stdevs);
  odsState.addOperands(minvals);
  odsState.addOperands(maxvals);
  odsState.addAttribute(seedAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), seed));
  odsState.addAttribute(seed2AttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), seed2));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void ParameterizedTruncatedNormalOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 5u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult ParameterizedTruncatedNormalOp::verify() {
  {
    auto tblgen_seed = (*this)->getAttr(seedAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_seed, "seed")))
      return ::mlir::failure();
  }
  {
    auto tblgen_seed2 = (*this)->getAttr(seed2AttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_seed2, "seed2")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup3 = getODSOperands(3);

    for (auto v : valueGroup3) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup4 = getODSOperands(4);

    for (auto v : valueGroup4) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::ParameterizedTruncatedNormalOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::ParseExampleOp definitions
//===----------------------------------------------------------------------===//

ParseExampleOpAdaptor::ParseExampleOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

ParseExampleOpAdaptor::ParseExampleOpAdaptor(ParseExampleOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange ParseExampleOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> ParseExampleOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  assert(odsAttrs && "missing segment size attribute for op");
  auto sizeAttr = odsAttrs.get("operand_segment_sizes").cast<::mlir::DenseIntElementsAttr>();

  const uint32_t *sizeAttrValueIt = &*sizeAttr.value_begin<uint32_t>();
  if (sizeAttr.isSplat())
    return {*sizeAttrValueIt * index, *sizeAttrValueIt};

  unsigned start = 0;
  for (unsigned i = 0; i < index; ++i)
    start += sizeAttrValueIt[i];
  return {start, sizeAttrValueIt[index]};
}

::mlir::ValueRange ParseExampleOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ParseExampleOpAdaptor::serialized() {
  return *getODSOperands(0).begin();
}

::mlir::Value ParseExampleOpAdaptor::names() {
  return *getODSOperands(1).begin();
}

::mlir::ValueRange ParseExampleOpAdaptor::sparse_keys() {
  return getODSOperands(2);
}

::mlir::ValueRange ParseExampleOpAdaptor::dense_keys() {
  return getODSOperands(3);
}

::mlir::ValueRange ParseExampleOpAdaptor::dense_defaults() {
  return getODSOperands(4);
}

::mlir::DictionaryAttr ParseExampleOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::ArrayAttr ParseExampleOpAdaptor::dense_shapes() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("dense_shapes").cast<::mlir::ArrayAttr>();
  return attr;
}

::mlir::DenseIntElementsAttr ParseExampleOpAdaptor::result_segment_sizes() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::DenseIntElementsAttr attr = odsAttrs.get("result_segment_sizes").cast<::mlir::DenseIntElementsAttr>();
  return attr;
}

::mlir::DenseIntElementsAttr ParseExampleOpAdaptor::operand_segment_sizes() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::DenseIntElementsAttr attr = odsAttrs.get("operand_segment_sizes").cast<::mlir::DenseIntElementsAttr>();
  return attr;
}

::mlir::LogicalResult ParseExampleOpAdaptor::verify(::mlir::Location loc) {
  {
    auto sizeAttr = odsAttrs.get("result_segment_sizes").dyn_cast<::mlir::DenseIntElementsAttr>();
    if (!sizeAttr)
      return emitError(loc, "'tf.ParseExample' op ""missing segment sizes attribute 'result_segment_sizes'");
    auto numElements =
        sizeAttr.getType().cast<::mlir::ShapedType>().getNumElements();
    if (numElements != 4)
      return emitError(loc, "'tf.ParseExample' op ""'result_segment_sizes' attribute for specifying result segments must have 4 "
                "elements, but got ") << numElements;
  }

  {
    auto sizeAttr = odsAttrs.get("operand_segment_sizes").dyn_cast<::mlir::DenseIntElementsAttr>();
    if (!sizeAttr)
      return emitError(loc, "'tf.ParseExample' op ""missing segment sizes attribute 'operand_segment_sizes'");
    auto numElements =
        sizeAttr.getType().cast<::mlir::ShapedType>().getNumElements();
    if (numElements != 5)
      return emitError(loc, "'tf.ParseExample' op ""'operand_segment_sizes' attribute for specifying operand segments must have 5 "
                "elements, but got ") << numElements;
  }
    {
    auto tblgen_dense_shapes = odsAttrs.get("dense_shapes");
    if (!tblgen_dense_shapes)
      return emitError(loc, "'tf.ParseExample' op ""requires attribute 'dense_shapes'");

    if (tblgen_dense_shapes && !(((tblgen_dense_shapes.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_dense_shapes.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return (attr.isa<mlir::TF::ShapeAttr>()); }))))
      return emitError(loc, "'tf.ParseExample' op ""attribute 'dense_shapes' failed to satisfy constraint: tensorflow shape attribute array");
  }
  {
    auto tblgen_result_segment_sizes = odsAttrs.get("result_segment_sizes");
    if (!tblgen_result_segment_sizes)
      return emitError(loc, "'tf.ParseExample' op ""requires attribute 'result_segment_sizes'");

    if (tblgen_result_segment_sizes && !(((tblgen_result_segment_sizes.isa<::mlir::DenseIntElementsAttr>())) && ((tblgen_result_segment_sizes.cast<::mlir::DenseIntElementsAttr>().getType().getElementType().isSignlessInteger(32)))))
      return emitError(loc, "'tf.ParseExample' op ""attribute 'result_segment_sizes' failed to satisfy constraint: 32-bit signless integer elements attribute");
  }
  {
    auto tblgen_operand_segment_sizes = odsAttrs.get("operand_segment_sizes");
    if (!tblgen_operand_segment_sizes)
      return emitError(loc, "'tf.ParseExample' op ""requires attribute 'operand_segment_sizes'");

    if (tblgen_operand_segment_sizes && !(((tblgen_operand_segment_sizes.isa<::mlir::DenseIntElementsAttr>())) && ((tblgen_operand_segment_sizes.cast<::mlir::DenseIntElementsAttr>().getType().getElementType().isSignlessInteger(32)))))
      return emitError(loc, "'tf.ParseExample' op ""attribute 'operand_segment_sizes' failed to satisfy constraint: 32-bit signless integer elements attribute");
  }
  return ::mlir::success();
}

void ParseExampleOp::getAsmResultNames(::mlir::OpAsmSetValueNameFn setNameFn) {
  auto resultGroup0 = getODSResults(0);
  if (!llvm::empty(resultGroup0))
    setNameFn(*resultGroup0.begin(), "sparse_indices");
  auto resultGroup1 = getODSResults(1);
  if (!llvm::empty(resultGroup1))
    setNameFn(*resultGroup1.begin(), "sparse_values");
  auto resultGroup2 = getODSResults(2);
  if (!llvm::empty(resultGroup2))
    setNameFn(*resultGroup2.begin(), "sparse_shapes");
  auto resultGroup3 = getODSResults(3);
  if (!llvm::empty(resultGroup3))
    setNameFn(*resultGroup3.begin(), "dense_values");
}

std::pair<unsigned, unsigned> ParseExampleOp::getODSOperandIndexAndLength(unsigned index) {
  auto sizeAttr =
      (*this)->getAttr(operand_segment_sizesAttrName()).cast<::mlir::DenseIntElementsAttr>();

  const uint32_t *sizeAttrValueIt = &*sizeAttr.value_begin<uint32_t>();
  if (sizeAttr.isSplat())
    return {*sizeAttrValueIt * index, *sizeAttrValueIt};

  unsigned start = 0;
  for (unsigned i = 0; i < index; ++i)
    start += sizeAttrValueIt[i];
  return {start, sizeAttrValueIt[index]};
}

::mlir::Operation::operand_range ParseExampleOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ParseExampleOp::serialized() {
  return *getODSOperands(0).begin();
}

::mlir::Value ParseExampleOp::names() {
  return *getODSOperands(1).begin();
}

::mlir::Operation::operand_range ParseExampleOp::sparse_keys() {
  return getODSOperands(2);
}

::mlir::Operation::operand_range ParseExampleOp::dense_keys() {
  return getODSOperands(3);
}

::mlir::Operation::operand_range ParseExampleOp::dense_defaults() {
  return getODSOperands(4);
}

::mlir::MutableOperandRange ParseExampleOp::serializedMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second, ::mlir::MutableOperandRange::OperandSegment(0u, *getOperation()->getAttrDictionary().getNamed(operand_segment_sizesAttrName())));
  return mutableRange;
}

::mlir::MutableOperandRange ParseExampleOp::namesMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second, ::mlir::MutableOperandRange::OperandSegment(1u, *getOperation()->getAttrDictionary().getNamed(operand_segment_sizesAttrName())));
  return mutableRange;
}

::mlir::MutableOperandRange ParseExampleOp::sparse_keysMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second, ::mlir::MutableOperandRange::OperandSegment(2u, *getOperation()->getAttrDictionary().getNamed(operand_segment_sizesAttrName())));
  return mutableRange;
}

::mlir::MutableOperandRange ParseExampleOp::dense_keysMutable() {
  auto range = getODSOperandIndexAndLength(3);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second, ::mlir::MutableOperandRange::OperandSegment(3u, *getOperation()->getAttrDictionary().getNamed(operand_segment_sizesAttrName())));
  return mutableRange;
}

::mlir::MutableOperandRange ParseExampleOp::dense_defaultsMutable() {
  auto range = getODSOperandIndexAndLength(4);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second, ::mlir::MutableOperandRange::OperandSegment(4u, *getOperation()->getAttrDictionary().getNamed(operand_segment_sizesAttrName())));
  return mutableRange;
}

std::pair<unsigned, unsigned> ParseExampleOp::getODSResultIndexAndLength(unsigned index) {
  auto sizeAttr =
      (*this)->getAttr(result_segment_sizesAttrName()).cast<::mlir::DenseIntElementsAttr>();

  const uint32_t *sizeAttrValueIt = &*sizeAttr.value_begin<uint32_t>();
  if (sizeAttr.isSplat())
    return {*sizeAttrValueIt * index, *sizeAttrValueIt};

  unsigned start = 0;
  for (unsigned i = 0; i < index; ++i)
    start += sizeAttrValueIt[i];
  return {start, sizeAttrValueIt[index]};
}

::mlir::Operation::result_range ParseExampleOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Operation::result_range ParseExampleOp::sparse_indices() {
  return getODSResults(0);
}

::mlir::Operation::result_range ParseExampleOp::sparse_values() {
  return getODSResults(1);
}

::mlir::Operation::result_range ParseExampleOp::sparse_shapes() {
  return getODSResults(2);
}

::mlir::Operation::result_range ParseExampleOp::dense_values() {
  return getODSResults(3);
}

::mlir::ArrayAttr ParseExampleOp::dense_shapesAttr() {
  return (*this)->getAttr(dense_shapesAttrName()).cast<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr ParseExampleOp::dense_shapes() {
  auto attr = dense_shapesAttr();
  return attr;
}

::mlir::DenseIntElementsAttr ParseExampleOp::result_segment_sizesAttr() {
  return (*this)->getAttr(result_segment_sizesAttrName()).cast<::mlir::DenseIntElementsAttr>();
}

::mlir::DenseIntElementsAttr ParseExampleOp::result_segment_sizes() {
  auto attr = result_segment_sizesAttr();
  return attr;
}

::mlir::DenseIntElementsAttr ParseExampleOp::operand_segment_sizesAttr() {
  return (*this)->getAttr(operand_segment_sizesAttrName()).cast<::mlir::DenseIntElementsAttr>();
}

::mlir::DenseIntElementsAttr ParseExampleOp::operand_segment_sizes() {
  auto attr = operand_segment_sizesAttr();
  return attr;
}

size_t ParseExampleOp::Nsparse() {
  auto range = getODSOperands(2);
return std::distance(range.begin(), range.end());
}

size_t ParseExampleOp::Ndense() {
  auto range = getODSOperands(3);
return std::distance(range.begin(), range.end());
}

mlir::OperandElementTypeRange ParseExampleOp::Tdense() {
  auto values = getODSOperands(4);
return {mlir::OperandElementTypeIterator(values.begin()), mlir::OperandElementTypeIterator(values.end())};
}

mlir::ResultElementTypeRange ParseExampleOp::sparse_types() {
  auto values = getODSResults(1);
return {mlir::ResultElementTypeIterator(values.begin()), mlir::ResultElementTypeIterator(values.end())};
}

bool ParseExampleOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "Nsparse") return true;
  if (name == "Ndense") return true;
  if (name == "Tdense") return true;
  if (name == "sparse_types") return true;
 return false;
}

::mlir::DictionaryAttr ParseExampleOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {NsparseAttrName(),
odsBuilder.getI64IntegerAttr(Nsparse())},
    {NdenseAttrName(),
odsBuilder.getI64IntegerAttr(Ndense())},
    {TdenseAttrName(),
ArrayAttr::get(ctx, 
    [&]() {
      llvm::SmallVector<Attribute, 4> ret;
      for (auto t : Tdense())
        ret.push_back(TypeAttr::get(t));
      return ret;
    }())},
    {sparse_typesAttrName(),
ArrayAttr::get(ctx, 
    [&]() {
      llvm::SmallVector<Attribute, 4> ret;
      for (auto t : sparse_types())
        ret.push_back(TypeAttr::get(t));
      return ret;
    }())}});
}

void ParseExampleOp::dense_shapesAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(dense_shapesAttrName(), attr);
}

void ParseExampleOp::result_segment_sizesAttr(::mlir::DenseIntElementsAttr attr) {
  (*this)->setAttr(result_segment_sizesAttrName(), attr);
}

void ParseExampleOp::operand_segment_sizesAttr(::mlir::DenseIntElementsAttr attr) {
  (*this)->setAttr(operand_segment_sizesAttrName(), attr);
}

void ParseExampleOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange sparse_indices, ::mlir::TypeRange sparse_values, ::mlir::TypeRange sparse_shapes, ::mlir::TypeRange dense_values, ::mlir::Value serialized, ::mlir::Value names, ::mlir::ValueRange sparse_keys, ::mlir::ValueRange dense_keys, ::mlir::ValueRange dense_defaults, ::mlir::ArrayAttr dense_shapes, ::mlir::DenseIntElementsAttr result_segment_sizes, ::mlir::DenseIntElementsAttr operand_segment_sizes) {
  odsState.addOperands(serialized);
  odsState.addOperands(names);
  odsState.addOperands(sparse_keys);
  odsState.addOperands(dense_keys);
  odsState.addOperands(dense_defaults);
  odsState.addAttribute(operand_segment_sizesAttrName(odsState.name), odsBuilder.getI32VectorAttr({1, 1, static_cast<int32_t>(sparse_keys.size()), static_cast<int32_t>(dense_keys.size()), static_cast<int32_t>(dense_defaults.size())}));
  odsState.addAttribute(dense_shapesAttrName(odsState.name), dense_shapes);
  odsState.addAttribute(result_segment_sizesAttrName(odsState.name), result_segment_sizes);
  odsState.addAttribute(operand_segment_sizesAttrName(odsState.name), operand_segment_sizes);
  odsState.addTypes(sparse_indices);
  odsState.addTypes(sparse_values);
  odsState.addTypes(sparse_shapes);
  odsState.addTypes(dense_values);
}

void ParseExampleOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value serialized, ::mlir::Value names, ::mlir::ValueRange sparse_keys, ::mlir::ValueRange dense_keys, ::mlir::ValueRange dense_defaults, ::mlir::ArrayAttr dense_shapes, ::mlir::DenseIntElementsAttr result_segment_sizes, ::mlir::DenseIntElementsAttr operand_segment_sizes) {
  odsState.addOperands(serialized);
  odsState.addOperands(names);
  odsState.addOperands(sparse_keys);
  odsState.addOperands(dense_keys);
  odsState.addOperands(dense_defaults);
  odsState.addAttribute(operand_segment_sizesAttrName(odsState.name), odsBuilder.getI32VectorAttr({1, 1, static_cast<int32_t>(sparse_keys.size()), static_cast<int32_t>(dense_keys.size()), static_cast<int32_t>(dense_defaults.size())}));
  odsState.addAttribute(dense_shapesAttrName(odsState.name), dense_shapes);
  odsState.addAttribute(result_segment_sizesAttrName(odsState.name), result_segment_sizes);
  odsState.addAttribute(operand_segment_sizesAttrName(odsState.name), operand_segment_sizes);
  odsState.addTypes(resultTypes);
}

void ParseExampleOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() >= 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult ParseExampleOp::verify() {
  {
    auto sizeAttr = (*this)->getAttr(result_segment_sizesAttrName()).dyn_cast<::mlir::DenseIntElementsAttr>();
    if (!sizeAttr)
      return emitOpError("missing segment sizes attribute 'result_segment_sizes'");
    auto numElements =
        sizeAttr.getType().cast<::mlir::ShapedType>().getNumElements();
    if (numElements != 4)
      return emitOpError("'result_segment_sizes' attribute for specifying result segments must have 4 "
                "elements, but got ") << numElements;
  }

  {
    auto sizeAttr = (*this)->getAttr(operand_segment_sizesAttrName()).dyn_cast<::mlir::DenseIntElementsAttr>();
    if (!sizeAttr)
      return emitOpError("missing segment sizes attribute 'operand_segment_sizes'");
    auto numElements =
        sizeAttr.getType().cast<::mlir::ShapedType>().getNumElements();
    if (numElements != 5)
      return emitOpError("'operand_segment_sizes' attribute for specifying operand segments must have 5 "
                "elements, but got ") << numElements;
  }
    {
    auto tblgen_dense_shapes = (*this)->getAttr(dense_shapesAttrName());
    if (!tblgen_dense_shapes)
      return emitOpError("requires attribute 'dense_shapes'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops28(*this, tblgen_dense_shapes, "dense_shapes")))
      return ::mlir::failure();
  }
  {
    auto tblgen_result_segment_sizes = (*this)->getAttr(result_segment_sizesAttrName());
    if (!tblgen_result_segment_sizes)
      return emitOpError("requires attribute 'result_segment_sizes'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops34(*this, tblgen_result_segment_sizes, "result_segment_sizes")))
      return ::mlir::failure();
  }
  {
    auto tblgen_operand_segment_sizes = (*this)->getAttr(operand_segment_sizesAttrName());
    if (!tblgen_operand_segment_sizes)
      return emitOpError("requires attribute 'operand_segment_sizes'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops34(*this, tblgen_operand_segment_sizes, "operand_segment_sizes")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops19(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops19(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops19(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup3 = getODSOperands(3);

    for (auto v : valueGroup3) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops19(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup4 = getODSOperands(4);

    for (auto v : valueGroup4) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops49(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops16(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSResults(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops49(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSResults(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops16(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
    auto valueGroup3 = getODSResults(3);

    for (auto v : valueGroup3) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops49(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void ParseExampleOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::ParseExampleOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::ParseExampleV2Op definitions
//===----------------------------------------------------------------------===//

ParseExampleV2OpAdaptor::ParseExampleV2OpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

ParseExampleV2OpAdaptor::ParseExampleV2OpAdaptor(ParseExampleV2Op &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange ParseExampleV2OpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> ParseExampleV2OpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  bool isVariadic[] = {false, false, false, false, false, true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (odsOperands.size() - 5) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::ValueRange ParseExampleV2OpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ParseExampleV2OpAdaptor::serialized() {
  return *getODSOperands(0).begin();
}

::mlir::Value ParseExampleV2OpAdaptor::names() {
  return *getODSOperands(1).begin();
}

::mlir::Value ParseExampleV2OpAdaptor::sparse_keys() {
  return *getODSOperands(2).begin();
}

::mlir::Value ParseExampleV2OpAdaptor::dense_keys() {
  return *getODSOperands(3).begin();
}

::mlir::Value ParseExampleV2OpAdaptor::ragged_keys() {
  return *getODSOperands(4).begin();
}

::mlir::ValueRange ParseExampleV2OpAdaptor::dense_defaults() {
  return getODSOperands(5);
}

::mlir::DictionaryAttr ParseExampleV2OpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::IntegerAttr ParseExampleV2OpAdaptor::num_sparse() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("num_sparse").cast<::mlir::IntegerAttr>();
  return attr;
}

::mlir::ArrayAttr ParseExampleV2OpAdaptor::dense_shapes() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("dense_shapes").cast<::mlir::ArrayAttr>();
  return attr;
}

::mlir::DenseIntElementsAttr ParseExampleV2OpAdaptor::result_segment_sizes() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::DenseIntElementsAttr attr = odsAttrs.get("result_segment_sizes").cast<::mlir::DenseIntElementsAttr>();
  return attr;
}

::mlir::LogicalResult ParseExampleV2OpAdaptor::verify(::mlir::Location loc) {
  {
    auto sizeAttr = odsAttrs.get("result_segment_sizes").dyn_cast<::mlir::DenseIntElementsAttr>();
    if (!sizeAttr)
      return emitError(loc, "'tf.ParseExampleV2' op ""missing segment sizes attribute 'result_segment_sizes'");
    auto numElements =
        sizeAttr.getType().cast<::mlir::ShapedType>().getNumElements();
    if (numElements != 6)
      return emitError(loc, "'tf.ParseExampleV2' op ""'result_segment_sizes' attribute for specifying result segments must have 6 "
                "elements, but got ") << numElements;
  }
    {
    auto tblgen_num_sparse = odsAttrs.get("num_sparse");
    if (!tblgen_num_sparse)
      return emitError(loc, "'tf.ParseExampleV2' op ""requires attribute 'num_sparse'");

    if (tblgen_num_sparse && !((((tblgen_num_sparse.isa<::mlir::IntegerAttr>())) && ((tblgen_num_sparse.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))) && ((tblgen_num_sparse.cast<::mlir::IntegerAttr>().getInt() >= 0))))
      return emitError(loc, "'tf.ParseExampleV2' op ""attribute 'num_sparse' failed to satisfy constraint: 64-bit signless integer attribute whose minimum value is 0");
  }
  {
    auto tblgen_dense_shapes = odsAttrs.get("dense_shapes");
    if (!tblgen_dense_shapes)
      return emitError(loc, "'tf.ParseExampleV2' op ""requires attribute 'dense_shapes'");

    if (tblgen_dense_shapes && !(((tblgen_dense_shapes.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_dense_shapes.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return (attr.isa<mlir::TF::ShapeAttr>()); }))))
      return emitError(loc, "'tf.ParseExampleV2' op ""attribute 'dense_shapes' failed to satisfy constraint: tensorflow shape attribute array");
  }
  {
    auto tblgen_result_segment_sizes = odsAttrs.get("result_segment_sizes");
    if (!tblgen_result_segment_sizes)
      return emitError(loc, "'tf.ParseExampleV2' op ""requires attribute 'result_segment_sizes'");

    if (tblgen_result_segment_sizes && !(((tblgen_result_segment_sizes.isa<::mlir::DenseIntElementsAttr>())) && ((tblgen_result_segment_sizes.cast<::mlir::DenseIntElementsAttr>().getType().getElementType().isSignlessInteger(32)))))
      return emitError(loc, "'tf.ParseExampleV2' op ""attribute 'result_segment_sizes' failed to satisfy constraint: 32-bit signless integer elements attribute");
  }
  return ::mlir::success();
}

void ParseExampleV2Op::getAsmResultNames(::mlir::OpAsmSetValueNameFn setNameFn) {
  auto resultGroup0 = getODSResults(0);
  if (!llvm::empty(resultGroup0))
    setNameFn(*resultGroup0.begin(), "sparse_indices");
  auto resultGroup1 = getODSResults(1);
  if (!llvm::empty(resultGroup1))
    setNameFn(*resultGroup1.begin(), "sparse_values");
  auto resultGroup2 = getODSResults(2);
  if (!llvm::empty(resultGroup2))
    setNameFn(*resultGroup2.begin(), "sparse_shapes");
  auto resultGroup3 = getODSResults(3);
  if (!llvm::empty(resultGroup3))
    setNameFn(*resultGroup3.begin(), "dense_values");
  auto resultGroup4 = getODSResults(4);
  if (!llvm::empty(resultGroup4))
    setNameFn(*resultGroup4.begin(), "ragged_values");
  auto resultGroup5 = getODSResults(5);
  if (!llvm::empty(resultGroup5))
    setNameFn(*resultGroup5.begin(), "ragged_row_splits");
}

std::pair<unsigned, unsigned> ParseExampleV2Op::getODSOperandIndexAndLength(unsigned index) {
  bool isVariadic[] = {false, false, false, false, false, true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (getOperation()->getNumOperands() - 5) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::Operation::operand_range ParseExampleV2Op::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ParseExampleV2Op::serialized() {
  return *getODSOperands(0).begin();
}

::mlir::Value ParseExampleV2Op::names() {
  return *getODSOperands(1).begin();
}

::mlir::Value ParseExampleV2Op::sparse_keys() {
  return *getODSOperands(2).begin();
}

::mlir::Value ParseExampleV2Op::dense_keys() {
  return *getODSOperands(3).begin();
}

::mlir::Value ParseExampleV2Op::ragged_keys() {
  return *getODSOperands(4).begin();
}

::mlir::Operation::operand_range ParseExampleV2Op::dense_defaults() {
  return getODSOperands(5);
}

::mlir::MutableOperandRange ParseExampleV2Op::serializedMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ParseExampleV2Op::namesMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ParseExampleV2Op::sparse_keysMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ParseExampleV2Op::dense_keysMutable() {
  auto range = getODSOperandIndexAndLength(3);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ParseExampleV2Op::ragged_keysMutable() {
  auto range = getODSOperandIndexAndLength(4);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ParseExampleV2Op::dense_defaultsMutable() {
  auto range = getODSOperandIndexAndLength(5);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> ParseExampleV2Op::getODSResultIndexAndLength(unsigned index) {
  auto sizeAttr =
      (*this)->getAttr(result_segment_sizesAttrName()).cast<::mlir::DenseIntElementsAttr>();

  const uint32_t *sizeAttrValueIt = &*sizeAttr.value_begin<uint32_t>();
  if (sizeAttr.isSplat())
    return {*sizeAttrValueIt * index, *sizeAttrValueIt};

  unsigned start = 0;
  for (unsigned i = 0; i < index; ++i)
    start += sizeAttrValueIt[i];
  return {start, sizeAttrValueIt[index]};
}

::mlir::Operation::result_range ParseExampleV2Op::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Operation::result_range ParseExampleV2Op::sparse_indices() {
  return getODSResults(0);
}

::mlir::Operation::result_range ParseExampleV2Op::sparse_values() {
  return getODSResults(1);
}

::mlir::Operation::result_range ParseExampleV2Op::sparse_shapes() {
  return getODSResults(2);
}

::mlir::Operation::result_range ParseExampleV2Op::dense_values() {
  return getODSResults(3);
}

::mlir::Operation::result_range ParseExampleV2Op::ragged_values() {
  return getODSResults(4);
}

::mlir::Operation::result_range ParseExampleV2Op::ragged_row_splits() {
  return getODSResults(5);
}

::mlir::IntegerAttr ParseExampleV2Op::num_sparseAttr() {
  return (*this)->getAttr(num_sparseAttrName()).cast<::mlir::IntegerAttr>();
}

uint64_t ParseExampleV2Op::num_sparse() {
  auto attr = num_sparseAttr();
  return attr.getValue().getZExtValue();
}

::mlir::ArrayAttr ParseExampleV2Op::dense_shapesAttr() {
  return (*this)->getAttr(dense_shapesAttrName()).cast<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr ParseExampleV2Op::dense_shapes() {
  auto attr = dense_shapesAttr();
  return attr;
}

::mlir::DenseIntElementsAttr ParseExampleV2Op::result_segment_sizesAttr() {
  return (*this)->getAttr(result_segment_sizesAttrName()).cast<::mlir::DenseIntElementsAttr>();
}

::mlir::DenseIntElementsAttr ParseExampleV2Op::result_segment_sizes() {
  auto attr = result_segment_sizesAttr();
  return attr;
}

mlir::OperandElementTypeRange ParseExampleV2Op::Tdense() {
  auto values = getODSOperands(5);
return {mlir::OperandElementTypeIterator(values.begin()), mlir::OperandElementTypeIterator(values.end())};
}

mlir::ResultElementTypeRange ParseExampleV2Op::sparse_types() {
  auto values = getODSResults(1);
return {mlir::ResultElementTypeIterator(values.begin()), mlir::ResultElementTypeIterator(values.end())};
}

mlir::ResultElementTypeRange ParseExampleV2Op::ragged_value_types() {
  auto values = getODSResults(4);
return {mlir::ResultElementTypeIterator(values.begin()), mlir::ResultElementTypeIterator(values.end())};
}

mlir::ResultElementTypeRange ParseExampleV2Op::ragged_split_types() {
  auto values = getODSResults(5);
return {mlir::ResultElementTypeIterator(values.begin()), mlir::ResultElementTypeIterator(values.end())};
}

bool ParseExampleV2Op::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "Tdense") return true;
  if (name == "sparse_types") return true;
  if (name == "ragged_value_types") return true;
  if (name == "ragged_split_types") return true;
 return false;
}

::mlir::DictionaryAttr ParseExampleV2Op::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TdenseAttrName(),
ArrayAttr::get(ctx, 
    [&]() {
      llvm::SmallVector<Attribute, 4> ret;
      for (auto t : Tdense())
        ret.push_back(TypeAttr::get(t));
      return ret;
    }())},
    {sparse_typesAttrName(),
ArrayAttr::get(ctx, 
    [&]() {
      llvm::SmallVector<Attribute, 4> ret;
      for (auto t : sparse_types())
        ret.push_back(TypeAttr::get(t));
      return ret;
    }())},
    {ragged_value_typesAttrName(),
ArrayAttr::get(ctx, 
    [&]() {
      llvm::SmallVector<Attribute, 4> ret;
      for (auto t : ragged_value_types())
        ret.push_back(TypeAttr::get(t));
      return ret;
    }())},
    {ragged_split_typesAttrName(),
ArrayAttr::get(ctx, 
    [&]() {
      llvm::SmallVector<Attribute, 4> ret;
      for (auto t : ragged_split_types())
        ret.push_back(TypeAttr::get(t));
      return ret;
    }())}});
}

void ParseExampleV2Op::num_sparseAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(num_sparseAttrName(), attr);
}

void ParseExampleV2Op::dense_shapesAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(dense_shapesAttrName(), attr);
}

void ParseExampleV2Op::result_segment_sizesAttr(::mlir::DenseIntElementsAttr attr) {
  (*this)->setAttr(result_segment_sizesAttrName(), attr);
}

void ParseExampleV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange sparse_indices, ::mlir::TypeRange sparse_values, ::mlir::TypeRange sparse_shapes, ::mlir::TypeRange dense_values, ::mlir::TypeRange ragged_values, ::mlir::TypeRange ragged_row_splits, ::mlir::Value serialized, ::mlir::Value names, ::mlir::Value sparse_keys, ::mlir::Value dense_keys, ::mlir::Value ragged_keys, ::mlir::ValueRange dense_defaults, ::mlir::IntegerAttr num_sparse, ::mlir::ArrayAttr dense_shapes, ::mlir::DenseIntElementsAttr result_segment_sizes) {
  odsState.addOperands(serialized);
  odsState.addOperands(names);
  odsState.addOperands(sparse_keys);
  odsState.addOperands(dense_keys);
  odsState.addOperands(ragged_keys);
  odsState.addOperands(dense_defaults);
  odsState.addAttribute(num_sparseAttrName(odsState.name), num_sparse);
  odsState.addAttribute(dense_shapesAttrName(odsState.name), dense_shapes);
  odsState.addAttribute(result_segment_sizesAttrName(odsState.name), result_segment_sizes);
  odsState.addTypes(sparse_indices);
  odsState.addTypes(sparse_values);
  odsState.addTypes(sparse_shapes);
  odsState.addTypes(dense_values);
  odsState.addTypes(ragged_values);
  odsState.addTypes(ragged_row_splits);
}

void ParseExampleV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value serialized, ::mlir::Value names, ::mlir::Value sparse_keys, ::mlir::Value dense_keys, ::mlir::Value ragged_keys, ::mlir::ValueRange dense_defaults, ::mlir::IntegerAttr num_sparse, ::mlir::ArrayAttr dense_shapes, ::mlir::DenseIntElementsAttr result_segment_sizes) {
  odsState.addOperands(serialized);
  odsState.addOperands(names);
  odsState.addOperands(sparse_keys);
  odsState.addOperands(dense_keys);
  odsState.addOperands(ragged_keys);
  odsState.addOperands(dense_defaults);
  odsState.addAttribute(num_sparseAttrName(odsState.name), num_sparse);
  odsState.addAttribute(dense_shapesAttrName(odsState.name), dense_shapes);
  odsState.addAttribute(result_segment_sizesAttrName(odsState.name), result_segment_sizes);
  odsState.addTypes(resultTypes);
}

void ParseExampleV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange sparse_indices, ::mlir::TypeRange sparse_values, ::mlir::TypeRange sparse_shapes, ::mlir::TypeRange dense_values, ::mlir::TypeRange ragged_values, ::mlir::TypeRange ragged_row_splits, ::mlir::Value serialized, ::mlir::Value names, ::mlir::Value sparse_keys, ::mlir::Value dense_keys, ::mlir::Value ragged_keys, ::mlir::ValueRange dense_defaults, uint64_t num_sparse, ::mlir::ArrayAttr dense_shapes, ::mlir::DenseIntElementsAttr result_segment_sizes) {
  odsState.addOperands(serialized);
  odsState.addOperands(names);
  odsState.addOperands(sparse_keys);
  odsState.addOperands(dense_keys);
  odsState.addOperands(ragged_keys);
  odsState.addOperands(dense_defaults);
  odsState.addAttribute(num_sparseAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), num_sparse));
  odsState.addAttribute(dense_shapesAttrName(odsState.name), dense_shapes);
  odsState.addAttribute(result_segment_sizesAttrName(odsState.name), result_segment_sizes);
  odsState.addTypes(sparse_indices);
  odsState.addTypes(sparse_values);
  odsState.addTypes(sparse_shapes);
  odsState.addTypes(dense_values);
  odsState.addTypes(ragged_values);
  odsState.addTypes(ragged_row_splits);
}

void ParseExampleV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value serialized, ::mlir::Value names, ::mlir::Value sparse_keys, ::mlir::Value dense_keys, ::mlir::Value ragged_keys, ::mlir::ValueRange dense_defaults, uint64_t num_sparse, ::mlir::ArrayAttr dense_shapes, ::mlir::DenseIntElementsAttr result_segment_sizes) {
  odsState.addOperands(serialized);
  odsState.addOperands(names);
  odsState.addOperands(sparse_keys);
  odsState.addOperands(dense_keys);
  odsState.addOperands(ragged_keys);
  odsState.addOperands(dense_defaults);
  odsState.addAttribute(num_sparseAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), num_sparse));
  odsState.addAttribute(dense_shapesAttrName(odsState.name), dense_shapes);
  odsState.addAttribute(result_segment_sizesAttrName(odsState.name), result_segment_sizes);
  odsState.addTypes(resultTypes);
}

void ParseExampleV2Op::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() >= 5u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult ParseExampleV2Op::verify() {
  {
    auto sizeAttr = (*this)->getAttr(result_segment_sizesAttrName()).dyn_cast<::mlir::DenseIntElementsAttr>();
    if (!sizeAttr)
      return emitOpError("missing segment sizes attribute 'result_segment_sizes'");
    auto numElements =
        sizeAttr.getType().cast<::mlir::ShapedType>().getNumElements();
    if (numElements != 6)
      return emitOpError("'result_segment_sizes' attribute for specifying result segments must have 6 "
                "elements, but got ") << numElements;
  }
    {
    auto tblgen_num_sparse = (*this)->getAttr(num_sparseAttrName());
    if (!tblgen_num_sparse)
      return emitOpError("requires attribute 'num_sparse'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops35(*this, tblgen_num_sparse, "num_sparse")))
      return ::mlir::failure();
  }
  {
    auto tblgen_dense_shapes = (*this)->getAttr(dense_shapesAttrName());
    if (!tblgen_dense_shapes)
      return emitOpError("requires attribute 'dense_shapes'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops28(*this, tblgen_dense_shapes, "dense_shapes")))
      return ::mlir::failure();
  }
  {
    auto tblgen_result_segment_sizes = (*this)->getAttr(result_segment_sizesAttrName());
    if (!tblgen_result_segment_sizes)
      return emitOpError("requires attribute 'result_segment_sizes'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops34(*this, tblgen_result_segment_sizes, "result_segment_sizes")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops19(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops19(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops19(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup3 = getODSOperands(3);

    for (auto v : valueGroup3) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops19(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup4 = getODSOperands(4);

    for (auto v : valueGroup4) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops19(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup5 = getODSOperands(5);

    for (auto v : valueGroup5) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops49(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops16(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSResults(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops49(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSResults(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops16(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
    auto valueGroup3 = getODSResults(3);

    for (auto v : valueGroup3) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops49(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
    auto valueGroup4 = getODSResults(4);

    for (auto v : valueGroup4) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops49(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
    auto valueGroup5 = getODSResults(5);

    for (auto v : valueGroup5) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops50(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return Verify(*this);
}

void ParseExampleV2Op::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::ParseExampleV2Op)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::PartitionedCallOp definitions
//===----------------------------------------------------------------------===//

PartitionedCallOpAdaptor::PartitionedCallOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

PartitionedCallOpAdaptor::PartitionedCallOpAdaptor(PartitionedCallOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange PartitionedCallOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> PartitionedCallOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  bool isVariadic[] = {true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (odsOperands.size() - 0) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::ValueRange PartitionedCallOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::ValueRange PartitionedCallOpAdaptor::args() {
  return getODSOperands(0);
}

::mlir::DictionaryAttr PartitionedCallOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::SymbolRefAttr PartitionedCallOpAdaptor::f() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::SymbolRefAttr attr = odsAttrs.get("f").cast<::mlir::SymbolRefAttr>();
  return attr;
}

::mlir::StringAttr PartitionedCallOpAdaptor::config() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("config").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("");
  return attr;
}

::mlir::StringAttr PartitionedCallOpAdaptor::config_proto() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("config_proto").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("");
  return attr;
}

::mlir::StringAttr PartitionedCallOpAdaptor::executor_type() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("executor_type").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("");
  return attr;
}

::mlir::LogicalResult PartitionedCallOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_f = odsAttrs.get("f");
    if (!tblgen_f)
      return emitError(loc, "'tf.PartitionedCall' op ""requires attribute 'f'");

    if (tblgen_f && !((tblgen_f.isa<::mlir::SymbolRefAttr>())))
      return emitError(loc, "'tf.PartitionedCall' op ""attribute 'f' failed to satisfy constraint: symbol reference attribute");
  }
  {
    auto tblgen_config = odsAttrs.get("config");
    if (tblgen_config && !((tblgen_config.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.PartitionedCall' op ""attribute 'config' failed to satisfy constraint: string attribute");
  }
  {
    auto tblgen_config_proto = odsAttrs.get("config_proto");
    if (tblgen_config_proto && !((tblgen_config_proto.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.PartitionedCall' op ""attribute 'config_proto' failed to satisfy constraint: string attribute");
  }
  {
    auto tblgen_executor_type = odsAttrs.get("executor_type");
    if (tblgen_executor_type && !((tblgen_executor_type.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.PartitionedCall' op ""attribute 'executor_type' failed to satisfy constraint: string attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> PartitionedCallOp::getODSOperandIndexAndLength(unsigned index) {
  bool isVariadic[] = {true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (getOperation()->getNumOperands() - 0) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::Operation::operand_range PartitionedCallOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Operation::operand_range PartitionedCallOp::args() {
  return getODSOperands(0);
}

::mlir::MutableOperandRange PartitionedCallOp::argsMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> PartitionedCallOp::getODSResultIndexAndLength(unsigned index) {
  bool isVariadic[] = {true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (getOperation()->getNumResults() - 0) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::Operation::result_range PartitionedCallOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Operation::result_range PartitionedCallOp::output() {
  return getODSResults(0);
}

::mlir::SymbolRefAttr PartitionedCallOp::fAttr() {
  return (*this)->getAttr(fAttrName()).cast<::mlir::SymbolRefAttr>();
}

::mlir::SymbolRefAttr PartitionedCallOp::f() {
  auto attr = fAttr();
  return attr;
}

::mlir::StringAttr PartitionedCallOp::configAttr() {
  return (*this)->getAttr(configAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef PartitionedCallOp::config() {
  auto attr = configAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("").getValue();
  return attr.getValue();
}

::mlir::StringAttr PartitionedCallOp::config_protoAttr() {
  return (*this)->getAttr(config_protoAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef PartitionedCallOp::config_proto() {
  auto attr = config_protoAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("").getValue();
  return attr.getValue();
}

::mlir::StringAttr PartitionedCallOp::executor_typeAttr() {
  return (*this)->getAttr(executor_typeAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef PartitionedCallOp::executor_type() {
  auto attr = executor_typeAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("").getValue();
  return attr.getValue();
}

mlir::OperandElementTypeRange PartitionedCallOp::Tin() {
  auto values = getODSOperands(0);
return {mlir::OperandElementTypeIterator(values.begin()), mlir::OperandElementTypeIterator(values.end())};
}

mlir::ResultElementTypeRange PartitionedCallOp::Tout() {
  auto values = getODSResults(0);
return {mlir::ResultElementTypeIterator(values.begin()), mlir::ResultElementTypeIterator(values.end())};
}

bool PartitionedCallOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "Tin") return true;
  if (name == "Tout") return true;
 return false;
}

::mlir::DictionaryAttr PartitionedCallOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TinAttrName(),
ArrayAttr::get(ctx, 
    [&]() {
      llvm::SmallVector<Attribute, 4> ret;
      for (auto t : Tin())
        ret.push_back(TypeAttr::get(t));
      return ret;
    }())},
    {ToutAttrName(),
ArrayAttr::get(ctx, 
    [&]() {
      llvm::SmallVector<Attribute, 4> ret;
      for (auto t : Tout())
        ret.push_back(TypeAttr::get(t));
      return ret;
    }())}});
}

void PartitionedCallOp::fAttr(::mlir::SymbolRefAttr attr) {
  (*this)->setAttr(fAttrName(), attr);
}

void PartitionedCallOp::configAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(configAttrName(), attr);
}

void PartitionedCallOp::config_protoAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(config_protoAttrName(), attr);
}

void PartitionedCallOp::executor_typeAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(executor_typeAttrName(), attr);
}

void PartitionedCallOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange output, ::mlir::ValueRange args, ::mlir::SymbolRefAttr f, ::mlir::StringAttr config, ::mlir::StringAttr config_proto, ::mlir::StringAttr executor_type) {
  odsState.addOperands(args);
  odsState.addAttribute(fAttrName(odsState.name), f);
  odsState.addAttribute(configAttrName(odsState.name), config);
  odsState.addAttribute(config_protoAttrName(odsState.name), config_proto);
  odsState.addAttribute(executor_typeAttrName(odsState.name), executor_type);
  odsState.addTypes(output);
}

void PartitionedCallOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange output, ::mlir::ValueRange args, ::mlir::SymbolRefAttr f, ::llvm::StringRef config, ::llvm::StringRef config_proto, ::llvm::StringRef executor_type) {
  odsState.addOperands(args);
  odsState.addAttribute(fAttrName(odsState.name), f);
  odsState.addAttribute(configAttrName(odsState.name), odsBuilder.getStringAttr(config));
  odsState.addAttribute(config_protoAttrName(odsState.name), odsBuilder.getStringAttr(config_proto));
  odsState.addAttribute(executor_typeAttrName(odsState.name), odsBuilder.getStringAttr(executor_type));
  odsState.addTypes(output);
}

void PartitionedCallOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult PartitionedCallOp::verify() {
  {
    auto tblgen_f = (*this)->getAttr(fAttrName());
    if (!tblgen_f)
      return emitOpError("requires attribute 'f'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops12(*this, tblgen_f, "f")))
      return ::mlir::failure();
  }
  {
    auto tblgen_config = (*this)->getAttr(configAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_config, "config")))
      return ::mlir::failure();
  }
  {
    auto tblgen_config_proto = (*this)->getAttr(config_protoAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_config_proto, "config_proto")))
      return ::mlir::failure();
  }
  {
    auto tblgen_executor_type = (*this)->getAttr(executor_typeAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_executor_type, "executor_type")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return VerifyPartitionedCall(*this);
}

void PartitionedCallOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::PartitionedCallOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::PlaceholderOp definitions
//===----------------------------------------------------------------------===//

PlaceholderOpAdaptor::PlaceholderOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

PlaceholderOpAdaptor::PlaceholderOpAdaptor(PlaceholderOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange PlaceholderOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> PlaceholderOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange PlaceholderOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::DictionaryAttr PlaceholderOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult PlaceholderOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> PlaceholderOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range PlaceholderOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

std::pair<unsigned, unsigned> PlaceholderOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range PlaceholderOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value PlaceholderOp::output() {
  return *getODSResults(0).begin();
}

::mlir::Type PlaceholderOp::dtype() {
  return mlir::getElementTypeOrSelf(*getODSResults(0).begin());
}

bool PlaceholderOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "dtype") return true;
 return false;
}

::mlir::DictionaryAttr PlaceholderOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {dtypeAttrName(),
::mlir::TypeAttr::get(dtype())}});
}

void PlaceholderOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output) {
  odsState.addTypes(output);
}

void PlaceholderOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes) {
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void PlaceholderOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 0u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult PlaceholderOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void PlaceholderOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::PlaceholderOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::PlaceholderWithDefaultOp definitions
//===----------------------------------------------------------------------===//

PlaceholderWithDefaultOpAdaptor::PlaceholderWithDefaultOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

PlaceholderWithDefaultOpAdaptor::PlaceholderWithDefaultOpAdaptor(PlaceholderWithDefaultOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange PlaceholderWithDefaultOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> PlaceholderWithDefaultOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange PlaceholderWithDefaultOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value PlaceholderWithDefaultOpAdaptor::input() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr PlaceholderWithDefaultOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult PlaceholderWithDefaultOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> PlaceholderWithDefaultOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range PlaceholderWithDefaultOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value PlaceholderWithDefaultOp::input() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange PlaceholderWithDefaultOp::inputMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> PlaceholderWithDefaultOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range PlaceholderWithDefaultOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value PlaceholderWithDefaultOp::output() {
  return *getODSResults(0).begin();
}

::mlir::Type PlaceholderWithDefaultOp::dtype() {
  return mlir::getElementTypeOrSelf(*getODSResults(0).begin());
}

ShapedType PlaceholderWithDefaultOp::shape() {
  return (*getOperation()->result_type_begin()).cast<ShapedType>();
}

bool PlaceholderWithDefaultOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "dtype") return true;
  if (name == "shape") return true;
 return false;
}

::mlir::DictionaryAttr PlaceholderWithDefaultOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {dtypeAttrName(),
::mlir::TypeAttr::get(dtype())},
    {shapeAttrName(),
mlir::TF::ShapeAttr::get(ctx, shape())}});
}

void PlaceholderWithDefaultOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input) {
  odsState.addOperands(input);
  odsState.addTypes(output);
}

void PlaceholderWithDefaultOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input) {
  odsState.addOperands(input);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void PlaceholderWithDefaultOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult PlaceholderWithDefaultOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void PlaceholderWithDefaultOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::PlaceholderWithDefaultOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::PolygammaOp definitions
//===----------------------------------------------------------------------===//

PolygammaOpAdaptor::PolygammaOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

PolygammaOpAdaptor::PolygammaOpAdaptor(PolygammaOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange PolygammaOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> PolygammaOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange PolygammaOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value PolygammaOpAdaptor::a() {
  return *getODSOperands(0).begin();
}

::mlir::Value PolygammaOpAdaptor::x() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr PolygammaOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult PolygammaOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> PolygammaOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range PolygammaOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value PolygammaOp::a() {
  return *getODSOperands(0).begin();
}

::mlir::Value PolygammaOp::x() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange PolygammaOp::aMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange PolygammaOp::xMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> PolygammaOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range PolygammaOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value PolygammaOp::z() {
  return *getODSResults(0).begin();
}

::mlir::Type PolygammaOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool PolygammaOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr PolygammaOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void PolygammaOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, Value x, Value y) {
  auto resultType =
      OpTrait::util::getBroadcastedType(x.getType(), y.getType());
  if (!resultType)
    mlir::emitError(odsState.location, "non-broadcastable operands");
  return build(odsBuilder, odsState, resultType, x, y);
}

void PolygammaOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type z, ::mlir::Value a, ::mlir::Value x) {
  odsState.addOperands(a);
  odsState.addOperands(x);
  odsState.addTypes(z);
}

void PolygammaOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value a, ::mlir::Value x) {
  odsState.addOperands(a);
  odsState.addOperands(x);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void PolygammaOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult PolygammaOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops13(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops13(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops13(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void PolygammaOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::PolygammaOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::PopulationCountOp definitions
//===----------------------------------------------------------------------===//

PopulationCountOpAdaptor::PopulationCountOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

PopulationCountOpAdaptor::PopulationCountOpAdaptor(PopulationCountOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange PopulationCountOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> PopulationCountOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange PopulationCountOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value PopulationCountOpAdaptor::x() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr PopulationCountOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult PopulationCountOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> PopulationCountOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range PopulationCountOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value PopulationCountOp::x() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange PopulationCountOp::xMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> PopulationCountOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range PopulationCountOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value PopulationCountOp::y() {
  return *getODSResults(0).begin();
}

::mlir::Type PopulationCountOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool PopulationCountOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr PopulationCountOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void PopulationCountOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type y, ::mlir::Value x) {
  odsState.addOperands(x);
  odsState.addTypes(y);
}

void PopulationCountOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value x) {
  odsState.addOperands(x);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void PopulationCountOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult PopulationCountOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops27(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops37(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void PopulationCountOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::PopulationCountOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::PowOp definitions
//===----------------------------------------------------------------------===//

PowOpAdaptor::PowOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

PowOpAdaptor::PowOpAdaptor(PowOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange PowOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> PowOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange PowOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value PowOpAdaptor::x() {
  return *getODSOperands(0).begin();
}

::mlir::Value PowOpAdaptor::y() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr PowOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult PowOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> PowOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range PowOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value PowOp::x() {
  return *getODSOperands(0).begin();
}

::mlir::Value PowOp::y() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange PowOp::xMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange PowOp::yMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> PowOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range PowOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value PowOp::z() {
  return *getODSResults(0).begin();
}

::mlir::Type PowOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool PowOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr PowOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void PowOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, Value x, Value y) {
  auto resultType =
      OpTrait::util::getBroadcastedType(x.getType(), y.getType());
  if (!resultType)
    mlir::emitError(odsState.location, "non-broadcastable operands");
  return build(odsBuilder, odsState, resultType, x, y);
}

void PowOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type z, ::mlir::Value x, ::mlir::Value y) {
  odsState.addOperands(x);
  odsState.addOperands(y);
  odsState.addTypes(z);
}

void PowOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value x, ::mlir::Value y) {
  odsState.addOperands(x);
  odsState.addOperands(y);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void PowOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult PowOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops1(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops1(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops1(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void PowOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::PowOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::PrefetchDatasetOp definitions
//===----------------------------------------------------------------------===//

PrefetchDatasetOpAdaptor::PrefetchDatasetOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

PrefetchDatasetOpAdaptor::PrefetchDatasetOpAdaptor(PrefetchDatasetOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange PrefetchDatasetOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> PrefetchDatasetOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange PrefetchDatasetOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value PrefetchDatasetOpAdaptor::input_dataset() {
  return *getODSOperands(0).begin();
}

::mlir::Value PrefetchDatasetOpAdaptor::buffer_size() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr PrefetchDatasetOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::ArrayAttr PrefetchDatasetOpAdaptor::output_types() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("output_types").cast<::mlir::ArrayAttr>();
  return attr;
}

::mlir::ArrayAttr PrefetchDatasetOpAdaptor::output_shapes() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("output_shapes").cast<::mlir::ArrayAttr>();
  return attr;
}

::mlir::IntegerAttr PrefetchDatasetOpAdaptor::slack_period() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("slack_period").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), 0);
  return attr;
}

::mlir::BoolAttr PrefetchDatasetOpAdaptor::legacy_autotune() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("legacy_autotune").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(true);
  return attr;
}

::mlir::IntegerAttr PrefetchDatasetOpAdaptor::buffer_size_min() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("buffer_size_min").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), 0);
  return attr;
}

::mlir::StringAttr PrefetchDatasetOpAdaptor::metadata() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("metadata").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("");
  return attr;
}

::mlir::LogicalResult PrefetchDatasetOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_output_types = odsAttrs.get("output_types");
    if (!tblgen_output_types)
      return emitError(loc, "'tf.PrefetchDataset' op ""requires attribute 'output_types'");

    if (tblgen_output_types && !((((tblgen_output_types.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_output_types.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return ((attr.isa<::mlir::TypeAttr>())) && ((attr.cast<::mlir::TypeAttr>().getValue().isa<::mlir::Type>())); }))) && ((tblgen_output_types.cast<::mlir::ArrayAttr>().size() >= 1))))
      return emitError(loc, "'tf.PrefetchDataset' op ""attribute 'output_types' failed to satisfy constraint: type array attribute with at least 1 elements");
  }
  {
    auto tblgen_output_shapes = odsAttrs.get("output_shapes");
    if (!tblgen_output_shapes)
      return emitError(loc, "'tf.PrefetchDataset' op ""requires attribute 'output_shapes'");

    if (tblgen_output_shapes && !((((tblgen_output_shapes.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_output_shapes.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return (attr.isa<mlir::TF::ShapeAttr>()); }))) && ((tblgen_output_shapes.cast<::mlir::ArrayAttr>().size() >= 1))))
      return emitError(loc, "'tf.PrefetchDataset' op ""attribute 'output_shapes' failed to satisfy constraint: tensorflow shape attribute array with at least 1 elements");
  }
  {
    auto tblgen_slack_period = odsAttrs.get("slack_period");
    if (tblgen_slack_period && !(((tblgen_slack_period.isa<::mlir::IntegerAttr>())) && ((tblgen_slack_period.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.PrefetchDataset' op ""attribute 'slack_period' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_legacy_autotune = odsAttrs.get("legacy_autotune");
    if (tblgen_legacy_autotune && !((tblgen_legacy_autotune.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.PrefetchDataset' op ""attribute 'legacy_autotune' failed to satisfy constraint: bool attribute");
  }
  {
    auto tblgen_buffer_size_min = odsAttrs.get("buffer_size_min");
    if (tblgen_buffer_size_min && !(((tblgen_buffer_size_min.isa<::mlir::IntegerAttr>())) && ((tblgen_buffer_size_min.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.PrefetchDataset' op ""attribute 'buffer_size_min' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_metadata = odsAttrs.get("metadata");
    if (tblgen_metadata && !((tblgen_metadata.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.PrefetchDataset' op ""attribute 'metadata' failed to satisfy constraint: string attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> PrefetchDatasetOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range PrefetchDatasetOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value PrefetchDatasetOp::input_dataset() {
  return *getODSOperands(0).begin();
}

::mlir::Value PrefetchDatasetOp::buffer_size() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange PrefetchDatasetOp::input_datasetMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange PrefetchDatasetOp::buffer_sizeMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> PrefetchDatasetOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range PrefetchDatasetOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value PrefetchDatasetOp::handle() {
  return *getODSResults(0).begin();
}

::mlir::ArrayAttr PrefetchDatasetOp::output_typesAttr() {
  return (*this)->getAttr(output_typesAttrName()).cast<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr PrefetchDatasetOp::output_types() {
  auto attr = output_typesAttr();
  return attr;
}

::mlir::ArrayAttr PrefetchDatasetOp::output_shapesAttr() {
  return (*this)->getAttr(output_shapesAttrName()).cast<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr PrefetchDatasetOp::output_shapes() {
  auto attr = output_shapesAttr();
  return attr;
}

::mlir::IntegerAttr PrefetchDatasetOp::slack_periodAttr() {
  return (*this)->getAttr(slack_periodAttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t PrefetchDatasetOp::slack_period() {
  auto attr = slack_periodAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), 0).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

::mlir::BoolAttr PrefetchDatasetOp::legacy_autotuneAttr() {
  return (*this)->getAttr(legacy_autotuneAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool PrefetchDatasetOp::legacy_autotune() {
  auto attr = legacy_autotuneAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(true).getValue();
  return attr.getValue();
}

::mlir::IntegerAttr PrefetchDatasetOp::buffer_size_minAttr() {
  return (*this)->getAttr(buffer_size_minAttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t PrefetchDatasetOp::buffer_size_min() {
  auto attr = buffer_size_minAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), 0).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

::mlir::StringAttr PrefetchDatasetOp::metadataAttr() {
  return (*this)->getAttr(metadataAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef PrefetchDatasetOp::metadata() {
  auto attr = metadataAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("").getValue();
  return attr.getValue();
}

void PrefetchDatasetOp::output_typesAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(output_typesAttrName(), attr);
}

void PrefetchDatasetOp::output_shapesAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(output_shapesAttrName(), attr);
}

void PrefetchDatasetOp::slack_periodAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(slack_periodAttrName(), attr);
}

void PrefetchDatasetOp::legacy_autotuneAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(legacy_autotuneAttrName(), attr);
}

void PrefetchDatasetOp::buffer_size_minAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(buffer_size_minAttrName(), attr);
}

void PrefetchDatasetOp::metadataAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(metadataAttrName(), attr);
}

void PrefetchDatasetOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type handle, ::mlir::Value input_dataset, ::mlir::Value buffer_size, ::mlir::ArrayAttr output_types, ::mlir::ArrayAttr output_shapes, ::mlir::IntegerAttr slack_period, ::mlir::BoolAttr legacy_autotune, ::mlir::IntegerAttr buffer_size_min, ::mlir::StringAttr metadata) {
  odsState.addOperands(input_dataset);
  odsState.addOperands(buffer_size);
  odsState.addAttribute(output_typesAttrName(odsState.name), output_types);
  odsState.addAttribute(output_shapesAttrName(odsState.name), output_shapes);
  odsState.addAttribute(slack_periodAttrName(odsState.name), slack_period);
  odsState.addAttribute(legacy_autotuneAttrName(odsState.name), legacy_autotune);
  odsState.addAttribute(buffer_size_minAttrName(odsState.name), buffer_size_min);
  odsState.addAttribute(metadataAttrName(odsState.name), metadata);
  odsState.addTypes(handle);
}

void PrefetchDatasetOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input_dataset, ::mlir::Value buffer_size, ::mlir::ArrayAttr output_types, ::mlir::ArrayAttr output_shapes, ::mlir::IntegerAttr slack_period, ::mlir::BoolAttr legacy_autotune, ::mlir::IntegerAttr buffer_size_min, ::mlir::StringAttr metadata) {
  odsState.addOperands(input_dataset);
  odsState.addOperands(buffer_size);
  odsState.addAttribute(output_typesAttrName(odsState.name), output_types);
  odsState.addAttribute(output_shapesAttrName(odsState.name), output_shapes);
  odsState.addAttribute(slack_periodAttrName(odsState.name), slack_period);
  odsState.addAttribute(legacy_autotuneAttrName(odsState.name), legacy_autotune);
  odsState.addAttribute(buffer_size_minAttrName(odsState.name), buffer_size_min);
  odsState.addAttribute(metadataAttrName(odsState.name), metadata);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void PrefetchDatasetOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type handle, ::mlir::Value input_dataset, ::mlir::Value buffer_size, ::mlir::ArrayAttr output_types, ::mlir::ArrayAttr output_shapes, uint64_t slack_period, bool legacy_autotune, uint64_t buffer_size_min, ::llvm::StringRef metadata) {
  odsState.addOperands(input_dataset);
  odsState.addOperands(buffer_size);
  odsState.addAttribute(output_typesAttrName(odsState.name), output_types);
  odsState.addAttribute(output_shapesAttrName(odsState.name), output_shapes);
  odsState.addAttribute(slack_periodAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), slack_period));
  odsState.addAttribute(legacy_autotuneAttrName(odsState.name), odsBuilder.getBoolAttr(legacy_autotune));
  odsState.addAttribute(buffer_size_minAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), buffer_size_min));
  odsState.addAttribute(metadataAttrName(odsState.name), odsBuilder.getStringAttr(metadata));
  odsState.addTypes(handle);
}

void PrefetchDatasetOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input_dataset, ::mlir::Value buffer_size, ::mlir::ArrayAttr output_types, ::mlir::ArrayAttr output_shapes, uint64_t slack_period, bool legacy_autotune, uint64_t buffer_size_min, ::llvm::StringRef metadata) {
  odsState.addOperands(input_dataset);
  odsState.addOperands(buffer_size);
  odsState.addAttribute(output_typesAttrName(odsState.name), output_types);
  odsState.addAttribute(output_shapesAttrName(odsState.name), output_shapes);
  odsState.addAttribute(slack_periodAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), slack_period));
  odsState.addAttribute(legacy_autotuneAttrName(odsState.name), odsBuilder.getBoolAttr(legacy_autotune));
  odsState.addAttribute(buffer_size_minAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), buffer_size_min));
  odsState.addAttribute(metadataAttrName(odsState.name), odsBuilder.getStringAttr(metadata));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void PrefetchDatasetOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult PrefetchDatasetOp::verify() {
  {
    auto tblgen_output_types = (*this)->getAttr(output_typesAttrName());
    if (!tblgen_output_types)
      return emitOpError("requires attribute 'output_types'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops2(*this, tblgen_output_types, "output_types")))
      return ::mlir::failure();
  }
  {
    auto tblgen_output_shapes = (*this)->getAttr(output_shapesAttrName());
    if (!tblgen_output_shapes)
      return emitOpError("requires attribute 'output_shapes'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops3(*this, tblgen_output_shapes, "output_shapes")))
      return ::mlir::failure();
  }
  {
    auto tblgen_slack_period = (*this)->getAttr(slack_periodAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_slack_period, "slack_period")))
      return ::mlir::failure();
  }
  {
    auto tblgen_legacy_autotune = (*this)->getAttr(legacy_autotuneAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_legacy_autotune, "legacy_autotune")))
      return ::mlir::failure();
  }
  {
    auto tblgen_buffer_size_min = (*this)->getAttr(buffer_size_minAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_buffer_size_min, "buffer_size_min")))
      return ::mlir::failure();
  }
  {
    auto tblgen_metadata = (*this)->getAttr(metadataAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_metadata, "metadata")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops15(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops16(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops15(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void PrefetchDatasetOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::PrefetchDatasetOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::PreventGradientOp definitions
//===----------------------------------------------------------------------===//

PreventGradientOpAdaptor::PreventGradientOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

PreventGradientOpAdaptor::PreventGradientOpAdaptor(PreventGradientOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange PreventGradientOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> PreventGradientOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange PreventGradientOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value PreventGradientOpAdaptor::input() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr PreventGradientOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::StringAttr PreventGradientOpAdaptor::message() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("message").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("");
  return attr;
}

::mlir::LogicalResult PreventGradientOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_message = odsAttrs.get("message");
    if (tblgen_message && !((tblgen_message.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.PreventGradient' op ""attribute 'message' failed to satisfy constraint: string attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> PreventGradientOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range PreventGradientOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value PreventGradientOp::input() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange PreventGradientOp::inputMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> PreventGradientOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range PreventGradientOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value PreventGradientOp::output() {
  return *getODSResults(0).begin();
}

::mlir::StringAttr PreventGradientOp::messageAttr() {
  return (*this)->getAttr(messageAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef PreventGradientOp::message() {
  auto attr = messageAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("").getValue();
  return attr.getValue();
}

::mlir::Type PreventGradientOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool PreventGradientOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr PreventGradientOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void PreventGradientOp::messageAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(messageAttrName(), attr);
}

void PreventGradientOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input, ::mlir::StringAttr message) {
  odsState.addOperands(input);
  odsState.addAttribute(messageAttrName(odsState.name), message);
  odsState.addTypes(output);
}

void PreventGradientOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::StringAttr message) {
  odsState.addOperands(input);
  odsState.addAttribute(messageAttrName(odsState.name), message);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void PreventGradientOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input, ::llvm::StringRef message) {
  odsState.addOperands(input);
  odsState.addAttribute(messageAttrName(odsState.name), odsBuilder.getStringAttr(message));
  odsState.addTypes(output);
}

void PreventGradientOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::llvm::StringRef message) {
  odsState.addOperands(input);
  odsState.addAttribute(messageAttrName(odsState.name), odsBuilder.getStringAttr(message));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void PreventGradientOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult PreventGradientOp::verify() {
  {
    auto tblgen_message = (*this)->getAttr(messageAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_message, "message")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void PreventGradientOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::PreventGradientOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::PrintOp definitions
//===----------------------------------------------------------------------===//

PrintOpAdaptor::PrintOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

PrintOpAdaptor::PrintOpAdaptor(PrintOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange PrintOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> PrintOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  bool isVariadic[] = {false, true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (odsOperands.size() - 1) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::ValueRange PrintOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value PrintOpAdaptor::input() {
  return *getODSOperands(0).begin();
}

::mlir::ValueRange PrintOpAdaptor::data() {
  return getODSOperands(1);
}

::mlir::DictionaryAttr PrintOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::StringAttr PrintOpAdaptor::message() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("message").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("");
  return attr;
}

::mlir::IntegerAttr PrintOpAdaptor::first_n() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("first_n").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), -1);
  return attr;
}

::mlir::IntegerAttr PrintOpAdaptor::summarize() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("summarize").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), 3);
  return attr;
}

::mlir::LogicalResult PrintOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_message = odsAttrs.get("message");
    if (tblgen_message && !((tblgen_message.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.Print' op ""attribute 'message' failed to satisfy constraint: string attribute");
  }
  {
    auto tblgen_first_n = odsAttrs.get("first_n");
    if (tblgen_first_n && !(((tblgen_first_n.isa<::mlir::IntegerAttr>())) && ((tblgen_first_n.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.Print' op ""attribute 'first_n' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_summarize = odsAttrs.get("summarize");
    if (tblgen_summarize && !(((tblgen_summarize.isa<::mlir::IntegerAttr>())) && ((tblgen_summarize.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.Print' op ""attribute 'summarize' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> PrintOp::getODSOperandIndexAndLength(unsigned index) {
  bool isVariadic[] = {false, true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (getOperation()->getNumOperands() - 1) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::Operation::operand_range PrintOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value PrintOp::input() {
  return *getODSOperands(0).begin();
}

::mlir::Operation::operand_range PrintOp::data() {
  return getODSOperands(1);
}

::mlir::MutableOperandRange PrintOp::inputMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange PrintOp::dataMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> PrintOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range PrintOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value PrintOp::output() {
  return *getODSResults(0).begin();
}

::mlir::StringAttr PrintOp::messageAttr() {
  return (*this)->getAttr(messageAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef PrintOp::message() {
  auto attr = messageAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("").getValue();
  return attr.getValue();
}

::mlir::IntegerAttr PrintOp::first_nAttr() {
  return (*this)->getAttr(first_nAttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t PrintOp::first_n() {
  auto attr = first_nAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), -1).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

::mlir::IntegerAttr PrintOp::summarizeAttr() {
  return (*this)->getAttr(summarizeAttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t PrintOp::summarize() {
  auto attr = summarizeAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), 3).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

::mlir::Type PrintOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

mlir::OperandElementTypeRange PrintOp::U() {
  auto values = getODSOperands(1);
return {mlir::OperandElementTypeIterator(values.begin()), mlir::OperandElementTypeIterator(values.end())};
}

bool PrintOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
  if (name == "U") return true;
 return false;
}

::mlir::DictionaryAttr PrintOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())},
    {UAttrName(),
ArrayAttr::get(ctx, 
    [&]() {
      llvm::SmallVector<Attribute, 4> ret;
      for (auto t : U())
        ret.push_back(TypeAttr::get(t));
      return ret;
    }())}});
}

void PrintOp::messageAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(messageAttrName(), attr);
}

void PrintOp::first_nAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(first_nAttrName(), attr);
}

void PrintOp::summarizeAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(summarizeAttrName(), attr);
}

void PrintOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input, ::mlir::ValueRange data, ::mlir::StringAttr message, ::mlir::IntegerAttr first_n, ::mlir::IntegerAttr summarize) {
  odsState.addOperands(input);
  odsState.addOperands(data);
  odsState.addAttribute(messageAttrName(odsState.name), message);
  odsState.addAttribute(first_nAttrName(odsState.name), first_n);
  odsState.addAttribute(summarizeAttrName(odsState.name), summarize);
  odsState.addTypes(output);
}

void PrintOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::ValueRange data, ::mlir::StringAttr message, ::mlir::IntegerAttr first_n, ::mlir::IntegerAttr summarize) {
  odsState.addOperands(input);
  odsState.addOperands(data);
  odsState.addAttribute(messageAttrName(odsState.name), message);
  odsState.addAttribute(first_nAttrName(odsState.name), first_n);
  odsState.addAttribute(summarizeAttrName(odsState.name), summarize);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void PrintOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input, ::mlir::ValueRange data, ::llvm::StringRef message, uint64_t first_n, uint64_t summarize) {
  odsState.addOperands(input);
  odsState.addOperands(data);
  odsState.addAttribute(messageAttrName(odsState.name), odsBuilder.getStringAttr(message));
  odsState.addAttribute(first_nAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), first_n));
  odsState.addAttribute(summarizeAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), summarize));
  odsState.addTypes(output);
}

void PrintOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::ValueRange data, ::llvm::StringRef message, uint64_t first_n, uint64_t summarize) {
  odsState.addOperands(input);
  odsState.addOperands(data);
  odsState.addAttribute(messageAttrName(odsState.name), odsBuilder.getStringAttr(message));
  odsState.addAttribute(first_nAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), first_n));
  odsState.addAttribute(summarizeAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), summarize));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void PrintOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() >= 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult PrintOp::verify() {
  {
    auto tblgen_message = (*this)->getAttr(messageAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_message, "message")))
      return ::mlir::failure();
  }
  {
    auto tblgen_first_n = (*this)->getAttr(first_nAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_first_n, "first_n")))
      return ::mlir::failure();
  }
  {
    auto tblgen_summarize = (*this)->getAttr(summarizeAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_summarize, "summarize")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::PrintOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::PrintV2Op definitions
//===----------------------------------------------------------------------===//

PrintV2OpAdaptor::PrintV2OpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

PrintV2OpAdaptor::PrintV2OpAdaptor(PrintV2Op &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange PrintV2OpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> PrintV2OpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange PrintV2OpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value PrintV2OpAdaptor::input() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr PrintV2OpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::StringAttr PrintV2OpAdaptor::output_stream() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("output_stream").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("stderr");
  return attr;
}

::mlir::StringAttr PrintV2OpAdaptor::end() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("end").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("\n");
  return attr;
}

::mlir::LogicalResult PrintV2OpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_output_stream = odsAttrs.get("output_stream");
    if (tblgen_output_stream && !((tblgen_output_stream.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.PrintV2' op ""attribute 'output_stream' failed to satisfy constraint: string attribute");
  }
  {
    auto tblgen_end = odsAttrs.get("end");
    if (tblgen_end && !((tblgen_end.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.PrintV2' op ""attribute 'end' failed to satisfy constraint: string attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> PrintV2Op::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range PrintV2Op::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value PrintV2Op::input() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange PrintV2Op::inputMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> PrintV2Op::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range PrintV2Op::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::StringAttr PrintV2Op::output_streamAttr() {
  return (*this)->getAttr(output_streamAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef PrintV2Op::output_stream() {
  auto attr = output_streamAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("stderr").getValue();
  return attr.getValue();
}

::mlir::StringAttr PrintV2Op::endAttr() {
  return (*this)->getAttr(endAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef PrintV2Op::end() {
  auto attr = endAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("\n").getValue();
  return attr.getValue();
}

void PrintV2Op::output_streamAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(output_streamAttrName(), attr);
}

void PrintV2Op::endAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(endAttrName(), attr);
}

void PrintV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value input, ::mlir::StringAttr output_stream, ::mlir::StringAttr end) {
  odsState.addOperands(input);
  odsState.addAttribute(output_streamAttrName(odsState.name), output_stream);
  odsState.addAttribute(endAttrName(odsState.name), end);
}

void PrintV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::StringAttr output_stream, ::mlir::StringAttr end) {
  odsState.addOperands(input);
  odsState.addAttribute(output_streamAttrName(odsState.name), output_stream);
  odsState.addAttribute(endAttrName(odsState.name), end);
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void PrintV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value input, ::llvm::StringRef output_stream, ::llvm::StringRef end) {
  odsState.addOperands(input);
  odsState.addAttribute(output_streamAttrName(odsState.name), odsBuilder.getStringAttr(output_stream));
  odsState.addAttribute(endAttrName(odsState.name), odsBuilder.getStringAttr(end));
}

void PrintV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::llvm::StringRef output_stream, ::llvm::StringRef end) {
  odsState.addOperands(input);
  odsState.addAttribute(output_streamAttrName(odsState.name), odsBuilder.getStringAttr(output_stream));
  odsState.addAttribute(endAttrName(odsState.name), odsBuilder.getStringAttr(end));
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void PrintV2Op::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 0u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult PrintV2Op::verify() {
  {
    auto tblgen_output_stream = (*this)->getAttr(output_streamAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_output_stream, "output_stream")))
      return ::mlir::failure();
  }
  {
    auto tblgen_end = (*this)->getAttr(endAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_end, "end")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops19(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::PrintV2Op)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::ProdOp definitions
//===----------------------------------------------------------------------===//

ProdOpAdaptor::ProdOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

ProdOpAdaptor::ProdOpAdaptor(ProdOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange ProdOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> ProdOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange ProdOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ProdOpAdaptor::input() {
  return *getODSOperands(0).begin();
}

::mlir::Value ProdOpAdaptor::reduction_indices() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr ProdOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::BoolAttr ProdOpAdaptor::keep_dims() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("keep_dims").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(false);
  return attr;
}

::mlir::LogicalResult ProdOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_keep_dims = odsAttrs.get("keep_dims");
    if (tblgen_keep_dims && !((tblgen_keep_dims.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.Prod' op ""attribute 'keep_dims' failed to satisfy constraint: bool attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> ProdOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range ProdOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ProdOp::input() {
  return *getODSOperands(0).begin();
}

::mlir::Value ProdOp::reduction_indices() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange ProdOp::inputMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ProdOp::reduction_indicesMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> ProdOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range ProdOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ProdOp::output() {
  return *getODSResults(0).begin();
}

::mlir::BoolAttr ProdOp::keep_dimsAttr() {
  return (*this)->getAttr(keep_dimsAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool ProdOp::keep_dims() {
  auto attr = keep_dimsAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(false).getValue();
  return attr.getValue();
}

::mlir::Type ProdOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

::mlir::Type ProdOp::Tidx() {
  return mlir::getElementTypeOrSelf(*getODSOperands(1).begin());
}

bool ProdOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
  if (name == "Tidx") return true;
 return false;
}

::mlir::DictionaryAttr ProdOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())},
    {TidxAttrName(),
::mlir::TypeAttr::get(Tidx())}});
}

void ProdOp::keep_dimsAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(keep_dimsAttrName(), attr);
}

void ProdOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input, ::mlir::Value reduction_indices, ::mlir::BoolAttr keep_dims) {
  odsState.addOperands(input);
  odsState.addOperands(reduction_indices);
  odsState.addAttribute(keep_dimsAttrName(odsState.name), keep_dims);
  odsState.addTypes(output);
}

void ProdOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::Value reduction_indices, ::mlir::BoolAttr keep_dims) {
  odsState.addOperands(input);
  odsState.addOperands(reduction_indices);
  odsState.addAttribute(keep_dimsAttrName(odsState.name), keep_dims);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void ProdOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input, ::mlir::Value reduction_indices, bool keep_dims) {
  odsState.addOperands(input);
  odsState.addOperands(reduction_indices);
  odsState.addAttribute(keep_dimsAttrName(odsState.name), odsBuilder.getBoolAttr(keep_dims));
  odsState.addTypes(output);
}

void ProdOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::Value reduction_indices, bool keep_dims) {
  odsState.addOperands(input);
  odsState.addOperands(reduction_indices);
  odsState.addAttribute(keep_dimsAttrName(odsState.name), odsBuilder.getBoolAttr(keep_dims));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void ProdOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult ProdOp::verify() {
  {
    auto tblgen_keep_dims = (*this)->getAttr(keep_dimsAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_keep_dims, "keep_dims")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void ProdOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::ProdOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::QrOp definitions
//===----------------------------------------------------------------------===//

QrOpAdaptor::QrOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

QrOpAdaptor::QrOpAdaptor(QrOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange QrOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> QrOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange QrOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value QrOpAdaptor::input() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr QrOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::BoolAttr QrOpAdaptor::full_matrices() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("full_matrices").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(false);
  return attr;
}

::mlir::LogicalResult QrOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_full_matrices = odsAttrs.get("full_matrices");
    if (tblgen_full_matrices && !((tblgen_full_matrices.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.Qr' op ""attribute 'full_matrices' failed to satisfy constraint: bool attribute");
  }
  return ::mlir::success();
}

void QrOp::getAsmResultNames(::mlir::OpAsmSetValueNameFn setNameFn) {
  auto resultGroup0 = getODSResults(0);
  if (!llvm::empty(resultGroup0))
    setNameFn(*resultGroup0.begin(), "q");
  auto resultGroup1 = getODSResults(1);
  if (!llvm::empty(resultGroup1))
    setNameFn(*resultGroup1.begin(), "r");
}

std::pair<unsigned, unsigned> QrOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range QrOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value QrOp::input() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange QrOp::inputMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> QrOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range QrOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value QrOp::q() {
  return *getODSResults(0).begin();
}

::mlir::Value QrOp::r() {
  return *getODSResults(1).begin();
}

::mlir::BoolAttr QrOp::full_matricesAttr() {
  return (*this)->getAttr(full_matricesAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool QrOp::full_matrices() {
  auto attr = full_matricesAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(false).getValue();
  return attr.getValue();
}

::mlir::Type QrOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool QrOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr QrOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void QrOp::full_matricesAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(full_matricesAttrName(), attr);
}

void QrOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type q, ::mlir::Type r, ::mlir::Value input, ::mlir::BoolAttr full_matrices) {
  odsState.addOperands(input);
  odsState.addAttribute(full_matricesAttrName(odsState.name), full_matrices);
  odsState.addTypes(q);
  odsState.addTypes(r);
}

void QrOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::BoolAttr full_matrices) {
  odsState.addOperands(input);
  odsState.addAttribute(full_matricesAttrName(odsState.name), full_matrices);
  assert(resultTypes.size() == 2u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void QrOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type q, ::mlir::Type r, ::mlir::Value input, bool full_matrices) {
  odsState.addOperands(input);
  odsState.addAttribute(full_matricesAttrName(odsState.name), odsBuilder.getBoolAttr(full_matrices));
  odsState.addTypes(q);
  odsState.addTypes(r);
}

void QrOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, bool full_matrices) {
  odsState.addOperands(input);
  odsState.addAttribute(full_matricesAttrName(odsState.name), odsBuilder.getBoolAttr(full_matrices));
  assert(resultTypes.size() == 2u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void QrOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 2u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult QrOp::verify() {
  {
    auto tblgen_full_matrices = (*this)->getAttr(full_matricesAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_full_matrices, "full_matrices")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops29(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops29(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSResults(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops29(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return Verify(*this);
}

void QrOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::QrOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::QuantizeAndDequantizeOp definitions
//===----------------------------------------------------------------------===//

QuantizeAndDequantizeOpAdaptor::QuantizeAndDequantizeOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

QuantizeAndDequantizeOpAdaptor::QuantizeAndDequantizeOpAdaptor(QuantizeAndDequantizeOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange QuantizeAndDequantizeOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> QuantizeAndDequantizeOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange QuantizeAndDequantizeOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value QuantizeAndDequantizeOpAdaptor::input() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr QuantizeAndDequantizeOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::BoolAttr QuantizeAndDequantizeOpAdaptor::signed_input() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("signed_input").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(true);
  return attr;
}

::mlir::IntegerAttr QuantizeAndDequantizeOpAdaptor::num_bits() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("num_bits").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), 8);
  return attr;
}

::mlir::BoolAttr QuantizeAndDequantizeOpAdaptor::range_given() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("range_given").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(false);
  return attr;
}

::mlir::FloatAttr QuantizeAndDequantizeOpAdaptor::input_min() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::FloatAttr attr = odsAttrs.get("input_min").dyn_cast_or_null<::mlir::FloatAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getFloatAttr(::mlir::Builder(odsAttrs.getContext()).getF32Type(), 0.0f);
  return attr;
}

::mlir::FloatAttr QuantizeAndDequantizeOpAdaptor::input_max() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::FloatAttr attr = odsAttrs.get("input_max").dyn_cast_or_null<::mlir::FloatAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getFloatAttr(::mlir::Builder(odsAttrs.getContext()).getF32Type(), 0.0f);
  return attr;
}

::mlir::LogicalResult QuantizeAndDequantizeOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_signed_input = odsAttrs.get("signed_input");
    if (tblgen_signed_input && !((tblgen_signed_input.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.QuantizeAndDequantize' op ""attribute 'signed_input' failed to satisfy constraint: bool attribute");
  }
  {
    auto tblgen_num_bits = odsAttrs.get("num_bits");
    if (tblgen_num_bits && !(((tblgen_num_bits.isa<::mlir::IntegerAttr>())) && ((tblgen_num_bits.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.QuantizeAndDequantize' op ""attribute 'num_bits' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_range_given = odsAttrs.get("range_given");
    if (tblgen_range_given && !((tblgen_range_given.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.QuantizeAndDequantize' op ""attribute 'range_given' failed to satisfy constraint: bool attribute");
  }
  {
    auto tblgen_input_min = odsAttrs.get("input_min");
    if (tblgen_input_min && !(((tblgen_input_min.isa<::mlir::FloatAttr>())) && ((tblgen_input_min.cast<::mlir::FloatAttr>().getType().isF32()))))
      return emitError(loc, "'tf.QuantizeAndDequantize' op ""attribute 'input_min' failed to satisfy constraint: 32-bit float attribute");
  }
  {
    auto tblgen_input_max = odsAttrs.get("input_max");
    if (tblgen_input_max && !(((tblgen_input_max.isa<::mlir::FloatAttr>())) && ((tblgen_input_max.cast<::mlir::FloatAttr>().getType().isF32()))))
      return emitError(loc, "'tf.QuantizeAndDequantize' op ""attribute 'input_max' failed to satisfy constraint: 32-bit float attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> QuantizeAndDequantizeOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range QuantizeAndDequantizeOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value QuantizeAndDequantizeOp::input() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange QuantizeAndDequantizeOp::inputMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> QuantizeAndDequantizeOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range QuantizeAndDequantizeOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value QuantizeAndDequantizeOp::output() {
  return *getODSResults(0).begin();
}

::mlir::BoolAttr QuantizeAndDequantizeOp::signed_inputAttr() {
  return (*this)->getAttr(signed_inputAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool QuantizeAndDequantizeOp::signed_input() {
  auto attr = signed_inputAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(true).getValue();
  return attr.getValue();
}

::mlir::IntegerAttr QuantizeAndDequantizeOp::num_bitsAttr() {
  return (*this)->getAttr(num_bitsAttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t QuantizeAndDequantizeOp::num_bits() {
  auto attr = num_bitsAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), 8).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

::mlir::BoolAttr QuantizeAndDequantizeOp::range_givenAttr() {
  return (*this)->getAttr(range_givenAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool QuantizeAndDequantizeOp::range_given() {
  auto attr = range_givenAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(false).getValue();
  return attr.getValue();
}

::mlir::FloatAttr QuantizeAndDequantizeOp::input_minAttr() {
  return (*this)->getAttr(input_minAttrName()).dyn_cast_or_null<::mlir::FloatAttr>();
}

::llvm::APFloat QuantizeAndDequantizeOp::input_min() {
  auto attr = input_minAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getFloatAttr(::mlir::Builder((*this)->getContext()).getF32Type(), 0.0f).getValue();
  return attr.getValue();
}

::mlir::FloatAttr QuantizeAndDequantizeOp::input_maxAttr() {
  return (*this)->getAttr(input_maxAttrName()).dyn_cast_or_null<::mlir::FloatAttr>();
}

::llvm::APFloat QuantizeAndDequantizeOp::input_max() {
  auto attr = input_maxAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getFloatAttr(::mlir::Builder((*this)->getContext()).getF32Type(), 0.0f).getValue();
  return attr.getValue();
}

::mlir::Type QuantizeAndDequantizeOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool QuantizeAndDequantizeOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr QuantizeAndDequantizeOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void QuantizeAndDequantizeOp::signed_inputAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(signed_inputAttrName(), attr);
}

void QuantizeAndDequantizeOp::num_bitsAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(num_bitsAttrName(), attr);
}

void QuantizeAndDequantizeOp::range_givenAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(range_givenAttrName(), attr);
}

void QuantizeAndDequantizeOp::input_minAttr(::mlir::FloatAttr attr) {
  (*this)->setAttr(input_minAttrName(), attr);
}

void QuantizeAndDequantizeOp::input_maxAttr(::mlir::FloatAttr attr) {
  (*this)->setAttr(input_maxAttrName(), attr);
}

void QuantizeAndDequantizeOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input, ::mlir::BoolAttr signed_input, ::mlir::IntegerAttr num_bits, ::mlir::BoolAttr range_given, ::mlir::FloatAttr input_min, ::mlir::FloatAttr input_max) {
  odsState.addOperands(input);
  odsState.addAttribute(signed_inputAttrName(odsState.name), signed_input);
  odsState.addAttribute(num_bitsAttrName(odsState.name), num_bits);
  odsState.addAttribute(range_givenAttrName(odsState.name), range_given);
  odsState.addAttribute(input_minAttrName(odsState.name), input_min);
  odsState.addAttribute(input_maxAttrName(odsState.name), input_max);
  odsState.addTypes(output);
}

void QuantizeAndDequantizeOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::BoolAttr signed_input, ::mlir::IntegerAttr num_bits, ::mlir::BoolAttr range_given, ::mlir::FloatAttr input_min, ::mlir::FloatAttr input_max) {
  odsState.addOperands(input);
  odsState.addAttribute(signed_inputAttrName(odsState.name), signed_input);
  odsState.addAttribute(num_bitsAttrName(odsState.name), num_bits);
  odsState.addAttribute(range_givenAttrName(odsState.name), range_given);
  odsState.addAttribute(input_minAttrName(odsState.name), input_min);
  odsState.addAttribute(input_maxAttrName(odsState.name), input_max);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void QuantizeAndDequantizeOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input, bool signed_input, uint64_t num_bits, bool range_given, ::llvm::APFloat input_min, ::llvm::APFloat input_max) {
  odsState.addOperands(input);
  odsState.addAttribute(signed_inputAttrName(odsState.name), odsBuilder.getBoolAttr(signed_input));
  odsState.addAttribute(num_bitsAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), num_bits));
  odsState.addAttribute(range_givenAttrName(odsState.name), odsBuilder.getBoolAttr(range_given));
  odsState.addAttribute(input_minAttrName(odsState.name), odsBuilder.getFloatAttr(odsBuilder.getF32Type(), input_min));
  odsState.addAttribute(input_maxAttrName(odsState.name), odsBuilder.getFloatAttr(odsBuilder.getF32Type(), input_max));
  odsState.addTypes(output);
}

void QuantizeAndDequantizeOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, bool signed_input, uint64_t num_bits, bool range_given, ::llvm::APFloat input_min, ::llvm::APFloat input_max) {
  odsState.addOperands(input);
  odsState.addAttribute(signed_inputAttrName(odsState.name), odsBuilder.getBoolAttr(signed_input));
  odsState.addAttribute(num_bitsAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), num_bits));
  odsState.addAttribute(range_givenAttrName(odsState.name), odsBuilder.getBoolAttr(range_given));
  odsState.addAttribute(input_minAttrName(odsState.name), odsBuilder.getFloatAttr(odsBuilder.getF32Type(), input_min));
  odsState.addAttribute(input_maxAttrName(odsState.name), odsBuilder.getFloatAttr(odsBuilder.getF32Type(), input_max));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void QuantizeAndDequantizeOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult QuantizeAndDequantizeOp::verify() {
  {
    auto tblgen_signed_input = (*this)->getAttr(signed_inputAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_signed_input, "signed_input")))
      return ::mlir::failure();
  }
  {
    auto tblgen_num_bits = (*this)->getAttr(num_bitsAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_num_bits, "num_bits")))
      return ::mlir::failure();
  }
  {
    auto tblgen_range_given = (*this)->getAttr(range_givenAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_range_given, "range_given")))
      return ::mlir::failure();
  }
  {
    auto tblgen_input_min = (*this)->getAttr(input_minAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops5(*this, tblgen_input_min, "input_min")))
      return ::mlir::failure();
  }
  {
    auto tblgen_input_max = (*this)->getAttr(input_maxAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops5(*this, tblgen_input_max, "input_max")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void QuantizeAndDequantizeOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::QuantizeAndDequantizeOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::QuantizeAndDequantizeV2Op definitions
//===----------------------------------------------------------------------===//

QuantizeAndDequantizeV2OpAdaptor::QuantizeAndDequantizeV2OpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

QuantizeAndDequantizeV2OpAdaptor::QuantizeAndDequantizeV2OpAdaptor(QuantizeAndDequantizeV2Op &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange QuantizeAndDequantizeV2OpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> QuantizeAndDequantizeV2OpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange QuantizeAndDequantizeV2OpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value QuantizeAndDequantizeV2OpAdaptor::input() {
  return *getODSOperands(0).begin();
}

::mlir::Value QuantizeAndDequantizeV2OpAdaptor::input_min() {
  return *getODSOperands(1).begin();
}

::mlir::Value QuantizeAndDequantizeV2OpAdaptor::input_max() {
  return *getODSOperands(2).begin();
}

::mlir::DictionaryAttr QuantizeAndDequantizeV2OpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::BoolAttr QuantizeAndDequantizeV2OpAdaptor::signed_input() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("signed_input").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(true);
  return attr;
}

::mlir::IntegerAttr QuantizeAndDequantizeV2OpAdaptor::num_bits() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("num_bits").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), 8);
  return attr;
}

::mlir::BoolAttr QuantizeAndDequantizeV2OpAdaptor::range_given() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("range_given").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(false);
  return attr;
}

::mlir::StringAttr QuantizeAndDequantizeV2OpAdaptor::round_mode() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("round_mode").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("HALF_TO_EVEN");
  return attr;
}

::mlir::BoolAttr QuantizeAndDequantizeV2OpAdaptor::narrow_range() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("narrow_range").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(false);
  return attr;
}

::mlir::IntegerAttr QuantizeAndDequantizeV2OpAdaptor::axis() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("axis").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), -1);
  return attr;
}

::mlir::LogicalResult QuantizeAndDequantizeV2OpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_signed_input = odsAttrs.get("signed_input");
    if (tblgen_signed_input && !((tblgen_signed_input.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.QuantizeAndDequantizeV2' op ""attribute 'signed_input' failed to satisfy constraint: bool attribute");
  }
  {
    auto tblgen_num_bits = odsAttrs.get("num_bits");
    if (tblgen_num_bits && !(((tblgen_num_bits.isa<::mlir::IntegerAttr>())) && ((tblgen_num_bits.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.QuantizeAndDequantizeV2' op ""attribute 'num_bits' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_range_given = odsAttrs.get("range_given");
    if (tblgen_range_given && !((tblgen_range_given.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.QuantizeAndDequantizeV2' op ""attribute 'range_given' failed to satisfy constraint: bool attribute");
  }
  {
    auto tblgen_round_mode = odsAttrs.get("round_mode");
    if (tblgen_round_mode && !((tblgen_round_mode.cast<StringAttr>().getValue() == "HALF_TO_EVEN" || tblgen_round_mode.cast<StringAttr>().getValue() == "HALF_UP")))
      return emitError(loc, "'tf.QuantizeAndDequantizeV2' op ""attribute 'round_mode' failed to satisfy constraint: string attribute whose value is HALF_TO_EVEN, or HALF_UP");
  }
  {
    auto tblgen_narrow_range = odsAttrs.get("narrow_range");
    if (tblgen_narrow_range && !((tblgen_narrow_range.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.QuantizeAndDequantizeV2' op ""attribute 'narrow_range' failed to satisfy constraint: bool attribute");
  }
  {
    auto tblgen_axis = odsAttrs.get("axis");
    if (tblgen_axis && !(((tblgen_axis.isa<::mlir::IntegerAttr>())) && ((tblgen_axis.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.QuantizeAndDequantizeV2' op ""attribute 'axis' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> QuantizeAndDequantizeV2Op::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range QuantizeAndDequantizeV2Op::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value QuantizeAndDequantizeV2Op::input() {
  return *getODSOperands(0).begin();
}

::mlir::Value QuantizeAndDequantizeV2Op::input_min() {
  return *getODSOperands(1).begin();
}

::mlir::Value QuantizeAndDequantizeV2Op::input_max() {
  return *getODSOperands(2).begin();
}

::mlir::MutableOperandRange QuantizeAndDequantizeV2Op::inputMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange QuantizeAndDequantizeV2Op::input_minMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange QuantizeAndDequantizeV2Op::input_maxMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> QuantizeAndDequantizeV2Op::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range QuantizeAndDequantizeV2Op::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value QuantizeAndDequantizeV2Op::output() {
  return *getODSResults(0).begin();
}

::mlir::BoolAttr QuantizeAndDequantizeV2Op::signed_inputAttr() {
  return (*this)->getAttr(signed_inputAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool QuantizeAndDequantizeV2Op::signed_input() {
  auto attr = signed_inputAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(true).getValue();
  return attr.getValue();
}

::mlir::IntegerAttr QuantizeAndDequantizeV2Op::num_bitsAttr() {
  return (*this)->getAttr(num_bitsAttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t QuantizeAndDequantizeV2Op::num_bits() {
  auto attr = num_bitsAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), 8).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

::mlir::BoolAttr QuantizeAndDequantizeV2Op::range_givenAttr() {
  return (*this)->getAttr(range_givenAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool QuantizeAndDequantizeV2Op::range_given() {
  auto attr = range_givenAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(false).getValue();
  return attr.getValue();
}

::mlir::StringAttr QuantizeAndDequantizeV2Op::round_modeAttr() {
  return (*this)->getAttr(round_modeAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef QuantizeAndDequantizeV2Op::round_mode() {
  auto attr = round_modeAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("HALF_TO_EVEN").getValue();
  return attr.getValue();
}

::mlir::BoolAttr QuantizeAndDequantizeV2Op::narrow_rangeAttr() {
  return (*this)->getAttr(narrow_rangeAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool QuantizeAndDequantizeV2Op::narrow_range() {
  auto attr = narrow_rangeAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(false).getValue();
  return attr.getValue();
}

::mlir::IntegerAttr QuantizeAndDequantizeV2Op::axisAttr() {
  return (*this)->getAttr(axisAttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t QuantizeAndDequantizeV2Op::axis() {
  auto attr = axisAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), -1).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

::mlir::Type QuantizeAndDequantizeV2Op::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool QuantizeAndDequantizeV2Op::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr QuantizeAndDequantizeV2Op::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void QuantizeAndDequantizeV2Op::signed_inputAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(signed_inputAttrName(), attr);
}

void QuantizeAndDequantizeV2Op::num_bitsAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(num_bitsAttrName(), attr);
}

void QuantizeAndDequantizeV2Op::range_givenAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(range_givenAttrName(), attr);
}

void QuantizeAndDequantizeV2Op::round_modeAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(round_modeAttrName(), attr);
}

void QuantizeAndDequantizeV2Op::narrow_rangeAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(narrow_rangeAttrName(), attr);
}

void QuantizeAndDequantizeV2Op::axisAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(axisAttrName(), attr);
}

void QuantizeAndDequantizeV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input, ::mlir::Value input_min, ::mlir::Value input_max, ::mlir::BoolAttr signed_input, ::mlir::IntegerAttr num_bits, ::mlir::BoolAttr range_given, ::mlir::StringAttr round_mode, ::mlir::BoolAttr narrow_range, ::mlir::IntegerAttr axis) {
  odsState.addOperands(input);
  odsState.addOperands(input_min);
  odsState.addOperands(input_max);
  odsState.addAttribute(signed_inputAttrName(odsState.name), signed_input);
  odsState.addAttribute(num_bitsAttrName(odsState.name), num_bits);
  odsState.addAttribute(range_givenAttrName(odsState.name), range_given);
  odsState.addAttribute(round_modeAttrName(odsState.name), round_mode);
  odsState.addAttribute(narrow_rangeAttrName(odsState.name), narrow_range);
  odsState.addAttribute(axisAttrName(odsState.name), axis);
  odsState.addTypes(output);
}

void QuantizeAndDequantizeV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::Value input_min, ::mlir::Value input_max, ::mlir::BoolAttr signed_input, ::mlir::IntegerAttr num_bits, ::mlir::BoolAttr range_given, ::mlir::StringAttr round_mode, ::mlir::BoolAttr narrow_range, ::mlir::IntegerAttr axis) {
  odsState.addOperands(input);
  odsState.addOperands(input_min);
  odsState.addOperands(input_max);
  odsState.addAttribute(signed_inputAttrName(odsState.name), signed_input);
  odsState.addAttribute(num_bitsAttrName(odsState.name), num_bits);
  odsState.addAttribute(range_givenAttrName(odsState.name), range_given);
  odsState.addAttribute(round_modeAttrName(odsState.name), round_mode);
  odsState.addAttribute(narrow_rangeAttrName(odsState.name), narrow_range);
  odsState.addAttribute(axisAttrName(odsState.name), axis);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void QuantizeAndDequantizeV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input, ::mlir::Value input_min, ::mlir::Value input_max, bool signed_input, uint64_t num_bits, bool range_given, ::llvm::StringRef round_mode, bool narrow_range, uint64_t axis) {
  odsState.addOperands(input);
  odsState.addOperands(input_min);
  odsState.addOperands(input_max);
  odsState.addAttribute(signed_inputAttrName(odsState.name), odsBuilder.getBoolAttr(signed_input));
  odsState.addAttribute(num_bitsAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), num_bits));
  odsState.addAttribute(range_givenAttrName(odsState.name), odsBuilder.getBoolAttr(range_given));
  odsState.addAttribute(round_modeAttrName(odsState.name), odsBuilder.getStringAttr(round_mode));
  odsState.addAttribute(narrow_rangeAttrName(odsState.name), odsBuilder.getBoolAttr(narrow_range));
  odsState.addAttribute(axisAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), axis));
  odsState.addTypes(output);
}

void QuantizeAndDequantizeV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::Value input_min, ::mlir::Value input_max, bool signed_input, uint64_t num_bits, bool range_given, ::llvm::StringRef round_mode, bool narrow_range, uint64_t axis) {
  odsState.addOperands(input);
  odsState.addOperands(input_min);
  odsState.addOperands(input_max);
  odsState.addAttribute(signed_inputAttrName(odsState.name), odsBuilder.getBoolAttr(signed_input));
  odsState.addAttribute(num_bitsAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), num_bits));
  odsState.addAttribute(range_givenAttrName(odsState.name), odsBuilder.getBoolAttr(range_given));
  odsState.addAttribute(round_modeAttrName(odsState.name), odsBuilder.getStringAttr(round_mode));
  odsState.addAttribute(narrow_rangeAttrName(odsState.name), odsBuilder.getBoolAttr(narrow_range));
  odsState.addAttribute(axisAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), axis));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void QuantizeAndDequantizeV2Op::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 3u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult QuantizeAndDequantizeV2Op::verify() {
  {
    auto tblgen_signed_input = (*this)->getAttr(signed_inputAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_signed_input, "signed_input")))
      return ::mlir::failure();
  }
  {
    auto tblgen_num_bits = (*this)->getAttr(num_bitsAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_num_bits, "num_bits")))
      return ::mlir::failure();
  }
  {
    auto tblgen_range_given = (*this)->getAttr(range_givenAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_range_given, "range_given")))
      return ::mlir::failure();
  }
  {
    auto tblgen_round_mode = (*this)->getAttr(round_modeAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops36(*this, tblgen_round_mode, "round_mode")))
      return ::mlir::failure();
  }
  {
    auto tblgen_narrow_range = (*this)->getAttr(narrow_rangeAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_narrow_range, "narrow_range")))
      return ::mlir::failure();
  }
  {
    auto tblgen_axis = (*this)->getAttr(axisAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_axis, "axis")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void QuantizeAndDequantizeV2Op::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::QuantizeAndDequantizeV2Op)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::QuantizeAndDequantizeV3Op definitions
//===----------------------------------------------------------------------===//

QuantizeAndDequantizeV3OpAdaptor::QuantizeAndDequantizeV3OpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

QuantizeAndDequantizeV3OpAdaptor::QuantizeAndDequantizeV3OpAdaptor(QuantizeAndDequantizeV3Op &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange QuantizeAndDequantizeV3OpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> QuantizeAndDequantizeV3OpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange QuantizeAndDequantizeV3OpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value QuantizeAndDequantizeV3OpAdaptor::input() {
  return *getODSOperands(0).begin();
}

::mlir::Value QuantizeAndDequantizeV3OpAdaptor::input_min() {
  return *getODSOperands(1).begin();
}

::mlir::Value QuantizeAndDequantizeV3OpAdaptor::input_max() {
  return *getODSOperands(2).begin();
}

::mlir::Value QuantizeAndDequantizeV3OpAdaptor::num_bits() {
  return *getODSOperands(3).begin();
}

::mlir::DictionaryAttr QuantizeAndDequantizeV3OpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::BoolAttr QuantizeAndDequantizeV3OpAdaptor::signed_input() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("signed_input").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(true);
  return attr;
}

::mlir::BoolAttr QuantizeAndDequantizeV3OpAdaptor::range_given() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("range_given").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(true);
  return attr;
}

::mlir::BoolAttr QuantizeAndDequantizeV3OpAdaptor::narrow_range() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("narrow_range").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(false);
  return attr;
}

::mlir::IntegerAttr QuantizeAndDequantizeV3OpAdaptor::axis() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("axis").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), -1);
  return attr;
}

::mlir::LogicalResult QuantizeAndDequantizeV3OpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_signed_input = odsAttrs.get("signed_input");
    if (tblgen_signed_input && !((tblgen_signed_input.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.QuantizeAndDequantizeV3' op ""attribute 'signed_input' failed to satisfy constraint: bool attribute");
  }
  {
    auto tblgen_range_given = odsAttrs.get("range_given");
    if (tblgen_range_given && !((tblgen_range_given.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.QuantizeAndDequantizeV3' op ""attribute 'range_given' failed to satisfy constraint: bool attribute");
  }
  {
    auto tblgen_narrow_range = odsAttrs.get("narrow_range");
    if (tblgen_narrow_range && !((tblgen_narrow_range.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.QuantizeAndDequantizeV3' op ""attribute 'narrow_range' failed to satisfy constraint: bool attribute");
  }
  {
    auto tblgen_axis = odsAttrs.get("axis");
    if (tblgen_axis && !(((tblgen_axis.isa<::mlir::IntegerAttr>())) && ((tblgen_axis.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.QuantizeAndDequantizeV3' op ""attribute 'axis' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> QuantizeAndDequantizeV3Op::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range QuantizeAndDequantizeV3Op::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value QuantizeAndDequantizeV3Op::input() {
  return *getODSOperands(0).begin();
}

::mlir::Value QuantizeAndDequantizeV3Op::input_min() {
  return *getODSOperands(1).begin();
}

::mlir::Value QuantizeAndDequantizeV3Op::input_max() {
  return *getODSOperands(2).begin();
}

::mlir::Value QuantizeAndDequantizeV3Op::num_bits() {
  return *getODSOperands(3).begin();
}

::mlir::MutableOperandRange QuantizeAndDequantizeV3Op::inputMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange QuantizeAndDequantizeV3Op::input_minMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange QuantizeAndDequantizeV3Op::input_maxMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange QuantizeAndDequantizeV3Op::num_bitsMutable() {
  auto range = getODSOperandIndexAndLength(3);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> QuantizeAndDequantizeV3Op::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range QuantizeAndDequantizeV3Op::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value QuantizeAndDequantizeV3Op::output() {
  return *getODSResults(0).begin();
}

::mlir::BoolAttr QuantizeAndDequantizeV3Op::signed_inputAttr() {
  return (*this)->getAttr(signed_inputAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool QuantizeAndDequantizeV3Op::signed_input() {
  auto attr = signed_inputAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(true).getValue();
  return attr.getValue();
}

::mlir::BoolAttr QuantizeAndDequantizeV3Op::range_givenAttr() {
  return (*this)->getAttr(range_givenAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool QuantizeAndDequantizeV3Op::range_given() {
  auto attr = range_givenAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(true).getValue();
  return attr.getValue();
}

::mlir::BoolAttr QuantizeAndDequantizeV3Op::narrow_rangeAttr() {
  return (*this)->getAttr(narrow_rangeAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool QuantizeAndDequantizeV3Op::narrow_range() {
  auto attr = narrow_rangeAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(false).getValue();
  return attr.getValue();
}

::mlir::IntegerAttr QuantizeAndDequantizeV3Op::axisAttr() {
  return (*this)->getAttr(axisAttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t QuantizeAndDequantizeV3Op::axis() {
  auto attr = axisAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), -1).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

::mlir::Type QuantizeAndDequantizeV3Op::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool QuantizeAndDequantizeV3Op::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr QuantizeAndDequantizeV3Op::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void QuantizeAndDequantizeV3Op::signed_inputAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(signed_inputAttrName(), attr);
}

void QuantizeAndDequantizeV3Op::range_givenAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(range_givenAttrName(), attr);
}

void QuantizeAndDequantizeV3Op::narrow_rangeAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(narrow_rangeAttrName(), attr);
}

void QuantizeAndDequantizeV3Op::axisAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(axisAttrName(), attr);
}

void QuantizeAndDequantizeV3Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input, ::mlir::Value input_min, ::mlir::Value input_max, ::mlir::Value num_bits, ::mlir::BoolAttr signed_input, ::mlir::BoolAttr range_given, ::mlir::BoolAttr narrow_range, ::mlir::IntegerAttr axis) {
  odsState.addOperands(input);
  odsState.addOperands(input_min);
  odsState.addOperands(input_max);
  odsState.addOperands(num_bits);
  odsState.addAttribute(signed_inputAttrName(odsState.name), signed_input);
  odsState.addAttribute(range_givenAttrName(odsState.name), range_given);
  odsState.addAttribute(narrow_rangeAttrName(odsState.name), narrow_range);
  odsState.addAttribute(axisAttrName(odsState.name), axis);
  odsState.addTypes(output);
}

void QuantizeAndDequantizeV3Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::Value input_min, ::mlir::Value input_max, ::mlir::Value num_bits, ::mlir::BoolAttr signed_input, ::mlir::BoolAttr range_given, ::mlir::BoolAttr narrow_range, ::mlir::IntegerAttr axis) {
  odsState.addOperands(input);
  odsState.addOperands(input_min);
  odsState.addOperands(input_max);
  odsState.addOperands(num_bits);
  odsState.addAttribute(signed_inputAttrName(odsState.name), signed_input);
  odsState.addAttribute(range_givenAttrName(odsState.name), range_given);
  odsState.addAttribute(narrow_rangeAttrName(odsState.name), narrow_range);
  odsState.addAttribute(axisAttrName(odsState.name), axis);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void QuantizeAndDequantizeV3Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input, ::mlir::Value input_min, ::mlir::Value input_max, ::mlir::Value num_bits, bool signed_input, bool range_given, bool narrow_range, uint64_t axis) {
  odsState.addOperands(input);
  odsState.addOperands(input_min);
  odsState.addOperands(input_max);
  odsState.addOperands(num_bits);
  odsState.addAttribute(signed_inputAttrName(odsState.name), odsBuilder.getBoolAttr(signed_input));
  odsState.addAttribute(range_givenAttrName(odsState.name), odsBuilder.getBoolAttr(range_given));
  odsState.addAttribute(narrow_rangeAttrName(odsState.name), odsBuilder.getBoolAttr(narrow_range));
  odsState.addAttribute(axisAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), axis));
  odsState.addTypes(output);
}

void QuantizeAndDequantizeV3Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::Value input_min, ::mlir::Value input_max, ::mlir::Value num_bits, bool signed_input, bool range_given, bool narrow_range, uint64_t axis) {
  odsState.addOperands(input);
  odsState.addOperands(input_min);
  odsState.addOperands(input_max);
  odsState.addOperands(num_bits);
  odsState.addAttribute(signed_inputAttrName(odsState.name), odsBuilder.getBoolAttr(signed_input));
  odsState.addAttribute(range_givenAttrName(odsState.name), odsBuilder.getBoolAttr(range_given));
  odsState.addAttribute(narrow_rangeAttrName(odsState.name), odsBuilder.getBoolAttr(narrow_range));
  odsState.addAttribute(axisAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), axis));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void QuantizeAndDequantizeV3Op::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 4u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult QuantizeAndDequantizeV3Op::verify() {
  {
    auto tblgen_signed_input = (*this)->getAttr(signed_inputAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_signed_input, "signed_input")))
      return ::mlir::failure();
  }
  {
    auto tblgen_range_given = (*this)->getAttr(range_givenAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_range_given, "range_given")))
      return ::mlir::failure();
  }
  {
    auto tblgen_narrow_range = (*this)->getAttr(narrow_rangeAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_narrow_range, "narrow_range")))
      return ::mlir::failure();
  }
  {
    auto tblgen_axis = (*this)->getAttr(axisAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_axis, "axis")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup3 = getODSOperands(3);

    for (auto v : valueGroup3) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops11(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void QuantizeAndDequantizeV3Op::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::QuantizeAndDequantizeV3Op)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::QuantizeAndDequantizeV4Op definitions
//===----------------------------------------------------------------------===//

QuantizeAndDequantizeV4OpAdaptor::QuantizeAndDequantizeV4OpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

QuantizeAndDequantizeV4OpAdaptor::QuantizeAndDequantizeV4OpAdaptor(QuantizeAndDequantizeV4Op &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange QuantizeAndDequantizeV4OpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> QuantizeAndDequantizeV4OpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange QuantizeAndDequantizeV4OpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value QuantizeAndDequantizeV4OpAdaptor::input() {
  return *getODSOperands(0).begin();
}

::mlir::Value QuantizeAndDequantizeV4OpAdaptor::input_min() {
  return *getODSOperands(1).begin();
}

::mlir::Value QuantizeAndDequantizeV4OpAdaptor::input_max() {
  return *getODSOperands(2).begin();
}

::mlir::DictionaryAttr QuantizeAndDequantizeV4OpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::BoolAttr QuantizeAndDequantizeV4OpAdaptor::signed_input() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("signed_input").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(true);
  return attr;
}

::mlir::IntegerAttr QuantizeAndDequantizeV4OpAdaptor::num_bits() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("num_bits").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), 8);
  return attr;
}

::mlir::BoolAttr QuantizeAndDequantizeV4OpAdaptor::range_given() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("range_given").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(false);
  return attr;
}

::mlir::StringAttr QuantizeAndDequantizeV4OpAdaptor::round_mode() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("round_mode").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("HALF_TO_EVEN");
  return attr;
}

::mlir::BoolAttr QuantizeAndDequantizeV4OpAdaptor::narrow_range() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("narrow_range").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(false);
  return attr;
}

::mlir::IntegerAttr QuantizeAndDequantizeV4OpAdaptor::axis() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("axis").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), -1);
  return attr;
}

::mlir::LogicalResult QuantizeAndDequantizeV4OpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_signed_input = odsAttrs.get("signed_input");
    if (tblgen_signed_input && !((tblgen_signed_input.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.QuantizeAndDequantizeV4' op ""attribute 'signed_input' failed to satisfy constraint: bool attribute");
  }
  {
    auto tblgen_num_bits = odsAttrs.get("num_bits");
    if (tblgen_num_bits && !(((tblgen_num_bits.isa<::mlir::IntegerAttr>())) && ((tblgen_num_bits.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.QuantizeAndDequantizeV4' op ""attribute 'num_bits' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_range_given = odsAttrs.get("range_given");
    if (tblgen_range_given && !((tblgen_range_given.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.QuantizeAndDequantizeV4' op ""attribute 'range_given' failed to satisfy constraint: bool attribute");
  }
  {
    auto tblgen_round_mode = odsAttrs.get("round_mode");
    if (tblgen_round_mode && !((tblgen_round_mode.cast<StringAttr>().getValue() == "HALF_TO_EVEN" || tblgen_round_mode.cast<StringAttr>().getValue() == "HALF_UP")))
      return emitError(loc, "'tf.QuantizeAndDequantizeV4' op ""attribute 'round_mode' failed to satisfy constraint: string attribute whose value is HALF_TO_EVEN, or HALF_UP");
  }
  {
    auto tblgen_narrow_range = odsAttrs.get("narrow_range");
    if (tblgen_narrow_range && !((tblgen_narrow_range.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.QuantizeAndDequantizeV4' op ""attribute 'narrow_range' failed to satisfy constraint: bool attribute");
  }
  {
    auto tblgen_axis = odsAttrs.get("axis");
    if (tblgen_axis && !(((tblgen_axis.isa<::mlir::IntegerAttr>())) && ((tblgen_axis.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.QuantizeAndDequantizeV4' op ""attribute 'axis' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> QuantizeAndDequantizeV4Op::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range QuantizeAndDequantizeV4Op::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value QuantizeAndDequantizeV4Op::input() {
  return *getODSOperands(0).begin();
}

::mlir::Value QuantizeAndDequantizeV4Op::input_min() {
  return *getODSOperands(1).begin();
}

::mlir::Value QuantizeAndDequantizeV4Op::input_max() {
  return *getODSOperands(2).begin();
}

::mlir::MutableOperandRange QuantizeAndDequantizeV4Op::inputMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange QuantizeAndDequantizeV4Op::input_minMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange QuantizeAndDequantizeV4Op::input_maxMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> QuantizeAndDequantizeV4Op::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range QuantizeAndDequantizeV4Op::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value QuantizeAndDequantizeV4Op::output() {
  return *getODSResults(0).begin();
}

::mlir::BoolAttr QuantizeAndDequantizeV4Op::signed_inputAttr() {
  return (*this)->getAttr(signed_inputAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool QuantizeAndDequantizeV4Op::signed_input() {
  auto attr = signed_inputAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(true).getValue();
  return attr.getValue();
}

::mlir::IntegerAttr QuantizeAndDequantizeV4Op::num_bitsAttr() {
  return (*this)->getAttr(num_bitsAttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t QuantizeAndDequantizeV4Op::num_bits() {
  auto attr = num_bitsAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), 8).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

::mlir::BoolAttr QuantizeAndDequantizeV4Op::range_givenAttr() {
  return (*this)->getAttr(range_givenAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool QuantizeAndDequantizeV4Op::range_given() {
  auto attr = range_givenAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(false).getValue();
  return attr.getValue();
}

::mlir::StringAttr QuantizeAndDequantizeV4Op::round_modeAttr() {
  return (*this)->getAttr(round_modeAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef QuantizeAndDequantizeV4Op::round_mode() {
  auto attr = round_modeAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("HALF_TO_EVEN").getValue();
  return attr.getValue();
}

::mlir::BoolAttr QuantizeAndDequantizeV4Op::narrow_rangeAttr() {
  return (*this)->getAttr(narrow_rangeAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool QuantizeAndDequantizeV4Op::narrow_range() {
  auto attr = narrow_rangeAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(false).getValue();
  return attr.getValue();
}

::mlir::IntegerAttr QuantizeAndDequantizeV4Op::axisAttr() {
  return (*this)->getAttr(axisAttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t QuantizeAndDequantizeV4Op::axis() {
  auto attr = axisAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), -1).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

::mlir::Type QuantizeAndDequantizeV4Op::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool QuantizeAndDequantizeV4Op::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr QuantizeAndDequantizeV4Op::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void QuantizeAndDequantizeV4Op::signed_inputAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(signed_inputAttrName(), attr);
}

void QuantizeAndDequantizeV4Op::num_bitsAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(num_bitsAttrName(), attr);
}

void QuantizeAndDequantizeV4Op::range_givenAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(range_givenAttrName(), attr);
}

void QuantizeAndDequantizeV4Op::round_modeAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(round_modeAttrName(), attr);
}

void QuantizeAndDequantizeV4Op::narrow_rangeAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(narrow_rangeAttrName(), attr);
}

void QuantizeAndDequantizeV4Op::axisAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(axisAttrName(), attr);
}

void QuantizeAndDequantizeV4Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input, ::mlir::Value input_min, ::mlir::Value input_max, ::mlir::BoolAttr signed_input, ::mlir::IntegerAttr num_bits, ::mlir::BoolAttr range_given, ::mlir::StringAttr round_mode, ::mlir::BoolAttr narrow_range, ::mlir::IntegerAttr axis) {
  odsState.addOperands(input);
  odsState.addOperands(input_min);
  odsState.addOperands(input_max);
  odsState.addAttribute(signed_inputAttrName(odsState.name), signed_input);
  odsState.addAttribute(num_bitsAttrName(odsState.name), num_bits);
  odsState.addAttribute(range_givenAttrName(odsState.name), range_given);
  odsState.addAttribute(round_modeAttrName(odsState.name), round_mode);
  odsState.addAttribute(narrow_rangeAttrName(odsState.name), narrow_range);
  odsState.addAttribute(axisAttrName(odsState.name), axis);
  odsState.addTypes(output);
}

void QuantizeAndDequantizeV4Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::Value input_min, ::mlir::Value input_max, ::mlir::BoolAttr signed_input, ::mlir::IntegerAttr num_bits, ::mlir::BoolAttr range_given, ::mlir::StringAttr round_mode, ::mlir::BoolAttr narrow_range, ::mlir::IntegerAttr axis) {
  odsState.addOperands(input);
  odsState.addOperands(input_min);
  odsState.addOperands(input_max);
  odsState.addAttribute(signed_inputAttrName(odsState.name), signed_input);
  odsState.addAttribute(num_bitsAttrName(odsState.name), num_bits);
  odsState.addAttribute(range_givenAttrName(odsState.name), range_given);
  odsState.addAttribute(round_modeAttrName(odsState.name), round_mode);
  odsState.addAttribute(narrow_rangeAttrName(odsState.name), narrow_range);
  odsState.addAttribute(axisAttrName(odsState.name), axis);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void QuantizeAndDequantizeV4Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input, ::mlir::Value input_min, ::mlir::Value input_max, bool signed_input, uint64_t num_bits, bool range_given, ::llvm::StringRef round_mode, bool narrow_range, uint64_t axis) {
  odsState.addOperands(input);
  odsState.addOperands(input_min);
  odsState.addOperands(input_max);
  odsState.addAttribute(signed_inputAttrName(odsState.name), odsBuilder.getBoolAttr(signed_input));
  odsState.addAttribute(num_bitsAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), num_bits));
  odsState.addAttribute(range_givenAttrName(odsState.name), odsBuilder.getBoolAttr(range_given));
  odsState.addAttribute(round_modeAttrName(odsState.name), odsBuilder.getStringAttr(round_mode));
  odsState.addAttribute(narrow_rangeAttrName(odsState.name), odsBuilder.getBoolAttr(narrow_range));
  odsState.addAttribute(axisAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), axis));
  odsState.addTypes(output);
}

void QuantizeAndDequantizeV4Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::Value input_min, ::mlir::Value input_max, bool signed_input, uint64_t num_bits, bool range_given, ::llvm::StringRef round_mode, bool narrow_range, uint64_t axis) {
  odsState.addOperands(input);
  odsState.addOperands(input_min);
  odsState.addOperands(input_max);
  odsState.addAttribute(signed_inputAttrName(odsState.name), odsBuilder.getBoolAttr(signed_input));
  odsState.addAttribute(num_bitsAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), num_bits));
  odsState.addAttribute(range_givenAttrName(odsState.name), odsBuilder.getBoolAttr(range_given));
  odsState.addAttribute(round_modeAttrName(odsState.name), odsBuilder.getStringAttr(round_mode));
  odsState.addAttribute(narrow_rangeAttrName(odsState.name), odsBuilder.getBoolAttr(narrow_range));
  odsState.addAttribute(axisAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), axis));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void QuantizeAndDequantizeV4Op::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 3u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult QuantizeAndDequantizeV4Op::verify() {
  {
    auto tblgen_signed_input = (*this)->getAttr(signed_inputAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_signed_input, "signed_input")))
      return ::mlir::failure();
  }
  {
    auto tblgen_num_bits = (*this)->getAttr(num_bitsAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_num_bits, "num_bits")))
      return ::mlir::failure();
  }
  {
    auto tblgen_range_given = (*this)->getAttr(range_givenAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_range_given, "range_given")))
      return ::mlir::failure();
  }
  {
    auto tblgen_round_mode = (*this)->getAttr(round_modeAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops36(*this, tblgen_round_mode, "round_mode")))
      return ::mlir::failure();
  }
  {
    auto tblgen_narrow_range = (*this)->getAttr(narrow_rangeAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_narrow_range, "narrow_range")))
      return ::mlir::failure();
  }
  {
    auto tblgen_axis = (*this)->getAttr(axisAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_axis, "axis")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void QuantizeAndDequantizeV4Op::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::QuantizeAndDequantizeV4Op)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::QueueDequeueV2Op definitions
//===----------------------------------------------------------------------===//

QueueDequeueV2OpAdaptor::QueueDequeueV2OpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

QueueDequeueV2OpAdaptor::QueueDequeueV2OpAdaptor(QueueDequeueV2Op &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange QueueDequeueV2OpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> QueueDequeueV2OpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange QueueDequeueV2OpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value QueueDequeueV2OpAdaptor::handle() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr QueueDequeueV2OpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::IntegerAttr QueueDequeueV2OpAdaptor::timeout_ms() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("timeout_ms").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), -1);
  return attr;
}

::mlir::LogicalResult QueueDequeueV2OpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_timeout_ms = odsAttrs.get("timeout_ms");
    if (tblgen_timeout_ms && !(((tblgen_timeout_ms.isa<::mlir::IntegerAttr>())) && ((tblgen_timeout_ms.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.QueueDequeueV2' op ""attribute 'timeout_ms' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> QueueDequeueV2Op::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range QueueDequeueV2Op::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value QueueDequeueV2Op::handle() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange QueueDequeueV2Op::handleMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> QueueDequeueV2Op::getODSResultIndexAndLength(unsigned index) {
  bool isVariadic[] = {true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (getOperation()->getNumResults() - 0) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::Operation::result_range QueueDequeueV2Op::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Operation::result_range QueueDequeueV2Op::components() {
  return getODSResults(0);
}

::mlir::IntegerAttr QueueDequeueV2Op::timeout_msAttr() {
  return (*this)->getAttr(timeout_msAttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t QueueDequeueV2Op::timeout_ms() {
  auto attr = timeout_msAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), -1).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

mlir::ResultElementTypeRange QueueDequeueV2Op::component_types() {
  auto values = getODSResults(0);
return {mlir::ResultElementTypeIterator(values.begin()), mlir::ResultElementTypeIterator(values.end())};
}

bool QueueDequeueV2Op::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "component_types") return true;
 return false;
}

::mlir::DictionaryAttr QueueDequeueV2Op::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {component_typesAttrName(),
ArrayAttr::get(ctx, 
    [&]() {
      llvm::SmallVector<Attribute, 4> ret;
      for (auto t : component_types())
        ret.push_back(TypeAttr::get(t));
      return ret;
    }())}});
}

void QueueDequeueV2Op::timeout_msAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(timeout_msAttrName(), attr);
}

void QueueDequeueV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange components, ::mlir::Value handle, ::mlir::IntegerAttr timeout_ms) {
  odsState.addOperands(handle);
  odsState.addAttribute(timeout_msAttrName(odsState.name), timeout_ms);
  odsState.addTypes(components);
}

void QueueDequeueV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange components, ::mlir::Value handle, uint64_t timeout_ms) {
  odsState.addOperands(handle);
  odsState.addAttribute(timeout_msAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), timeout_ms));
  odsState.addTypes(components);
}

void QueueDequeueV2Op::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult QueueDequeueV2Op::verify() {
  {
    auto tblgen_timeout_ms = (*this)->getAttr(timeout_msAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_timeout_ms, "timeout_ms")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::QueueDequeueV2Op)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::RFFT2DOp definitions
//===----------------------------------------------------------------------===//

RFFT2DOpAdaptor::RFFT2DOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

RFFT2DOpAdaptor::RFFT2DOpAdaptor(RFFT2DOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange RFFT2DOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> RFFT2DOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange RFFT2DOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value RFFT2DOpAdaptor::input() {
  return *getODSOperands(0).begin();
}

::mlir::Value RFFT2DOpAdaptor::fft_length() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr RFFT2DOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult RFFT2DOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> RFFT2DOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range RFFT2DOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value RFFT2DOp::input() {
  return *getODSOperands(0).begin();
}

::mlir::Value RFFT2DOp::fft_length() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange RFFT2DOp::inputMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange RFFT2DOp::fft_lengthMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> RFFT2DOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range RFFT2DOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value RFFT2DOp::output() {
  return *getODSResults(0).begin();
}

::mlir::Type RFFT2DOp::Treal() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

::mlir::Type RFFT2DOp::Tcomplex() {
  return mlir::getElementTypeOrSelf(*getODSResults(0).begin());
}

bool RFFT2DOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "Treal") return true;
  if (name == "Tcomplex") return true;
 return false;
}

::mlir::DictionaryAttr RFFT2DOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TrealAttrName(),
::mlir::TypeAttr::get(Treal())},
    {TcomplexAttrName(),
::mlir::TypeAttr::get(Tcomplex())}});
}

void RFFT2DOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input, ::mlir::Value fft_length) {
  odsState.addOperands(input);
  odsState.addOperands(fft_length);
  odsState.addTypes(output);
}

void RFFT2DOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::Value fft_length) {
  odsState.addOperands(input);
  odsState.addOperands(fft_length);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void RFFT2DOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult RFFT2DOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops13(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops11(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops12(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void RFFT2DOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::RFFT2DOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::RFFT3DOp definitions
//===----------------------------------------------------------------------===//

RFFT3DOpAdaptor::RFFT3DOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

RFFT3DOpAdaptor::RFFT3DOpAdaptor(RFFT3DOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange RFFT3DOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> RFFT3DOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange RFFT3DOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value RFFT3DOpAdaptor::input() {
  return *getODSOperands(0).begin();
}

::mlir::Value RFFT3DOpAdaptor::fft_length() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr RFFT3DOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult RFFT3DOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> RFFT3DOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range RFFT3DOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value RFFT3DOp::input() {
  return *getODSOperands(0).begin();
}

::mlir::Value RFFT3DOp::fft_length() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange RFFT3DOp::inputMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange RFFT3DOp::fft_lengthMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> RFFT3DOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range RFFT3DOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value RFFT3DOp::output() {
  return *getODSResults(0).begin();
}

::mlir::Type RFFT3DOp::Treal() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

::mlir::Type RFFT3DOp::Tcomplex() {
  return mlir::getElementTypeOrSelf(*getODSResults(0).begin());
}

bool RFFT3DOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "Treal") return true;
  if (name == "Tcomplex") return true;
 return false;
}

::mlir::DictionaryAttr RFFT3DOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TrealAttrName(),
::mlir::TypeAttr::get(Treal())},
    {TcomplexAttrName(),
::mlir::TypeAttr::get(Tcomplex())}});
}

void RFFT3DOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input, ::mlir::Value fft_length) {
  odsState.addOperands(input);
  odsState.addOperands(fft_length);
  odsState.addTypes(output);
}

void RFFT3DOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::Value fft_length) {
  odsState.addOperands(input);
  odsState.addOperands(fft_length);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void RFFT3DOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult RFFT3DOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops13(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops11(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops12(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void RFFT3DOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::RFFT3DOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::RFFTOp definitions
//===----------------------------------------------------------------------===//

RFFTOpAdaptor::RFFTOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

RFFTOpAdaptor::RFFTOpAdaptor(RFFTOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange RFFTOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> RFFTOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange RFFTOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value RFFTOpAdaptor::input() {
  return *getODSOperands(0).begin();
}

::mlir::Value RFFTOpAdaptor::fft_length() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr RFFTOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult RFFTOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> RFFTOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range RFFTOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value RFFTOp::input() {
  return *getODSOperands(0).begin();
}

::mlir::Value RFFTOp::fft_length() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange RFFTOp::inputMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange RFFTOp::fft_lengthMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> RFFTOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range RFFTOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value RFFTOp::output() {
  return *getODSResults(0).begin();
}

::mlir::Type RFFTOp::Treal() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

::mlir::Type RFFTOp::Tcomplex() {
  return mlir::getElementTypeOrSelf(*getODSResults(0).begin());
}

bool RFFTOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "Treal") return true;
  if (name == "Tcomplex") return true;
 return false;
}

::mlir::DictionaryAttr RFFTOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TrealAttrName(),
::mlir::TypeAttr::get(Treal())},
    {TcomplexAttrName(),
::mlir::TypeAttr::get(Tcomplex())}});
}

void RFFTOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input, ::mlir::Value fft_length) {
  odsState.addOperands(input);
  odsState.addOperands(fft_length);
  odsState.addTypes(output);
}

void RFFTOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::Value fft_length) {
  odsState.addOperands(input);
  odsState.addOperands(fft_length);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void RFFTOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult RFFTOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops13(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops11(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops12(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void RFFTOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::RFFTOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::RGBToHSVOp definitions
//===----------------------------------------------------------------------===//

RGBToHSVOpAdaptor::RGBToHSVOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

RGBToHSVOpAdaptor::RGBToHSVOpAdaptor(RGBToHSVOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange RGBToHSVOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> RGBToHSVOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange RGBToHSVOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value RGBToHSVOpAdaptor::images() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr RGBToHSVOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult RGBToHSVOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> RGBToHSVOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range RGBToHSVOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value RGBToHSVOp::images() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange RGBToHSVOp::imagesMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> RGBToHSVOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range RGBToHSVOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value RGBToHSVOp::output() {
  return *getODSResults(0).begin();
}

::mlir::Type RGBToHSVOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool RGBToHSVOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr RGBToHSVOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void RGBToHSVOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value images) {
  odsState.addOperands(images);
  odsState.addTypes(output);
}

void RGBToHSVOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value images) {
  odsState.addOperands(images);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void RGBToHSVOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult RGBToHSVOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void RGBToHSVOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::RGBToHSVOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::RaggedGatherOp definitions
//===----------------------------------------------------------------------===//

RaggedGatherOpAdaptor::RaggedGatherOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

RaggedGatherOpAdaptor::RaggedGatherOpAdaptor(RaggedGatherOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange RaggedGatherOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> RaggedGatherOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  bool isVariadic[] = {true, false, false};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (odsOperands.size() - 2) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::ValueRange RaggedGatherOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::ValueRange RaggedGatherOpAdaptor::params_nested_splits() {
  return getODSOperands(0);
}

::mlir::Value RaggedGatherOpAdaptor::params_dense_values() {
  return *getODSOperands(1).begin();
}

::mlir::Value RaggedGatherOpAdaptor::indices() {
  return *getODSOperands(2).begin();
}

::mlir::DictionaryAttr RaggedGatherOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult RaggedGatherOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

void RaggedGatherOp::getAsmResultNames(::mlir::OpAsmSetValueNameFn setNameFn) {
  auto resultGroup0 = getODSResults(0);
  if (!llvm::empty(resultGroup0))
    setNameFn(*resultGroup0.begin(), "output_nested_splits");
  auto resultGroup1 = getODSResults(1);
  if (!llvm::empty(resultGroup1))
    setNameFn(*resultGroup1.begin(), "output_dense_values");
}

std::pair<unsigned, unsigned> RaggedGatherOp::getODSOperandIndexAndLength(unsigned index) {
  bool isVariadic[] = {true, false, false};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (getOperation()->getNumOperands() - 2) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::Operation::operand_range RaggedGatherOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Operation::operand_range RaggedGatherOp::params_nested_splits() {
  return getODSOperands(0);
}

::mlir::Value RaggedGatherOp::params_dense_values() {
  return *getODSOperands(1).begin();
}

::mlir::Value RaggedGatherOp::indices() {
  return *getODSOperands(2).begin();
}

::mlir::MutableOperandRange RaggedGatherOp::params_nested_splitsMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange RaggedGatherOp::params_dense_valuesMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange RaggedGatherOp::indicesMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> RaggedGatherOp::getODSResultIndexAndLength(unsigned index) {
  bool isVariadic[] = {true, false};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (getOperation()->getNumResults() - 1) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::Operation::result_range RaggedGatherOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Operation::result_range RaggedGatherOp::output_nested_splits() {
  return getODSResults(0);
}

::mlir::Value RaggedGatherOp::output_dense_values() {
  return *getODSResults(1).begin();
}

size_t RaggedGatherOp::PARAMS_RAGGED_RANK() {
  auto range = getODSOperands(0);
return std::distance(range.begin(), range.end());
}

::mlir::Type RaggedGatherOp::Tindices() {
  return mlir::getElementTypeOrSelf(*getODSOperands(2).begin());
}

::mlir::Type RaggedGatherOp::Tsplits() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

::mlir::Type RaggedGatherOp::Tvalues() {
  return mlir::getElementTypeOrSelf(*getODSOperands(1).begin());
}

size_t RaggedGatherOp::OUTPUT_RAGGED_RANK() {
  auto range = getODSResults(0);
return std::distance(range.begin(), range.end());
}

bool RaggedGatherOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "PARAMS_RAGGED_RANK") return true;
  if (name == "Tindices") return true;
  if (name == "Tsplits") return true;
  if (name == "Tvalues") return true;
  if (name == "OUTPUT_RAGGED_RANK") return true;
 return false;
}

::mlir::DictionaryAttr RaggedGatherOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {PARAMS_RAGGED_RANKAttrName(),
odsBuilder.getI64IntegerAttr(PARAMS_RAGGED_RANK())},
    {TindicesAttrName(),
::mlir::TypeAttr::get(Tindices())},
    {TsplitsAttrName(),
::mlir::TypeAttr::get(Tsplits())},
    {TvaluesAttrName(),
::mlir::TypeAttr::get(Tvalues())},
    {OUTPUT_RAGGED_RANKAttrName(),
odsBuilder.getI64IntegerAttr(OUTPUT_RAGGED_RANK())}});
}

void RaggedGatherOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange output_nested_splits, ::mlir::Type output_dense_values, ::mlir::ValueRange params_nested_splits, ::mlir::Value params_dense_values, ::mlir::Value indices) {
  odsState.addOperands(params_nested_splits);
  odsState.addOperands(params_dense_values);
  odsState.addOperands(indices);
  odsState.addTypes(output_nested_splits);
  odsState.addTypes(output_dense_values);
}

void RaggedGatherOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange params_nested_splits, ::mlir::Value params_dense_values, ::mlir::Value indices) {
  odsState.addOperands(params_nested_splits);
  odsState.addOperands(params_dense_values);
  odsState.addOperands(indices);
  assert(resultTypes.size() >= 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void RaggedGatherOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() >= 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() >= 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult RaggedGatherOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSResults(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void RaggedGatherOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::RaggedGatherOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::RaggedRangeOp definitions
//===----------------------------------------------------------------------===//

RaggedRangeOpAdaptor::RaggedRangeOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

RaggedRangeOpAdaptor::RaggedRangeOpAdaptor(RaggedRangeOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange RaggedRangeOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> RaggedRangeOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange RaggedRangeOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value RaggedRangeOpAdaptor::starts() {
  return *getODSOperands(0).begin();
}

::mlir::Value RaggedRangeOpAdaptor::limits() {
  return *getODSOperands(1).begin();
}

::mlir::Value RaggedRangeOpAdaptor::deltas() {
  return *getODSOperands(2).begin();
}

::mlir::DictionaryAttr RaggedRangeOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult RaggedRangeOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

void RaggedRangeOp::getAsmResultNames(::mlir::OpAsmSetValueNameFn setNameFn) {
  auto resultGroup0 = getODSResults(0);
  if (!llvm::empty(resultGroup0))
    setNameFn(*resultGroup0.begin(), "rt_nested_splits");
  auto resultGroup1 = getODSResults(1);
  if (!llvm::empty(resultGroup1))
    setNameFn(*resultGroup1.begin(), "rt_dense_values");
}

std::pair<unsigned, unsigned> RaggedRangeOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range RaggedRangeOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value RaggedRangeOp::starts() {
  return *getODSOperands(0).begin();
}

::mlir::Value RaggedRangeOp::limits() {
  return *getODSOperands(1).begin();
}

::mlir::Value RaggedRangeOp::deltas() {
  return *getODSOperands(2).begin();
}

::mlir::MutableOperandRange RaggedRangeOp::startsMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange RaggedRangeOp::limitsMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange RaggedRangeOp::deltasMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> RaggedRangeOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range RaggedRangeOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value RaggedRangeOp::rt_nested_splits() {
  return *getODSResults(0).begin();
}

::mlir::Value RaggedRangeOp::rt_dense_values() {
  return *getODSResults(1).begin();
}

::mlir::Type RaggedRangeOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

::mlir::Type RaggedRangeOp::Tsplits() {
  return mlir::getElementTypeOrSelf(*getODSResults(0).begin());
}

bool RaggedRangeOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
  if (name == "Tsplits") return true;
 return false;
}

::mlir::DictionaryAttr RaggedRangeOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())},
    {TsplitsAttrName(),
::mlir::TypeAttr::get(Tsplits())}});
}

void RaggedRangeOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type rt_nested_splits, ::mlir::Type rt_dense_values, ::mlir::Value starts, ::mlir::Value limits, ::mlir::Value deltas) {
  odsState.addOperands(starts);
  odsState.addOperands(limits);
  odsState.addOperands(deltas);
  odsState.addTypes(rt_nested_splits);
  odsState.addTypes(rt_dense_values);
}

void RaggedRangeOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value starts, ::mlir::Value limits, ::mlir::Value deltas) {
  odsState.addOperands(starts);
  odsState.addOperands(limits);
  odsState.addOperands(deltas);
  assert(resultTypes.size() == 2u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void RaggedRangeOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 3u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 2u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult RaggedRangeOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops51(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops51(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops51(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSResults(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops51(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void RaggedRangeOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::RaggedRangeOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::RandomGammaGradOp definitions
//===----------------------------------------------------------------------===//

RandomGammaGradOpAdaptor::RandomGammaGradOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

RandomGammaGradOpAdaptor::RandomGammaGradOpAdaptor(RandomGammaGradOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange RandomGammaGradOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> RandomGammaGradOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange RandomGammaGradOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value RandomGammaGradOpAdaptor::alpha() {
  return *getODSOperands(0).begin();
}

::mlir::Value RandomGammaGradOpAdaptor::sample() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr RandomGammaGradOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult RandomGammaGradOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> RandomGammaGradOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range RandomGammaGradOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value RandomGammaGradOp::alpha() {
  return *getODSOperands(0).begin();
}

::mlir::Value RandomGammaGradOp::sample() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange RandomGammaGradOp::alphaMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange RandomGammaGradOp::sampleMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> RandomGammaGradOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range RandomGammaGradOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value RandomGammaGradOp::output() {
  return *getODSResults(0).begin();
}

::mlir::Type RandomGammaGradOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool RandomGammaGradOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr RandomGammaGradOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void RandomGammaGradOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, Value x, Value y) {
  auto resultType =
      OpTrait::util::getBroadcastedType(x.getType(), y.getType());
  if (!resultType)
    mlir::emitError(odsState.location, "non-broadcastable operands");
  return build(odsBuilder, odsState, resultType, x, y);
}

void RandomGammaGradOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value alpha, ::mlir::Value sample) {
  odsState.addOperands(alpha);
  odsState.addOperands(sample);
  odsState.addTypes(output);
}

void RandomGammaGradOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value alpha, ::mlir::Value sample) {
  odsState.addOperands(alpha);
  odsState.addOperands(sample);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void RandomGammaGradOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult RandomGammaGradOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops13(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops13(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops13(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void RandomGammaGradOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::RandomGammaGradOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::RandomGammaOp definitions
//===----------------------------------------------------------------------===//

RandomGammaOpAdaptor::RandomGammaOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

RandomGammaOpAdaptor::RandomGammaOpAdaptor(RandomGammaOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange RandomGammaOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> RandomGammaOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange RandomGammaOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value RandomGammaOpAdaptor::shape() {
  return *getODSOperands(0).begin();
}

::mlir::Value RandomGammaOpAdaptor::alpha() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr RandomGammaOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::IntegerAttr RandomGammaOpAdaptor::seed() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("seed").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), 0);
  return attr;
}

::mlir::IntegerAttr RandomGammaOpAdaptor::seed2() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("seed2").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), 0);
  return attr;
}

::mlir::LogicalResult RandomGammaOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_seed = odsAttrs.get("seed");
    if (tblgen_seed && !(((tblgen_seed.isa<::mlir::IntegerAttr>())) && ((tblgen_seed.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.RandomGamma' op ""attribute 'seed' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_seed2 = odsAttrs.get("seed2");
    if (tblgen_seed2 && !(((tblgen_seed2.isa<::mlir::IntegerAttr>())) && ((tblgen_seed2.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.RandomGamma' op ""attribute 'seed2' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> RandomGammaOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range RandomGammaOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value RandomGammaOp::shape() {
  return *getODSOperands(0).begin();
}

::mlir::Value RandomGammaOp::alpha() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange RandomGammaOp::shapeMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange RandomGammaOp::alphaMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> RandomGammaOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range RandomGammaOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value RandomGammaOp::output() {
  return *getODSResults(0).begin();
}

::mlir::IntegerAttr RandomGammaOp::seedAttr() {
  return (*this)->getAttr(seedAttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t RandomGammaOp::seed() {
  auto attr = seedAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), 0).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

::mlir::IntegerAttr RandomGammaOp::seed2Attr() {
  return (*this)->getAttr(seed2AttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t RandomGammaOp::seed2() {
  auto attr = seed2Attr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), 0).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

::mlir::Type RandomGammaOp::S() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

::mlir::Type RandomGammaOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(1).begin());
}

bool RandomGammaOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "S") return true;
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr RandomGammaOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {SAttrName(),
::mlir::TypeAttr::get(S())},
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void RandomGammaOp::seedAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(seedAttrName(), attr);
}

void RandomGammaOp::seed2Attr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(seed2AttrName(), attr);
}

void RandomGammaOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value shape, ::mlir::Value alpha, ::mlir::IntegerAttr seed, ::mlir::IntegerAttr seed2) {
  odsState.addOperands(shape);
  odsState.addOperands(alpha);
  odsState.addAttribute(seedAttrName(odsState.name), seed);
  odsState.addAttribute(seed2AttrName(odsState.name), seed2);
  odsState.addTypes(output);
}

void RandomGammaOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value shape, ::mlir::Value alpha, ::mlir::IntegerAttr seed, ::mlir::IntegerAttr seed2) {
  odsState.addOperands(shape);
  odsState.addOperands(alpha);
  odsState.addAttribute(seedAttrName(odsState.name), seed);
  odsState.addAttribute(seed2AttrName(odsState.name), seed2);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void RandomGammaOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value shape, ::mlir::Value alpha, uint64_t seed, uint64_t seed2) {
  odsState.addOperands(shape);
  odsState.addOperands(alpha);
  odsState.addAttribute(seedAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), seed));
  odsState.addAttribute(seed2AttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), seed2));
  odsState.addTypes(output);
}

void RandomGammaOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value shape, ::mlir::Value alpha, uint64_t seed, uint64_t seed2) {
  odsState.addOperands(shape);
  odsState.addOperands(alpha);
  odsState.addAttribute(seedAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), seed));
  odsState.addAttribute(seed2AttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), seed2));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void RandomGammaOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult RandomGammaOp::verify() {
  {
    auto tblgen_seed = (*this)->getAttr(seedAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_seed, "seed")))
      return ::mlir::failure();
  }
  {
    auto tblgen_seed2 = (*this)->getAttr(seed2AttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_seed2, "seed2")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops52(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops52(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::RandomGammaOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::RandomPoissonOp definitions
//===----------------------------------------------------------------------===//

RandomPoissonOpAdaptor::RandomPoissonOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

RandomPoissonOpAdaptor::RandomPoissonOpAdaptor(RandomPoissonOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange RandomPoissonOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> RandomPoissonOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange RandomPoissonOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value RandomPoissonOpAdaptor::shape() {
  return *getODSOperands(0).begin();
}

::mlir::Value RandomPoissonOpAdaptor::rate() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr RandomPoissonOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::IntegerAttr RandomPoissonOpAdaptor::seed() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("seed").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), 0);
  return attr;
}

::mlir::IntegerAttr RandomPoissonOpAdaptor::seed2() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("seed2").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), 0);
  return attr;
}

::mlir::LogicalResult RandomPoissonOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_seed = odsAttrs.get("seed");
    if (tblgen_seed && !(((tblgen_seed.isa<::mlir::IntegerAttr>())) && ((tblgen_seed.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.RandomPoisson' op ""attribute 'seed' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_seed2 = odsAttrs.get("seed2");
    if (tblgen_seed2 && !(((tblgen_seed2.isa<::mlir::IntegerAttr>())) && ((tblgen_seed2.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.RandomPoisson' op ""attribute 'seed2' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> RandomPoissonOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range RandomPoissonOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value RandomPoissonOp::shape() {
  return *getODSOperands(0).begin();
}

::mlir::Value RandomPoissonOp::rate() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange RandomPoissonOp::shapeMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange RandomPoissonOp::rateMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> RandomPoissonOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range RandomPoissonOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value RandomPoissonOp::output() {
  return *getODSResults(0).begin();
}

::mlir::IntegerAttr RandomPoissonOp::seedAttr() {
  return (*this)->getAttr(seedAttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t RandomPoissonOp::seed() {
  auto attr = seedAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), 0).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

::mlir::IntegerAttr RandomPoissonOp::seed2Attr() {
  return (*this)->getAttr(seed2AttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t RandomPoissonOp::seed2() {
  auto attr = seed2Attr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), 0).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

::mlir::Type RandomPoissonOp::S() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

::mlir::Type RandomPoissonOp::dtype() {
  return mlir::getElementTypeOrSelf(*getODSOperands(1).begin());
}

bool RandomPoissonOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "S") return true;
  if (name == "dtype") return true;
 return false;
}

::mlir::DictionaryAttr RandomPoissonOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {SAttrName(),
::mlir::TypeAttr::get(S())},
    {dtypeAttrName(),
::mlir::TypeAttr::get(dtype())}});
}

void RandomPoissonOp::seedAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(seedAttrName(), attr);
}

void RandomPoissonOp::seed2Attr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(seed2AttrName(), attr);
}

void RandomPoissonOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value shape, ::mlir::Value rate, ::mlir::IntegerAttr seed, ::mlir::IntegerAttr seed2) {
  odsState.addOperands(shape);
  odsState.addOperands(rate);
  odsState.addAttribute(seedAttrName(odsState.name), seed);
  odsState.addAttribute(seed2AttrName(odsState.name), seed2);
  odsState.addTypes(output);
}

void RandomPoissonOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value shape, ::mlir::Value rate, ::mlir::IntegerAttr seed, ::mlir::IntegerAttr seed2) {
  odsState.addOperands(shape);
  odsState.addOperands(rate);
  odsState.addAttribute(seedAttrName(odsState.name), seed);
  odsState.addAttribute(seed2AttrName(odsState.name), seed2);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void RandomPoissonOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value shape, ::mlir::Value rate, uint64_t seed, uint64_t seed2) {
  odsState.addOperands(shape);
  odsState.addOperands(rate);
  odsState.addAttribute(seedAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), seed));
  odsState.addAttribute(seed2AttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), seed2));
  odsState.addTypes(output);
}

void RandomPoissonOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value shape, ::mlir::Value rate, uint64_t seed, uint64_t seed2) {
  odsState.addOperands(shape);
  odsState.addOperands(rate);
  odsState.addAttribute(seedAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), seed));
  odsState.addAttribute(seed2AttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), seed2));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void RandomPoissonOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult RandomPoissonOp::verify() {
  {
    auto tblgen_seed = (*this)->getAttr(seedAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_seed, "seed")))
      return ::mlir::failure();
  }
  {
    auto tblgen_seed2 = (*this)->getAttr(seed2AttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_seed2, "seed2")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops52(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops52(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::RandomPoissonOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::RandomPoissonV2Op definitions
//===----------------------------------------------------------------------===//

RandomPoissonV2OpAdaptor::RandomPoissonV2OpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

RandomPoissonV2OpAdaptor::RandomPoissonV2OpAdaptor(RandomPoissonV2Op &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange RandomPoissonV2OpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> RandomPoissonV2OpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange RandomPoissonV2OpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value RandomPoissonV2OpAdaptor::shape() {
  return *getODSOperands(0).begin();
}

::mlir::Value RandomPoissonV2OpAdaptor::rate() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr RandomPoissonV2OpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::IntegerAttr RandomPoissonV2OpAdaptor::seed() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("seed").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), 0);
  return attr;
}

::mlir::IntegerAttr RandomPoissonV2OpAdaptor::seed2() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("seed2").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), 0);
  return attr;
}

::mlir::LogicalResult RandomPoissonV2OpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_seed = odsAttrs.get("seed");
    if (tblgen_seed && !(((tblgen_seed.isa<::mlir::IntegerAttr>())) && ((tblgen_seed.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.RandomPoissonV2' op ""attribute 'seed' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_seed2 = odsAttrs.get("seed2");
    if (tblgen_seed2 && !(((tblgen_seed2.isa<::mlir::IntegerAttr>())) && ((tblgen_seed2.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.RandomPoissonV2' op ""attribute 'seed2' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> RandomPoissonV2Op::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range RandomPoissonV2Op::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value RandomPoissonV2Op::shape() {
  return *getODSOperands(0).begin();
}

::mlir::Value RandomPoissonV2Op::rate() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange RandomPoissonV2Op::shapeMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange RandomPoissonV2Op::rateMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> RandomPoissonV2Op::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range RandomPoissonV2Op::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value RandomPoissonV2Op::output() {
  return *getODSResults(0).begin();
}

::mlir::IntegerAttr RandomPoissonV2Op::seedAttr() {
  return (*this)->getAttr(seedAttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t RandomPoissonV2Op::seed() {
  auto attr = seedAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), 0).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

::mlir::IntegerAttr RandomPoissonV2Op::seed2Attr() {
  return (*this)->getAttr(seed2AttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t RandomPoissonV2Op::seed2() {
  auto attr = seed2Attr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), 0).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

::mlir::Type RandomPoissonV2Op::R() {
  return mlir::getElementTypeOrSelf(*getODSOperands(1).begin());
}

::mlir::Type RandomPoissonV2Op::S() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

::mlir::Type RandomPoissonV2Op::dtype() {
  return mlir::getElementTypeOrSelf(*getODSResults(0).begin());
}

bool RandomPoissonV2Op::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "R") return true;
  if (name == "S") return true;
  if (name == "dtype") return true;
 return false;
}

::mlir::DictionaryAttr RandomPoissonV2Op::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {RAttrName(),
::mlir::TypeAttr::get(R())},
    {SAttrName(),
::mlir::TypeAttr::get(S())},
    {dtypeAttrName(),
::mlir::TypeAttr::get(dtype())}});
}

void RandomPoissonV2Op::seedAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(seedAttrName(), attr);
}

void RandomPoissonV2Op::seed2Attr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(seed2AttrName(), attr);
}

void RandomPoissonV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value shape, ::mlir::Value rate, ::mlir::IntegerAttr seed, ::mlir::IntegerAttr seed2) {
  odsState.addOperands(shape);
  odsState.addOperands(rate);
  odsState.addAttribute(seedAttrName(odsState.name), seed);
  odsState.addAttribute(seed2AttrName(odsState.name), seed2);
  odsState.addTypes(output);
}

void RandomPoissonV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value shape, ::mlir::Value rate, ::mlir::IntegerAttr seed, ::mlir::IntegerAttr seed2) {
  odsState.addOperands(shape);
  odsState.addOperands(rate);
  odsState.addAttribute(seedAttrName(odsState.name), seed);
  odsState.addAttribute(seed2AttrName(odsState.name), seed2);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void RandomPoissonV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value shape, ::mlir::Value rate, uint64_t seed, uint64_t seed2) {
  odsState.addOperands(shape);
  odsState.addOperands(rate);
  odsState.addAttribute(seedAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), seed));
  odsState.addAttribute(seed2AttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), seed2));
  odsState.addTypes(output);
}

void RandomPoissonV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value shape, ::mlir::Value rate, uint64_t seed, uint64_t seed2) {
  odsState.addOperands(shape);
  odsState.addOperands(rate);
  odsState.addAttribute(seedAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), seed));
  odsState.addAttribute(seed2AttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), seed2));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void RandomPoissonV2Op::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult RandomPoissonV2Op::verify() {
  {
    auto tblgen_seed = (*this)->getAttr(seedAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_seed, "seed")))
      return ::mlir::failure();
  }
  {
    auto tblgen_seed2 = (*this)->getAttr(seed2AttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_seed2, "seed2")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops31(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops31(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::RandomPoissonV2Op)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::RandomShuffleOp definitions
//===----------------------------------------------------------------------===//

RandomShuffleOpAdaptor::RandomShuffleOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

RandomShuffleOpAdaptor::RandomShuffleOpAdaptor(RandomShuffleOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange RandomShuffleOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> RandomShuffleOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange RandomShuffleOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value RandomShuffleOpAdaptor::value() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr RandomShuffleOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::IntegerAttr RandomShuffleOpAdaptor::seed() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("seed").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), 0);
  return attr;
}

::mlir::IntegerAttr RandomShuffleOpAdaptor::seed2() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("seed2").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), 0);
  return attr;
}

::mlir::LogicalResult RandomShuffleOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_seed = odsAttrs.get("seed");
    if (tblgen_seed && !(((tblgen_seed.isa<::mlir::IntegerAttr>())) && ((tblgen_seed.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.RandomShuffle' op ""attribute 'seed' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_seed2 = odsAttrs.get("seed2");
    if (tblgen_seed2 && !(((tblgen_seed2.isa<::mlir::IntegerAttr>())) && ((tblgen_seed2.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.RandomShuffle' op ""attribute 'seed2' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> RandomShuffleOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range RandomShuffleOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value RandomShuffleOp::value() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange RandomShuffleOp::valueMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> RandomShuffleOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range RandomShuffleOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value RandomShuffleOp::output() {
  return *getODSResults(0).begin();
}

::mlir::IntegerAttr RandomShuffleOp::seedAttr() {
  return (*this)->getAttr(seedAttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t RandomShuffleOp::seed() {
  auto attr = seedAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), 0).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

::mlir::IntegerAttr RandomShuffleOp::seed2Attr() {
  return (*this)->getAttr(seed2AttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t RandomShuffleOp::seed2() {
  auto attr = seed2Attr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), 0).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

::mlir::Type RandomShuffleOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool RandomShuffleOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr RandomShuffleOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void RandomShuffleOp::seedAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(seedAttrName(), attr);
}

void RandomShuffleOp::seed2Attr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(seed2AttrName(), attr);
}

void RandomShuffleOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value value, ::mlir::IntegerAttr seed, ::mlir::IntegerAttr seed2) {
  odsState.addOperands(value);
  odsState.addAttribute(seedAttrName(odsState.name), seed);
  odsState.addAttribute(seed2AttrName(odsState.name), seed2);
  odsState.addTypes(output);
}

void RandomShuffleOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value value, ::mlir::IntegerAttr seed, ::mlir::IntegerAttr seed2) {
  odsState.addOperands(value);
  odsState.addAttribute(seedAttrName(odsState.name), seed);
  odsState.addAttribute(seed2AttrName(odsState.name), seed2);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void RandomShuffleOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value value, uint64_t seed, uint64_t seed2) {
  odsState.addOperands(value);
  odsState.addAttribute(seedAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), seed));
  odsState.addAttribute(seed2AttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), seed2));
  odsState.addTypes(output);
}

void RandomShuffleOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value value, uint64_t seed, uint64_t seed2) {
  odsState.addOperands(value);
  odsState.addAttribute(seedAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), seed));
  odsState.addAttribute(seed2AttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), seed2));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void RandomShuffleOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult RandomShuffleOp::verify() {
  {
    auto tblgen_seed = (*this)->getAttr(seedAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_seed, "seed")))
      return ::mlir::failure();
  }
  {
    auto tblgen_seed2 = (*this)->getAttr(seed2AttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_seed2, "seed2")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::RandomShuffleOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::RandomStandardNormalOp definitions
//===----------------------------------------------------------------------===//

RandomStandardNormalOpAdaptor::RandomStandardNormalOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

RandomStandardNormalOpAdaptor::RandomStandardNormalOpAdaptor(RandomStandardNormalOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange RandomStandardNormalOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> RandomStandardNormalOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange RandomStandardNormalOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value RandomStandardNormalOpAdaptor::shape() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr RandomStandardNormalOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::IntegerAttr RandomStandardNormalOpAdaptor::seed() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("seed").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), 0);
  return attr;
}

::mlir::IntegerAttr RandomStandardNormalOpAdaptor::seed2() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("seed2").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), 0);
  return attr;
}

::mlir::LogicalResult RandomStandardNormalOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_seed = odsAttrs.get("seed");
    if (tblgen_seed && !(((tblgen_seed.isa<::mlir::IntegerAttr>())) && ((tblgen_seed.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.RandomStandardNormal' op ""attribute 'seed' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_seed2 = odsAttrs.get("seed2");
    if (tblgen_seed2 && !(((tblgen_seed2.isa<::mlir::IntegerAttr>())) && ((tblgen_seed2.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.RandomStandardNormal' op ""attribute 'seed2' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> RandomStandardNormalOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range RandomStandardNormalOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value RandomStandardNormalOp::shape() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange RandomStandardNormalOp::shapeMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> RandomStandardNormalOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range RandomStandardNormalOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value RandomStandardNormalOp::output() {
  return *getODSResults(0).begin();
}

::mlir::IntegerAttr RandomStandardNormalOp::seedAttr() {
  return (*this)->getAttr(seedAttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t RandomStandardNormalOp::seed() {
  auto attr = seedAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), 0).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

::mlir::IntegerAttr RandomStandardNormalOp::seed2Attr() {
  return (*this)->getAttr(seed2AttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t RandomStandardNormalOp::seed2() {
  auto attr = seed2Attr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), 0).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

::mlir::Type RandomStandardNormalOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

::mlir::Type RandomStandardNormalOp::dtype() {
  return mlir::getElementTypeOrSelf(*getODSResults(0).begin());
}

bool RandomStandardNormalOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
  if (name == "dtype") return true;
 return false;
}

::mlir::DictionaryAttr RandomStandardNormalOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())},
    {dtypeAttrName(),
::mlir::TypeAttr::get(dtype())}});
}

void RandomStandardNormalOp::seedAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(seedAttrName(), attr);
}

void RandomStandardNormalOp::seed2Attr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(seed2AttrName(), attr);
}

void RandomStandardNormalOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value shape, ::mlir::IntegerAttr seed, ::mlir::IntegerAttr seed2) {
  odsState.addOperands(shape);
  odsState.addAttribute(seedAttrName(odsState.name), seed);
  odsState.addAttribute(seed2AttrName(odsState.name), seed2);
  odsState.addTypes(output);
}

void RandomStandardNormalOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value shape, ::mlir::IntegerAttr seed, ::mlir::IntegerAttr seed2) {
  odsState.addOperands(shape);
  odsState.addAttribute(seedAttrName(odsState.name), seed);
  odsState.addAttribute(seed2AttrName(odsState.name), seed2);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void RandomStandardNormalOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value shape, uint64_t seed, uint64_t seed2) {
  odsState.addOperands(shape);
  odsState.addAttribute(seedAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), seed));
  odsState.addAttribute(seed2AttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), seed2));
  odsState.addTypes(output);
}

void RandomStandardNormalOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value shape, uint64_t seed, uint64_t seed2) {
  odsState.addOperands(shape);
  odsState.addAttribute(seedAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), seed));
  odsState.addAttribute(seed2AttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), seed2));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void RandomStandardNormalOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult RandomStandardNormalOp::verify() {
  {
    auto tblgen_seed = (*this)->getAttr(seedAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_seed, "seed")))
      return ::mlir::failure();
  }
  {
    auto tblgen_seed2 = (*this)->getAttr(seed2AttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_seed2, "seed2")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::RandomStandardNormalOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::RandomUniformIntOp definitions
//===----------------------------------------------------------------------===//

RandomUniformIntOpAdaptor::RandomUniformIntOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

RandomUniformIntOpAdaptor::RandomUniformIntOpAdaptor(RandomUniformIntOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange RandomUniformIntOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> RandomUniformIntOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange RandomUniformIntOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value RandomUniformIntOpAdaptor::shape() {
  return *getODSOperands(0).begin();
}

::mlir::Value RandomUniformIntOpAdaptor::minval() {
  return *getODSOperands(1).begin();
}

::mlir::Value RandomUniformIntOpAdaptor::maxval() {
  return *getODSOperands(2).begin();
}

::mlir::DictionaryAttr RandomUniformIntOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::IntegerAttr RandomUniformIntOpAdaptor::seed() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("seed").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), 0);
  return attr;
}

::mlir::IntegerAttr RandomUniformIntOpAdaptor::seed2() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("seed2").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), 0);
  return attr;
}

::mlir::LogicalResult RandomUniformIntOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_seed = odsAttrs.get("seed");
    if (tblgen_seed && !(((tblgen_seed.isa<::mlir::IntegerAttr>())) && ((tblgen_seed.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.RandomUniformInt' op ""attribute 'seed' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_seed2 = odsAttrs.get("seed2");
    if (tblgen_seed2 && !(((tblgen_seed2.isa<::mlir::IntegerAttr>())) && ((tblgen_seed2.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.RandomUniformInt' op ""attribute 'seed2' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> RandomUniformIntOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range RandomUniformIntOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value RandomUniformIntOp::shape() {
  return *getODSOperands(0).begin();
}

::mlir::Value RandomUniformIntOp::minval() {
  return *getODSOperands(1).begin();
}

::mlir::Value RandomUniformIntOp::maxval() {
  return *getODSOperands(2).begin();
}

::mlir::MutableOperandRange RandomUniformIntOp::shapeMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange RandomUniformIntOp::minvalMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange RandomUniformIntOp::maxvalMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> RandomUniformIntOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range RandomUniformIntOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value RandomUniformIntOp::output() {
  return *getODSResults(0).begin();
}

::mlir::IntegerAttr RandomUniformIntOp::seedAttr() {
  return (*this)->getAttr(seedAttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t RandomUniformIntOp::seed() {
  auto attr = seedAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), 0).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

::mlir::IntegerAttr RandomUniformIntOp::seed2Attr() {
  return (*this)->getAttr(seed2AttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t RandomUniformIntOp::seed2() {
  auto attr = seed2Attr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), 0).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

::mlir::Type RandomUniformIntOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

::mlir::Type RandomUniformIntOp::Tout() {
  return mlir::getElementTypeOrSelf(*getODSOperands(1).begin());
}

bool RandomUniformIntOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
  if (name == "Tout") return true;
 return false;
}

::mlir::DictionaryAttr RandomUniformIntOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())},
    {ToutAttrName(),
::mlir::TypeAttr::get(Tout())}});
}

void RandomUniformIntOp::seedAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(seedAttrName(), attr);
}

void RandomUniformIntOp::seed2Attr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(seed2AttrName(), attr);
}

void RandomUniformIntOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value shape, ::mlir::Value minval, ::mlir::Value maxval, ::mlir::IntegerAttr seed, ::mlir::IntegerAttr seed2) {
  odsState.addOperands(shape);
  odsState.addOperands(minval);
  odsState.addOperands(maxval);
  odsState.addAttribute(seedAttrName(odsState.name), seed);
  odsState.addAttribute(seed2AttrName(odsState.name), seed2);
  odsState.addTypes(output);
}

void RandomUniformIntOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value shape, ::mlir::Value minval, ::mlir::Value maxval, ::mlir::IntegerAttr seed, ::mlir::IntegerAttr seed2) {
  odsState.addOperands(shape);
  odsState.addOperands(minval);
  odsState.addOperands(maxval);
  odsState.addAttribute(seedAttrName(odsState.name), seed);
  odsState.addAttribute(seed2AttrName(odsState.name), seed2);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void RandomUniformIntOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value shape, ::mlir::Value minval, ::mlir::Value maxval, uint64_t seed, uint64_t seed2) {
  odsState.addOperands(shape);
  odsState.addOperands(minval);
  odsState.addOperands(maxval);
  odsState.addAttribute(seedAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), seed));
  odsState.addAttribute(seed2AttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), seed2));
  odsState.addTypes(output);
}

void RandomUniformIntOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value shape, ::mlir::Value minval, ::mlir::Value maxval, uint64_t seed, uint64_t seed2) {
  odsState.addOperands(shape);
  odsState.addOperands(minval);
  odsState.addOperands(maxval);
  odsState.addAttribute(seedAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), seed));
  odsState.addAttribute(seed2AttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), seed2));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void RandomUniformIntOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 3u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult RandomUniformIntOp::verify() {
  {
    auto tblgen_seed = (*this)->getAttr(seedAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_seed, "seed")))
      return ::mlir::failure();
  }
  {
    auto tblgen_seed2 = (*this)->getAttr(seed2AttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_seed2, "seed2")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::RandomUniformIntOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::RandomUniformOp definitions
//===----------------------------------------------------------------------===//

RandomUniformOpAdaptor::RandomUniformOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

RandomUniformOpAdaptor::RandomUniformOpAdaptor(RandomUniformOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange RandomUniformOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> RandomUniformOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange RandomUniformOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value RandomUniformOpAdaptor::shape() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr RandomUniformOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::IntegerAttr RandomUniformOpAdaptor::seed() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("seed").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), 0);
  return attr;
}

::mlir::IntegerAttr RandomUniformOpAdaptor::seed2() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("seed2").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), 0);
  return attr;
}

::mlir::LogicalResult RandomUniformOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_seed = odsAttrs.get("seed");
    if (tblgen_seed && !(((tblgen_seed.isa<::mlir::IntegerAttr>())) && ((tblgen_seed.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.RandomUniform' op ""attribute 'seed' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_seed2 = odsAttrs.get("seed2");
    if (tblgen_seed2 && !(((tblgen_seed2.isa<::mlir::IntegerAttr>())) && ((tblgen_seed2.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.RandomUniform' op ""attribute 'seed2' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> RandomUniformOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range RandomUniformOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value RandomUniformOp::shape() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange RandomUniformOp::shapeMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> RandomUniformOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range RandomUniformOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value RandomUniformOp::output() {
  return *getODSResults(0).begin();
}

::mlir::IntegerAttr RandomUniformOp::seedAttr() {
  return (*this)->getAttr(seedAttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t RandomUniformOp::seed() {
  auto attr = seedAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), 0).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

::mlir::IntegerAttr RandomUniformOp::seed2Attr() {
  return (*this)->getAttr(seed2AttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t RandomUniformOp::seed2() {
  auto attr = seed2Attr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), 0).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

::mlir::Type RandomUniformOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

::mlir::Type RandomUniformOp::dtype() {
  return mlir::getElementTypeOrSelf(*getODSResults(0).begin());
}

bool RandomUniformOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
  if (name == "dtype") return true;
 return false;
}

::mlir::DictionaryAttr RandomUniformOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())},
    {dtypeAttrName(),
::mlir::TypeAttr::get(dtype())}});
}

void RandomUniformOp::seedAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(seedAttrName(), attr);
}

void RandomUniformOp::seed2Attr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(seed2AttrName(), attr);
}

void RandomUniformOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value shape, ::mlir::IntegerAttr seed, ::mlir::IntegerAttr seed2) {
  odsState.addOperands(shape);
  odsState.addAttribute(seedAttrName(odsState.name), seed);
  odsState.addAttribute(seed2AttrName(odsState.name), seed2);
  odsState.addTypes(output);
}

void RandomUniformOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value shape, ::mlir::IntegerAttr seed, ::mlir::IntegerAttr seed2) {
  odsState.addOperands(shape);
  odsState.addAttribute(seedAttrName(odsState.name), seed);
  odsState.addAttribute(seed2AttrName(odsState.name), seed2);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void RandomUniformOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value shape, uint64_t seed, uint64_t seed2) {
  odsState.addOperands(shape);
  odsState.addAttribute(seedAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), seed));
  odsState.addAttribute(seed2AttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), seed2));
  odsState.addTypes(output);
}

void RandomUniformOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value shape, uint64_t seed, uint64_t seed2) {
  odsState.addOperands(shape);
  odsState.addAttribute(seedAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), seed));
  odsState.addAttribute(seed2AttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), seed2));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void RandomUniformOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult RandomUniformOp::verify() {
  {
    auto tblgen_seed = (*this)->getAttr(seedAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_seed, "seed")))
      return ::mlir::failure();
  }
  {
    auto tblgen_seed2 = (*this)->getAttr(seed2AttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_seed2, "seed2")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return Verify(*this);
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::RandomUniformOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::RangeDatasetOp definitions
//===----------------------------------------------------------------------===//

RangeDatasetOpAdaptor::RangeDatasetOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

RangeDatasetOpAdaptor::RangeDatasetOpAdaptor(RangeDatasetOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange RangeDatasetOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> RangeDatasetOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange RangeDatasetOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value RangeDatasetOpAdaptor::start() {
  return *getODSOperands(0).begin();
}

::mlir::Value RangeDatasetOpAdaptor::stop() {
  return *getODSOperands(1).begin();
}

::mlir::Value RangeDatasetOpAdaptor::step() {
  return *getODSOperands(2).begin();
}

::mlir::DictionaryAttr RangeDatasetOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::ArrayAttr RangeDatasetOpAdaptor::output_types() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("output_types").cast<::mlir::ArrayAttr>();
  return attr;
}

::mlir::ArrayAttr RangeDatasetOpAdaptor::output_shapes() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("output_shapes").cast<::mlir::ArrayAttr>();
  return attr;
}

::mlir::StringAttr RangeDatasetOpAdaptor::metadata() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("metadata").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("");
  return attr;
}

::mlir::LogicalResult RangeDatasetOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_output_types = odsAttrs.get("output_types");
    if (!tblgen_output_types)
      return emitError(loc, "'tf.RangeDataset' op ""requires attribute 'output_types'");

    if (tblgen_output_types && !((((tblgen_output_types.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_output_types.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return ((attr.isa<::mlir::TypeAttr>())) && ((attr.cast<::mlir::TypeAttr>().getValue().isa<::mlir::Type>())); }))) && ((tblgen_output_types.cast<::mlir::ArrayAttr>().size() >= 1))))
      return emitError(loc, "'tf.RangeDataset' op ""attribute 'output_types' failed to satisfy constraint: type array attribute with at least 1 elements");
  }
  {
    auto tblgen_output_shapes = odsAttrs.get("output_shapes");
    if (!tblgen_output_shapes)
      return emitError(loc, "'tf.RangeDataset' op ""requires attribute 'output_shapes'");

    if (tblgen_output_shapes && !((((tblgen_output_shapes.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_output_shapes.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return (attr.isa<mlir::TF::ShapeAttr>()); }))) && ((tblgen_output_shapes.cast<::mlir::ArrayAttr>().size() >= 1))))
      return emitError(loc, "'tf.RangeDataset' op ""attribute 'output_shapes' failed to satisfy constraint: tensorflow shape attribute array with at least 1 elements");
  }
  {
    auto tblgen_metadata = odsAttrs.get("metadata");
    if (tblgen_metadata && !((tblgen_metadata.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.RangeDataset' op ""attribute 'metadata' failed to satisfy constraint: string attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> RangeDatasetOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range RangeDatasetOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value RangeDatasetOp::start() {
  return *getODSOperands(0).begin();
}

::mlir::Value RangeDatasetOp::stop() {
  return *getODSOperands(1).begin();
}

::mlir::Value RangeDatasetOp::step() {
  return *getODSOperands(2).begin();
}

::mlir::MutableOperandRange RangeDatasetOp::startMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange RangeDatasetOp::stopMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange RangeDatasetOp::stepMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> RangeDatasetOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range RangeDatasetOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value RangeDatasetOp::handle() {
  return *getODSResults(0).begin();
}

::mlir::ArrayAttr RangeDatasetOp::output_typesAttr() {
  return (*this)->getAttr(output_typesAttrName()).cast<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr RangeDatasetOp::output_types() {
  auto attr = output_typesAttr();
  return attr;
}

::mlir::ArrayAttr RangeDatasetOp::output_shapesAttr() {
  return (*this)->getAttr(output_shapesAttrName()).cast<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr RangeDatasetOp::output_shapes() {
  auto attr = output_shapesAttr();
  return attr;
}

::mlir::StringAttr RangeDatasetOp::metadataAttr() {
  return (*this)->getAttr(metadataAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef RangeDatasetOp::metadata() {
  auto attr = metadataAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("").getValue();
  return attr.getValue();
}

void RangeDatasetOp::output_typesAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(output_typesAttrName(), attr);
}

void RangeDatasetOp::output_shapesAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(output_shapesAttrName(), attr);
}

void RangeDatasetOp::metadataAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(metadataAttrName(), attr);
}

void RangeDatasetOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type handle, ::mlir::Value start, ::mlir::Value stop, ::mlir::Value step, ::mlir::ArrayAttr output_types, ::mlir::ArrayAttr output_shapes, ::mlir::StringAttr metadata) {
  odsState.addOperands(start);
  odsState.addOperands(stop);
  odsState.addOperands(step);
  odsState.addAttribute(output_typesAttrName(odsState.name), output_types);
  odsState.addAttribute(output_shapesAttrName(odsState.name), output_shapes);
  odsState.addAttribute(metadataAttrName(odsState.name), metadata);
  odsState.addTypes(handle);
}

void RangeDatasetOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value start, ::mlir::Value stop, ::mlir::Value step, ::mlir::ArrayAttr output_types, ::mlir::ArrayAttr output_shapes, ::mlir::StringAttr metadata) {
  odsState.addOperands(start);
  odsState.addOperands(stop);
  odsState.addOperands(step);
  odsState.addAttribute(output_typesAttrName(odsState.name), output_types);
  odsState.addAttribute(output_shapesAttrName(odsState.name), output_shapes);
  odsState.addAttribute(metadataAttrName(odsState.name), metadata);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void RangeDatasetOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type handle, ::mlir::Value start, ::mlir::Value stop, ::mlir::Value step, ::mlir::ArrayAttr output_types, ::mlir::ArrayAttr output_shapes, ::llvm::StringRef metadata) {
  odsState.addOperands(start);
  odsState.addOperands(stop);
  odsState.addOperands(step);
  odsState.addAttribute(output_typesAttrName(odsState.name), output_types);
  odsState.addAttribute(output_shapesAttrName(odsState.name), output_shapes);
  odsState.addAttribute(metadataAttrName(odsState.name), odsBuilder.getStringAttr(metadata));
  odsState.addTypes(handle);
}

void RangeDatasetOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value start, ::mlir::Value stop, ::mlir::Value step, ::mlir::ArrayAttr output_types, ::mlir::ArrayAttr output_shapes, ::llvm::StringRef metadata) {
  odsState.addOperands(start);
  odsState.addOperands(stop);
  odsState.addOperands(step);
  odsState.addAttribute(output_typesAttrName(odsState.name), output_types);
  odsState.addAttribute(output_shapesAttrName(odsState.name), output_shapes);
  odsState.addAttribute(metadataAttrName(odsState.name), odsBuilder.getStringAttr(metadata));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void RangeDatasetOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 3u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult RangeDatasetOp::verify() {
  {
    auto tblgen_output_types = (*this)->getAttr(output_typesAttrName());
    if (!tblgen_output_types)
      return emitOpError("requires attribute 'output_types'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops2(*this, tblgen_output_types, "output_types")))
      return ::mlir::failure();
  }
  {
    auto tblgen_output_shapes = (*this)->getAttr(output_shapesAttrName());
    if (!tblgen_output_shapes)
      return emitOpError("requires attribute 'output_shapes'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops3(*this, tblgen_output_shapes, "output_shapes")))
      return ::mlir::failure();
  }
  {
    auto tblgen_metadata = (*this)->getAttr(metadataAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_metadata, "metadata")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops16(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops16(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops16(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops15(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void RangeDatasetOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::RangeDatasetOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::RangeOp definitions
//===----------------------------------------------------------------------===//

RangeOpAdaptor::RangeOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

RangeOpAdaptor::RangeOpAdaptor(RangeOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange RangeOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> RangeOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange RangeOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value RangeOpAdaptor::start() {
  return *getODSOperands(0).begin();
}

::mlir::Value RangeOpAdaptor::limit() {
  return *getODSOperands(1).begin();
}

::mlir::Value RangeOpAdaptor::delta() {
  return *getODSOperands(2).begin();
}

::mlir::DictionaryAttr RangeOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult RangeOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> RangeOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range RangeOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value RangeOp::start() {
  return *getODSOperands(0).begin();
}

::mlir::Value RangeOp::limit() {
  return *getODSOperands(1).begin();
}

::mlir::Value RangeOp::delta() {
  return *getODSOperands(2).begin();
}

::mlir::MutableOperandRange RangeOp::startMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange RangeOp::limitMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange RangeOp::deltaMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> RangeOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range RangeOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value RangeOp::output() {
  return *getODSResults(0).begin();
}

::mlir::Type RangeOp::Tidx() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool RangeOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "Tidx") return true;
 return false;
}

::mlir::DictionaryAttr RangeOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TidxAttrName(),
::mlir::TypeAttr::get(Tidx())}});
}

void RangeOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value start, ::mlir::Value limit, ::mlir::Value delta) {
  odsState.addOperands(start);
  odsState.addOperands(limit);
  odsState.addOperands(delta);
  odsState.addTypes(output);
}

void RangeOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value start, ::mlir::Value limit, ::mlir::Value delta) {
  odsState.addOperands(start);
  odsState.addOperands(limit);
  odsState.addOperands(delta);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void RangeOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 3u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult RangeOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops53(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops53(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops53(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops53(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void RangeOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::RangeOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::RankOp definitions
//===----------------------------------------------------------------------===//

RankOpAdaptor::RankOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

RankOpAdaptor::RankOpAdaptor(RankOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange RankOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> RankOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange RankOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value RankOpAdaptor::input() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr RankOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult RankOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> RankOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range RankOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value RankOp::input() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange RankOp::inputMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> RankOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range RankOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value RankOp::output() {
  return *getODSResults(0).begin();
}

::mlir::Type RankOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool RankOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr RankOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void RankOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input) {
  odsState.addOperands(input);
  odsState.addTypes(output);
}

void RankOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input) {
  odsState.addOperands(input);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void RankOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult RankOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops11(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void RankOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::RankOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::ReadVariableOp definitions
//===----------------------------------------------------------------------===//

ReadVariableOpAdaptor::ReadVariableOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

ReadVariableOpAdaptor::ReadVariableOpAdaptor(ReadVariableOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange ReadVariableOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> ReadVariableOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange ReadVariableOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ReadVariableOpAdaptor::resource() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr ReadVariableOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult ReadVariableOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> ReadVariableOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range ReadVariableOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ReadVariableOp::resource() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange ReadVariableOp::resourceMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> ReadVariableOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range ReadVariableOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ReadVariableOp::value() {
  return *getODSResults(0).begin();
}

::mlir::Type ReadVariableOp::dtype() {
  return mlir::getElementTypeOrSelf(*getODSResults(0).begin());
}

bool ReadVariableOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "dtype") return true;
 return false;
}

::mlir::DictionaryAttr ReadVariableOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {dtypeAttrName(),
::mlir::TypeAttr::get(dtype())}});
}

void ReadVariableOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type value, ::mlir::Value resource) {
  odsState.addOperands(resource);
  odsState.addTypes(value);
}

void ReadVariableOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value resource) {
  odsState.addOperands(resource);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void ReadVariableOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult ReadVariableOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void ReadVariableOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  for (::mlir::Value value : getODSOperands(0))
    effects.emplace_back(::mlir::MemoryEffects::Read::get(), value, ::mlir::TF::ResourceEffects::Variable::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::ReadVariableOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::RealDivOp definitions
//===----------------------------------------------------------------------===//

RealDivOpAdaptor::RealDivOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

RealDivOpAdaptor::RealDivOpAdaptor(RealDivOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange RealDivOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> RealDivOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange RealDivOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value RealDivOpAdaptor::x() {
  return *getODSOperands(0).begin();
}

::mlir::Value RealDivOpAdaptor::y() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr RealDivOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult RealDivOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> RealDivOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range RealDivOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value RealDivOp::x() {
  return *getODSOperands(0).begin();
}

::mlir::Value RealDivOp::y() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange RealDivOp::xMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange RealDivOp::yMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> RealDivOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range RealDivOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value RealDivOp::z() {
  return *getODSResults(0).begin();
}

::mlir::Type RealDivOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool RealDivOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr RealDivOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void RealDivOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, Value x, Value y) {
  auto resultType =
      OpTrait::util::getBroadcastedType(x.getType(), y.getType());
  if (!resultType)
    mlir::emitError(odsState.location, "non-broadcastable operands");
  return build(odsBuilder, odsState, resultType, x, y);
}

void RealDivOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type z, ::mlir::Value x, ::mlir::Value y) {
  odsState.addOperands(x);
  odsState.addOperands(y);
  odsState.addTypes(z);
}

void RealDivOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value x, ::mlir::Value y) {
  odsState.addOperands(x);
  odsState.addOperands(y);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void RealDivOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult RealDivOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops5(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops5(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops5(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void RealDivOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::RealDivOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::RealOp definitions
//===----------------------------------------------------------------------===//

RealOpAdaptor::RealOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

RealOpAdaptor::RealOpAdaptor(RealOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange RealOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> RealOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange RealOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value RealOpAdaptor::input() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr RealOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult RealOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> RealOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range RealOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value RealOp::input() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange RealOp::inputMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> RealOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range RealOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value RealOp::output() {
  return *getODSResults(0).begin();
}

::mlir::Type RealOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

::mlir::Type RealOp::Tout() {
  return mlir::getElementTypeOrSelf(*getODSResults(0).begin());
}

bool RealOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
  if (name == "Tout") return true;
 return false;
}

::mlir::DictionaryAttr RealOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())},
    {ToutAttrName(),
::mlir::TypeAttr::get(Tout())}});
}

void RealOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input) {
  odsState.addOperands(input);
  odsState.addTypes(output);
}

void RealOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input) {
  odsState.addOperands(input);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void RealOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult RealOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops12(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops13(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void RealOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::RealOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::ReciprocalGradOp definitions
//===----------------------------------------------------------------------===//

ReciprocalGradOpAdaptor::ReciprocalGradOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

ReciprocalGradOpAdaptor::ReciprocalGradOpAdaptor(ReciprocalGradOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange ReciprocalGradOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> ReciprocalGradOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange ReciprocalGradOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ReciprocalGradOpAdaptor::y() {
  return *getODSOperands(0).begin();
}

::mlir::Value ReciprocalGradOpAdaptor::dy() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr ReciprocalGradOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult ReciprocalGradOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> ReciprocalGradOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range ReciprocalGradOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ReciprocalGradOp::y() {
  return *getODSOperands(0).begin();
}

::mlir::Value ReciprocalGradOp::dy() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange ReciprocalGradOp::yMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ReciprocalGradOp::dyMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> ReciprocalGradOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range ReciprocalGradOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ReciprocalGradOp::z() {
  return *getODSResults(0).begin();
}

::mlir::Type ReciprocalGradOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool ReciprocalGradOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr ReciprocalGradOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void ReciprocalGradOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type z, ::mlir::Value y, ::mlir::Value dy) {
  odsState.addOperands(y);
  odsState.addOperands(dy);
  odsState.addTypes(z);
}

void ReciprocalGradOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value y, ::mlir::Value dy) {
  odsState.addOperands(y);
  odsState.addOperands(dy);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void ReciprocalGradOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult ReciprocalGradOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops2(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops2(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops2(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void ReciprocalGradOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::ReciprocalGradOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::ReciprocalOp definitions
//===----------------------------------------------------------------------===//

ReciprocalOpAdaptor::ReciprocalOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

ReciprocalOpAdaptor::ReciprocalOpAdaptor(ReciprocalOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange ReciprocalOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> ReciprocalOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange ReciprocalOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ReciprocalOpAdaptor::x() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr ReciprocalOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult ReciprocalOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> ReciprocalOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range ReciprocalOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ReciprocalOp::x() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange ReciprocalOp::xMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> ReciprocalOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range ReciprocalOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ReciprocalOp::y() {
  return *getODSResults(0).begin();
}

::mlir::Type ReciprocalOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool ReciprocalOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr ReciprocalOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void ReciprocalOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type y, ::mlir::Value x) {
  odsState.addOperands(x);
  odsState.addTypes(y);
}

void ReciprocalOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value x) {
  odsState.addOperands(x);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void ReciprocalOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

void ReciprocalOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value x) {
  odsState.addOperands(x);
  odsState.addTypes({x.getType()});

}

void ReciprocalOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  odsState.addTypes({operands[0].getType()});

}

::mlir::LogicalResult ReciprocalOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops1(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops1(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void ReciprocalOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::ReciprocalOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::RecvOp definitions
//===----------------------------------------------------------------------===//

RecvOpAdaptor::RecvOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

RecvOpAdaptor::RecvOpAdaptor(RecvOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange RecvOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> RecvOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange RecvOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::DictionaryAttr RecvOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::StringAttr RecvOpAdaptor::tensor_name() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("tensor_name").cast<::mlir::StringAttr>();
  return attr;
}

::mlir::StringAttr RecvOpAdaptor::send_device() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("send_device").cast<::mlir::StringAttr>();
  return attr;
}

::mlir::IntegerAttr RecvOpAdaptor::send_device_incarnation() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("send_device_incarnation").cast<::mlir::IntegerAttr>();
  return attr;
}

::mlir::StringAttr RecvOpAdaptor::recv_device() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("recv_device").cast<::mlir::StringAttr>();
  return attr;
}

::mlir::BoolAttr RecvOpAdaptor::client_terminated() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("client_terminated").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(false);
  return attr;
}

::mlir::LogicalResult RecvOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_tensor_name = odsAttrs.get("tensor_name");
    if (!tblgen_tensor_name)
      return emitError(loc, "'tf.Recv' op ""requires attribute 'tensor_name'");

    if (tblgen_tensor_name && !((tblgen_tensor_name.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.Recv' op ""attribute 'tensor_name' failed to satisfy constraint: string attribute");
  }
  {
    auto tblgen_send_device = odsAttrs.get("send_device");
    if (!tblgen_send_device)
      return emitError(loc, "'tf.Recv' op ""requires attribute 'send_device'");

    if (tblgen_send_device && !((tblgen_send_device.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.Recv' op ""attribute 'send_device' failed to satisfy constraint: string attribute");
  }
  {
    auto tblgen_send_device_incarnation = odsAttrs.get("send_device_incarnation");
    if (!tblgen_send_device_incarnation)
      return emitError(loc, "'tf.Recv' op ""requires attribute 'send_device_incarnation'");

    if (tblgen_send_device_incarnation && !(((tblgen_send_device_incarnation.isa<::mlir::IntegerAttr>())) && ((tblgen_send_device_incarnation.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.Recv' op ""attribute 'send_device_incarnation' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_recv_device = odsAttrs.get("recv_device");
    if (!tblgen_recv_device)
      return emitError(loc, "'tf.Recv' op ""requires attribute 'recv_device'");

    if (tblgen_recv_device && !((tblgen_recv_device.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.Recv' op ""attribute 'recv_device' failed to satisfy constraint: string attribute");
  }
  {
    auto tblgen_client_terminated = odsAttrs.get("client_terminated");
    if (tblgen_client_terminated && !((tblgen_client_terminated.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.Recv' op ""attribute 'client_terminated' failed to satisfy constraint: bool attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> RecvOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range RecvOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

std::pair<unsigned, unsigned> RecvOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range RecvOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value RecvOp::tensor() {
  return *getODSResults(0).begin();
}

::mlir::StringAttr RecvOp::tensor_nameAttr() {
  return (*this)->getAttr(tensor_nameAttrName()).cast<::mlir::StringAttr>();
}

::llvm::StringRef RecvOp::tensor_name() {
  auto attr = tensor_nameAttr();
  return attr.getValue();
}

::mlir::StringAttr RecvOp::send_deviceAttr() {
  return (*this)->getAttr(send_deviceAttrName()).cast<::mlir::StringAttr>();
}

::llvm::StringRef RecvOp::send_device() {
  auto attr = send_deviceAttr();
  return attr.getValue();
}

::mlir::IntegerAttr RecvOp::send_device_incarnationAttr() {
  return (*this)->getAttr(send_device_incarnationAttrName()).cast<::mlir::IntegerAttr>();
}

uint64_t RecvOp::send_device_incarnation() {
  auto attr = send_device_incarnationAttr();
  return attr.getValue().getZExtValue();
}

::mlir::StringAttr RecvOp::recv_deviceAttr() {
  return (*this)->getAttr(recv_deviceAttrName()).cast<::mlir::StringAttr>();
}

::llvm::StringRef RecvOp::recv_device() {
  auto attr = recv_deviceAttr();
  return attr.getValue();
}

::mlir::BoolAttr RecvOp::client_terminatedAttr() {
  return (*this)->getAttr(client_terminatedAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool RecvOp::client_terminated() {
  auto attr = client_terminatedAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(false).getValue();
  return attr.getValue();
}

::mlir::Type RecvOp::tensor_type() {
  return mlir::getElementTypeOrSelf(*getODSResults(0).begin());
}

bool RecvOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "tensor_type") return true;
 return false;
}

::mlir::DictionaryAttr RecvOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {tensor_typeAttrName(),
::mlir::TypeAttr::get(tensor_type())}});
}

void RecvOp::tensor_nameAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(tensor_nameAttrName(), attr);
}

void RecvOp::send_deviceAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(send_deviceAttrName(), attr);
}

void RecvOp::send_device_incarnationAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(send_device_incarnationAttrName(), attr);
}

void RecvOp::recv_deviceAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(recv_deviceAttrName(), attr);
}

void RecvOp::client_terminatedAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(client_terminatedAttrName(), attr);
}

void RecvOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type tensor, ::mlir::StringAttr tensor_name, ::mlir::StringAttr send_device, ::mlir::IntegerAttr send_device_incarnation, ::mlir::StringAttr recv_device, ::mlir::BoolAttr client_terminated) {
  odsState.addAttribute(tensor_nameAttrName(odsState.name), tensor_name);
  odsState.addAttribute(send_deviceAttrName(odsState.name), send_device);
  odsState.addAttribute(send_device_incarnationAttrName(odsState.name), send_device_incarnation);
  odsState.addAttribute(recv_deviceAttrName(odsState.name), recv_device);
  odsState.addAttribute(client_terminatedAttrName(odsState.name), client_terminated);
  odsState.addTypes(tensor);
}

void RecvOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::StringAttr tensor_name, ::mlir::StringAttr send_device, ::mlir::IntegerAttr send_device_incarnation, ::mlir::StringAttr recv_device, ::mlir::BoolAttr client_terminated) {
  odsState.addAttribute(tensor_nameAttrName(odsState.name), tensor_name);
  odsState.addAttribute(send_deviceAttrName(odsState.name), send_device);
  odsState.addAttribute(send_device_incarnationAttrName(odsState.name), send_device_incarnation);
  odsState.addAttribute(recv_deviceAttrName(odsState.name), recv_device);
  odsState.addAttribute(client_terminatedAttrName(odsState.name), client_terminated);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void RecvOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type tensor, ::llvm::StringRef tensor_name, ::llvm::StringRef send_device, uint64_t send_device_incarnation, ::llvm::StringRef recv_device, bool client_terminated) {
  odsState.addAttribute(tensor_nameAttrName(odsState.name), odsBuilder.getStringAttr(tensor_name));
  odsState.addAttribute(send_deviceAttrName(odsState.name), odsBuilder.getStringAttr(send_device));
  odsState.addAttribute(send_device_incarnationAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), send_device_incarnation));
  odsState.addAttribute(recv_deviceAttrName(odsState.name), odsBuilder.getStringAttr(recv_device));
  odsState.addAttribute(client_terminatedAttrName(odsState.name), odsBuilder.getBoolAttr(client_terminated));
  odsState.addTypes(tensor);
}

void RecvOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::llvm::StringRef tensor_name, ::llvm::StringRef send_device, uint64_t send_device_incarnation, ::llvm::StringRef recv_device, bool client_terminated) {
  odsState.addAttribute(tensor_nameAttrName(odsState.name), odsBuilder.getStringAttr(tensor_name));
  odsState.addAttribute(send_deviceAttrName(odsState.name), odsBuilder.getStringAttr(send_device));
  odsState.addAttribute(send_device_incarnationAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), send_device_incarnation));
  odsState.addAttribute(recv_deviceAttrName(odsState.name), odsBuilder.getStringAttr(recv_device));
  odsState.addAttribute(client_terminatedAttrName(odsState.name), odsBuilder.getBoolAttr(client_terminated));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void RecvOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 0u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult RecvOp::verify() {
  {
    auto tblgen_tensor_name = (*this)->getAttr(tensor_nameAttrName());
    if (!tblgen_tensor_name)
      return emitOpError("requires attribute 'tensor_name'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_tensor_name, "tensor_name")))
      return ::mlir::failure();
  }
  {
    auto tblgen_send_device = (*this)->getAttr(send_deviceAttrName());
    if (!tblgen_send_device)
      return emitOpError("requires attribute 'send_device'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_send_device, "send_device")))
      return ::mlir::failure();
  }
  {
    auto tblgen_send_device_incarnation = (*this)->getAttr(send_device_incarnationAttrName());
    if (!tblgen_send_device_incarnation)
      return emitOpError("requires attribute 'send_device_incarnation'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_send_device_incarnation, "send_device_incarnation")))
      return ::mlir::failure();
  }
  {
    auto tblgen_recv_device = (*this)->getAttr(recv_deviceAttrName());
    if (!tblgen_recv_device)
      return emitOpError("requires attribute 'recv_device'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_recv_device, "recv_device")))
      return ::mlir::failure();
  }
  {
    auto tblgen_client_terminated = (*this)->getAttr(client_terminatedAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_client_terminated, "client_terminated")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::RecvOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::RecvTPUEmbeddingActivationsOp definitions
//===----------------------------------------------------------------------===//

RecvTPUEmbeddingActivationsOpAdaptor::RecvTPUEmbeddingActivationsOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

RecvTPUEmbeddingActivationsOpAdaptor::RecvTPUEmbeddingActivationsOpAdaptor(RecvTPUEmbeddingActivationsOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange RecvTPUEmbeddingActivationsOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> RecvTPUEmbeddingActivationsOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange RecvTPUEmbeddingActivationsOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::DictionaryAttr RecvTPUEmbeddingActivationsOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::StringAttr RecvTPUEmbeddingActivationsOpAdaptor::config() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("config").cast<::mlir::StringAttr>();
  return attr;
}

::mlir::LogicalResult RecvTPUEmbeddingActivationsOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_config = odsAttrs.get("config");
    if (!tblgen_config)
      return emitError(loc, "'tf.RecvTPUEmbeddingActivations' op ""requires attribute 'config'");

    if (tblgen_config && !((tblgen_config.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.RecvTPUEmbeddingActivations' op ""attribute 'config' failed to satisfy constraint: string attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> RecvTPUEmbeddingActivationsOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range RecvTPUEmbeddingActivationsOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

std::pair<unsigned, unsigned> RecvTPUEmbeddingActivationsOp::getODSResultIndexAndLength(unsigned index) {
  bool isVariadic[] = {true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (getOperation()->getNumResults() - 0) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::Operation::result_range RecvTPUEmbeddingActivationsOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Operation::result_range RecvTPUEmbeddingActivationsOp::outputs() {
  return getODSResults(0);
}

::mlir::StringAttr RecvTPUEmbeddingActivationsOp::configAttr() {
  return (*this)->getAttr(configAttrName()).cast<::mlir::StringAttr>();
}

::llvm::StringRef RecvTPUEmbeddingActivationsOp::config() {
  auto attr = configAttr();
  return attr.getValue();
}

size_t RecvTPUEmbeddingActivationsOp::num_outputs() {
  auto range = getODSResults(0);
return std::distance(range.begin(), range.end());
}

bool RecvTPUEmbeddingActivationsOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "num_outputs") return true;
 return false;
}

::mlir::DictionaryAttr RecvTPUEmbeddingActivationsOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {num_outputsAttrName(),
odsBuilder.getI64IntegerAttr(num_outputs())}});
}

void RecvTPUEmbeddingActivationsOp::configAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(configAttrName(), attr);
}

void RecvTPUEmbeddingActivationsOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange outputs, ::mlir::StringAttr config) {
  odsState.addAttribute(configAttrName(odsState.name), config);
  odsState.addTypes(outputs);
}

void RecvTPUEmbeddingActivationsOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange outputs, ::llvm::StringRef config) {
  odsState.addAttribute(configAttrName(odsState.name), odsBuilder.getStringAttr(config));
  odsState.addTypes(outputs);
}

void RecvTPUEmbeddingActivationsOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 0u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult RecvTPUEmbeddingActivationsOp::verify() {
  {
    auto tblgen_config = (*this)->getAttr(configAttrName());
    if (!tblgen_config)
      return emitOpError("requires attribute 'config'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_config, "config")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void RecvTPUEmbeddingActivationsOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  effects.emplace_back(::mlir::MemoryEffects::Write::get(), ::mlir::TF::ResourceEffects::MustExecute::get());
  effects.emplace_back(::mlir::MemoryEffects::Read::get(), ::mlir::TF::ResourceEffects::TPUEmbedding::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::RecvTPUEmbeddingActivationsOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::ReduceDatasetOp definitions
//===----------------------------------------------------------------------===//

ReduceDatasetOpAdaptor::ReduceDatasetOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

ReduceDatasetOpAdaptor::ReduceDatasetOpAdaptor(ReduceDatasetOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange ReduceDatasetOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> ReduceDatasetOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  bool isVariadic[] = {false, true, true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (odsOperands.size() - 1) / 2;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::ValueRange ReduceDatasetOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ReduceDatasetOpAdaptor::input_dataset() {
  return *getODSOperands(0).begin();
}

::mlir::ValueRange ReduceDatasetOpAdaptor::initial_state() {
  return getODSOperands(1);
}

::mlir::ValueRange ReduceDatasetOpAdaptor::other_arguments() {
  return getODSOperands(2);
}

::mlir::DictionaryAttr ReduceDatasetOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::SymbolRefAttr ReduceDatasetOpAdaptor::f() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::SymbolRefAttr attr = odsAttrs.get("f").cast<::mlir::SymbolRefAttr>();
  return attr;
}

::mlir::ArrayAttr ReduceDatasetOpAdaptor::Tstate() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("Tstate").cast<::mlir::ArrayAttr>();
  return attr;
}

::mlir::ArrayAttr ReduceDatasetOpAdaptor::Targuments() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("Targuments").cast<::mlir::ArrayAttr>();
  return attr;
}

::mlir::ArrayAttr ReduceDatasetOpAdaptor::output_types() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("output_types").cast<::mlir::ArrayAttr>();
  return attr;
}

::mlir::ArrayAttr ReduceDatasetOpAdaptor::output_shapes() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("output_shapes").cast<::mlir::ArrayAttr>();
  return attr;
}

::mlir::BoolAttr ReduceDatasetOpAdaptor::use_inter_op_parallelism() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("use_inter_op_parallelism").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(true);
  return attr;
}

::mlir::LogicalResult ReduceDatasetOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_f = odsAttrs.get("f");
    if (!tblgen_f)
      return emitError(loc, "'tf.ReduceDataset' op ""requires attribute 'f'");

    if (tblgen_f && !((tblgen_f.isa<::mlir::SymbolRefAttr>())))
      return emitError(loc, "'tf.ReduceDataset' op ""attribute 'f' failed to satisfy constraint: symbol reference attribute");
  }
  {
    auto tblgen_Tstate = odsAttrs.get("Tstate");
    if (!tblgen_Tstate)
      return emitError(loc, "'tf.ReduceDataset' op ""requires attribute 'Tstate'");

    if (tblgen_Tstate && !((((tblgen_Tstate.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_Tstate.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return ((attr.isa<::mlir::TypeAttr>())) && ((attr.cast<::mlir::TypeAttr>().getValue().isa<::mlir::Type>())); }))) && ((tblgen_Tstate.cast<::mlir::ArrayAttr>().size() >= 1))))
      return emitError(loc, "'tf.ReduceDataset' op ""attribute 'Tstate' failed to satisfy constraint: type array attribute with at least 1 elements");
  }
  {
    auto tblgen_Targuments = odsAttrs.get("Targuments");
    if (!tblgen_Targuments)
      return emitError(loc, "'tf.ReduceDataset' op ""requires attribute 'Targuments'");

    if (tblgen_Targuments && !((((tblgen_Targuments.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_Targuments.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return ((attr.isa<::mlir::TypeAttr>())) && ((attr.cast<::mlir::TypeAttr>().getValue().isa<::mlir::Type>())); }))) && ((tblgen_Targuments.cast<::mlir::ArrayAttr>().size() >= 0))))
      return emitError(loc, "'tf.ReduceDataset' op ""attribute 'Targuments' failed to satisfy constraint: type array attribute with at least 0 elements");
  }
  {
    auto tblgen_output_types = odsAttrs.get("output_types");
    if (!tblgen_output_types)
      return emitError(loc, "'tf.ReduceDataset' op ""requires attribute 'output_types'");

    if (tblgen_output_types && !((((tblgen_output_types.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_output_types.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return ((attr.isa<::mlir::TypeAttr>())) && ((attr.cast<::mlir::TypeAttr>().getValue().isa<::mlir::Type>())); }))) && ((tblgen_output_types.cast<::mlir::ArrayAttr>().size() >= 1))))
      return emitError(loc, "'tf.ReduceDataset' op ""attribute 'output_types' failed to satisfy constraint: type array attribute with at least 1 elements");
  }
  {
    auto tblgen_output_shapes = odsAttrs.get("output_shapes");
    if (!tblgen_output_shapes)
      return emitError(loc, "'tf.ReduceDataset' op ""requires attribute 'output_shapes'");

    if (tblgen_output_shapes && !((((tblgen_output_shapes.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_output_shapes.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return (attr.isa<mlir::TF::ShapeAttr>()); }))) && ((tblgen_output_shapes.cast<::mlir::ArrayAttr>().size() >= 1))))
      return emitError(loc, "'tf.ReduceDataset' op ""attribute 'output_shapes' failed to satisfy constraint: tensorflow shape attribute array with at least 1 elements");
  }
  {
    auto tblgen_use_inter_op_parallelism = odsAttrs.get("use_inter_op_parallelism");
    if (tblgen_use_inter_op_parallelism && !((tblgen_use_inter_op_parallelism.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.ReduceDataset' op ""attribute 'use_inter_op_parallelism' failed to satisfy constraint: bool attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> ReduceDatasetOp::getODSOperandIndexAndLength(unsigned index) {
  bool isVariadic[] = {false, true, true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (getOperation()->getNumOperands() - 1) / 2;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::Operation::operand_range ReduceDatasetOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ReduceDatasetOp::input_dataset() {
  return *getODSOperands(0).begin();
}

::mlir::Operation::operand_range ReduceDatasetOp::initial_state() {
  return getODSOperands(1);
}

::mlir::Operation::operand_range ReduceDatasetOp::other_arguments() {
  return getODSOperands(2);
}

::mlir::MutableOperandRange ReduceDatasetOp::input_datasetMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ReduceDatasetOp::initial_stateMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ReduceDatasetOp::other_argumentsMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> ReduceDatasetOp::getODSResultIndexAndLength(unsigned index) {
  bool isVariadic[] = {true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (getOperation()->getNumResults() - 0) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::Operation::result_range ReduceDatasetOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Operation::result_range ReduceDatasetOp::components() {
  return getODSResults(0);
}

::mlir::SymbolRefAttr ReduceDatasetOp::fAttr() {
  return (*this)->getAttr(fAttrName()).cast<::mlir::SymbolRefAttr>();
}

::mlir::SymbolRefAttr ReduceDatasetOp::f() {
  auto attr = fAttr();
  return attr;
}

::mlir::ArrayAttr ReduceDatasetOp::TstateAttr() {
  return (*this)->getAttr(TstateAttrName()).cast<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr ReduceDatasetOp::Tstate() {
  auto attr = TstateAttr();
  return attr;
}

::mlir::ArrayAttr ReduceDatasetOp::TargumentsAttr() {
  return (*this)->getAttr(TargumentsAttrName()).cast<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr ReduceDatasetOp::Targuments() {
  auto attr = TargumentsAttr();
  return attr;
}

::mlir::ArrayAttr ReduceDatasetOp::output_typesAttr() {
  return (*this)->getAttr(output_typesAttrName()).cast<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr ReduceDatasetOp::output_types() {
  auto attr = output_typesAttr();
  return attr;
}

::mlir::ArrayAttr ReduceDatasetOp::output_shapesAttr() {
  return (*this)->getAttr(output_shapesAttrName()).cast<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr ReduceDatasetOp::output_shapes() {
  auto attr = output_shapesAttr();
  return attr;
}

::mlir::BoolAttr ReduceDatasetOp::use_inter_op_parallelismAttr() {
  return (*this)->getAttr(use_inter_op_parallelismAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool ReduceDatasetOp::use_inter_op_parallelism() {
  auto attr = use_inter_op_parallelismAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(true).getValue();
  return attr.getValue();
}

void ReduceDatasetOp::fAttr(::mlir::SymbolRefAttr attr) {
  (*this)->setAttr(fAttrName(), attr);
}

void ReduceDatasetOp::TstateAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(TstateAttrName(), attr);
}

void ReduceDatasetOp::TargumentsAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(TargumentsAttrName(), attr);
}

void ReduceDatasetOp::output_typesAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(output_typesAttrName(), attr);
}

void ReduceDatasetOp::output_shapesAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(output_shapesAttrName(), attr);
}

void ReduceDatasetOp::use_inter_op_parallelismAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(use_inter_op_parallelismAttrName(), attr);
}

void ReduceDatasetOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange components, ::mlir::Value input_dataset, ::mlir::ValueRange initial_state, ::mlir::ValueRange other_arguments, ::mlir::SymbolRefAttr f, ::mlir::ArrayAttr Tstate, ::mlir::ArrayAttr Targuments, ::mlir::ArrayAttr output_types, ::mlir::ArrayAttr output_shapes, ::mlir::BoolAttr use_inter_op_parallelism) {
  odsState.addOperands(input_dataset);
  odsState.addOperands(initial_state);
  odsState.addOperands(other_arguments);
  odsState.addAttribute(fAttrName(odsState.name), f);
  odsState.addAttribute(TstateAttrName(odsState.name), Tstate);
  odsState.addAttribute(TargumentsAttrName(odsState.name), Targuments);
  odsState.addAttribute(output_typesAttrName(odsState.name), output_types);
  odsState.addAttribute(output_shapesAttrName(odsState.name), output_shapes);
  odsState.addAttribute(use_inter_op_parallelismAttrName(odsState.name), use_inter_op_parallelism);
  odsState.addTypes(components);
}

void ReduceDatasetOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange components, ::mlir::Value input_dataset, ::mlir::ValueRange initial_state, ::mlir::ValueRange other_arguments, ::mlir::SymbolRefAttr f, ::mlir::ArrayAttr Tstate, ::mlir::ArrayAttr Targuments, ::mlir::ArrayAttr output_types, ::mlir::ArrayAttr output_shapes, bool use_inter_op_parallelism) {
  odsState.addOperands(input_dataset);
  odsState.addOperands(initial_state);
  odsState.addOperands(other_arguments);
  odsState.addAttribute(fAttrName(odsState.name), f);
  odsState.addAttribute(TstateAttrName(odsState.name), Tstate);
  odsState.addAttribute(TargumentsAttrName(odsState.name), Targuments);
  odsState.addAttribute(output_typesAttrName(odsState.name), output_types);
  odsState.addAttribute(output_shapesAttrName(odsState.name), output_shapes);
  odsState.addAttribute(use_inter_op_parallelismAttrName(odsState.name), odsBuilder.getBoolAttr(use_inter_op_parallelism));
  odsState.addTypes(components);
}

void ReduceDatasetOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() >= 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult ReduceDatasetOp::verify() {
  {
    auto tblgen_f = (*this)->getAttr(fAttrName());
    if (!tblgen_f)
      return emitOpError("requires attribute 'f'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops12(*this, tblgen_f, "f")))
      return ::mlir::failure();
  }
  {
    auto tblgen_Tstate = (*this)->getAttr(TstateAttrName());
    if (!tblgen_Tstate)
      return emitOpError("requires attribute 'Tstate'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops2(*this, tblgen_Tstate, "Tstate")))
      return ::mlir::failure();
  }
  {
    auto tblgen_Targuments = (*this)->getAttr(TargumentsAttrName());
    if (!tblgen_Targuments)
      return emitOpError("requires attribute 'Targuments'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops37(*this, tblgen_Targuments, "Targuments")))
      return ::mlir::failure();
  }
  {
    auto tblgen_output_types = (*this)->getAttr(output_typesAttrName());
    if (!tblgen_output_types)
      return emitOpError("requires attribute 'output_types'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops2(*this, tblgen_output_types, "output_types")))
      return ::mlir::failure();
  }
  {
    auto tblgen_output_shapes = (*this)->getAttr(output_shapesAttrName());
    if (!tblgen_output_shapes)
      return emitOpError("requires attribute 'output_shapes'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops3(*this, tblgen_output_shapes, "output_shapes")))
      return ::mlir::failure();
  }
  {
    auto tblgen_use_inter_op_parallelism = (*this)->getAttr(use_inter_op_parallelismAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_use_inter_op_parallelism, "use_inter_op_parallelism")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops15(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::ReduceDatasetOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::ReduceJoinOp definitions
//===----------------------------------------------------------------------===//

ReduceJoinOpAdaptor::ReduceJoinOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

ReduceJoinOpAdaptor::ReduceJoinOpAdaptor(ReduceJoinOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange ReduceJoinOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> ReduceJoinOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange ReduceJoinOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ReduceJoinOpAdaptor::inputs() {
  return *getODSOperands(0).begin();
}

::mlir::Value ReduceJoinOpAdaptor::reduction_indices() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr ReduceJoinOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::BoolAttr ReduceJoinOpAdaptor::keep_dims() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("keep_dims").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(false);
  return attr;
}

::mlir::StringAttr ReduceJoinOpAdaptor::separator() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("separator").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("");
  return attr;
}

::mlir::LogicalResult ReduceJoinOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_keep_dims = odsAttrs.get("keep_dims");
    if (tblgen_keep_dims && !((tblgen_keep_dims.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.ReduceJoin' op ""attribute 'keep_dims' failed to satisfy constraint: bool attribute");
  }
  {
    auto tblgen_separator = odsAttrs.get("separator");
    if (tblgen_separator && !((tblgen_separator.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.ReduceJoin' op ""attribute 'separator' failed to satisfy constraint: string attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> ReduceJoinOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range ReduceJoinOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ReduceJoinOp::inputs() {
  return *getODSOperands(0).begin();
}

::mlir::Value ReduceJoinOp::reduction_indices() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange ReduceJoinOp::inputsMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ReduceJoinOp::reduction_indicesMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> ReduceJoinOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range ReduceJoinOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ReduceJoinOp::output() {
  return *getODSResults(0).begin();
}

::mlir::BoolAttr ReduceJoinOp::keep_dimsAttr() {
  return (*this)->getAttr(keep_dimsAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool ReduceJoinOp::keep_dims() {
  auto attr = keep_dimsAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(false).getValue();
  return attr.getValue();
}

::mlir::StringAttr ReduceJoinOp::separatorAttr() {
  return (*this)->getAttr(separatorAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef ReduceJoinOp::separator() {
  auto attr = separatorAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("").getValue();
  return attr.getValue();
}

void ReduceJoinOp::keep_dimsAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(keep_dimsAttrName(), attr);
}

void ReduceJoinOp::separatorAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(separatorAttrName(), attr);
}

void ReduceJoinOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value inputs, ::mlir::Value reduction_indices, ::mlir::BoolAttr keep_dims, ::mlir::StringAttr separator) {
  odsState.addOperands(inputs);
  odsState.addOperands(reduction_indices);
  odsState.addAttribute(keep_dimsAttrName(odsState.name), keep_dims);
  odsState.addAttribute(separatorAttrName(odsState.name), separator);
  odsState.addTypes(output);
}

void ReduceJoinOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value inputs, ::mlir::Value reduction_indices, ::mlir::BoolAttr keep_dims, ::mlir::StringAttr separator) {
  odsState.addOperands(inputs);
  odsState.addOperands(reduction_indices);
  odsState.addAttribute(keep_dimsAttrName(odsState.name), keep_dims);
  odsState.addAttribute(separatorAttrName(odsState.name), separator);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void ReduceJoinOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value inputs, ::mlir::Value reduction_indices, bool keep_dims, ::llvm::StringRef separator) {
  odsState.addOperands(inputs);
  odsState.addOperands(reduction_indices);
  odsState.addAttribute(keep_dimsAttrName(odsState.name), odsBuilder.getBoolAttr(keep_dims));
  odsState.addAttribute(separatorAttrName(odsState.name), odsBuilder.getStringAttr(separator));
  odsState.addTypes(output);
}

void ReduceJoinOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value inputs, ::mlir::Value reduction_indices, bool keep_dims, ::llvm::StringRef separator) {
  odsState.addOperands(inputs);
  odsState.addOperands(reduction_indices);
  odsState.addAttribute(keep_dimsAttrName(odsState.name), odsBuilder.getBoolAttr(keep_dims));
  odsState.addAttribute(separatorAttrName(odsState.name), odsBuilder.getStringAttr(separator));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void ReduceJoinOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult ReduceJoinOp::verify() {
  {
    auto tblgen_keep_dims = (*this)->getAttr(keep_dimsAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_keep_dims, "keep_dims")))
      return ::mlir::failure();
  }
  {
    auto tblgen_separator = (*this)->getAttr(separatorAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_separator, "separator")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops19(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops11(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops19(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void ReduceJoinOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::ReduceJoinOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::Relu6GradOp definitions
//===----------------------------------------------------------------------===//

Relu6GradOpAdaptor::Relu6GradOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

Relu6GradOpAdaptor::Relu6GradOpAdaptor(Relu6GradOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange Relu6GradOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> Relu6GradOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange Relu6GradOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value Relu6GradOpAdaptor::gradients() {
  return *getODSOperands(0).begin();
}

::mlir::Value Relu6GradOpAdaptor::features() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr Relu6GradOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult Relu6GradOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> Relu6GradOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range Relu6GradOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value Relu6GradOp::gradients() {
  return *getODSOperands(0).begin();
}

::mlir::Value Relu6GradOp::features() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange Relu6GradOp::gradientsMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange Relu6GradOp::featuresMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> Relu6GradOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range Relu6GradOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value Relu6GradOp::backprops() {
  return *getODSResults(0).begin();
}

::mlir::Type Relu6GradOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool Relu6GradOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr Relu6GradOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void Relu6GradOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type backprops, ::mlir::Value gradients, ::mlir::Value features) {
  odsState.addOperands(gradients);
  odsState.addOperands(features);
  odsState.addTypes(backprops);
}

void Relu6GradOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value gradients, ::mlir::Value features) {
  odsState.addOperands(gradients);
  odsState.addOperands(features);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void Relu6GradOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult Relu6GradOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops35(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops35(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops35(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void Relu6GradOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::Relu6GradOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::Relu6Op definitions
//===----------------------------------------------------------------------===//

Relu6OpAdaptor::Relu6OpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

Relu6OpAdaptor::Relu6OpAdaptor(Relu6Op &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange Relu6OpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> Relu6OpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange Relu6OpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value Relu6OpAdaptor::features() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr Relu6OpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult Relu6OpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> Relu6Op::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range Relu6Op::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value Relu6Op::features() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange Relu6Op::featuresMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> Relu6Op::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range Relu6Op::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value Relu6Op::activations() {
  return *getODSResults(0).begin();
}

::mlir::Type Relu6Op::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool Relu6Op::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr Relu6Op::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void Relu6Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type activations, ::mlir::Value features) {
  odsState.addOperands(features);
  odsState.addTypes(activations);
}

void Relu6Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value features) {
  odsState.addOperands(features);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void Relu6Op::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

void Relu6Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value features) {
  odsState.addOperands(features);
  odsState.addTypes({features.getType()});

}

void Relu6Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  odsState.addTypes({operands[0].getType()});

}

::mlir::LogicalResult Relu6Op::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops35(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops35(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void Relu6Op::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::Relu6Op)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::ReluGradOp definitions
//===----------------------------------------------------------------------===//

ReluGradOpAdaptor::ReluGradOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

ReluGradOpAdaptor::ReluGradOpAdaptor(ReluGradOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange ReluGradOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> ReluGradOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange ReluGradOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ReluGradOpAdaptor::gradients() {
  return *getODSOperands(0).begin();
}

::mlir::Value ReluGradOpAdaptor::features() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr ReluGradOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult ReluGradOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> ReluGradOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range ReluGradOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ReluGradOp::gradients() {
  return *getODSOperands(0).begin();
}

::mlir::Value ReluGradOp::features() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange ReluGradOp::gradientsMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ReluGradOp::featuresMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> ReluGradOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range ReluGradOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ReluGradOp::backprops() {
  return *getODSResults(0).begin();
}

::mlir::Type ReluGradOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool ReluGradOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr ReluGradOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void ReluGradOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type backprops, ::mlir::Value gradients, ::mlir::Value features) {
  odsState.addOperands(gradients);
  odsState.addOperands(features);
  odsState.addTypes(backprops);
}

void ReluGradOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value gradients, ::mlir::Value features) {
  odsState.addOperands(gradients);
  odsState.addOperands(features);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void ReluGradOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult ReluGradOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops35(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops35(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops35(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void ReluGradOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::ReluGradOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::ReluOp definitions
//===----------------------------------------------------------------------===//

ReluOpAdaptor::ReluOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

ReluOpAdaptor::ReluOpAdaptor(ReluOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange ReluOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> ReluOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange ReluOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ReluOpAdaptor::features() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr ReluOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult ReluOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> ReluOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range ReluOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ReluOp::features() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange ReluOp::featuresMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> ReluOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range ReluOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ReluOp::activations() {
  return *getODSResults(0).begin();
}

::mlir::Type ReluOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool ReluOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr ReluOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void ReluOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type activations, ::mlir::Value features) {
  odsState.addOperands(features);
  odsState.addTypes(activations);
}

void ReluOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value features) {
  odsState.addOperands(features);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void ReluOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

void ReluOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value features) {
  odsState.addOperands(features);
  odsState.addTypes({features.getType()});

}

void ReluOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  odsState.addTypes({operands[0].getType()});

}

::mlir::LogicalResult ReluOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops54(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops54(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void ReluOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::ReluOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::RemoteCallOp definitions
//===----------------------------------------------------------------------===//

RemoteCallOpAdaptor::RemoteCallOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

RemoteCallOpAdaptor::RemoteCallOpAdaptor(RemoteCallOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange RemoteCallOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> RemoteCallOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  bool isVariadic[] = {false, true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (odsOperands.size() - 1) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::ValueRange RemoteCallOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value RemoteCallOpAdaptor::target() {
  return *getODSOperands(0).begin();
}

::mlir::ValueRange RemoteCallOpAdaptor::args() {
  return getODSOperands(1);
}

::mlir::DictionaryAttr RemoteCallOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::SymbolRefAttr RemoteCallOpAdaptor::f() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::SymbolRefAttr attr = odsAttrs.get("f").cast<::mlir::SymbolRefAttr>();
  return attr;
}

::mlir::LogicalResult RemoteCallOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_f = odsAttrs.get("f");
    if (!tblgen_f)
      return emitError(loc, "'tf.RemoteCall' op ""requires attribute 'f'");

    if (tblgen_f && !((tblgen_f.isa<::mlir::SymbolRefAttr>())))
      return emitError(loc, "'tf.RemoteCall' op ""attribute 'f' failed to satisfy constraint: symbol reference attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> RemoteCallOp::getODSOperandIndexAndLength(unsigned index) {
  bool isVariadic[] = {false, true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (getOperation()->getNumOperands() - 1) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::Operation::operand_range RemoteCallOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value RemoteCallOp::target() {
  return *getODSOperands(0).begin();
}

::mlir::Operation::operand_range RemoteCallOp::args() {
  return getODSOperands(1);
}

::mlir::MutableOperandRange RemoteCallOp::targetMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange RemoteCallOp::argsMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> RemoteCallOp::getODSResultIndexAndLength(unsigned index) {
  bool isVariadic[] = {true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (getOperation()->getNumResults() - 0) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::Operation::result_range RemoteCallOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Operation::result_range RemoteCallOp::output() {
  return getODSResults(0);
}

::mlir::SymbolRefAttr RemoteCallOp::fAttr() {
  return (*this)->getAttr(fAttrName()).cast<::mlir::SymbolRefAttr>();
}

::mlir::SymbolRefAttr RemoteCallOp::f() {
  auto attr = fAttr();
  return attr;
}

mlir::OperandElementTypeRange RemoteCallOp::Tin() {
  auto values = getODSOperands(1);
return {mlir::OperandElementTypeIterator(values.begin()), mlir::OperandElementTypeIterator(values.end())};
}

mlir::ResultElementTypeRange RemoteCallOp::Tout() {
  auto values = getODSResults(0);
return {mlir::ResultElementTypeIterator(values.begin()), mlir::ResultElementTypeIterator(values.end())};
}

bool RemoteCallOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "Tin") return true;
  if (name == "Tout") return true;
 return false;
}

::mlir::DictionaryAttr RemoteCallOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TinAttrName(),
ArrayAttr::get(ctx, 
    [&]() {
      llvm::SmallVector<Attribute, 4> ret;
      for (auto t : Tin())
        ret.push_back(TypeAttr::get(t));
      return ret;
    }())},
    {ToutAttrName(),
ArrayAttr::get(ctx, 
    [&]() {
      llvm::SmallVector<Attribute, 4> ret;
      for (auto t : Tout())
        ret.push_back(TypeAttr::get(t));
      return ret;
    }())}});
}

void RemoteCallOp::fAttr(::mlir::SymbolRefAttr attr) {
  (*this)->setAttr(fAttrName(), attr);
}

void RemoteCallOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange output, ::mlir::Value target, ::mlir::ValueRange args, ::mlir::SymbolRefAttr f) {
  odsState.addOperands(target);
  odsState.addOperands(args);
  odsState.addAttribute(fAttrName(odsState.name), f);
  odsState.addTypes(output);
}

void RemoteCallOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() >= 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult RemoteCallOp::verify() {
  {
    auto tblgen_f = (*this)->getAttr(fAttrName());
    if (!tblgen_f)
      return emitOpError("requires attribute 'f'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops12(*this, tblgen_f, "f")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops19(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::RemoteCallOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::RepeatDatasetOp definitions
//===----------------------------------------------------------------------===//

RepeatDatasetOpAdaptor::RepeatDatasetOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

RepeatDatasetOpAdaptor::RepeatDatasetOpAdaptor(RepeatDatasetOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange RepeatDatasetOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> RepeatDatasetOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange RepeatDatasetOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value RepeatDatasetOpAdaptor::input_dataset() {
  return *getODSOperands(0).begin();
}

::mlir::Value RepeatDatasetOpAdaptor::count() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr RepeatDatasetOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::ArrayAttr RepeatDatasetOpAdaptor::output_types() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("output_types").cast<::mlir::ArrayAttr>();
  return attr;
}

::mlir::ArrayAttr RepeatDatasetOpAdaptor::output_shapes() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("output_shapes").cast<::mlir::ArrayAttr>();
  return attr;
}

::mlir::StringAttr RepeatDatasetOpAdaptor::metadata() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("metadata").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("");
  return attr;
}

::mlir::LogicalResult RepeatDatasetOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_output_types = odsAttrs.get("output_types");
    if (!tblgen_output_types)
      return emitError(loc, "'tf.RepeatDataset' op ""requires attribute 'output_types'");

    if (tblgen_output_types && !((((tblgen_output_types.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_output_types.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return ((attr.isa<::mlir::TypeAttr>())) && ((attr.cast<::mlir::TypeAttr>().getValue().isa<::mlir::Type>())); }))) && ((tblgen_output_types.cast<::mlir::ArrayAttr>().size() >= 1))))
      return emitError(loc, "'tf.RepeatDataset' op ""attribute 'output_types' failed to satisfy constraint: type array attribute with at least 1 elements");
  }
  {
    auto tblgen_output_shapes = odsAttrs.get("output_shapes");
    if (!tblgen_output_shapes)
      return emitError(loc, "'tf.RepeatDataset' op ""requires attribute 'output_shapes'");

    if (tblgen_output_shapes && !((((tblgen_output_shapes.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_output_shapes.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return (attr.isa<mlir::TF::ShapeAttr>()); }))) && ((tblgen_output_shapes.cast<::mlir::ArrayAttr>().size() >= 1))))
      return emitError(loc, "'tf.RepeatDataset' op ""attribute 'output_shapes' failed to satisfy constraint: tensorflow shape attribute array with at least 1 elements");
  }
  {
    auto tblgen_metadata = odsAttrs.get("metadata");
    if (tblgen_metadata && !((tblgen_metadata.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.RepeatDataset' op ""attribute 'metadata' failed to satisfy constraint: string attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> RepeatDatasetOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range RepeatDatasetOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value RepeatDatasetOp::input_dataset() {
  return *getODSOperands(0).begin();
}

::mlir::Value RepeatDatasetOp::count() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange RepeatDatasetOp::input_datasetMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange RepeatDatasetOp::countMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> RepeatDatasetOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range RepeatDatasetOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value RepeatDatasetOp::handle() {
  return *getODSResults(0).begin();
}

::mlir::ArrayAttr RepeatDatasetOp::output_typesAttr() {
  return (*this)->getAttr(output_typesAttrName()).cast<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr RepeatDatasetOp::output_types() {
  auto attr = output_typesAttr();
  return attr;
}

::mlir::ArrayAttr RepeatDatasetOp::output_shapesAttr() {
  return (*this)->getAttr(output_shapesAttrName()).cast<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr RepeatDatasetOp::output_shapes() {
  auto attr = output_shapesAttr();
  return attr;
}

::mlir::StringAttr RepeatDatasetOp::metadataAttr() {
  return (*this)->getAttr(metadataAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef RepeatDatasetOp::metadata() {
  auto attr = metadataAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("").getValue();
  return attr.getValue();
}

void RepeatDatasetOp::output_typesAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(output_typesAttrName(), attr);
}

void RepeatDatasetOp::output_shapesAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(output_shapesAttrName(), attr);
}

void RepeatDatasetOp::metadataAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(metadataAttrName(), attr);
}

void RepeatDatasetOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type handle, ::mlir::Value input_dataset, ::mlir::Value count, ::mlir::ArrayAttr output_types, ::mlir::ArrayAttr output_shapes, ::mlir::StringAttr metadata) {
  odsState.addOperands(input_dataset);
  odsState.addOperands(count);
  odsState.addAttribute(output_typesAttrName(odsState.name), output_types);
  odsState.addAttribute(output_shapesAttrName(odsState.name), output_shapes);
  odsState.addAttribute(metadataAttrName(odsState.name), metadata);
  odsState.addTypes(handle);
}

void RepeatDatasetOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input_dataset, ::mlir::Value count, ::mlir::ArrayAttr output_types, ::mlir::ArrayAttr output_shapes, ::mlir::StringAttr metadata) {
  odsState.addOperands(input_dataset);
  odsState.addOperands(count);
  odsState.addAttribute(output_typesAttrName(odsState.name), output_types);
  odsState.addAttribute(output_shapesAttrName(odsState.name), output_shapes);
  odsState.addAttribute(metadataAttrName(odsState.name), metadata);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void RepeatDatasetOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type handle, ::mlir::Value input_dataset, ::mlir::Value count, ::mlir::ArrayAttr output_types, ::mlir::ArrayAttr output_shapes, ::llvm::StringRef metadata) {
  odsState.addOperands(input_dataset);
  odsState.addOperands(count);
  odsState.addAttribute(output_typesAttrName(odsState.name), output_types);
  odsState.addAttribute(output_shapesAttrName(odsState.name), output_shapes);
  odsState.addAttribute(metadataAttrName(odsState.name), odsBuilder.getStringAttr(metadata));
  odsState.addTypes(handle);
}

void RepeatDatasetOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input_dataset, ::mlir::Value count, ::mlir::ArrayAttr output_types, ::mlir::ArrayAttr output_shapes, ::llvm::StringRef metadata) {
  odsState.addOperands(input_dataset);
  odsState.addOperands(count);
  odsState.addAttribute(output_typesAttrName(odsState.name), output_types);
  odsState.addAttribute(output_shapesAttrName(odsState.name), output_shapes);
  odsState.addAttribute(metadataAttrName(odsState.name), odsBuilder.getStringAttr(metadata));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void RepeatDatasetOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult RepeatDatasetOp::verify() {
  {
    auto tblgen_output_types = (*this)->getAttr(output_typesAttrName());
    if (!tblgen_output_types)
      return emitOpError("requires attribute 'output_types'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops2(*this, tblgen_output_types, "output_types")))
      return ::mlir::failure();
  }
  {
    auto tblgen_output_shapes = (*this)->getAttr(output_shapesAttrName());
    if (!tblgen_output_shapes)
      return emitOpError("requires attribute 'output_shapes'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops3(*this, tblgen_output_shapes, "output_shapes")))
      return ::mlir::failure();
  }
  {
    auto tblgen_metadata = (*this)->getAttr(metadataAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_metadata, "metadata")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops15(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops16(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops15(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void RepeatDatasetOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::RepeatDatasetOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::ReshapeOp definitions
//===----------------------------------------------------------------------===//

ReshapeOpAdaptor::ReshapeOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

ReshapeOpAdaptor::ReshapeOpAdaptor(ReshapeOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange ReshapeOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> ReshapeOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange ReshapeOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ReshapeOpAdaptor::tensor() {
  return *getODSOperands(0).begin();
}

::mlir::Value ReshapeOpAdaptor::shape() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr ReshapeOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult ReshapeOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> ReshapeOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range ReshapeOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ReshapeOp::tensor() {
  return *getODSOperands(0).begin();
}

::mlir::Value ReshapeOp::shape() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange ReshapeOp::tensorMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ReshapeOp::shapeMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> ReshapeOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range ReshapeOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ReshapeOp::output() {
  return *getODSResults(0).begin();
}

::mlir::Type ReshapeOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

::mlir::Type ReshapeOp::Tshape() {
  return mlir::getElementTypeOrSelf(*getODSOperands(1).begin());
}

bool ReshapeOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
  if (name == "Tshape") return true;
 return false;
}

::mlir::DictionaryAttr ReshapeOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())},
    {TshapeAttrName(),
::mlir::TypeAttr::get(Tshape())}});
}

void ReshapeOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value tensor, ::mlir::Value shape) {
  odsState.addOperands(tensor);
  odsState.addOperands(shape);
  odsState.addTypes(output);
}

void ReshapeOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value tensor, ::mlir::Value shape) {
  odsState.addOperands(tensor);
  odsState.addOperands(shape);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void ReshapeOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult ReshapeOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return Verify(*this);
}

void ReshapeOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::ReshapeOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::ResizeBilinearGradOp definitions
//===----------------------------------------------------------------------===//

ResizeBilinearGradOpAdaptor::ResizeBilinearGradOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

ResizeBilinearGradOpAdaptor::ResizeBilinearGradOpAdaptor(ResizeBilinearGradOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange ResizeBilinearGradOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> ResizeBilinearGradOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange ResizeBilinearGradOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ResizeBilinearGradOpAdaptor::grads() {
  return *getODSOperands(0).begin();
}

::mlir::Value ResizeBilinearGradOpAdaptor::original_image() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr ResizeBilinearGradOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::BoolAttr ResizeBilinearGradOpAdaptor::align_corners() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("align_corners").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(false);
  return attr;
}

::mlir::BoolAttr ResizeBilinearGradOpAdaptor::half_pixel_centers() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("half_pixel_centers").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(false);
  return attr;
}

::mlir::LogicalResult ResizeBilinearGradOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_align_corners = odsAttrs.get("align_corners");
    if (tblgen_align_corners && !((tblgen_align_corners.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.ResizeBilinearGrad' op ""attribute 'align_corners' failed to satisfy constraint: bool attribute");
  }
  {
    auto tblgen_half_pixel_centers = odsAttrs.get("half_pixel_centers");
    if (tblgen_half_pixel_centers && !((tblgen_half_pixel_centers.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.ResizeBilinearGrad' op ""attribute 'half_pixel_centers' failed to satisfy constraint: bool attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> ResizeBilinearGradOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range ResizeBilinearGradOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ResizeBilinearGradOp::grads() {
  return *getODSOperands(0).begin();
}

::mlir::Value ResizeBilinearGradOp::original_image() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange ResizeBilinearGradOp::gradsMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ResizeBilinearGradOp::original_imageMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> ResizeBilinearGradOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range ResizeBilinearGradOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ResizeBilinearGradOp::output() {
  return *getODSResults(0).begin();
}

::mlir::BoolAttr ResizeBilinearGradOp::align_cornersAttr() {
  return (*this)->getAttr(align_cornersAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool ResizeBilinearGradOp::align_corners() {
  auto attr = align_cornersAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(false).getValue();
  return attr.getValue();
}

::mlir::BoolAttr ResizeBilinearGradOp::half_pixel_centersAttr() {
  return (*this)->getAttr(half_pixel_centersAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool ResizeBilinearGradOp::half_pixel_centers() {
  auto attr = half_pixel_centersAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(false).getValue();
  return attr.getValue();
}

::mlir::Type ResizeBilinearGradOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(1).begin());
}

bool ResizeBilinearGradOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr ResizeBilinearGradOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void ResizeBilinearGradOp::align_cornersAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(align_cornersAttrName(), attr);
}

void ResizeBilinearGradOp::half_pixel_centersAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(half_pixel_centersAttrName(), attr);
}

void ResizeBilinearGradOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value grads, ::mlir::Value original_image, ::mlir::BoolAttr align_corners, ::mlir::BoolAttr half_pixel_centers) {
  odsState.addOperands(grads);
  odsState.addOperands(original_image);
  odsState.addAttribute(align_cornersAttrName(odsState.name), align_corners);
  odsState.addAttribute(half_pixel_centersAttrName(odsState.name), half_pixel_centers);
  odsState.addTypes(output);
}

void ResizeBilinearGradOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value grads, ::mlir::Value original_image, ::mlir::BoolAttr align_corners, ::mlir::BoolAttr half_pixel_centers) {
  odsState.addOperands(grads);
  odsState.addOperands(original_image);
  odsState.addAttribute(align_cornersAttrName(odsState.name), align_corners);
  odsState.addAttribute(half_pixel_centersAttrName(odsState.name), half_pixel_centers);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void ResizeBilinearGradOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value grads, ::mlir::Value original_image, bool align_corners, bool half_pixel_centers) {
  odsState.addOperands(grads);
  odsState.addOperands(original_image);
  odsState.addAttribute(align_cornersAttrName(odsState.name), odsBuilder.getBoolAttr(align_corners));
  odsState.addAttribute(half_pixel_centersAttrName(odsState.name), odsBuilder.getBoolAttr(half_pixel_centers));
  odsState.addTypes(output);
}

void ResizeBilinearGradOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value grads, ::mlir::Value original_image, bool align_corners, bool half_pixel_centers) {
  odsState.addOperands(grads);
  odsState.addOperands(original_image);
  odsState.addAttribute(align_cornersAttrName(odsState.name), odsBuilder.getBoolAttr(align_corners));
  odsState.addAttribute(half_pixel_centersAttrName(odsState.name), odsBuilder.getBoolAttr(half_pixel_centers));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void ResizeBilinearGradOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult ResizeBilinearGradOp::verify() {
  {
    auto tblgen_align_corners = (*this)->getAttr(align_cornersAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_align_corners, "align_corners")))
      return ::mlir::failure();
  }
  {
    auto tblgen_half_pixel_centers = (*this)->getAttr(half_pixel_centersAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_half_pixel_centers, "half_pixel_centers")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void ResizeBilinearGradOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::ResizeBilinearGradOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::ResizeBilinearOp definitions
//===----------------------------------------------------------------------===//

ResizeBilinearOpAdaptor::ResizeBilinearOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

ResizeBilinearOpAdaptor::ResizeBilinearOpAdaptor(ResizeBilinearOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange ResizeBilinearOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> ResizeBilinearOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange ResizeBilinearOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ResizeBilinearOpAdaptor::images() {
  return *getODSOperands(0).begin();
}

::mlir::Value ResizeBilinearOpAdaptor::size() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr ResizeBilinearOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::BoolAttr ResizeBilinearOpAdaptor::align_corners() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("align_corners").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(false);
  return attr;
}

::mlir::BoolAttr ResizeBilinearOpAdaptor::half_pixel_centers() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("half_pixel_centers").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(false);
  return attr;
}

::mlir::LogicalResult ResizeBilinearOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_align_corners = odsAttrs.get("align_corners");
    if (tblgen_align_corners && !((tblgen_align_corners.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.ResizeBilinear' op ""attribute 'align_corners' failed to satisfy constraint: bool attribute");
  }
  {
    auto tblgen_half_pixel_centers = odsAttrs.get("half_pixel_centers");
    if (tblgen_half_pixel_centers && !((tblgen_half_pixel_centers.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.ResizeBilinear' op ""attribute 'half_pixel_centers' failed to satisfy constraint: bool attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> ResizeBilinearOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range ResizeBilinearOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ResizeBilinearOp::images() {
  return *getODSOperands(0).begin();
}

::mlir::Value ResizeBilinearOp::size() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange ResizeBilinearOp::imagesMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ResizeBilinearOp::sizeMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> ResizeBilinearOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range ResizeBilinearOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ResizeBilinearOp::resized_images() {
  return *getODSResults(0).begin();
}

::mlir::BoolAttr ResizeBilinearOp::align_cornersAttr() {
  return (*this)->getAttr(align_cornersAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool ResizeBilinearOp::align_corners() {
  auto attr = align_cornersAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(false).getValue();
  return attr.getValue();
}

::mlir::BoolAttr ResizeBilinearOp::half_pixel_centersAttr() {
  return (*this)->getAttr(half_pixel_centersAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool ResizeBilinearOp::half_pixel_centers() {
  auto attr = half_pixel_centersAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(false).getValue();
  return attr.getValue();
}

::mlir::Type ResizeBilinearOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool ResizeBilinearOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr ResizeBilinearOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void ResizeBilinearOp::align_cornersAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(align_cornersAttrName(), attr);
}

void ResizeBilinearOp::half_pixel_centersAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(half_pixel_centersAttrName(), attr);
}

void ResizeBilinearOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type resized_images, ::mlir::Value images, ::mlir::Value size, ::mlir::BoolAttr align_corners, ::mlir::BoolAttr half_pixel_centers) {
  odsState.addOperands(images);
  odsState.addOperands(size);
  odsState.addAttribute(align_cornersAttrName(odsState.name), align_corners);
  odsState.addAttribute(half_pixel_centersAttrName(odsState.name), half_pixel_centers);
  odsState.addTypes(resized_images);
}

void ResizeBilinearOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value images, ::mlir::Value size, ::mlir::BoolAttr align_corners, ::mlir::BoolAttr half_pixel_centers) {
  odsState.addOperands(images);
  odsState.addOperands(size);
  odsState.addAttribute(align_cornersAttrName(odsState.name), align_corners);
  odsState.addAttribute(half_pixel_centersAttrName(odsState.name), half_pixel_centers);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void ResizeBilinearOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type resized_images, ::mlir::Value images, ::mlir::Value size, bool align_corners, bool half_pixel_centers) {
  odsState.addOperands(images);
  odsState.addOperands(size);
  odsState.addAttribute(align_cornersAttrName(odsState.name), odsBuilder.getBoolAttr(align_corners));
  odsState.addAttribute(half_pixel_centersAttrName(odsState.name), odsBuilder.getBoolAttr(half_pixel_centers));
  odsState.addTypes(resized_images);
}

void ResizeBilinearOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value images, ::mlir::Value size, bool align_corners, bool half_pixel_centers) {
  odsState.addOperands(images);
  odsState.addOperands(size);
  odsState.addAttribute(align_cornersAttrName(odsState.name), odsBuilder.getBoolAttr(align_corners));
  odsState.addAttribute(half_pixel_centersAttrName(odsState.name), odsBuilder.getBoolAttr(half_pixel_centers));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void ResizeBilinearOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult ResizeBilinearOp::verify() {
  {
    auto tblgen_align_corners = (*this)->getAttr(align_cornersAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_align_corners, "align_corners")))
      return ::mlir::failure();
  }
  {
    auto tblgen_half_pixel_centers = (*this)->getAttr(half_pixel_centersAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_half_pixel_centers, "half_pixel_centers")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops38(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops11(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void ResizeBilinearOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::ResizeBilinearOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::ResizeNearestNeighborGradOp definitions
//===----------------------------------------------------------------------===//

ResizeNearestNeighborGradOpAdaptor::ResizeNearestNeighborGradOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

ResizeNearestNeighborGradOpAdaptor::ResizeNearestNeighborGradOpAdaptor(ResizeNearestNeighborGradOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange ResizeNearestNeighborGradOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> ResizeNearestNeighborGradOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange ResizeNearestNeighborGradOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ResizeNearestNeighborGradOpAdaptor::grads() {
  return *getODSOperands(0).begin();
}

::mlir::Value ResizeNearestNeighborGradOpAdaptor::size() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr ResizeNearestNeighborGradOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::BoolAttr ResizeNearestNeighborGradOpAdaptor::align_corners() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("align_corners").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(false);
  return attr;
}

::mlir::BoolAttr ResizeNearestNeighborGradOpAdaptor::half_pixel_centers() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("half_pixel_centers").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(false);
  return attr;
}

::mlir::LogicalResult ResizeNearestNeighborGradOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_align_corners = odsAttrs.get("align_corners");
    if (tblgen_align_corners && !((tblgen_align_corners.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.ResizeNearestNeighborGrad' op ""attribute 'align_corners' failed to satisfy constraint: bool attribute");
  }
  {
    auto tblgen_half_pixel_centers = odsAttrs.get("half_pixel_centers");
    if (tblgen_half_pixel_centers && !((tblgen_half_pixel_centers.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.ResizeNearestNeighborGrad' op ""attribute 'half_pixel_centers' failed to satisfy constraint: bool attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> ResizeNearestNeighborGradOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range ResizeNearestNeighborGradOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ResizeNearestNeighborGradOp::grads() {
  return *getODSOperands(0).begin();
}

::mlir::Value ResizeNearestNeighborGradOp::size() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange ResizeNearestNeighborGradOp::gradsMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ResizeNearestNeighborGradOp::sizeMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> ResizeNearestNeighborGradOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range ResizeNearestNeighborGradOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ResizeNearestNeighborGradOp::output() {
  return *getODSResults(0).begin();
}

::mlir::BoolAttr ResizeNearestNeighborGradOp::align_cornersAttr() {
  return (*this)->getAttr(align_cornersAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool ResizeNearestNeighborGradOp::align_corners() {
  auto attr = align_cornersAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(false).getValue();
  return attr.getValue();
}

::mlir::BoolAttr ResizeNearestNeighborGradOp::half_pixel_centersAttr() {
  return (*this)->getAttr(half_pixel_centersAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool ResizeNearestNeighborGradOp::half_pixel_centers() {
  auto attr = half_pixel_centersAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(false).getValue();
  return attr.getValue();
}

::mlir::Type ResizeNearestNeighborGradOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool ResizeNearestNeighborGradOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr ResizeNearestNeighborGradOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void ResizeNearestNeighborGradOp::align_cornersAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(align_cornersAttrName(), attr);
}

void ResizeNearestNeighborGradOp::half_pixel_centersAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(half_pixel_centersAttrName(), attr);
}

void ResizeNearestNeighborGradOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value grads, ::mlir::Value size, ::mlir::BoolAttr align_corners, ::mlir::BoolAttr half_pixel_centers) {
  odsState.addOperands(grads);
  odsState.addOperands(size);
  odsState.addAttribute(align_cornersAttrName(odsState.name), align_corners);
  odsState.addAttribute(half_pixel_centersAttrName(odsState.name), half_pixel_centers);
  odsState.addTypes(output);
}

void ResizeNearestNeighborGradOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value grads, ::mlir::Value size, ::mlir::BoolAttr align_corners, ::mlir::BoolAttr half_pixel_centers) {
  odsState.addOperands(grads);
  odsState.addOperands(size);
  odsState.addAttribute(align_cornersAttrName(odsState.name), align_corners);
  odsState.addAttribute(half_pixel_centersAttrName(odsState.name), half_pixel_centers);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void ResizeNearestNeighborGradOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value grads, ::mlir::Value size, bool align_corners, bool half_pixel_centers) {
  odsState.addOperands(grads);
  odsState.addOperands(size);
  odsState.addAttribute(align_cornersAttrName(odsState.name), odsBuilder.getBoolAttr(align_corners));
  odsState.addAttribute(half_pixel_centersAttrName(odsState.name), odsBuilder.getBoolAttr(half_pixel_centers));
  odsState.addTypes(output);
}

void ResizeNearestNeighborGradOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value grads, ::mlir::Value size, bool align_corners, bool half_pixel_centers) {
  odsState.addOperands(grads);
  odsState.addOperands(size);
  odsState.addAttribute(align_cornersAttrName(odsState.name), odsBuilder.getBoolAttr(align_corners));
  odsState.addAttribute(half_pixel_centersAttrName(odsState.name), odsBuilder.getBoolAttr(half_pixel_centers));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void ResizeNearestNeighborGradOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult ResizeNearestNeighborGradOp::verify() {
  {
    auto tblgen_align_corners = (*this)->getAttr(align_cornersAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_align_corners, "align_corners")))
      return ::mlir::failure();
  }
  {
    auto tblgen_half_pixel_centers = (*this)->getAttr(half_pixel_centersAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_half_pixel_centers, "half_pixel_centers")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops55(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops11(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops55(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void ResizeNearestNeighborGradOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::ResizeNearestNeighborGradOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::ResizeNearestNeighborOp definitions
//===----------------------------------------------------------------------===//

ResizeNearestNeighborOpAdaptor::ResizeNearestNeighborOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

ResizeNearestNeighborOpAdaptor::ResizeNearestNeighborOpAdaptor(ResizeNearestNeighborOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange ResizeNearestNeighborOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> ResizeNearestNeighborOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange ResizeNearestNeighborOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ResizeNearestNeighborOpAdaptor::images() {
  return *getODSOperands(0).begin();
}

::mlir::Value ResizeNearestNeighborOpAdaptor::size() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr ResizeNearestNeighborOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::BoolAttr ResizeNearestNeighborOpAdaptor::align_corners() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("align_corners").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(false);
  return attr;
}

::mlir::BoolAttr ResizeNearestNeighborOpAdaptor::half_pixel_centers() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("half_pixel_centers").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(false);
  return attr;
}

::mlir::LogicalResult ResizeNearestNeighborOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_align_corners = odsAttrs.get("align_corners");
    if (tblgen_align_corners && !((tblgen_align_corners.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.ResizeNearestNeighbor' op ""attribute 'align_corners' failed to satisfy constraint: bool attribute");
  }
  {
    auto tblgen_half_pixel_centers = odsAttrs.get("half_pixel_centers");
    if (tblgen_half_pixel_centers && !((tblgen_half_pixel_centers.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.ResizeNearestNeighbor' op ""attribute 'half_pixel_centers' failed to satisfy constraint: bool attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> ResizeNearestNeighborOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range ResizeNearestNeighborOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ResizeNearestNeighborOp::images() {
  return *getODSOperands(0).begin();
}

::mlir::Value ResizeNearestNeighborOp::size() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange ResizeNearestNeighborOp::imagesMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ResizeNearestNeighborOp::sizeMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> ResizeNearestNeighborOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range ResizeNearestNeighborOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ResizeNearestNeighborOp::resized_images() {
  return *getODSResults(0).begin();
}

::mlir::BoolAttr ResizeNearestNeighborOp::align_cornersAttr() {
  return (*this)->getAttr(align_cornersAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool ResizeNearestNeighborOp::align_corners() {
  auto attr = align_cornersAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(false).getValue();
  return attr.getValue();
}

::mlir::BoolAttr ResizeNearestNeighborOp::half_pixel_centersAttr() {
  return (*this)->getAttr(half_pixel_centersAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool ResizeNearestNeighborOp::half_pixel_centers() {
  auto attr = half_pixel_centersAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(false).getValue();
  return attr.getValue();
}

::mlir::Type ResizeNearestNeighborOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool ResizeNearestNeighborOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr ResizeNearestNeighborOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void ResizeNearestNeighborOp::align_cornersAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(align_cornersAttrName(), attr);
}

void ResizeNearestNeighborOp::half_pixel_centersAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(half_pixel_centersAttrName(), attr);
}

void ResizeNearestNeighborOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type resized_images, ::mlir::Value images, ::mlir::Value size, ::mlir::BoolAttr align_corners, ::mlir::BoolAttr half_pixel_centers) {
  odsState.addOperands(images);
  odsState.addOperands(size);
  odsState.addAttribute(align_cornersAttrName(odsState.name), align_corners);
  odsState.addAttribute(half_pixel_centersAttrName(odsState.name), half_pixel_centers);
  odsState.addTypes(resized_images);
}

void ResizeNearestNeighborOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value images, ::mlir::Value size, ::mlir::BoolAttr align_corners, ::mlir::BoolAttr half_pixel_centers) {
  odsState.addOperands(images);
  odsState.addOperands(size);
  odsState.addAttribute(align_cornersAttrName(odsState.name), align_corners);
  odsState.addAttribute(half_pixel_centersAttrName(odsState.name), half_pixel_centers);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void ResizeNearestNeighborOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type resized_images, ::mlir::Value images, ::mlir::Value size, bool align_corners, bool half_pixel_centers) {
  odsState.addOperands(images);
  odsState.addOperands(size);
  odsState.addAttribute(align_cornersAttrName(odsState.name), odsBuilder.getBoolAttr(align_corners));
  odsState.addAttribute(half_pixel_centersAttrName(odsState.name), odsBuilder.getBoolAttr(half_pixel_centers));
  odsState.addTypes(resized_images);
}

void ResizeNearestNeighborOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value images, ::mlir::Value size, bool align_corners, bool half_pixel_centers) {
  odsState.addOperands(images);
  odsState.addOperands(size);
  odsState.addAttribute(align_cornersAttrName(odsState.name), odsBuilder.getBoolAttr(align_corners));
  odsState.addAttribute(half_pixel_centersAttrName(odsState.name), odsBuilder.getBoolAttr(half_pixel_centers));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void ResizeNearestNeighborOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult ResizeNearestNeighborOp::verify() {
  {
    auto tblgen_align_corners = (*this)->getAttr(align_cornersAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_align_corners, "align_corners")))
      return ::mlir::failure();
  }
  {
    auto tblgen_half_pixel_centers = (*this)->getAttr(half_pixel_centersAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_half_pixel_centers, "half_pixel_centers")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops38(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops11(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops38(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void ResizeNearestNeighborOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::ResizeNearestNeighborOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::ResourceApplyAdaMaxOp definitions
//===----------------------------------------------------------------------===//

ResourceApplyAdaMaxOpAdaptor::ResourceApplyAdaMaxOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

ResourceApplyAdaMaxOpAdaptor::ResourceApplyAdaMaxOpAdaptor(ResourceApplyAdaMaxOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange ResourceApplyAdaMaxOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> ResourceApplyAdaMaxOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange ResourceApplyAdaMaxOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ResourceApplyAdaMaxOpAdaptor::var() {
  return *getODSOperands(0).begin();
}

::mlir::Value ResourceApplyAdaMaxOpAdaptor::m() {
  return *getODSOperands(1).begin();
}

::mlir::Value ResourceApplyAdaMaxOpAdaptor::v() {
  return *getODSOperands(2).begin();
}

::mlir::Value ResourceApplyAdaMaxOpAdaptor::beta1_power() {
  return *getODSOperands(3).begin();
}

::mlir::Value ResourceApplyAdaMaxOpAdaptor::lr() {
  return *getODSOperands(4).begin();
}

::mlir::Value ResourceApplyAdaMaxOpAdaptor::beta1() {
  return *getODSOperands(5).begin();
}

::mlir::Value ResourceApplyAdaMaxOpAdaptor::beta2() {
  return *getODSOperands(6).begin();
}

::mlir::Value ResourceApplyAdaMaxOpAdaptor::epsilon() {
  return *getODSOperands(7).begin();
}

::mlir::Value ResourceApplyAdaMaxOpAdaptor::grad() {
  return *getODSOperands(8).begin();
}

::mlir::DictionaryAttr ResourceApplyAdaMaxOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::BoolAttr ResourceApplyAdaMaxOpAdaptor::use_locking() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("use_locking").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(false);
  return attr;
}

::mlir::LogicalResult ResourceApplyAdaMaxOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_use_locking = odsAttrs.get("use_locking");
    if (tblgen_use_locking && !((tblgen_use_locking.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.ResourceApplyAdaMax' op ""attribute 'use_locking' failed to satisfy constraint: bool attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> ResourceApplyAdaMaxOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range ResourceApplyAdaMaxOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ResourceApplyAdaMaxOp::var() {
  return *getODSOperands(0).begin();
}

::mlir::Value ResourceApplyAdaMaxOp::m() {
  return *getODSOperands(1).begin();
}

::mlir::Value ResourceApplyAdaMaxOp::v() {
  return *getODSOperands(2).begin();
}

::mlir::Value ResourceApplyAdaMaxOp::beta1_power() {
  return *getODSOperands(3).begin();
}

::mlir::Value ResourceApplyAdaMaxOp::lr() {
  return *getODSOperands(4).begin();
}

::mlir::Value ResourceApplyAdaMaxOp::beta1() {
  return *getODSOperands(5).begin();
}

::mlir::Value ResourceApplyAdaMaxOp::beta2() {
  return *getODSOperands(6).begin();
}

::mlir::Value ResourceApplyAdaMaxOp::epsilon() {
  return *getODSOperands(7).begin();
}

::mlir::Value ResourceApplyAdaMaxOp::grad() {
  return *getODSOperands(8).begin();
}

::mlir::MutableOperandRange ResourceApplyAdaMaxOp::varMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ResourceApplyAdaMaxOp::mMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ResourceApplyAdaMaxOp::vMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ResourceApplyAdaMaxOp::beta1_powerMutable() {
  auto range = getODSOperandIndexAndLength(3);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ResourceApplyAdaMaxOp::lrMutable() {
  auto range = getODSOperandIndexAndLength(4);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ResourceApplyAdaMaxOp::beta1Mutable() {
  auto range = getODSOperandIndexAndLength(5);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ResourceApplyAdaMaxOp::beta2Mutable() {
  auto range = getODSOperandIndexAndLength(6);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ResourceApplyAdaMaxOp::epsilonMutable() {
  auto range = getODSOperandIndexAndLength(7);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ResourceApplyAdaMaxOp::gradMutable() {
  auto range = getODSOperandIndexAndLength(8);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> ResourceApplyAdaMaxOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range ResourceApplyAdaMaxOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::BoolAttr ResourceApplyAdaMaxOp::use_lockingAttr() {
  return (*this)->getAttr(use_lockingAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool ResourceApplyAdaMaxOp::use_locking() {
  auto attr = use_lockingAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(false).getValue();
  return attr.getValue();
}

::mlir::Type ResourceApplyAdaMaxOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(3).begin());
}

bool ResourceApplyAdaMaxOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr ResourceApplyAdaMaxOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void ResourceApplyAdaMaxOp::use_lockingAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(use_lockingAttrName(), attr);
}

void ResourceApplyAdaMaxOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value var, ::mlir::Value m, ::mlir::Value v, ::mlir::Value beta1_power, ::mlir::Value lr, ::mlir::Value beta1, ::mlir::Value beta2, ::mlir::Value epsilon, ::mlir::Value grad, ::mlir::BoolAttr use_locking) {
  odsState.addOperands(var);
  odsState.addOperands(m);
  odsState.addOperands(v);
  odsState.addOperands(beta1_power);
  odsState.addOperands(lr);
  odsState.addOperands(beta1);
  odsState.addOperands(beta2);
  odsState.addOperands(epsilon);
  odsState.addOperands(grad);
  odsState.addAttribute(use_lockingAttrName(odsState.name), use_locking);
}

void ResourceApplyAdaMaxOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value var, ::mlir::Value m, ::mlir::Value v, ::mlir::Value beta1_power, ::mlir::Value lr, ::mlir::Value beta1, ::mlir::Value beta2, ::mlir::Value epsilon, ::mlir::Value grad, ::mlir::BoolAttr use_locking) {
  odsState.addOperands(var);
  odsState.addOperands(m);
  odsState.addOperands(v);
  odsState.addOperands(beta1_power);
  odsState.addOperands(lr);
  odsState.addOperands(beta1);
  odsState.addOperands(beta2);
  odsState.addOperands(epsilon);
  odsState.addOperands(grad);
  odsState.addAttribute(use_lockingAttrName(odsState.name), use_locking);
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void ResourceApplyAdaMaxOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value var, ::mlir::Value m, ::mlir::Value v, ::mlir::Value beta1_power, ::mlir::Value lr, ::mlir::Value beta1, ::mlir::Value beta2, ::mlir::Value epsilon, ::mlir::Value grad, bool use_locking) {
  odsState.addOperands(var);
  odsState.addOperands(m);
  odsState.addOperands(v);
  odsState.addOperands(beta1_power);
  odsState.addOperands(lr);
  odsState.addOperands(beta1);
  odsState.addOperands(beta2);
  odsState.addOperands(epsilon);
  odsState.addOperands(grad);
  odsState.addAttribute(use_lockingAttrName(odsState.name), odsBuilder.getBoolAttr(use_locking));
}

void ResourceApplyAdaMaxOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value var, ::mlir::Value m, ::mlir::Value v, ::mlir::Value beta1_power, ::mlir::Value lr, ::mlir::Value beta1, ::mlir::Value beta2, ::mlir::Value epsilon, ::mlir::Value grad, bool use_locking) {
  odsState.addOperands(var);
  odsState.addOperands(m);
  odsState.addOperands(v);
  odsState.addOperands(beta1_power);
  odsState.addOperands(lr);
  odsState.addOperands(beta1);
  odsState.addOperands(beta2);
  odsState.addOperands(epsilon);
  odsState.addOperands(grad);
  odsState.addAttribute(use_lockingAttrName(odsState.name), odsBuilder.getBoolAttr(use_locking));
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void ResourceApplyAdaMaxOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 9u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 0u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult ResourceApplyAdaMaxOp::verify() {
  {
    auto tblgen_use_locking = (*this)->getAttr(use_lockingAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_use_locking, "use_locking")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup3 = getODSOperands(3);

    for (auto v : valueGroup3) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup4 = getODSOperands(4);

    for (auto v : valueGroup4) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup5 = getODSOperands(5);

    for (auto v : valueGroup5) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup6 = getODSOperands(6);

    for (auto v : valueGroup6) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup7 = getODSOperands(7);

    for (auto v : valueGroup7) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup8 = getODSOperands(8);

    for (auto v : valueGroup8) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void ResourceApplyAdaMaxOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  for (::mlir::Value value : getODSOperands(0))
    effects.emplace_back(::mlir::MemoryEffects::Read::get(), value, ::mlir::TF::ResourceEffects::Variable::get());
  for (::mlir::Value value : getODSOperands(0))
    effects.emplace_back(::mlir::MemoryEffects::Write::get(), value, ::mlir::TF::ResourceEffects::Variable::get());
  for (::mlir::Value value : getODSOperands(1))
    effects.emplace_back(::mlir::MemoryEffects::Read::get(), value, ::mlir::TF::ResourceEffects::Variable::get());
  for (::mlir::Value value : getODSOperands(1))
    effects.emplace_back(::mlir::MemoryEffects::Write::get(), value, ::mlir::TF::ResourceEffects::Variable::get());
  for (::mlir::Value value : getODSOperands(2))
    effects.emplace_back(::mlir::MemoryEffects::Read::get(), value, ::mlir::TF::ResourceEffects::Variable::get());
  for (::mlir::Value value : getODSOperands(2))
    effects.emplace_back(::mlir::MemoryEffects::Write::get(), value, ::mlir::TF::ResourceEffects::Variable::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::ResourceApplyAdaMaxOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::ResourceApplyAdadeltaOp definitions
//===----------------------------------------------------------------------===//

ResourceApplyAdadeltaOpAdaptor::ResourceApplyAdadeltaOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

ResourceApplyAdadeltaOpAdaptor::ResourceApplyAdadeltaOpAdaptor(ResourceApplyAdadeltaOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange ResourceApplyAdadeltaOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> ResourceApplyAdadeltaOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange ResourceApplyAdadeltaOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ResourceApplyAdadeltaOpAdaptor::var() {
  return *getODSOperands(0).begin();
}

::mlir::Value ResourceApplyAdadeltaOpAdaptor::accum() {
  return *getODSOperands(1).begin();
}

::mlir::Value ResourceApplyAdadeltaOpAdaptor::accum_update() {
  return *getODSOperands(2).begin();
}

::mlir::Value ResourceApplyAdadeltaOpAdaptor::lr() {
  return *getODSOperands(3).begin();
}

::mlir::Value ResourceApplyAdadeltaOpAdaptor::rho() {
  return *getODSOperands(4).begin();
}

::mlir::Value ResourceApplyAdadeltaOpAdaptor::epsilon() {
  return *getODSOperands(5).begin();
}

::mlir::Value ResourceApplyAdadeltaOpAdaptor::grad() {
  return *getODSOperands(6).begin();
}

::mlir::DictionaryAttr ResourceApplyAdadeltaOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::BoolAttr ResourceApplyAdadeltaOpAdaptor::use_locking() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("use_locking").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(false);
  return attr;
}

::mlir::LogicalResult ResourceApplyAdadeltaOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_use_locking = odsAttrs.get("use_locking");
    if (tblgen_use_locking && !((tblgen_use_locking.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.ResourceApplyAdadelta' op ""attribute 'use_locking' failed to satisfy constraint: bool attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> ResourceApplyAdadeltaOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range ResourceApplyAdadeltaOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ResourceApplyAdadeltaOp::var() {
  return *getODSOperands(0).begin();
}

::mlir::Value ResourceApplyAdadeltaOp::accum() {
  return *getODSOperands(1).begin();
}

::mlir::Value ResourceApplyAdadeltaOp::accum_update() {
  return *getODSOperands(2).begin();
}

::mlir::Value ResourceApplyAdadeltaOp::lr() {
  return *getODSOperands(3).begin();
}

::mlir::Value ResourceApplyAdadeltaOp::rho() {
  return *getODSOperands(4).begin();
}

::mlir::Value ResourceApplyAdadeltaOp::epsilon() {
  return *getODSOperands(5).begin();
}

::mlir::Value ResourceApplyAdadeltaOp::grad() {
  return *getODSOperands(6).begin();
}

::mlir::MutableOperandRange ResourceApplyAdadeltaOp::varMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ResourceApplyAdadeltaOp::accumMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ResourceApplyAdadeltaOp::accum_updateMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ResourceApplyAdadeltaOp::lrMutable() {
  auto range = getODSOperandIndexAndLength(3);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ResourceApplyAdadeltaOp::rhoMutable() {
  auto range = getODSOperandIndexAndLength(4);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ResourceApplyAdadeltaOp::epsilonMutable() {
  auto range = getODSOperandIndexAndLength(5);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ResourceApplyAdadeltaOp::gradMutable() {
  auto range = getODSOperandIndexAndLength(6);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> ResourceApplyAdadeltaOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range ResourceApplyAdadeltaOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::BoolAttr ResourceApplyAdadeltaOp::use_lockingAttr() {
  return (*this)->getAttr(use_lockingAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool ResourceApplyAdadeltaOp::use_locking() {
  auto attr = use_lockingAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(false).getValue();
  return attr.getValue();
}

::mlir::Type ResourceApplyAdadeltaOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(3).begin());
}

bool ResourceApplyAdadeltaOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr ResourceApplyAdadeltaOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void ResourceApplyAdadeltaOp::use_lockingAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(use_lockingAttrName(), attr);
}

void ResourceApplyAdadeltaOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value var, ::mlir::Value accum, ::mlir::Value accum_update, ::mlir::Value lr, ::mlir::Value rho, ::mlir::Value epsilon, ::mlir::Value grad, ::mlir::BoolAttr use_locking) {
  odsState.addOperands(var);
  odsState.addOperands(accum);
  odsState.addOperands(accum_update);
  odsState.addOperands(lr);
  odsState.addOperands(rho);
  odsState.addOperands(epsilon);
  odsState.addOperands(grad);
  odsState.addAttribute(use_lockingAttrName(odsState.name), use_locking);
}

void ResourceApplyAdadeltaOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value var, ::mlir::Value accum, ::mlir::Value accum_update, ::mlir::Value lr, ::mlir::Value rho, ::mlir::Value epsilon, ::mlir::Value grad, ::mlir::BoolAttr use_locking) {
  odsState.addOperands(var);
  odsState.addOperands(accum);
  odsState.addOperands(accum_update);
  odsState.addOperands(lr);
  odsState.addOperands(rho);
  odsState.addOperands(epsilon);
  odsState.addOperands(grad);
  odsState.addAttribute(use_lockingAttrName(odsState.name), use_locking);
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void ResourceApplyAdadeltaOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value var, ::mlir::Value accum, ::mlir::Value accum_update, ::mlir::Value lr, ::mlir::Value rho, ::mlir::Value epsilon, ::mlir::Value grad, bool use_locking) {
  odsState.addOperands(var);
  odsState.addOperands(accum);
  odsState.addOperands(accum_update);
  odsState.addOperands(lr);
  odsState.addOperands(rho);
  odsState.addOperands(epsilon);
  odsState.addOperands(grad);
  odsState.addAttribute(use_lockingAttrName(odsState.name), odsBuilder.getBoolAttr(use_locking));
}

void ResourceApplyAdadeltaOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value var, ::mlir::Value accum, ::mlir::Value accum_update, ::mlir::Value lr, ::mlir::Value rho, ::mlir::Value epsilon, ::mlir::Value grad, bool use_locking) {
  odsState.addOperands(var);
  odsState.addOperands(accum);
  odsState.addOperands(accum_update);
  odsState.addOperands(lr);
  odsState.addOperands(rho);
  odsState.addOperands(epsilon);
  odsState.addOperands(grad);
  odsState.addAttribute(use_lockingAttrName(odsState.name), odsBuilder.getBoolAttr(use_locking));
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void ResourceApplyAdadeltaOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 7u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 0u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult ResourceApplyAdadeltaOp::verify() {
  {
    auto tblgen_use_locking = (*this)->getAttr(use_lockingAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_use_locking, "use_locking")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup3 = getODSOperands(3);

    for (auto v : valueGroup3) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup4 = getODSOperands(4);

    for (auto v : valueGroup4) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup5 = getODSOperands(5);

    for (auto v : valueGroup5) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup6 = getODSOperands(6);

    for (auto v : valueGroup6) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void ResourceApplyAdadeltaOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  for (::mlir::Value value : getODSOperands(0))
    effects.emplace_back(::mlir::MemoryEffects::Read::get(), value, ::mlir::TF::ResourceEffects::Variable::get());
  for (::mlir::Value value : getODSOperands(0))
    effects.emplace_back(::mlir::MemoryEffects::Write::get(), value, ::mlir::TF::ResourceEffects::Variable::get());
  for (::mlir::Value value : getODSOperands(1))
    effects.emplace_back(::mlir::MemoryEffects::Read::get(), value, ::mlir::TF::ResourceEffects::Variable::get());
  for (::mlir::Value value : getODSOperands(1))
    effects.emplace_back(::mlir::MemoryEffects::Write::get(), value, ::mlir::TF::ResourceEffects::Variable::get());
  for (::mlir::Value value : getODSOperands(2))
    effects.emplace_back(::mlir::MemoryEffects::Read::get(), value, ::mlir::TF::ResourceEffects::Variable::get());
  for (::mlir::Value value : getODSOperands(2))
    effects.emplace_back(::mlir::MemoryEffects::Write::get(), value, ::mlir::TF::ResourceEffects::Variable::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::ResourceApplyAdadeltaOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::ResourceApplyAdagradDAOp definitions
//===----------------------------------------------------------------------===//

ResourceApplyAdagradDAOpAdaptor::ResourceApplyAdagradDAOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

ResourceApplyAdagradDAOpAdaptor::ResourceApplyAdagradDAOpAdaptor(ResourceApplyAdagradDAOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange ResourceApplyAdagradDAOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> ResourceApplyAdagradDAOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange ResourceApplyAdagradDAOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ResourceApplyAdagradDAOpAdaptor::var() {
  return *getODSOperands(0).begin();
}

::mlir::Value ResourceApplyAdagradDAOpAdaptor::gradient_accumulator() {
  return *getODSOperands(1).begin();
}

::mlir::Value ResourceApplyAdagradDAOpAdaptor::gradient_squared_accumulator() {
  return *getODSOperands(2).begin();
}

::mlir::Value ResourceApplyAdagradDAOpAdaptor::grad() {
  return *getODSOperands(3).begin();
}

::mlir::Value ResourceApplyAdagradDAOpAdaptor::lr() {
  return *getODSOperands(4).begin();
}

::mlir::Value ResourceApplyAdagradDAOpAdaptor::l1() {
  return *getODSOperands(5).begin();
}

::mlir::Value ResourceApplyAdagradDAOpAdaptor::l2() {
  return *getODSOperands(6).begin();
}

::mlir::Value ResourceApplyAdagradDAOpAdaptor::global_step() {
  return *getODSOperands(7).begin();
}

::mlir::DictionaryAttr ResourceApplyAdagradDAOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::BoolAttr ResourceApplyAdagradDAOpAdaptor::use_locking() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("use_locking").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(false);
  return attr;
}

::mlir::LogicalResult ResourceApplyAdagradDAOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_use_locking = odsAttrs.get("use_locking");
    if (tblgen_use_locking && !((tblgen_use_locking.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.ResourceApplyAdagradDA' op ""attribute 'use_locking' failed to satisfy constraint: bool attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> ResourceApplyAdagradDAOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range ResourceApplyAdagradDAOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ResourceApplyAdagradDAOp::var() {
  return *getODSOperands(0).begin();
}

::mlir::Value ResourceApplyAdagradDAOp::gradient_accumulator() {
  return *getODSOperands(1).begin();
}

::mlir::Value ResourceApplyAdagradDAOp::gradient_squared_accumulator() {
  return *getODSOperands(2).begin();
}

::mlir::Value ResourceApplyAdagradDAOp::grad() {
  return *getODSOperands(3).begin();
}

::mlir::Value ResourceApplyAdagradDAOp::lr() {
  return *getODSOperands(4).begin();
}

::mlir::Value ResourceApplyAdagradDAOp::l1() {
  return *getODSOperands(5).begin();
}

::mlir::Value ResourceApplyAdagradDAOp::l2() {
  return *getODSOperands(6).begin();
}

::mlir::Value ResourceApplyAdagradDAOp::global_step() {
  return *getODSOperands(7).begin();
}

::mlir::MutableOperandRange ResourceApplyAdagradDAOp::varMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ResourceApplyAdagradDAOp::gradient_accumulatorMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ResourceApplyAdagradDAOp::gradient_squared_accumulatorMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ResourceApplyAdagradDAOp::gradMutable() {
  auto range = getODSOperandIndexAndLength(3);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ResourceApplyAdagradDAOp::lrMutable() {
  auto range = getODSOperandIndexAndLength(4);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ResourceApplyAdagradDAOp::l1Mutable() {
  auto range = getODSOperandIndexAndLength(5);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ResourceApplyAdagradDAOp::l2Mutable() {
  auto range = getODSOperandIndexAndLength(6);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ResourceApplyAdagradDAOp::global_stepMutable() {
  auto range = getODSOperandIndexAndLength(7);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> ResourceApplyAdagradDAOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range ResourceApplyAdagradDAOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::BoolAttr ResourceApplyAdagradDAOp::use_lockingAttr() {
  return (*this)->getAttr(use_lockingAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool ResourceApplyAdagradDAOp::use_locking() {
  auto attr = use_lockingAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(false).getValue();
  return attr.getValue();
}

::mlir::Type ResourceApplyAdagradDAOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(3).begin());
}

bool ResourceApplyAdagradDAOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr ResourceApplyAdagradDAOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void ResourceApplyAdagradDAOp::use_lockingAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(use_lockingAttrName(), attr);
}

void ResourceApplyAdagradDAOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value var, ::mlir::Value gradient_accumulator, ::mlir::Value gradient_squared_accumulator, ::mlir::Value grad, ::mlir::Value lr, ::mlir::Value l1, ::mlir::Value l2, ::mlir::Value global_step, ::mlir::BoolAttr use_locking) {
  odsState.addOperands(var);
  odsState.addOperands(gradient_accumulator);
  odsState.addOperands(gradient_squared_accumulator);
  odsState.addOperands(grad);
  odsState.addOperands(lr);
  odsState.addOperands(l1);
  odsState.addOperands(l2);
  odsState.addOperands(global_step);
  odsState.addAttribute(use_lockingAttrName(odsState.name), use_locking);
}

void ResourceApplyAdagradDAOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value var, ::mlir::Value gradient_accumulator, ::mlir::Value gradient_squared_accumulator, ::mlir::Value grad, ::mlir::Value lr, ::mlir::Value l1, ::mlir::Value l2, ::mlir::Value global_step, ::mlir::BoolAttr use_locking) {
  odsState.addOperands(var);
  odsState.addOperands(gradient_accumulator);
  odsState.addOperands(gradient_squared_accumulator);
  odsState.addOperands(grad);
  odsState.addOperands(lr);
  odsState.addOperands(l1);
  odsState.addOperands(l2);
  odsState.addOperands(global_step);
  odsState.addAttribute(use_lockingAttrName(odsState.name), use_locking);
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void ResourceApplyAdagradDAOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value var, ::mlir::Value gradient_accumulator, ::mlir::Value gradient_squared_accumulator, ::mlir::Value grad, ::mlir::Value lr, ::mlir::Value l1, ::mlir::Value l2, ::mlir::Value global_step, bool use_locking) {
  odsState.addOperands(var);
  odsState.addOperands(gradient_accumulator);
  odsState.addOperands(gradient_squared_accumulator);
  odsState.addOperands(grad);
  odsState.addOperands(lr);
  odsState.addOperands(l1);
  odsState.addOperands(l2);
  odsState.addOperands(global_step);
  odsState.addAttribute(use_lockingAttrName(odsState.name), odsBuilder.getBoolAttr(use_locking));
}

void ResourceApplyAdagradDAOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value var, ::mlir::Value gradient_accumulator, ::mlir::Value gradient_squared_accumulator, ::mlir::Value grad, ::mlir::Value lr, ::mlir::Value l1, ::mlir::Value l2, ::mlir::Value global_step, bool use_locking) {
  odsState.addOperands(var);
  odsState.addOperands(gradient_accumulator);
  odsState.addOperands(gradient_squared_accumulator);
  odsState.addOperands(grad);
  odsState.addOperands(lr);
  odsState.addOperands(l1);
  odsState.addOperands(l2);
  odsState.addOperands(global_step);
  odsState.addAttribute(use_lockingAttrName(odsState.name), odsBuilder.getBoolAttr(use_locking));
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void ResourceApplyAdagradDAOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 8u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 0u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult ResourceApplyAdagradDAOp::verify() {
  {
    auto tblgen_use_locking = (*this)->getAttr(use_lockingAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_use_locking, "use_locking")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup3 = getODSOperands(3);

    for (auto v : valueGroup3) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup4 = getODSOperands(4);

    for (auto v : valueGroup4) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup5 = getODSOperands(5);

    for (auto v : valueGroup5) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup6 = getODSOperands(6);

    for (auto v : valueGroup6) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup7 = getODSOperands(7);

    for (auto v : valueGroup7) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops16(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void ResourceApplyAdagradDAOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  for (::mlir::Value value : getODSOperands(0))
    effects.emplace_back(::mlir::MemoryEffects::Read::get(), value, ::mlir::TF::ResourceEffects::Variable::get());
  for (::mlir::Value value : getODSOperands(0))
    effects.emplace_back(::mlir::MemoryEffects::Write::get(), value, ::mlir::TF::ResourceEffects::Variable::get());
  for (::mlir::Value value : getODSOperands(1))
    effects.emplace_back(::mlir::MemoryEffects::Read::get(), value, ::mlir::TF::ResourceEffects::Variable::get());
  for (::mlir::Value value : getODSOperands(1))
    effects.emplace_back(::mlir::MemoryEffects::Write::get(), value, ::mlir::TF::ResourceEffects::Variable::get());
  for (::mlir::Value value : getODSOperands(2))
    effects.emplace_back(::mlir::MemoryEffects::Read::get(), value, ::mlir::TF::ResourceEffects::Variable::get());
  for (::mlir::Value value : getODSOperands(2))
    effects.emplace_back(::mlir::MemoryEffects::Write::get(), value, ::mlir::TF::ResourceEffects::Variable::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::ResourceApplyAdagradDAOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::ResourceApplyAdagradOp definitions
//===----------------------------------------------------------------------===//

ResourceApplyAdagradOpAdaptor::ResourceApplyAdagradOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

ResourceApplyAdagradOpAdaptor::ResourceApplyAdagradOpAdaptor(ResourceApplyAdagradOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange ResourceApplyAdagradOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> ResourceApplyAdagradOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange ResourceApplyAdagradOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ResourceApplyAdagradOpAdaptor::var() {
  return *getODSOperands(0).begin();
}

::mlir::Value ResourceApplyAdagradOpAdaptor::accum() {
  return *getODSOperands(1).begin();
}

::mlir::Value ResourceApplyAdagradOpAdaptor::lr() {
  return *getODSOperands(2).begin();
}

::mlir::Value ResourceApplyAdagradOpAdaptor::grad() {
  return *getODSOperands(3).begin();
}

::mlir::DictionaryAttr ResourceApplyAdagradOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::BoolAttr ResourceApplyAdagradOpAdaptor::use_locking() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("use_locking").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(false);
  return attr;
}

::mlir::BoolAttr ResourceApplyAdagradOpAdaptor::update_slots() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("update_slots").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(true);
  return attr;
}

::mlir::LogicalResult ResourceApplyAdagradOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_use_locking = odsAttrs.get("use_locking");
    if (tblgen_use_locking && !((tblgen_use_locking.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.ResourceApplyAdagrad' op ""attribute 'use_locking' failed to satisfy constraint: bool attribute");
  }
  {
    auto tblgen_update_slots = odsAttrs.get("update_slots");
    if (tblgen_update_slots && !((tblgen_update_slots.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.ResourceApplyAdagrad' op ""attribute 'update_slots' failed to satisfy constraint: bool attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> ResourceApplyAdagradOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range ResourceApplyAdagradOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ResourceApplyAdagradOp::var() {
  return *getODSOperands(0).begin();
}

::mlir::Value ResourceApplyAdagradOp::accum() {
  return *getODSOperands(1).begin();
}

::mlir::Value ResourceApplyAdagradOp::lr() {
  return *getODSOperands(2).begin();
}

::mlir::Value ResourceApplyAdagradOp::grad() {
  return *getODSOperands(3).begin();
}

::mlir::MutableOperandRange ResourceApplyAdagradOp::varMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ResourceApplyAdagradOp::accumMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ResourceApplyAdagradOp::lrMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ResourceApplyAdagradOp::gradMutable() {
  auto range = getODSOperandIndexAndLength(3);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> ResourceApplyAdagradOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range ResourceApplyAdagradOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::BoolAttr ResourceApplyAdagradOp::use_lockingAttr() {
  return (*this)->getAttr(use_lockingAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool ResourceApplyAdagradOp::use_locking() {
  auto attr = use_lockingAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(false).getValue();
  return attr.getValue();
}

::mlir::BoolAttr ResourceApplyAdagradOp::update_slotsAttr() {
  return (*this)->getAttr(update_slotsAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool ResourceApplyAdagradOp::update_slots() {
  auto attr = update_slotsAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(true).getValue();
  return attr.getValue();
}

::mlir::Type ResourceApplyAdagradOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(2).begin());
}

bool ResourceApplyAdagradOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr ResourceApplyAdagradOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void ResourceApplyAdagradOp::use_lockingAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(use_lockingAttrName(), attr);
}

void ResourceApplyAdagradOp::update_slotsAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(update_slotsAttrName(), attr);
}

void ResourceApplyAdagradOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value var, ::mlir::Value accum, ::mlir::Value lr, ::mlir::Value grad, ::mlir::BoolAttr use_locking, ::mlir::BoolAttr update_slots) {
  odsState.addOperands(var);
  odsState.addOperands(accum);
  odsState.addOperands(lr);
  odsState.addOperands(grad);
  odsState.addAttribute(use_lockingAttrName(odsState.name), use_locking);
  odsState.addAttribute(update_slotsAttrName(odsState.name), update_slots);
}

void ResourceApplyAdagradOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value var, ::mlir::Value accum, ::mlir::Value lr, ::mlir::Value grad, ::mlir::BoolAttr use_locking, ::mlir::BoolAttr update_slots) {
  odsState.addOperands(var);
  odsState.addOperands(accum);
  odsState.addOperands(lr);
  odsState.addOperands(grad);
  odsState.addAttribute(use_lockingAttrName(odsState.name), use_locking);
  odsState.addAttribute(update_slotsAttrName(odsState.name), update_slots);
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void ResourceApplyAdagradOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value var, ::mlir::Value accum, ::mlir::Value lr, ::mlir::Value grad, bool use_locking, bool update_slots) {
  odsState.addOperands(var);
  odsState.addOperands(accum);
  odsState.addOperands(lr);
  odsState.addOperands(grad);
  odsState.addAttribute(use_lockingAttrName(odsState.name), odsBuilder.getBoolAttr(use_locking));
  odsState.addAttribute(update_slotsAttrName(odsState.name), odsBuilder.getBoolAttr(update_slots));
}

void ResourceApplyAdagradOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value var, ::mlir::Value accum, ::mlir::Value lr, ::mlir::Value grad, bool use_locking, bool update_slots) {
  odsState.addOperands(var);
  odsState.addOperands(accum);
  odsState.addOperands(lr);
  odsState.addOperands(grad);
  odsState.addAttribute(use_lockingAttrName(odsState.name), odsBuilder.getBoolAttr(use_locking));
  odsState.addAttribute(update_slotsAttrName(odsState.name), odsBuilder.getBoolAttr(update_slots));
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void ResourceApplyAdagradOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 4u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 0u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult ResourceApplyAdagradOp::verify() {
  {
    auto tblgen_use_locking = (*this)->getAttr(use_lockingAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_use_locking, "use_locking")))
      return ::mlir::failure();
  }
  {
    auto tblgen_update_slots = (*this)->getAttr(update_slotsAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_update_slots, "update_slots")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup3 = getODSOperands(3);

    for (auto v : valueGroup3) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void ResourceApplyAdagradOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  for (::mlir::Value value : getODSOperands(0))
    effects.emplace_back(::mlir::MemoryEffects::Read::get(), value, ::mlir::TF::ResourceEffects::Variable::get());
  for (::mlir::Value value : getODSOperands(0))
    effects.emplace_back(::mlir::MemoryEffects::Write::get(), value, ::mlir::TF::ResourceEffects::Variable::get());
  for (::mlir::Value value : getODSOperands(1))
    effects.emplace_back(::mlir::MemoryEffects::Read::get(), value, ::mlir::TF::ResourceEffects::Variable::get());
  for (::mlir::Value value : getODSOperands(1))
    effects.emplace_back(::mlir::MemoryEffects::Write::get(), value, ::mlir::TF::ResourceEffects::Variable::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::ResourceApplyAdagradOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::ResourceApplyAdagradV2Op definitions
//===----------------------------------------------------------------------===//

ResourceApplyAdagradV2OpAdaptor::ResourceApplyAdagradV2OpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

ResourceApplyAdagradV2OpAdaptor::ResourceApplyAdagradV2OpAdaptor(ResourceApplyAdagradV2Op &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange ResourceApplyAdagradV2OpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> ResourceApplyAdagradV2OpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange ResourceApplyAdagradV2OpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ResourceApplyAdagradV2OpAdaptor::var() {
  return *getODSOperands(0).begin();
}

::mlir::Value ResourceApplyAdagradV2OpAdaptor::accum() {
  return *getODSOperands(1).begin();
}

::mlir::Value ResourceApplyAdagradV2OpAdaptor::lr() {
  return *getODSOperands(2).begin();
}

::mlir::Value ResourceApplyAdagradV2OpAdaptor::epsilon() {
  return *getODSOperands(3).begin();
}

::mlir::Value ResourceApplyAdagradV2OpAdaptor::grad() {
  return *getODSOperands(4).begin();
}

::mlir::DictionaryAttr ResourceApplyAdagradV2OpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::BoolAttr ResourceApplyAdagradV2OpAdaptor::use_locking() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("use_locking").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(false);
  return attr;
}

::mlir::BoolAttr ResourceApplyAdagradV2OpAdaptor::update_slots() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("update_slots").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(true);
  return attr;
}

::mlir::LogicalResult ResourceApplyAdagradV2OpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_use_locking = odsAttrs.get("use_locking");
    if (tblgen_use_locking && !((tblgen_use_locking.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.ResourceApplyAdagradV2' op ""attribute 'use_locking' failed to satisfy constraint: bool attribute");
  }
  {
    auto tblgen_update_slots = odsAttrs.get("update_slots");
    if (tblgen_update_slots && !((tblgen_update_slots.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.ResourceApplyAdagradV2' op ""attribute 'update_slots' failed to satisfy constraint: bool attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> ResourceApplyAdagradV2Op::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range ResourceApplyAdagradV2Op::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ResourceApplyAdagradV2Op::var() {
  return *getODSOperands(0).begin();
}

::mlir::Value ResourceApplyAdagradV2Op::accum() {
  return *getODSOperands(1).begin();
}

::mlir::Value ResourceApplyAdagradV2Op::lr() {
  return *getODSOperands(2).begin();
}

::mlir::Value ResourceApplyAdagradV2Op::epsilon() {
  return *getODSOperands(3).begin();
}

::mlir::Value ResourceApplyAdagradV2Op::grad() {
  return *getODSOperands(4).begin();
}

::mlir::MutableOperandRange ResourceApplyAdagradV2Op::varMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ResourceApplyAdagradV2Op::accumMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ResourceApplyAdagradV2Op::lrMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ResourceApplyAdagradV2Op::epsilonMutable() {
  auto range = getODSOperandIndexAndLength(3);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ResourceApplyAdagradV2Op::gradMutable() {
  auto range = getODSOperandIndexAndLength(4);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> ResourceApplyAdagradV2Op::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range ResourceApplyAdagradV2Op::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::BoolAttr ResourceApplyAdagradV2Op::use_lockingAttr() {
  return (*this)->getAttr(use_lockingAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool ResourceApplyAdagradV2Op::use_locking() {
  auto attr = use_lockingAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(false).getValue();
  return attr.getValue();
}

::mlir::BoolAttr ResourceApplyAdagradV2Op::update_slotsAttr() {
  return (*this)->getAttr(update_slotsAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool ResourceApplyAdagradV2Op::update_slots() {
  auto attr = update_slotsAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(true).getValue();
  return attr.getValue();
}

::mlir::Type ResourceApplyAdagradV2Op::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(2).begin());
}

bool ResourceApplyAdagradV2Op::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr ResourceApplyAdagradV2Op::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void ResourceApplyAdagradV2Op::use_lockingAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(use_lockingAttrName(), attr);
}

void ResourceApplyAdagradV2Op::update_slotsAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(update_slotsAttrName(), attr);
}

void ResourceApplyAdagradV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value var, ::mlir::Value accum, ::mlir::Value lr, ::mlir::Value epsilon, ::mlir::Value grad, ::mlir::BoolAttr use_locking, ::mlir::BoolAttr update_slots) {
  odsState.addOperands(var);
  odsState.addOperands(accum);
  odsState.addOperands(lr);
  odsState.addOperands(epsilon);
  odsState.addOperands(grad);
  odsState.addAttribute(use_lockingAttrName(odsState.name), use_locking);
  odsState.addAttribute(update_slotsAttrName(odsState.name), update_slots);
}

void ResourceApplyAdagradV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value var, ::mlir::Value accum, ::mlir::Value lr, ::mlir::Value epsilon, ::mlir::Value grad, ::mlir::BoolAttr use_locking, ::mlir::BoolAttr update_slots) {
  odsState.addOperands(var);
  odsState.addOperands(accum);
  odsState.addOperands(lr);
  odsState.addOperands(epsilon);
  odsState.addOperands(grad);
  odsState.addAttribute(use_lockingAttrName(odsState.name), use_locking);
  odsState.addAttribute(update_slotsAttrName(odsState.name), update_slots);
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void ResourceApplyAdagradV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value var, ::mlir::Value accum, ::mlir::Value lr, ::mlir::Value epsilon, ::mlir::Value grad, bool use_locking, bool update_slots) {
  odsState.addOperands(var);
  odsState.addOperands(accum);
  odsState.addOperands(lr);
  odsState.addOperands(epsilon);
  odsState.addOperands(grad);
  odsState.addAttribute(use_lockingAttrName(odsState.name), odsBuilder.getBoolAttr(use_locking));
  odsState.addAttribute(update_slotsAttrName(odsState.name), odsBuilder.getBoolAttr(update_slots));
}

void ResourceApplyAdagradV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value var, ::mlir::Value accum, ::mlir::Value lr, ::mlir::Value epsilon, ::mlir::Value grad, bool use_locking, bool update_slots) {
  odsState.addOperands(var);
  odsState.addOperands(accum);
  odsState.addOperands(lr);
  odsState.addOperands(epsilon);
  odsState.addOperands(grad);
  odsState.addAttribute(use_lockingAttrName(odsState.name), odsBuilder.getBoolAttr(use_locking));
  odsState.addAttribute(update_slotsAttrName(odsState.name), odsBuilder.getBoolAttr(update_slots));
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void ResourceApplyAdagradV2Op::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 5u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 0u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult ResourceApplyAdagradV2Op::verify() {
  {
    auto tblgen_use_locking = (*this)->getAttr(use_lockingAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_use_locking, "use_locking")))
      return ::mlir::failure();
  }
  {
    auto tblgen_update_slots = (*this)->getAttr(update_slotsAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_update_slots, "update_slots")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup3 = getODSOperands(3);

    for (auto v : valueGroup3) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup4 = getODSOperands(4);

    for (auto v : valueGroup4) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void ResourceApplyAdagradV2Op::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  for (::mlir::Value value : getODSOperands(0))
    effects.emplace_back(::mlir::MemoryEffects::Read::get(), value, ::mlir::TF::ResourceEffects::Variable::get());
  for (::mlir::Value value : getODSOperands(0))
    effects.emplace_back(::mlir::MemoryEffects::Write::get(), value, ::mlir::TF::ResourceEffects::Variable::get());
  for (::mlir::Value value : getODSOperands(1))
    effects.emplace_back(::mlir::MemoryEffects::Read::get(), value, ::mlir::TF::ResourceEffects::Variable::get());
  for (::mlir::Value value : getODSOperands(1))
    effects.emplace_back(::mlir::MemoryEffects::Write::get(), value, ::mlir::TF::ResourceEffects::Variable::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::ResourceApplyAdagradV2Op)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::ResourceApplyAdamOp definitions
//===----------------------------------------------------------------------===//

ResourceApplyAdamOpAdaptor::ResourceApplyAdamOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

ResourceApplyAdamOpAdaptor::ResourceApplyAdamOpAdaptor(ResourceApplyAdamOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange ResourceApplyAdamOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> ResourceApplyAdamOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange ResourceApplyAdamOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ResourceApplyAdamOpAdaptor::var() {
  return *getODSOperands(0).begin();
}

::mlir::Value ResourceApplyAdamOpAdaptor::m() {
  return *getODSOperands(1).begin();
}

::mlir::Value ResourceApplyAdamOpAdaptor::v() {
  return *getODSOperands(2).begin();
}

::mlir::Value ResourceApplyAdamOpAdaptor::beta1_power() {
  return *getODSOperands(3).begin();
}

::mlir::Value ResourceApplyAdamOpAdaptor::beta2_power() {
  return *getODSOperands(4).begin();
}

::mlir::Value ResourceApplyAdamOpAdaptor::lr() {
  return *getODSOperands(5).begin();
}

::mlir::Value ResourceApplyAdamOpAdaptor::beta1() {
  return *getODSOperands(6).begin();
}

::mlir::Value ResourceApplyAdamOpAdaptor::beta2() {
  return *getODSOperands(7).begin();
}

::mlir::Value ResourceApplyAdamOpAdaptor::epsilon() {
  return *getODSOperands(8).begin();
}

::mlir::Value ResourceApplyAdamOpAdaptor::grad() {
  return *getODSOperands(9).begin();
}

::mlir::DictionaryAttr ResourceApplyAdamOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::BoolAttr ResourceApplyAdamOpAdaptor::use_locking() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("use_locking").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(false);
  return attr;
}

::mlir::BoolAttr ResourceApplyAdamOpAdaptor::use_nesterov() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("use_nesterov").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(false);
  return attr;
}

::mlir::LogicalResult ResourceApplyAdamOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_use_locking = odsAttrs.get("use_locking");
    if (tblgen_use_locking && !((tblgen_use_locking.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.ResourceApplyAdam' op ""attribute 'use_locking' failed to satisfy constraint: bool attribute");
  }
  {
    auto tblgen_use_nesterov = odsAttrs.get("use_nesterov");
    if (tblgen_use_nesterov && !((tblgen_use_nesterov.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.ResourceApplyAdam' op ""attribute 'use_nesterov' failed to satisfy constraint: bool attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> ResourceApplyAdamOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range ResourceApplyAdamOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ResourceApplyAdamOp::var() {
  return *getODSOperands(0).begin();
}

::mlir::Value ResourceApplyAdamOp::m() {
  return *getODSOperands(1).begin();
}

::mlir::Value ResourceApplyAdamOp::v() {
  return *getODSOperands(2).begin();
}

::mlir::Value ResourceApplyAdamOp::beta1_power() {
  return *getODSOperands(3).begin();
}

::mlir::Value ResourceApplyAdamOp::beta2_power() {
  return *getODSOperands(4).begin();
}

::mlir::Value ResourceApplyAdamOp::lr() {
  return *getODSOperands(5).begin();
}

::mlir::Value ResourceApplyAdamOp::beta1() {
  return *getODSOperands(6).begin();
}

::mlir::Value ResourceApplyAdamOp::beta2() {
  return *getODSOperands(7).begin();
}

::mlir::Value ResourceApplyAdamOp::epsilon() {
  return *getODSOperands(8).begin();
}

::mlir::Value ResourceApplyAdamOp::grad() {
  return *getODSOperands(9).begin();
}

::mlir::MutableOperandRange ResourceApplyAdamOp::varMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ResourceApplyAdamOp::mMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ResourceApplyAdamOp::vMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ResourceApplyAdamOp::beta1_powerMutable() {
  auto range = getODSOperandIndexAndLength(3);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ResourceApplyAdamOp::beta2_powerMutable() {
  auto range = getODSOperandIndexAndLength(4);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ResourceApplyAdamOp::lrMutable() {
  auto range = getODSOperandIndexAndLength(5);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ResourceApplyAdamOp::beta1Mutable() {
  auto range = getODSOperandIndexAndLength(6);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ResourceApplyAdamOp::beta2Mutable() {
  auto range = getODSOperandIndexAndLength(7);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ResourceApplyAdamOp::epsilonMutable() {
  auto range = getODSOperandIndexAndLength(8);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ResourceApplyAdamOp::gradMutable() {
  auto range = getODSOperandIndexAndLength(9);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> ResourceApplyAdamOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range ResourceApplyAdamOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::BoolAttr ResourceApplyAdamOp::use_lockingAttr() {
  return (*this)->getAttr(use_lockingAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool ResourceApplyAdamOp::use_locking() {
  auto attr = use_lockingAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(false).getValue();
  return attr.getValue();
}

::mlir::BoolAttr ResourceApplyAdamOp::use_nesterovAttr() {
  return (*this)->getAttr(use_nesterovAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool ResourceApplyAdamOp::use_nesterov() {
  auto attr = use_nesterovAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(false).getValue();
  return attr.getValue();
}

::mlir::Type ResourceApplyAdamOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(3).begin());
}

bool ResourceApplyAdamOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr ResourceApplyAdamOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void ResourceApplyAdamOp::use_lockingAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(use_lockingAttrName(), attr);
}

void ResourceApplyAdamOp::use_nesterovAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(use_nesterovAttrName(), attr);
}

void ResourceApplyAdamOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value var, ::mlir::Value m, ::mlir::Value v, ::mlir::Value beta1_power, ::mlir::Value beta2_power, ::mlir::Value lr, ::mlir::Value beta1, ::mlir::Value beta2, ::mlir::Value epsilon, ::mlir::Value grad, ::mlir::BoolAttr use_locking, ::mlir::BoolAttr use_nesterov) {
  odsState.addOperands(var);
  odsState.addOperands(m);
  odsState.addOperands(v);
  odsState.addOperands(beta1_power);
  odsState.addOperands(beta2_power);
  odsState.addOperands(lr);
  odsState.addOperands(beta1);
  odsState.addOperands(beta2);
  odsState.addOperands(epsilon);
  odsState.addOperands(grad);
  odsState.addAttribute(use_lockingAttrName(odsState.name), use_locking);
  odsState.addAttribute(use_nesterovAttrName(odsState.name), use_nesterov);
}

void ResourceApplyAdamOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value var, ::mlir::Value m, ::mlir::Value v, ::mlir::Value beta1_power, ::mlir::Value beta2_power, ::mlir::Value lr, ::mlir::Value beta1, ::mlir::Value beta2, ::mlir::Value epsilon, ::mlir::Value grad, ::mlir::BoolAttr use_locking, ::mlir::BoolAttr use_nesterov) {
  odsState.addOperands(var);
  odsState.addOperands(m);
  odsState.addOperands(v);
  odsState.addOperands(beta1_power);
  odsState.addOperands(beta2_power);
  odsState.addOperands(lr);
  odsState.addOperands(beta1);
  odsState.addOperands(beta2);
  odsState.addOperands(epsilon);
  odsState.addOperands(grad);
  odsState.addAttribute(use_lockingAttrName(odsState.name), use_locking);
  odsState.addAttribute(use_nesterovAttrName(odsState.name), use_nesterov);
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void ResourceApplyAdamOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value var, ::mlir::Value m, ::mlir::Value v, ::mlir::Value beta1_power, ::mlir::Value beta2_power, ::mlir::Value lr, ::mlir::Value beta1, ::mlir::Value beta2, ::mlir::Value epsilon, ::mlir::Value grad, bool use_locking, bool use_nesterov) {
  odsState.addOperands(var);
  odsState.addOperands(m);
  odsState.addOperands(v);
  odsState.addOperands(beta1_power);
  odsState.addOperands(beta2_power);
  odsState.addOperands(lr);
  odsState.addOperands(beta1);
  odsState.addOperands(beta2);
  odsState.addOperands(epsilon);
  odsState.addOperands(grad);
  odsState.addAttribute(use_lockingAttrName(odsState.name), odsBuilder.getBoolAttr(use_locking));
  odsState.addAttribute(use_nesterovAttrName(odsState.name), odsBuilder.getBoolAttr(use_nesterov));
}

void ResourceApplyAdamOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value var, ::mlir::Value m, ::mlir::Value v, ::mlir::Value beta1_power, ::mlir::Value beta2_power, ::mlir::Value lr, ::mlir::Value beta1, ::mlir::Value beta2, ::mlir::Value epsilon, ::mlir::Value grad, bool use_locking, bool use_nesterov) {
  odsState.addOperands(var);
  odsState.addOperands(m);
  odsState.addOperands(v);
  odsState.addOperands(beta1_power);
  odsState.addOperands(beta2_power);
  odsState.addOperands(lr);
  odsState.addOperands(beta1);
  odsState.addOperands(beta2);
  odsState.addOperands(epsilon);
  odsState.addOperands(grad);
  odsState.addAttribute(use_lockingAttrName(odsState.name), odsBuilder.getBoolAttr(use_locking));
  odsState.addAttribute(use_nesterovAttrName(odsState.name), odsBuilder.getBoolAttr(use_nesterov));
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void ResourceApplyAdamOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 10u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 0u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult ResourceApplyAdamOp::verify() {
  {
    auto tblgen_use_locking = (*this)->getAttr(use_lockingAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_use_locking, "use_locking")))
      return ::mlir::failure();
  }
  {
    auto tblgen_use_nesterov = (*this)->getAttr(use_nesterovAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_use_nesterov, "use_nesterov")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup3 = getODSOperands(3);

    for (auto v : valueGroup3) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup4 = getODSOperands(4);

    for (auto v : valueGroup4) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup5 = getODSOperands(5);

    for (auto v : valueGroup5) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup6 = getODSOperands(6);

    for (auto v : valueGroup6) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup7 = getODSOperands(7);

    for (auto v : valueGroup7) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup8 = getODSOperands(8);

    for (auto v : valueGroup8) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup9 = getODSOperands(9);

    for (auto v : valueGroup9) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void ResourceApplyAdamOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  for (::mlir::Value value : getODSOperands(0))
    effects.emplace_back(::mlir::MemoryEffects::Read::get(), value, ::mlir::TF::ResourceEffects::Variable::get());
  for (::mlir::Value value : getODSOperands(0))
    effects.emplace_back(::mlir::MemoryEffects::Write::get(), value, ::mlir::TF::ResourceEffects::Variable::get());
  for (::mlir::Value value : getODSOperands(1))
    effects.emplace_back(::mlir::MemoryEffects::Read::get(), value, ::mlir::TF::ResourceEffects::Variable::get());
  for (::mlir::Value value : getODSOperands(1))
    effects.emplace_back(::mlir::MemoryEffects::Write::get(), value, ::mlir::TF::ResourceEffects::Variable::get());
  for (::mlir::Value value : getODSOperands(2))
    effects.emplace_back(::mlir::MemoryEffects::Read::get(), value, ::mlir::TF::ResourceEffects::Variable::get());
  for (::mlir::Value value : getODSOperands(2))
    effects.emplace_back(::mlir::MemoryEffects::Write::get(), value, ::mlir::TF::ResourceEffects::Variable::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::ResourceApplyAdamOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::ResourceApplyAddSignOp definitions
//===----------------------------------------------------------------------===//

ResourceApplyAddSignOpAdaptor::ResourceApplyAddSignOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

ResourceApplyAddSignOpAdaptor::ResourceApplyAddSignOpAdaptor(ResourceApplyAddSignOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange ResourceApplyAddSignOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> ResourceApplyAddSignOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange ResourceApplyAddSignOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ResourceApplyAddSignOpAdaptor::var() {
  return *getODSOperands(0).begin();
}

::mlir::Value ResourceApplyAddSignOpAdaptor::m() {
  return *getODSOperands(1).begin();
}

::mlir::Value ResourceApplyAddSignOpAdaptor::lr() {
  return *getODSOperands(2).begin();
}

::mlir::Value ResourceApplyAddSignOpAdaptor::alpha() {
  return *getODSOperands(3).begin();
}

::mlir::Value ResourceApplyAddSignOpAdaptor::sign_decay() {
  return *getODSOperands(4).begin();
}

::mlir::Value ResourceApplyAddSignOpAdaptor::beta() {
  return *getODSOperands(5).begin();
}

::mlir::Value ResourceApplyAddSignOpAdaptor::grad() {
  return *getODSOperands(6).begin();
}

::mlir::DictionaryAttr ResourceApplyAddSignOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::BoolAttr ResourceApplyAddSignOpAdaptor::use_locking() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("use_locking").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(false);
  return attr;
}

::mlir::LogicalResult ResourceApplyAddSignOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_use_locking = odsAttrs.get("use_locking");
    if (tblgen_use_locking && !((tblgen_use_locking.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.ResourceApplyAddSign' op ""attribute 'use_locking' failed to satisfy constraint: bool attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> ResourceApplyAddSignOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range ResourceApplyAddSignOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ResourceApplyAddSignOp::var() {
  return *getODSOperands(0).begin();
}

::mlir::Value ResourceApplyAddSignOp::m() {
  return *getODSOperands(1).begin();
}

::mlir::Value ResourceApplyAddSignOp::lr() {
  return *getODSOperands(2).begin();
}

::mlir::Value ResourceApplyAddSignOp::alpha() {
  return *getODSOperands(3).begin();
}

::mlir::Value ResourceApplyAddSignOp::sign_decay() {
  return *getODSOperands(4).begin();
}

::mlir::Value ResourceApplyAddSignOp::beta() {
  return *getODSOperands(5).begin();
}

::mlir::Value ResourceApplyAddSignOp::grad() {
  return *getODSOperands(6).begin();
}

::mlir::MutableOperandRange ResourceApplyAddSignOp::varMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ResourceApplyAddSignOp::mMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ResourceApplyAddSignOp::lrMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ResourceApplyAddSignOp::alphaMutable() {
  auto range = getODSOperandIndexAndLength(3);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ResourceApplyAddSignOp::sign_decayMutable() {
  auto range = getODSOperandIndexAndLength(4);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ResourceApplyAddSignOp::betaMutable() {
  auto range = getODSOperandIndexAndLength(5);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ResourceApplyAddSignOp::gradMutable() {
  auto range = getODSOperandIndexAndLength(6);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> ResourceApplyAddSignOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range ResourceApplyAddSignOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::BoolAttr ResourceApplyAddSignOp::use_lockingAttr() {
  return (*this)->getAttr(use_lockingAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool ResourceApplyAddSignOp::use_locking() {
  auto attr = use_lockingAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(false).getValue();
  return attr.getValue();
}

::mlir::Type ResourceApplyAddSignOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(2).begin());
}

bool ResourceApplyAddSignOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr ResourceApplyAddSignOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void ResourceApplyAddSignOp::use_lockingAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(use_lockingAttrName(), attr);
}

void ResourceApplyAddSignOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value var, ::mlir::Value m, ::mlir::Value lr, ::mlir::Value alpha, ::mlir::Value sign_decay, ::mlir::Value beta, ::mlir::Value grad, ::mlir::BoolAttr use_locking) {
  odsState.addOperands(var);
  odsState.addOperands(m);
  odsState.addOperands(lr);
  odsState.addOperands(alpha);
  odsState.addOperands(sign_decay);
  odsState.addOperands(beta);
  odsState.addOperands(grad);
  odsState.addAttribute(use_lockingAttrName(odsState.name), use_locking);
}

void ResourceApplyAddSignOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value var, ::mlir::Value m, ::mlir::Value lr, ::mlir::Value alpha, ::mlir::Value sign_decay, ::mlir::Value beta, ::mlir::Value grad, ::mlir::BoolAttr use_locking) {
  odsState.addOperands(var);
  odsState.addOperands(m);
  odsState.addOperands(lr);
  odsState.addOperands(alpha);
  odsState.addOperands(sign_decay);
  odsState.addOperands(beta);
  odsState.addOperands(grad);
  odsState.addAttribute(use_lockingAttrName(odsState.name), use_locking);
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void ResourceApplyAddSignOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value var, ::mlir::Value m, ::mlir::Value lr, ::mlir::Value alpha, ::mlir::Value sign_decay, ::mlir::Value beta, ::mlir::Value grad, bool use_locking) {
  odsState.addOperands(var);
  odsState.addOperands(m);
  odsState.addOperands(lr);
  odsState.addOperands(alpha);
  odsState.addOperands(sign_decay);
  odsState.addOperands(beta);
  odsState.addOperands(grad);
  odsState.addAttribute(use_lockingAttrName(odsState.name), odsBuilder.getBoolAttr(use_locking));
}

void ResourceApplyAddSignOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value var, ::mlir::Value m, ::mlir::Value lr, ::mlir::Value alpha, ::mlir::Value sign_decay, ::mlir::Value beta, ::mlir::Value grad, bool use_locking) {
  odsState.addOperands(var);
  odsState.addOperands(m);
  odsState.addOperands(lr);
  odsState.addOperands(alpha);
  odsState.addOperands(sign_decay);
  odsState.addOperands(beta);
  odsState.addOperands(grad);
  odsState.addAttribute(use_lockingAttrName(odsState.name), odsBuilder.getBoolAttr(use_locking));
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void ResourceApplyAddSignOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 7u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 0u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult ResourceApplyAddSignOp::verify() {
  {
    auto tblgen_use_locking = (*this)->getAttr(use_lockingAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_use_locking, "use_locking")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup3 = getODSOperands(3);

    for (auto v : valueGroup3) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup4 = getODSOperands(4);

    for (auto v : valueGroup4) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup5 = getODSOperands(5);

    for (auto v : valueGroup5) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup6 = getODSOperands(6);

    for (auto v : valueGroup6) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void ResourceApplyAddSignOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  for (::mlir::Value value : getODSOperands(0))
    effects.emplace_back(::mlir::MemoryEffects::Read::get(), value, ::mlir::TF::ResourceEffects::Variable::get());
  for (::mlir::Value value : getODSOperands(0))
    effects.emplace_back(::mlir::MemoryEffects::Write::get(), value, ::mlir::TF::ResourceEffects::Variable::get());
  for (::mlir::Value value : getODSOperands(1))
    effects.emplace_back(::mlir::MemoryEffects::Read::get(), value, ::mlir::TF::ResourceEffects::Variable::get());
  for (::mlir::Value value : getODSOperands(1))
    effects.emplace_back(::mlir::MemoryEffects::Write::get(), value, ::mlir::TF::ResourceEffects::Variable::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::ResourceApplyAddSignOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::ResourceApplyCenteredRMSPropOp definitions
//===----------------------------------------------------------------------===//

ResourceApplyCenteredRMSPropOpAdaptor::ResourceApplyCenteredRMSPropOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

ResourceApplyCenteredRMSPropOpAdaptor::ResourceApplyCenteredRMSPropOpAdaptor(ResourceApplyCenteredRMSPropOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange ResourceApplyCenteredRMSPropOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> ResourceApplyCenteredRMSPropOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange ResourceApplyCenteredRMSPropOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ResourceApplyCenteredRMSPropOpAdaptor::var() {
  return *getODSOperands(0).begin();
}

::mlir::Value ResourceApplyCenteredRMSPropOpAdaptor::mg() {
  return *getODSOperands(1).begin();
}

::mlir::Value ResourceApplyCenteredRMSPropOpAdaptor::ms() {
  return *getODSOperands(2).begin();
}

::mlir::Value ResourceApplyCenteredRMSPropOpAdaptor::mom() {
  return *getODSOperands(3).begin();
}

::mlir::Value ResourceApplyCenteredRMSPropOpAdaptor::lr() {
  return *getODSOperands(4).begin();
}

::mlir::Value ResourceApplyCenteredRMSPropOpAdaptor::rho() {
  return *getODSOperands(5).begin();
}

::mlir::Value ResourceApplyCenteredRMSPropOpAdaptor::momentum() {
  return *getODSOperands(6).begin();
}

::mlir::Value ResourceApplyCenteredRMSPropOpAdaptor::epsilon() {
  return *getODSOperands(7).begin();
}

::mlir::Value ResourceApplyCenteredRMSPropOpAdaptor::grad() {
  return *getODSOperands(8).begin();
}

::mlir::DictionaryAttr ResourceApplyCenteredRMSPropOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::BoolAttr ResourceApplyCenteredRMSPropOpAdaptor::use_locking() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("use_locking").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(false);
  return attr;
}

::mlir::LogicalResult ResourceApplyCenteredRMSPropOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_use_locking = odsAttrs.get("use_locking");
    if (tblgen_use_locking && !((tblgen_use_locking.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.ResourceApplyCenteredRMSProp' op ""attribute 'use_locking' failed to satisfy constraint: bool attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> ResourceApplyCenteredRMSPropOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range ResourceApplyCenteredRMSPropOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ResourceApplyCenteredRMSPropOp::var() {
  return *getODSOperands(0).begin();
}

::mlir::Value ResourceApplyCenteredRMSPropOp::mg() {
  return *getODSOperands(1).begin();
}

::mlir::Value ResourceApplyCenteredRMSPropOp::ms() {
  return *getODSOperands(2).begin();
}

::mlir::Value ResourceApplyCenteredRMSPropOp::mom() {
  return *getODSOperands(3).begin();
}

::mlir::Value ResourceApplyCenteredRMSPropOp::lr() {
  return *getODSOperands(4).begin();
}

::mlir::Value ResourceApplyCenteredRMSPropOp::rho() {
  return *getODSOperands(5).begin();
}

::mlir::Value ResourceApplyCenteredRMSPropOp::momentum() {
  return *getODSOperands(6).begin();
}

::mlir::Value ResourceApplyCenteredRMSPropOp::epsilon() {
  return *getODSOperands(7).begin();
}

::mlir::Value ResourceApplyCenteredRMSPropOp::grad() {
  return *getODSOperands(8).begin();
}

::mlir::MutableOperandRange ResourceApplyCenteredRMSPropOp::varMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ResourceApplyCenteredRMSPropOp::mgMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ResourceApplyCenteredRMSPropOp::msMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ResourceApplyCenteredRMSPropOp::momMutable() {
  auto range = getODSOperandIndexAndLength(3);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ResourceApplyCenteredRMSPropOp::lrMutable() {
  auto range = getODSOperandIndexAndLength(4);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ResourceApplyCenteredRMSPropOp::rhoMutable() {
  auto range = getODSOperandIndexAndLength(5);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ResourceApplyCenteredRMSPropOp::momentumMutable() {
  auto range = getODSOperandIndexAndLength(6);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ResourceApplyCenteredRMSPropOp::epsilonMutable() {
  auto range = getODSOperandIndexAndLength(7);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ResourceApplyCenteredRMSPropOp::gradMutable() {
  auto range = getODSOperandIndexAndLength(8);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> ResourceApplyCenteredRMSPropOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range ResourceApplyCenteredRMSPropOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::BoolAttr ResourceApplyCenteredRMSPropOp::use_lockingAttr() {
  return (*this)->getAttr(use_lockingAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool ResourceApplyCenteredRMSPropOp::use_locking() {
  auto attr = use_lockingAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(false).getValue();
  return attr.getValue();
}

::mlir::Type ResourceApplyCenteredRMSPropOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(4).begin());
}

bool ResourceApplyCenteredRMSPropOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr ResourceApplyCenteredRMSPropOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void ResourceApplyCenteredRMSPropOp::use_lockingAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(use_lockingAttrName(), attr);
}

void ResourceApplyCenteredRMSPropOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value var, ::mlir::Value mg, ::mlir::Value ms, ::mlir::Value mom, ::mlir::Value lr, ::mlir::Value rho, ::mlir::Value momentum, ::mlir::Value epsilon, ::mlir::Value grad, ::mlir::BoolAttr use_locking) {
  odsState.addOperands(var);
  odsState.addOperands(mg);
  odsState.addOperands(ms);
  odsState.addOperands(mom);
  odsState.addOperands(lr);
  odsState.addOperands(rho);
  odsState.addOperands(momentum);
  odsState.addOperands(epsilon);
  odsState.addOperands(grad);
  odsState.addAttribute(use_lockingAttrName(odsState.name), use_locking);
}

void ResourceApplyCenteredRMSPropOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value var, ::mlir::Value mg, ::mlir::Value ms, ::mlir::Value mom, ::mlir::Value lr, ::mlir::Value rho, ::mlir::Value momentum, ::mlir::Value epsilon, ::mlir::Value grad, ::mlir::BoolAttr use_locking) {
  odsState.addOperands(var);
  odsState.addOperands(mg);
  odsState.addOperands(ms);
  odsState.addOperands(mom);
  odsState.addOperands(lr);
  odsState.addOperands(rho);
  odsState.addOperands(momentum);
  odsState.addOperands(epsilon);
  odsState.addOperands(grad);
  odsState.addAttribute(use_lockingAttrName(odsState.name), use_locking);
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void ResourceApplyCenteredRMSPropOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value var, ::mlir::Value mg, ::mlir::Value ms, ::mlir::Value mom, ::mlir::Value lr, ::mlir::Value rho, ::mlir::Value momentum, ::mlir::Value epsilon, ::mlir::Value grad, bool use_locking) {
  odsState.addOperands(var);
  odsState.addOperands(mg);
  odsState.addOperands(ms);
  odsState.addOperands(mom);
  odsState.addOperands(lr);
  odsState.addOperands(rho);
  odsState.addOperands(momentum);
  odsState.addOperands(epsilon);
  odsState.addOperands(grad);
  odsState.addAttribute(use_lockingAttrName(odsState.name), odsBuilder.getBoolAttr(use_locking));
}

void ResourceApplyCenteredRMSPropOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value var, ::mlir::Value mg, ::mlir::Value ms, ::mlir::Value mom, ::mlir::Value lr, ::mlir::Value rho, ::mlir::Value momentum, ::mlir::Value epsilon, ::mlir::Value grad, bool use_locking) {
  odsState.addOperands(var);
  odsState.addOperands(mg);
  odsState.addOperands(ms);
  odsState.addOperands(mom);
  odsState.addOperands(lr);
  odsState.addOperands(rho);
  odsState.addOperands(momentum);
  odsState.addOperands(epsilon);
  odsState.addOperands(grad);
  odsState.addAttribute(use_lockingAttrName(odsState.name), odsBuilder.getBoolAttr(use_locking));
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void ResourceApplyCenteredRMSPropOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 9u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 0u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult ResourceApplyCenteredRMSPropOp::verify() {
  {
    auto tblgen_use_locking = (*this)->getAttr(use_lockingAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_use_locking, "use_locking")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup3 = getODSOperands(3);

    for (auto v : valueGroup3) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup4 = getODSOperands(4);

    for (auto v : valueGroup4) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup5 = getODSOperands(5);

    for (auto v : valueGroup5) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup6 = getODSOperands(6);

    for (auto v : valueGroup6) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup7 = getODSOperands(7);

    for (auto v : valueGroup7) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup8 = getODSOperands(8);

    for (auto v : valueGroup8) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void ResourceApplyCenteredRMSPropOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  for (::mlir::Value value : getODSOperands(0))
    effects.emplace_back(::mlir::MemoryEffects::Read::get(), value, ::mlir::TF::ResourceEffects::Variable::get());
  for (::mlir::Value value : getODSOperands(0))
    effects.emplace_back(::mlir::MemoryEffects::Write::get(), value, ::mlir::TF::ResourceEffects::Variable::get());
  for (::mlir::Value value : getODSOperands(1))
    effects.emplace_back(::mlir::MemoryEffects::Read::get(), value, ::mlir::TF::ResourceEffects::Variable::get());
  for (::mlir::Value value : getODSOperands(1))
    effects.emplace_back(::mlir::MemoryEffects::Write::get(), value, ::mlir::TF::ResourceEffects::Variable::get());
  for (::mlir::Value value : getODSOperands(2))
    effects.emplace_back(::mlir::MemoryEffects::Read::get(), value, ::mlir::TF::ResourceEffects::Variable::get());
  for (::mlir::Value value : getODSOperands(2))
    effects.emplace_back(::mlir::MemoryEffects::Write::get(), value, ::mlir::TF::ResourceEffects::Variable::get());
  for (::mlir::Value value : getODSOperands(3))
    effects.emplace_back(::mlir::MemoryEffects::Read::get(), value, ::mlir::TF::ResourceEffects::Variable::get());
  for (::mlir::Value value : getODSOperands(3))
    effects.emplace_back(::mlir::MemoryEffects::Write::get(), value, ::mlir::TF::ResourceEffects::Variable::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::ResourceApplyCenteredRMSPropOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::ResourceApplyFtrlOp definitions
//===----------------------------------------------------------------------===//

ResourceApplyFtrlOpAdaptor::ResourceApplyFtrlOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

ResourceApplyFtrlOpAdaptor::ResourceApplyFtrlOpAdaptor(ResourceApplyFtrlOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange ResourceApplyFtrlOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> ResourceApplyFtrlOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange ResourceApplyFtrlOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ResourceApplyFtrlOpAdaptor::var() {
  return *getODSOperands(0).begin();
}

::mlir::Value ResourceApplyFtrlOpAdaptor::accum() {
  return *getODSOperands(1).begin();
}

::mlir::Value ResourceApplyFtrlOpAdaptor::linear() {
  return *getODSOperands(2).begin();
}

::mlir::Value ResourceApplyFtrlOpAdaptor::grad() {
  return *getODSOperands(3).begin();
}

::mlir::Value ResourceApplyFtrlOpAdaptor::lr() {
  return *getODSOperands(4).begin();
}

::mlir::Value ResourceApplyFtrlOpAdaptor::l1() {
  return *getODSOperands(5).begin();
}

::mlir::Value ResourceApplyFtrlOpAdaptor::l2() {
  return *getODSOperands(6).begin();
}

::mlir::Value ResourceApplyFtrlOpAdaptor::lr_power() {
  return *getODSOperands(7).begin();
}

::mlir::DictionaryAttr ResourceApplyFtrlOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::BoolAttr ResourceApplyFtrlOpAdaptor::use_locking() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("use_locking").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(false);
  return attr;
}

::mlir::BoolAttr ResourceApplyFtrlOpAdaptor::multiply_linear_by_lr() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("multiply_linear_by_lr").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(false);
  return attr;
}

::mlir::LogicalResult ResourceApplyFtrlOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_use_locking = odsAttrs.get("use_locking");
    if (tblgen_use_locking && !((tblgen_use_locking.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.ResourceApplyFtrl' op ""attribute 'use_locking' failed to satisfy constraint: bool attribute");
  }
  {
    auto tblgen_multiply_linear_by_lr = odsAttrs.get("multiply_linear_by_lr");
    if (tblgen_multiply_linear_by_lr && !((tblgen_multiply_linear_by_lr.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.ResourceApplyFtrl' op ""attribute 'multiply_linear_by_lr' failed to satisfy constraint: bool attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> ResourceApplyFtrlOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range ResourceApplyFtrlOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ResourceApplyFtrlOp::var() {
  return *getODSOperands(0).begin();
}

::mlir::Value ResourceApplyFtrlOp::accum() {
  return *getODSOperands(1).begin();
}

::mlir::Value ResourceApplyFtrlOp::linear() {
  return *getODSOperands(2).begin();
}

::mlir::Value ResourceApplyFtrlOp::grad() {
  return *getODSOperands(3).begin();
}

::mlir::Value ResourceApplyFtrlOp::lr() {
  return *getODSOperands(4).begin();
}

::mlir::Value ResourceApplyFtrlOp::l1() {
  return *getODSOperands(5).begin();
}

::mlir::Value ResourceApplyFtrlOp::l2() {
  return *getODSOperands(6).begin();
}

::mlir::Value ResourceApplyFtrlOp::lr_power() {
  return *getODSOperands(7).begin();
}

::mlir::MutableOperandRange ResourceApplyFtrlOp::varMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ResourceApplyFtrlOp::accumMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ResourceApplyFtrlOp::linearMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ResourceApplyFtrlOp::gradMutable() {
  auto range = getODSOperandIndexAndLength(3);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ResourceApplyFtrlOp::lrMutable() {
  auto range = getODSOperandIndexAndLength(4);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ResourceApplyFtrlOp::l1Mutable() {
  auto range = getODSOperandIndexAndLength(5);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ResourceApplyFtrlOp::l2Mutable() {
  auto range = getODSOperandIndexAndLength(6);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ResourceApplyFtrlOp::lr_powerMutable() {
  auto range = getODSOperandIndexAndLength(7);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> ResourceApplyFtrlOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range ResourceApplyFtrlOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::BoolAttr ResourceApplyFtrlOp::use_lockingAttr() {
  return (*this)->getAttr(use_lockingAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool ResourceApplyFtrlOp::use_locking() {
  auto attr = use_lockingAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(false).getValue();
  return attr.getValue();
}

::mlir::BoolAttr ResourceApplyFtrlOp::multiply_linear_by_lrAttr() {
  return (*this)->getAttr(multiply_linear_by_lrAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool ResourceApplyFtrlOp::multiply_linear_by_lr() {
  auto attr = multiply_linear_by_lrAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(false).getValue();
  return attr.getValue();
}

::mlir::Type ResourceApplyFtrlOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(3).begin());
}

bool ResourceApplyFtrlOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr ResourceApplyFtrlOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void ResourceApplyFtrlOp::use_lockingAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(use_lockingAttrName(), attr);
}

void ResourceApplyFtrlOp::multiply_linear_by_lrAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(multiply_linear_by_lrAttrName(), attr);
}

void ResourceApplyFtrlOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value var, ::mlir::Value accum, ::mlir::Value linear, ::mlir::Value grad, ::mlir::Value lr, ::mlir::Value l1, ::mlir::Value l2, ::mlir::Value lr_power, ::mlir::BoolAttr use_locking, ::mlir::BoolAttr multiply_linear_by_lr) {
  odsState.addOperands(var);
  odsState.addOperands(accum);
  odsState.addOperands(linear);
  odsState.addOperands(grad);
  odsState.addOperands(lr);
  odsState.addOperands(l1);
  odsState.addOperands(l2);
  odsState.addOperands(lr_power);
  odsState.addAttribute(use_lockingAttrName(odsState.name), use_locking);
  odsState.addAttribute(multiply_linear_by_lrAttrName(odsState.name), multiply_linear_by_lr);
}

void ResourceApplyFtrlOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value var, ::mlir::Value accum, ::mlir::Value linear, ::mlir::Value grad, ::mlir::Value lr, ::mlir::Value l1, ::mlir::Value l2, ::mlir::Value lr_power, ::mlir::BoolAttr use_locking, ::mlir::BoolAttr multiply_linear_by_lr) {
  odsState.addOperands(var);
  odsState.addOperands(accum);
  odsState.addOperands(linear);
  odsState.addOperands(grad);
  odsState.addOperands(lr);
  odsState.addOperands(l1);
  odsState.addOperands(l2);
  odsState.addOperands(lr_power);
  odsState.addAttribute(use_lockingAttrName(odsState.name), use_locking);
  odsState.addAttribute(multiply_linear_by_lrAttrName(odsState.name), multiply_linear_by_lr);
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void ResourceApplyFtrlOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value var, ::mlir::Value accum, ::mlir::Value linear, ::mlir::Value grad, ::mlir::Value lr, ::mlir::Value l1, ::mlir::Value l2, ::mlir::Value lr_power, bool use_locking, bool multiply_linear_by_lr) {
  odsState.addOperands(var);
  odsState.addOperands(accum);
  odsState.addOperands(linear);
  odsState.addOperands(grad);
  odsState.addOperands(lr);
  odsState.addOperands(l1);
  odsState.addOperands(l2);
  odsState.addOperands(lr_power);
  odsState.addAttribute(use_lockingAttrName(odsState.name), odsBuilder.getBoolAttr(use_locking));
  odsState.addAttribute(multiply_linear_by_lrAttrName(odsState.name), odsBuilder.getBoolAttr(multiply_linear_by_lr));
}

void ResourceApplyFtrlOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value var, ::mlir::Value accum, ::mlir::Value linear, ::mlir::Value grad, ::mlir::Value lr, ::mlir::Value l1, ::mlir::Value l2, ::mlir::Value lr_power, bool use_locking, bool multiply_linear_by_lr) {
  odsState.addOperands(var);
  odsState.addOperands(accum);
  odsState.addOperands(linear);
  odsState.addOperands(grad);
  odsState.addOperands(lr);
  odsState.addOperands(l1);
  odsState.addOperands(l2);
  odsState.addOperands(lr_power);
  odsState.addAttribute(use_lockingAttrName(odsState.name), odsBuilder.getBoolAttr(use_locking));
  odsState.addAttribute(multiply_linear_by_lrAttrName(odsState.name), odsBuilder.getBoolAttr(multiply_linear_by_lr));
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void ResourceApplyFtrlOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 8u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 0u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult ResourceApplyFtrlOp::verify() {
  {
    auto tblgen_use_locking = (*this)->getAttr(use_lockingAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_use_locking, "use_locking")))
      return ::mlir::failure();
  }
  {
    auto tblgen_multiply_linear_by_lr = (*this)->getAttr(multiply_linear_by_lrAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_multiply_linear_by_lr, "multiply_linear_by_lr")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup3 = getODSOperands(3);

    for (auto v : valueGroup3) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup4 = getODSOperands(4);

    for (auto v : valueGroup4) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup5 = getODSOperands(5);

    for (auto v : valueGroup5) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup6 = getODSOperands(6);

    for (auto v : valueGroup6) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup7 = getODSOperands(7);

    for (auto v : valueGroup7) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void ResourceApplyFtrlOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  for (::mlir::Value value : getODSOperands(0))
    effects.emplace_back(::mlir::MemoryEffects::Read::get(), value, ::mlir::TF::ResourceEffects::Variable::get());
  for (::mlir::Value value : getODSOperands(0))
    effects.emplace_back(::mlir::MemoryEffects::Write::get(), value, ::mlir::TF::ResourceEffects::Variable::get());
  for (::mlir::Value value : getODSOperands(1))
    effects.emplace_back(::mlir::MemoryEffects::Read::get(), value, ::mlir::TF::ResourceEffects::Variable::get());
  for (::mlir::Value value : getODSOperands(1))
    effects.emplace_back(::mlir::MemoryEffects::Write::get(), value, ::mlir::TF::ResourceEffects::Variable::get());
  for (::mlir::Value value : getODSOperands(2))
    effects.emplace_back(::mlir::MemoryEffects::Read::get(), value, ::mlir::TF::ResourceEffects::Variable::get());
  for (::mlir::Value value : getODSOperands(2))
    effects.emplace_back(::mlir::MemoryEffects::Write::get(), value, ::mlir::TF::ResourceEffects::Variable::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::ResourceApplyFtrlOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::ResourceApplyFtrlV2Op definitions
//===----------------------------------------------------------------------===//

ResourceApplyFtrlV2OpAdaptor::ResourceApplyFtrlV2OpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

ResourceApplyFtrlV2OpAdaptor::ResourceApplyFtrlV2OpAdaptor(ResourceApplyFtrlV2Op &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange ResourceApplyFtrlV2OpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> ResourceApplyFtrlV2OpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange ResourceApplyFtrlV2OpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ResourceApplyFtrlV2OpAdaptor::var() {
  return *getODSOperands(0).begin();
}

::mlir::Value ResourceApplyFtrlV2OpAdaptor::accum() {
  return *getODSOperands(1).begin();
}

::mlir::Value ResourceApplyFtrlV2OpAdaptor::linear() {
  return *getODSOperands(2).begin();
}

::mlir::Value ResourceApplyFtrlV2OpAdaptor::grad() {
  return *getODSOperands(3).begin();
}

::mlir::Value ResourceApplyFtrlV2OpAdaptor::lr() {
  return *getODSOperands(4).begin();
}

::mlir::Value ResourceApplyFtrlV2OpAdaptor::l1() {
  return *getODSOperands(5).begin();
}

::mlir::Value ResourceApplyFtrlV2OpAdaptor::l2() {
  return *getODSOperands(6).begin();
}

::mlir::Value ResourceApplyFtrlV2OpAdaptor::l2_shrinkage() {
  return *getODSOperands(7).begin();
}

::mlir::Value ResourceApplyFtrlV2OpAdaptor::lr_power() {
  return *getODSOperands(8).begin();
}

::mlir::DictionaryAttr ResourceApplyFtrlV2OpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::BoolAttr ResourceApplyFtrlV2OpAdaptor::use_locking() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("use_locking").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(false);
  return attr;
}

::mlir::BoolAttr ResourceApplyFtrlV2OpAdaptor::multiply_linear_by_lr() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("multiply_linear_by_lr").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(false);
  return attr;
}

::mlir::LogicalResult ResourceApplyFtrlV2OpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_use_locking = odsAttrs.get("use_locking");
    if (tblgen_use_locking && !((tblgen_use_locking.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.ResourceApplyFtrlV2' op ""attribute 'use_locking' failed to satisfy constraint: bool attribute");
  }
  {
    auto tblgen_multiply_linear_by_lr = odsAttrs.get("multiply_linear_by_lr");
    if (tblgen_multiply_linear_by_lr && !((tblgen_multiply_linear_by_lr.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.ResourceApplyFtrlV2' op ""attribute 'multiply_linear_by_lr' failed to satisfy constraint: bool attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> ResourceApplyFtrlV2Op::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range ResourceApplyFtrlV2Op::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ResourceApplyFtrlV2Op::var() {
  return *getODSOperands(0).begin();
}

::mlir::Value ResourceApplyFtrlV2Op::accum() {
  return *getODSOperands(1).begin();
}

::mlir::Value ResourceApplyFtrlV2Op::linear() {
  return *getODSOperands(2).begin();
}

::mlir::Value ResourceApplyFtrlV2Op::grad() {
  return *getODSOperands(3).begin();
}

::mlir::Value ResourceApplyFtrlV2Op::lr() {
  return *getODSOperands(4).begin();
}

::mlir::Value ResourceApplyFtrlV2Op::l1() {
  return *getODSOperands(5).begin();
}

::mlir::Value ResourceApplyFtrlV2Op::l2() {
  return *getODSOperands(6).begin();
}

::mlir::Value ResourceApplyFtrlV2Op::l2_shrinkage() {
  return *getODSOperands(7).begin();
}

::mlir::Value ResourceApplyFtrlV2Op::lr_power() {
  return *getODSOperands(8).begin();
}

::mlir::MutableOperandRange ResourceApplyFtrlV2Op::varMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ResourceApplyFtrlV2Op::accumMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ResourceApplyFtrlV2Op::linearMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ResourceApplyFtrlV2Op::gradMutable() {
  auto range = getODSOperandIndexAndLength(3);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ResourceApplyFtrlV2Op::lrMutable() {
  auto range = getODSOperandIndexAndLength(4);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ResourceApplyFtrlV2Op::l1Mutable() {
  auto range = getODSOperandIndexAndLength(5);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ResourceApplyFtrlV2Op::l2Mutable() {
  auto range = getODSOperandIndexAndLength(6);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ResourceApplyFtrlV2Op::l2_shrinkageMutable() {
  auto range = getODSOperandIndexAndLength(7);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ResourceApplyFtrlV2Op::lr_powerMutable() {
  auto range = getODSOperandIndexAndLength(8);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> ResourceApplyFtrlV2Op::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range ResourceApplyFtrlV2Op::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::BoolAttr ResourceApplyFtrlV2Op::use_lockingAttr() {
  return (*this)->getAttr(use_lockingAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool ResourceApplyFtrlV2Op::use_locking() {
  auto attr = use_lockingAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(false).getValue();
  return attr.getValue();
}

::mlir::BoolAttr ResourceApplyFtrlV2Op::multiply_linear_by_lrAttr() {
  return (*this)->getAttr(multiply_linear_by_lrAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool ResourceApplyFtrlV2Op::multiply_linear_by_lr() {
  auto attr = multiply_linear_by_lrAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(false).getValue();
  return attr.getValue();
}

::mlir::Type ResourceApplyFtrlV2Op::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(3).begin());
}

bool ResourceApplyFtrlV2Op::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr ResourceApplyFtrlV2Op::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void ResourceApplyFtrlV2Op::use_lockingAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(use_lockingAttrName(), attr);
}

void ResourceApplyFtrlV2Op::multiply_linear_by_lrAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(multiply_linear_by_lrAttrName(), attr);
}

void ResourceApplyFtrlV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value var, ::mlir::Value accum, ::mlir::Value linear, ::mlir::Value grad, ::mlir::Value lr, ::mlir::Value l1, ::mlir::Value l2, ::mlir::Value l2_shrinkage, ::mlir::Value lr_power, ::mlir::BoolAttr use_locking, ::mlir::BoolAttr multiply_linear_by_lr) {
  odsState.addOperands(var);
  odsState.addOperands(accum);
  odsState.addOperands(linear);
  odsState.addOperands(grad);
  odsState.addOperands(lr);
  odsState.addOperands(l1);
  odsState.addOperands(l2);
  odsState.addOperands(l2_shrinkage);
  odsState.addOperands(lr_power);
  odsState.addAttribute(use_lockingAttrName(odsState.name), use_locking);
  odsState.addAttribute(multiply_linear_by_lrAttrName(odsState.name), multiply_linear_by_lr);
}

void ResourceApplyFtrlV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value var, ::mlir::Value accum, ::mlir::Value linear, ::mlir::Value grad, ::mlir::Value lr, ::mlir::Value l1, ::mlir::Value l2, ::mlir::Value l2_shrinkage, ::mlir::Value lr_power, ::mlir::BoolAttr use_locking, ::mlir::BoolAttr multiply_linear_by_lr) {
  odsState.addOperands(var);
  odsState.addOperands(accum);
  odsState.addOperands(linear);
  odsState.addOperands(grad);
  odsState.addOperands(lr);
  odsState.addOperands(l1);
  odsState.addOperands(l2);
  odsState.addOperands(l2_shrinkage);
  odsState.addOperands(lr_power);
  odsState.addAttribute(use_lockingAttrName(odsState.name), use_locking);
  odsState.addAttribute(multiply_linear_by_lrAttrName(odsState.name), multiply_linear_by_lr);
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void ResourceApplyFtrlV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value var, ::mlir::Value accum, ::mlir::Value linear, ::mlir::Value grad, ::mlir::Value lr, ::mlir::Value l1, ::mlir::Value l2, ::mlir::Value l2_shrinkage, ::mlir::Value lr_power, bool use_locking, bool multiply_linear_by_lr) {
  odsState.addOperands(var);
  odsState.addOperands(accum);
  odsState.addOperands(linear);
  odsState.addOperands(grad);
  odsState.addOperands(lr);
  odsState.addOperands(l1);
  odsState.addOperands(l2);
  odsState.addOperands(l2_shrinkage);
  odsState.addOperands(lr_power);
  odsState.addAttribute(use_lockingAttrName(odsState.name), odsBuilder.getBoolAttr(use_locking));
  odsState.addAttribute(multiply_linear_by_lrAttrName(odsState.name), odsBuilder.getBoolAttr(multiply_linear_by_lr));
}

void ResourceApplyFtrlV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value var, ::mlir::Value accum, ::mlir::Value linear, ::mlir::Value grad, ::mlir::Value lr, ::mlir::Value l1, ::mlir::Value l2, ::mlir::Value l2_shrinkage, ::mlir::Value lr_power, bool use_locking, bool multiply_linear_by_lr) {
  odsState.addOperands(var);
  odsState.addOperands(accum);
  odsState.addOperands(linear);
  odsState.addOperands(grad);
  odsState.addOperands(lr);
  odsState.addOperands(l1);
  odsState.addOperands(l2);
  odsState.addOperands(l2_shrinkage);
  odsState.addOperands(lr_power);
  odsState.addAttribute(use_lockingAttrName(odsState.name), odsBuilder.getBoolAttr(use_locking));
  odsState.addAttribute(multiply_linear_by_lrAttrName(odsState.name), odsBuilder.getBoolAttr(multiply_linear_by_lr));
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void ResourceApplyFtrlV2Op::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 9u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 0u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult ResourceApplyFtrlV2Op::verify() {
  {
    auto tblgen_use_locking = (*this)->getAttr(use_lockingAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_use_locking, "use_locking")))
      return ::mlir::failure();
  }
  {
    auto tblgen_multiply_linear_by_lr = (*this)->getAttr(multiply_linear_by_lrAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_multiply_linear_by_lr, "multiply_linear_by_lr")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup3 = getODSOperands(3);

    for (auto v : valueGroup3) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup4 = getODSOperands(4);

    for (auto v : valueGroup4) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup5 = getODSOperands(5);

    for (auto v : valueGroup5) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup6 = getODSOperands(6);

    for (auto v : valueGroup6) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup7 = getODSOperands(7);

    for (auto v : valueGroup7) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup8 = getODSOperands(8);

    for (auto v : valueGroup8) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void ResourceApplyFtrlV2Op::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  for (::mlir::Value value : getODSOperands(0))
    effects.emplace_back(::mlir::MemoryEffects::Read::get(), value, ::mlir::TF::ResourceEffects::Variable::get());
  for (::mlir::Value value : getODSOperands(0))
    effects.emplace_back(::mlir::MemoryEffects::Write::get(), value, ::mlir::TF::ResourceEffects::Variable::get());
  for (::mlir::Value value : getODSOperands(1))
    effects.emplace_back(::mlir::MemoryEffects::Read::get(), value, ::mlir::TF::ResourceEffects::Variable::get());
  for (::mlir::Value value : getODSOperands(1))
    effects.emplace_back(::mlir::MemoryEffects::Write::get(), value, ::mlir::TF::ResourceEffects::Variable::get());
  for (::mlir::Value value : getODSOperands(2))
    effects.emplace_back(::mlir::MemoryEffects::Read::get(), value, ::mlir::TF::ResourceEffects::Variable::get());
  for (::mlir::Value value : getODSOperands(2))
    effects.emplace_back(::mlir::MemoryEffects::Write::get(), value, ::mlir::TF::ResourceEffects::Variable::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::ResourceApplyFtrlV2Op)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::ResourceApplyGradientDescentOp definitions
//===----------------------------------------------------------------------===//

ResourceApplyGradientDescentOpAdaptor::ResourceApplyGradientDescentOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

ResourceApplyGradientDescentOpAdaptor::ResourceApplyGradientDescentOpAdaptor(ResourceApplyGradientDescentOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange ResourceApplyGradientDescentOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> ResourceApplyGradientDescentOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange ResourceApplyGradientDescentOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ResourceApplyGradientDescentOpAdaptor::var() {
  return *getODSOperands(0).begin();
}

::mlir::Value ResourceApplyGradientDescentOpAdaptor::alpha() {
  return *getODSOperands(1).begin();
}

::mlir::Value ResourceApplyGradientDescentOpAdaptor::delta() {
  return *getODSOperands(2).begin();
}

::mlir::DictionaryAttr ResourceApplyGradientDescentOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::BoolAttr ResourceApplyGradientDescentOpAdaptor::use_locking() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("use_locking").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(false);
  return attr;
}

::mlir::LogicalResult ResourceApplyGradientDescentOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_use_locking = odsAttrs.get("use_locking");
    if (tblgen_use_locking && !((tblgen_use_locking.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.ResourceApplyGradientDescent' op ""attribute 'use_locking' failed to satisfy constraint: bool attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> ResourceApplyGradientDescentOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range ResourceApplyGradientDescentOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ResourceApplyGradientDescentOp::var() {
  return *getODSOperands(0).begin();
}

::mlir::Value ResourceApplyGradientDescentOp::alpha() {
  return *getODSOperands(1).begin();
}

::mlir::Value ResourceApplyGradientDescentOp::delta() {
  return *getODSOperands(2).begin();
}

::mlir::MutableOperandRange ResourceApplyGradientDescentOp::varMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ResourceApplyGradientDescentOp::alphaMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ResourceApplyGradientDescentOp::deltaMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> ResourceApplyGradientDescentOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range ResourceApplyGradientDescentOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::BoolAttr ResourceApplyGradientDescentOp::use_lockingAttr() {
  return (*this)->getAttr(use_lockingAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool ResourceApplyGradientDescentOp::use_locking() {
  auto attr = use_lockingAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(false).getValue();
  return attr.getValue();
}

::mlir::Type ResourceApplyGradientDescentOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(1).begin());
}

bool ResourceApplyGradientDescentOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr ResourceApplyGradientDescentOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void ResourceApplyGradientDescentOp::use_lockingAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(use_lockingAttrName(), attr);
}

void ResourceApplyGradientDescentOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value var, ::mlir::Value alpha, ::mlir::Value delta, ::mlir::BoolAttr use_locking) {
  odsState.addOperands(var);
  odsState.addOperands(alpha);
  odsState.addOperands(delta);
  odsState.addAttribute(use_lockingAttrName(odsState.name), use_locking);
}

void ResourceApplyGradientDescentOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value var, ::mlir::Value alpha, ::mlir::Value delta, ::mlir::BoolAttr use_locking) {
  odsState.addOperands(var);
  odsState.addOperands(alpha);
  odsState.addOperands(delta);
  odsState.addAttribute(use_lockingAttrName(odsState.name), use_locking);
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void ResourceApplyGradientDescentOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value var, ::mlir::Value alpha, ::mlir::Value delta, bool use_locking) {
  odsState.addOperands(var);
  odsState.addOperands(alpha);
  odsState.addOperands(delta);
  odsState.addAttribute(use_lockingAttrName(odsState.name), odsBuilder.getBoolAttr(use_locking));
}

void ResourceApplyGradientDescentOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value var, ::mlir::Value alpha, ::mlir::Value delta, bool use_locking) {
  odsState.addOperands(var);
  odsState.addOperands(alpha);
  odsState.addOperands(delta);
  odsState.addAttribute(use_lockingAttrName(odsState.name), odsBuilder.getBoolAttr(use_locking));
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void ResourceApplyGradientDescentOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 3u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 0u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult ResourceApplyGradientDescentOp::verify() {
  {
    auto tblgen_use_locking = (*this)->getAttr(use_lockingAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_use_locking, "use_locking")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void ResourceApplyGradientDescentOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  for (::mlir::Value value : getODSOperands(0))
    effects.emplace_back(::mlir::MemoryEffects::Read::get(), value, ::mlir::TF::ResourceEffects::Variable::get());
  for (::mlir::Value value : getODSOperands(0))
    effects.emplace_back(::mlir::MemoryEffects::Write::get(), value, ::mlir::TF::ResourceEffects::Variable::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::ResourceApplyGradientDescentOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::ResourceApplyKerasMomentumOp definitions
//===----------------------------------------------------------------------===//

ResourceApplyKerasMomentumOpAdaptor::ResourceApplyKerasMomentumOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

ResourceApplyKerasMomentumOpAdaptor::ResourceApplyKerasMomentumOpAdaptor(ResourceApplyKerasMomentumOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange ResourceApplyKerasMomentumOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> ResourceApplyKerasMomentumOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange ResourceApplyKerasMomentumOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ResourceApplyKerasMomentumOpAdaptor::var() {
  return *getODSOperands(0).begin();
}

::mlir::Value ResourceApplyKerasMomentumOpAdaptor::accum() {
  return *getODSOperands(1).begin();
}

::mlir::Value ResourceApplyKerasMomentumOpAdaptor::lr() {
  return *getODSOperands(2).begin();
}

::mlir::Value ResourceApplyKerasMomentumOpAdaptor::grad() {
  return *getODSOperands(3).begin();
}

::mlir::Value ResourceApplyKerasMomentumOpAdaptor::momentum() {
  return *getODSOperands(4).begin();
}

::mlir::DictionaryAttr ResourceApplyKerasMomentumOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::BoolAttr ResourceApplyKerasMomentumOpAdaptor::use_locking() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("use_locking").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(false);
  return attr;
}

::mlir::BoolAttr ResourceApplyKerasMomentumOpAdaptor::use_nesterov() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("use_nesterov").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(false);
  return attr;
}

::mlir::LogicalResult ResourceApplyKerasMomentumOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_use_locking = odsAttrs.get("use_locking");
    if (tblgen_use_locking && !((tblgen_use_locking.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.ResourceApplyKerasMomentum' op ""attribute 'use_locking' failed to satisfy constraint: bool attribute");
  }
  {
    auto tblgen_use_nesterov = odsAttrs.get("use_nesterov");
    if (tblgen_use_nesterov && !((tblgen_use_nesterov.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.ResourceApplyKerasMomentum' op ""attribute 'use_nesterov' failed to satisfy constraint: bool attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> ResourceApplyKerasMomentumOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range ResourceApplyKerasMomentumOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ResourceApplyKerasMomentumOp::var() {
  return *getODSOperands(0).begin();
}

::mlir::Value ResourceApplyKerasMomentumOp::accum() {
  return *getODSOperands(1).begin();
}

::mlir::Value ResourceApplyKerasMomentumOp::lr() {
  return *getODSOperands(2).begin();
}

::mlir::Value ResourceApplyKerasMomentumOp::grad() {
  return *getODSOperands(3).begin();
}

::mlir::Value ResourceApplyKerasMomentumOp::momentum() {
  return *getODSOperands(4).begin();
}

::mlir::MutableOperandRange ResourceApplyKerasMomentumOp::varMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ResourceApplyKerasMomentumOp::accumMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ResourceApplyKerasMomentumOp::lrMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ResourceApplyKerasMomentumOp::gradMutable() {
  auto range = getODSOperandIndexAndLength(3);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ResourceApplyKerasMomentumOp::momentumMutable() {
  auto range = getODSOperandIndexAndLength(4);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> ResourceApplyKerasMomentumOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range ResourceApplyKerasMomentumOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::BoolAttr ResourceApplyKerasMomentumOp::use_lockingAttr() {
  return (*this)->getAttr(use_lockingAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool ResourceApplyKerasMomentumOp::use_locking() {
  auto attr = use_lockingAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(false).getValue();
  return attr.getValue();
}

::mlir::BoolAttr ResourceApplyKerasMomentumOp::use_nesterovAttr() {
  return (*this)->getAttr(use_nesterovAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool ResourceApplyKerasMomentumOp::use_nesterov() {
  auto attr = use_nesterovAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(false).getValue();
  return attr.getValue();
}

::mlir::Type ResourceApplyKerasMomentumOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(2).begin());
}

bool ResourceApplyKerasMomentumOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr ResourceApplyKerasMomentumOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void ResourceApplyKerasMomentumOp::use_lockingAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(use_lockingAttrName(), attr);
}

void ResourceApplyKerasMomentumOp::use_nesterovAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(use_nesterovAttrName(), attr);
}

void ResourceApplyKerasMomentumOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value var, ::mlir::Value accum, ::mlir::Value lr, ::mlir::Value grad, ::mlir::Value momentum, ::mlir::BoolAttr use_locking, ::mlir::BoolAttr use_nesterov) {
  odsState.addOperands(var);
  odsState.addOperands(accum);
  odsState.addOperands(lr);
  odsState.addOperands(grad);
  odsState.addOperands(momentum);
  odsState.addAttribute(use_lockingAttrName(odsState.name), use_locking);
  odsState.addAttribute(use_nesterovAttrName(odsState.name), use_nesterov);
}

void ResourceApplyKerasMomentumOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value var, ::mlir::Value accum, ::mlir::Value lr, ::mlir::Value grad, ::mlir::Value momentum, ::mlir::BoolAttr use_locking, ::mlir::BoolAttr use_nesterov) {
  odsState.addOperands(var);
  odsState.addOperands(accum);
  odsState.addOperands(lr);
  odsState.addOperands(grad);
  odsState.addOperands(momentum);
  odsState.addAttribute(use_lockingAttrName(odsState.name), use_locking);
  odsState.addAttribute(use_nesterovAttrName(odsState.name), use_nesterov);
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void ResourceApplyKerasMomentumOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value var, ::mlir::Value accum, ::mlir::Value lr, ::mlir::Value grad, ::mlir::Value momentum, bool use_locking, bool use_nesterov) {
  odsState.addOperands(var);
  odsState.addOperands(accum);
  odsState.addOperands(lr);
  odsState.addOperands(grad);
  odsState.addOperands(momentum);
  odsState.addAttribute(use_lockingAttrName(odsState.name), odsBuilder.getBoolAttr(use_locking));
  odsState.addAttribute(use_nesterovAttrName(odsState.name), odsBuilder.getBoolAttr(use_nesterov));
}

void ResourceApplyKerasMomentumOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value var, ::mlir::Value accum, ::mlir::Value lr, ::mlir::Value grad, ::mlir::Value momentum, bool use_locking, bool use_nesterov) {
  odsState.addOperands(var);
  odsState.addOperands(accum);
  odsState.addOperands(lr);
  odsState.addOperands(grad);
  odsState.addOperands(momentum);
  odsState.addAttribute(use_lockingAttrName(odsState.name), odsBuilder.getBoolAttr(use_locking));
  odsState.addAttribute(use_nesterovAttrName(odsState.name), odsBuilder.getBoolAttr(use_nesterov));
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void ResourceApplyKerasMomentumOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 5u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 0u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult ResourceApplyKerasMomentumOp::verify() {
  {
    auto tblgen_use_locking = (*this)->getAttr(use_lockingAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_use_locking, "use_locking")))
      return ::mlir::failure();
  }
  {
    auto tblgen_use_nesterov = (*this)->getAttr(use_nesterovAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_use_nesterov, "use_nesterov")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup3 = getODSOperands(3);

    for (auto v : valueGroup3) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup4 = getODSOperands(4);

    for (auto v : valueGroup4) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void ResourceApplyKerasMomentumOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  for (::mlir::Value value : getODSOperands(0))
    effects.emplace_back(::mlir::MemoryEffects::Read::get(), value, ::mlir::TF::ResourceEffects::Variable::get());
  for (::mlir::Value value : getODSOperands(0))
    effects.emplace_back(::mlir::MemoryEffects::Write::get(), value, ::mlir::TF::ResourceEffects::Variable::get());
  for (::mlir::Value value : getODSOperands(1))
    effects.emplace_back(::mlir::MemoryEffects::Read::get(), value, ::mlir::TF::ResourceEffects::Variable::get());
  for (::mlir::Value value : getODSOperands(1))
    effects.emplace_back(::mlir::MemoryEffects::Write::get(), value, ::mlir::TF::ResourceEffects::Variable::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::ResourceApplyKerasMomentumOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::ResourceApplyMomentumOp definitions
//===----------------------------------------------------------------------===//

ResourceApplyMomentumOpAdaptor::ResourceApplyMomentumOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

ResourceApplyMomentumOpAdaptor::ResourceApplyMomentumOpAdaptor(ResourceApplyMomentumOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange ResourceApplyMomentumOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> ResourceApplyMomentumOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange ResourceApplyMomentumOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ResourceApplyMomentumOpAdaptor::var() {
  return *getODSOperands(0).begin();
}

::mlir::Value ResourceApplyMomentumOpAdaptor::accum() {
  return *getODSOperands(1).begin();
}

::mlir::Value ResourceApplyMomentumOpAdaptor::lr() {
  return *getODSOperands(2).begin();
}

::mlir::Value ResourceApplyMomentumOpAdaptor::grad() {
  return *getODSOperands(3).begin();
}

::mlir::Value ResourceApplyMomentumOpAdaptor::momentum() {
  return *getODSOperands(4).begin();
}

::mlir::DictionaryAttr ResourceApplyMomentumOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::BoolAttr ResourceApplyMomentumOpAdaptor::use_locking() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("use_locking").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(false);
  return attr;
}

::mlir::BoolAttr ResourceApplyMomentumOpAdaptor::use_nesterov() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("use_nesterov").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(false);
  return attr;
}

::mlir::LogicalResult ResourceApplyMomentumOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_use_locking = odsAttrs.get("use_locking");
    if (tblgen_use_locking && !((tblgen_use_locking.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.ResourceApplyMomentum' op ""attribute 'use_locking' failed to satisfy constraint: bool attribute");
  }
  {
    auto tblgen_use_nesterov = odsAttrs.get("use_nesterov");
    if (tblgen_use_nesterov && !((tblgen_use_nesterov.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.ResourceApplyMomentum' op ""attribute 'use_nesterov' failed to satisfy constraint: bool attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> ResourceApplyMomentumOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range ResourceApplyMomentumOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ResourceApplyMomentumOp::var() {
  return *getODSOperands(0).begin();
}

::mlir::Value ResourceApplyMomentumOp::accum() {
  return *getODSOperands(1).begin();
}

::mlir::Value ResourceApplyMomentumOp::lr() {
  return *getODSOperands(2).begin();
}

::mlir::Value ResourceApplyMomentumOp::grad() {
  return *getODSOperands(3).begin();
}

::mlir::Value ResourceApplyMomentumOp::momentum() {
  return *getODSOperands(4).begin();
}

::mlir::MutableOperandRange ResourceApplyMomentumOp::varMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ResourceApplyMomentumOp::accumMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ResourceApplyMomentumOp::lrMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ResourceApplyMomentumOp::gradMutable() {
  auto range = getODSOperandIndexAndLength(3);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ResourceApplyMomentumOp::momentumMutable() {
  auto range = getODSOperandIndexAndLength(4);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> ResourceApplyMomentumOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range ResourceApplyMomentumOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::BoolAttr ResourceApplyMomentumOp::use_lockingAttr() {
  return (*this)->getAttr(use_lockingAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool ResourceApplyMomentumOp::use_locking() {
  auto attr = use_lockingAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(false).getValue();
  return attr.getValue();
}

::mlir::BoolAttr ResourceApplyMomentumOp::use_nesterovAttr() {
  return (*this)->getAttr(use_nesterovAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool ResourceApplyMomentumOp::use_nesterov() {
  auto attr = use_nesterovAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(false).getValue();
  return attr.getValue();
}

::mlir::Type ResourceApplyMomentumOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(2).begin());
}

bool ResourceApplyMomentumOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr ResourceApplyMomentumOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void ResourceApplyMomentumOp::use_lockingAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(use_lockingAttrName(), attr);
}

void ResourceApplyMomentumOp::use_nesterovAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(use_nesterovAttrName(), attr);
}

void ResourceApplyMomentumOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value var, ::mlir::Value accum, ::mlir::Value lr, ::mlir::Value grad, ::mlir::Value momentum, ::mlir::BoolAttr use_locking, ::mlir::BoolAttr use_nesterov) {
  odsState.addOperands(var);
  odsState.addOperands(accum);
  odsState.addOperands(lr);
  odsState.addOperands(grad);
  odsState.addOperands(momentum);
  odsState.addAttribute(use_lockingAttrName(odsState.name), use_locking);
  odsState.addAttribute(use_nesterovAttrName(odsState.name), use_nesterov);
}

void ResourceApplyMomentumOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value var, ::mlir::Value accum, ::mlir::Value lr, ::mlir::Value grad, ::mlir::Value momentum, ::mlir::BoolAttr use_locking, ::mlir::BoolAttr use_nesterov) {
  odsState.addOperands(var);
  odsState.addOperands(accum);
  odsState.addOperands(lr);
  odsState.addOperands(grad);
  odsState.addOperands(momentum);
  odsState.addAttribute(use_lockingAttrName(odsState.name), use_locking);
  odsState.addAttribute(use_nesterovAttrName(odsState.name), use_nesterov);
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void ResourceApplyMomentumOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value var, ::mlir::Value accum, ::mlir::Value lr, ::mlir::Value grad, ::mlir::Value momentum, bool use_locking, bool use_nesterov) {
  odsState.addOperands(var);
  odsState.addOperands(accum);
  odsState.addOperands(lr);
  odsState.addOperands(grad);
  odsState.addOperands(momentum);
  odsState.addAttribute(use_lockingAttrName(odsState.name), odsBuilder.getBoolAttr(use_locking));
  odsState.addAttribute(use_nesterovAttrName(odsState.name), odsBuilder.getBoolAttr(use_nesterov));
}

void ResourceApplyMomentumOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value var, ::mlir::Value accum, ::mlir::Value lr, ::mlir::Value grad, ::mlir::Value momentum, bool use_locking, bool use_nesterov) {
  odsState.addOperands(var);
  odsState.addOperands(accum);
  odsState.addOperands(lr);
  odsState.addOperands(grad);
  odsState.addOperands(momentum);
  odsState.addAttribute(use_lockingAttrName(odsState.name), odsBuilder.getBoolAttr(use_locking));
  odsState.addAttribute(use_nesterovAttrName(odsState.name), odsBuilder.getBoolAttr(use_nesterov));
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void ResourceApplyMomentumOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 5u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 0u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult ResourceApplyMomentumOp::verify() {
  {
    auto tblgen_use_locking = (*this)->getAttr(use_lockingAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_use_locking, "use_locking")))
      return ::mlir::failure();
  }
  {
    auto tblgen_use_nesterov = (*this)->getAttr(use_nesterovAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_use_nesterov, "use_nesterov")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup3 = getODSOperands(3);

    for (auto v : valueGroup3) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup4 = getODSOperands(4);

    for (auto v : valueGroup4) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void ResourceApplyMomentumOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  for (::mlir::Value value : getODSOperands(0))
    effects.emplace_back(::mlir::MemoryEffects::Read::get(), value, ::mlir::TF::ResourceEffects::Variable::get());
  for (::mlir::Value value : getODSOperands(0))
    effects.emplace_back(::mlir::MemoryEffects::Write::get(), value, ::mlir::TF::ResourceEffects::Variable::get());
  for (::mlir::Value value : getODSOperands(1))
    effects.emplace_back(::mlir::MemoryEffects::Read::get(), value, ::mlir::TF::ResourceEffects::Variable::get());
  for (::mlir::Value value : getODSOperands(1))
    effects.emplace_back(::mlir::MemoryEffects::Write::get(), value, ::mlir::TF::ResourceEffects::Variable::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::ResourceApplyMomentumOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::ResourceApplyPowerSignOp definitions
//===----------------------------------------------------------------------===//

ResourceApplyPowerSignOpAdaptor::ResourceApplyPowerSignOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

ResourceApplyPowerSignOpAdaptor::ResourceApplyPowerSignOpAdaptor(ResourceApplyPowerSignOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange ResourceApplyPowerSignOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> ResourceApplyPowerSignOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange ResourceApplyPowerSignOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ResourceApplyPowerSignOpAdaptor::var() {
  return *getODSOperands(0).begin();
}

::mlir::Value ResourceApplyPowerSignOpAdaptor::m() {
  return *getODSOperands(1).begin();
}

::mlir::Value ResourceApplyPowerSignOpAdaptor::lr() {
  return *getODSOperands(2).begin();
}

::mlir::Value ResourceApplyPowerSignOpAdaptor::logbase() {
  return *getODSOperands(3).begin();
}

::mlir::Value ResourceApplyPowerSignOpAdaptor::sign_decay() {
  return *getODSOperands(4).begin();
}

::mlir::Value ResourceApplyPowerSignOpAdaptor::beta() {
  return *getODSOperands(5).begin();
}

::mlir::Value ResourceApplyPowerSignOpAdaptor::grad() {
  return *getODSOperands(6).begin();
}

::mlir::DictionaryAttr ResourceApplyPowerSignOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::BoolAttr ResourceApplyPowerSignOpAdaptor::use_locking() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("use_locking").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(false);
  return attr;
}

::mlir::LogicalResult ResourceApplyPowerSignOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_use_locking = odsAttrs.get("use_locking");
    if (tblgen_use_locking && !((tblgen_use_locking.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.ResourceApplyPowerSign' op ""attribute 'use_locking' failed to satisfy constraint: bool attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> ResourceApplyPowerSignOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range ResourceApplyPowerSignOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ResourceApplyPowerSignOp::var() {
  return *getODSOperands(0).begin();
}

::mlir::Value ResourceApplyPowerSignOp::m() {
  return *getODSOperands(1).begin();
}

::mlir::Value ResourceApplyPowerSignOp::lr() {
  return *getODSOperands(2).begin();
}

::mlir::Value ResourceApplyPowerSignOp::logbase() {
  return *getODSOperands(3).begin();
}

::mlir::Value ResourceApplyPowerSignOp::sign_decay() {
  return *getODSOperands(4).begin();
}

::mlir::Value ResourceApplyPowerSignOp::beta() {
  return *getODSOperands(5).begin();
}

::mlir::Value ResourceApplyPowerSignOp::grad() {
  return *getODSOperands(6).begin();
}

::mlir::MutableOperandRange ResourceApplyPowerSignOp::varMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ResourceApplyPowerSignOp::mMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ResourceApplyPowerSignOp::lrMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ResourceApplyPowerSignOp::logbaseMutable() {
  auto range = getODSOperandIndexAndLength(3);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ResourceApplyPowerSignOp::sign_decayMutable() {
  auto range = getODSOperandIndexAndLength(4);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ResourceApplyPowerSignOp::betaMutable() {
  auto range = getODSOperandIndexAndLength(5);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ResourceApplyPowerSignOp::gradMutable() {
  auto range = getODSOperandIndexAndLength(6);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> ResourceApplyPowerSignOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range ResourceApplyPowerSignOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::BoolAttr ResourceApplyPowerSignOp::use_lockingAttr() {
  return (*this)->getAttr(use_lockingAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool ResourceApplyPowerSignOp::use_locking() {
  auto attr = use_lockingAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(false).getValue();
  return attr.getValue();
}

::mlir::Type ResourceApplyPowerSignOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(2).begin());
}

bool ResourceApplyPowerSignOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr ResourceApplyPowerSignOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void ResourceApplyPowerSignOp::use_lockingAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(use_lockingAttrName(), attr);
}

void ResourceApplyPowerSignOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value var, ::mlir::Value m, ::mlir::Value lr, ::mlir::Value logbase, ::mlir::Value sign_decay, ::mlir::Value beta, ::mlir::Value grad, ::mlir::BoolAttr use_locking) {
  odsState.addOperands(var);
  odsState.addOperands(m);
  odsState.addOperands(lr);
  odsState.addOperands(logbase);
  odsState.addOperands(sign_decay);
  odsState.addOperands(beta);
  odsState.addOperands(grad);
  odsState.addAttribute(use_lockingAttrName(odsState.name), use_locking);
}

void ResourceApplyPowerSignOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value var, ::mlir::Value m, ::mlir::Value lr, ::mlir::Value logbase, ::mlir::Value sign_decay, ::mlir::Value beta, ::mlir::Value grad, ::mlir::BoolAttr use_locking) {
  odsState.addOperands(var);
  odsState.addOperands(m);
  odsState.addOperands(lr);
  odsState.addOperands(logbase);
  odsState.addOperands(sign_decay);
  odsState.addOperands(beta);
  odsState.addOperands(grad);
  odsState.addAttribute(use_lockingAttrName(odsState.name), use_locking);
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void ResourceApplyPowerSignOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value var, ::mlir::Value m, ::mlir::Value lr, ::mlir::Value logbase, ::mlir::Value sign_decay, ::mlir::Value beta, ::mlir::Value grad, bool use_locking) {
  odsState.addOperands(var);
  odsState.addOperands(m);
  odsState.addOperands(lr);
  odsState.addOperands(logbase);
  odsState.addOperands(sign_decay);
  odsState.addOperands(beta);
  odsState.addOperands(grad);
  odsState.addAttribute(use_lockingAttrName(odsState.name), odsBuilder.getBoolAttr(use_locking));
}

void ResourceApplyPowerSignOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value var, ::mlir::Value m, ::mlir::Value lr, ::mlir::Value logbase, ::mlir::Value sign_decay, ::mlir::Value beta, ::mlir::Value grad, bool use_locking) {
  odsState.addOperands(var);
  odsState.addOperands(m);
  odsState.addOperands(lr);
  odsState.addOperands(logbase);
  odsState.addOperands(sign_decay);
  odsState.addOperands(beta);
  odsState.addOperands(grad);
  odsState.addAttribute(use_lockingAttrName(odsState.name), odsBuilder.getBoolAttr(use_locking));
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void ResourceApplyPowerSignOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 7u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 0u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult ResourceApplyPowerSignOp::verify() {
  {
    auto tblgen_use_locking = (*this)->getAttr(use_lockingAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_use_locking, "use_locking")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup3 = getODSOperands(3);

    for (auto v : valueGroup3) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup4 = getODSOperands(4);

    for (auto v : valueGroup4) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup5 = getODSOperands(5);

    for (auto v : valueGroup5) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup6 = getODSOperands(6);

    for (auto v : valueGroup6) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void ResourceApplyPowerSignOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  for (::mlir::Value value : getODSOperands(0))
    effects.emplace_back(::mlir::MemoryEffects::Read::get(), value, ::mlir::TF::ResourceEffects::Variable::get());
  for (::mlir::Value value : getODSOperands(0))
    effects.emplace_back(::mlir::MemoryEffects::Write::get(), value, ::mlir::TF::ResourceEffects::Variable::get());
  for (::mlir::Value value : getODSOperands(1))
    effects.emplace_back(::mlir::MemoryEffects::Read::get(), value, ::mlir::TF::ResourceEffects::Variable::get());
  for (::mlir::Value value : getODSOperands(1))
    effects.emplace_back(::mlir::MemoryEffects::Write::get(), value, ::mlir::TF::ResourceEffects::Variable::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::ResourceApplyPowerSignOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::ResourceApplyProximalAdagradOp definitions
//===----------------------------------------------------------------------===//

ResourceApplyProximalAdagradOpAdaptor::ResourceApplyProximalAdagradOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

ResourceApplyProximalAdagradOpAdaptor::ResourceApplyProximalAdagradOpAdaptor(ResourceApplyProximalAdagradOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange ResourceApplyProximalAdagradOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> ResourceApplyProximalAdagradOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange ResourceApplyProximalAdagradOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ResourceApplyProximalAdagradOpAdaptor::var() {
  return *getODSOperands(0).begin();
}

::mlir::Value ResourceApplyProximalAdagradOpAdaptor::accum() {
  return *getODSOperands(1).begin();
}

::mlir::Value ResourceApplyProximalAdagradOpAdaptor::lr() {
  return *getODSOperands(2).begin();
}

::mlir::Value ResourceApplyProximalAdagradOpAdaptor::l1() {
  return *getODSOperands(3).begin();
}

::mlir::Value ResourceApplyProximalAdagradOpAdaptor::l2() {
  return *getODSOperands(4).begin();
}

::mlir::Value ResourceApplyProximalAdagradOpAdaptor::grad() {
  return *getODSOperands(5).begin();
}

::mlir::DictionaryAttr ResourceApplyProximalAdagradOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::BoolAttr ResourceApplyProximalAdagradOpAdaptor::use_locking() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("use_locking").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(false);
  return attr;
}

::mlir::LogicalResult ResourceApplyProximalAdagradOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_use_locking = odsAttrs.get("use_locking");
    if (tblgen_use_locking && !((tblgen_use_locking.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.ResourceApplyProximalAdagrad' op ""attribute 'use_locking' failed to satisfy constraint: bool attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> ResourceApplyProximalAdagradOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range ResourceApplyProximalAdagradOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ResourceApplyProximalAdagradOp::var() {
  return *getODSOperands(0).begin();
}

::mlir::Value ResourceApplyProximalAdagradOp::accum() {
  return *getODSOperands(1).begin();
}

::mlir::Value ResourceApplyProximalAdagradOp::lr() {
  return *getODSOperands(2).begin();
}

::mlir::Value ResourceApplyProximalAdagradOp::l1() {
  return *getODSOperands(3).begin();
}

::mlir::Value ResourceApplyProximalAdagradOp::l2() {
  return *getODSOperands(4).begin();
}

::mlir::Value ResourceApplyProximalAdagradOp::grad() {
  return *getODSOperands(5).begin();
}

::mlir::MutableOperandRange ResourceApplyProximalAdagradOp::varMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ResourceApplyProximalAdagradOp::accumMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ResourceApplyProximalAdagradOp::lrMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ResourceApplyProximalAdagradOp::l1Mutable() {
  auto range = getODSOperandIndexAndLength(3);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ResourceApplyProximalAdagradOp::l2Mutable() {
  auto range = getODSOperandIndexAndLength(4);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ResourceApplyProximalAdagradOp::gradMutable() {
  auto range = getODSOperandIndexAndLength(5);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> ResourceApplyProximalAdagradOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range ResourceApplyProximalAdagradOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::BoolAttr ResourceApplyProximalAdagradOp::use_lockingAttr() {
  return (*this)->getAttr(use_lockingAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool ResourceApplyProximalAdagradOp::use_locking() {
  auto attr = use_lockingAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(false).getValue();
  return attr.getValue();
}

::mlir::Type ResourceApplyProximalAdagradOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(2).begin());
}

bool ResourceApplyProximalAdagradOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr ResourceApplyProximalAdagradOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void ResourceApplyProximalAdagradOp::use_lockingAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(use_lockingAttrName(), attr);
}

void ResourceApplyProximalAdagradOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value var, ::mlir::Value accum, ::mlir::Value lr, ::mlir::Value l1, ::mlir::Value l2, ::mlir::Value grad, ::mlir::BoolAttr use_locking) {
  odsState.addOperands(var);
  odsState.addOperands(accum);
  odsState.addOperands(lr);
  odsState.addOperands(l1);
  odsState.addOperands(l2);
  odsState.addOperands(grad);
  odsState.addAttribute(use_lockingAttrName(odsState.name), use_locking);
}

void ResourceApplyProximalAdagradOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value var, ::mlir::Value accum, ::mlir::Value lr, ::mlir::Value l1, ::mlir::Value l2, ::mlir::Value grad, ::mlir::BoolAttr use_locking) {
  odsState.addOperands(var);
  odsState.addOperands(accum);
  odsState.addOperands(lr);
  odsState.addOperands(l1);
  odsState.addOperands(l2);
  odsState.addOperands(grad);
  odsState.addAttribute(use_lockingAttrName(odsState.name), use_locking);
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void ResourceApplyProximalAdagradOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value var, ::mlir::Value accum, ::mlir::Value lr, ::mlir::Value l1, ::mlir::Value l2, ::mlir::Value grad, bool use_locking) {
  odsState.addOperands(var);
  odsState.addOperands(accum);
  odsState.addOperands(lr);
  odsState.addOperands(l1);
  odsState.addOperands(l2);
  odsState.addOperands(grad);
  odsState.addAttribute(use_lockingAttrName(odsState.name), odsBuilder.getBoolAttr(use_locking));
}

void ResourceApplyProximalAdagradOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value var, ::mlir::Value accum, ::mlir::Value lr, ::mlir::Value l1, ::mlir::Value l2, ::mlir::Value grad, bool use_locking) {
  odsState.addOperands(var);
  odsState.addOperands(accum);
  odsState.addOperands(lr);
  odsState.addOperands(l1);
  odsState.addOperands(l2);
  odsState.addOperands(grad);
  odsState.addAttribute(use_lockingAttrName(odsState.name), odsBuilder.getBoolAttr(use_locking));
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void ResourceApplyProximalAdagradOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 6u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 0u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult ResourceApplyProximalAdagradOp::verify() {
  {
    auto tblgen_use_locking = (*this)->getAttr(use_lockingAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_use_locking, "use_locking")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup3 = getODSOperands(3);

    for (auto v : valueGroup3) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup4 = getODSOperands(4);

    for (auto v : valueGroup4) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup5 = getODSOperands(5);

    for (auto v : valueGroup5) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void ResourceApplyProximalAdagradOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  for (::mlir::Value value : getODSOperands(0))
    effects.emplace_back(::mlir::MemoryEffects::Read::get(), value, ::mlir::TF::ResourceEffects::Variable::get());
  for (::mlir::Value value : getODSOperands(0))
    effects.emplace_back(::mlir::MemoryEffects::Write::get(), value, ::mlir::TF::ResourceEffects::Variable::get());
  for (::mlir::Value value : getODSOperands(1))
    effects.emplace_back(::mlir::MemoryEffects::Read::get(), value, ::mlir::TF::ResourceEffects::Variable::get());
  for (::mlir::Value value : getODSOperands(1))
    effects.emplace_back(::mlir::MemoryEffects::Write::get(), value, ::mlir::TF::ResourceEffects::Variable::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::ResourceApplyProximalAdagradOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::ResourceApplyProximalGradientDescentOp definitions
//===----------------------------------------------------------------------===//

ResourceApplyProximalGradientDescentOpAdaptor::ResourceApplyProximalGradientDescentOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

ResourceApplyProximalGradientDescentOpAdaptor::ResourceApplyProximalGradientDescentOpAdaptor(ResourceApplyProximalGradientDescentOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange ResourceApplyProximalGradientDescentOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> ResourceApplyProximalGradientDescentOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange ResourceApplyProximalGradientDescentOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ResourceApplyProximalGradientDescentOpAdaptor::var() {
  return *getODSOperands(0).begin();
}

::mlir::Value ResourceApplyProximalGradientDescentOpAdaptor::alpha() {
  return *getODSOperands(1).begin();
}

::mlir::Value ResourceApplyProximalGradientDescentOpAdaptor::l1() {
  return *getODSOperands(2).begin();
}

::mlir::Value ResourceApplyProximalGradientDescentOpAdaptor::l2() {
  return *getODSOperands(3).begin();
}

::mlir::Value ResourceApplyProximalGradientDescentOpAdaptor::delta() {
  return *getODSOperands(4).begin();
}

::mlir::DictionaryAttr ResourceApplyProximalGradientDescentOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::BoolAttr ResourceApplyProximalGradientDescentOpAdaptor::use_locking() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("use_locking").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(false);
  return attr;
}

::mlir::LogicalResult ResourceApplyProximalGradientDescentOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_use_locking = odsAttrs.get("use_locking");
    if (tblgen_use_locking && !((tblgen_use_locking.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.ResourceApplyProximalGradientDescent' op ""attribute 'use_locking' failed to satisfy constraint: bool attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> ResourceApplyProximalGradientDescentOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range ResourceApplyProximalGradientDescentOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ResourceApplyProximalGradientDescentOp::var() {
  return *getODSOperands(0).begin();
}

::mlir::Value ResourceApplyProximalGradientDescentOp::alpha() {
  return *getODSOperands(1).begin();
}

::mlir::Value ResourceApplyProximalGradientDescentOp::l1() {
  return *getODSOperands(2).begin();
}

::mlir::Value ResourceApplyProximalGradientDescentOp::l2() {
  return *getODSOperands(3).begin();
}

::mlir::Value ResourceApplyProximalGradientDescentOp::delta() {
  return *getODSOperands(4).begin();
}

::mlir::MutableOperandRange ResourceApplyProximalGradientDescentOp::varMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ResourceApplyProximalGradientDescentOp::alphaMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ResourceApplyProximalGradientDescentOp::l1Mutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ResourceApplyProximalGradientDescentOp::l2Mutable() {
  auto range = getODSOperandIndexAndLength(3);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ResourceApplyProximalGradientDescentOp::deltaMutable() {
  auto range = getODSOperandIndexAndLength(4);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> ResourceApplyProximalGradientDescentOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range ResourceApplyProximalGradientDescentOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::BoolAttr ResourceApplyProximalGradientDescentOp::use_lockingAttr() {
  return (*this)->getAttr(use_lockingAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool ResourceApplyProximalGradientDescentOp::use_locking() {
  auto attr = use_lockingAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(false).getValue();
  return attr.getValue();
}

::mlir::Type ResourceApplyProximalGradientDescentOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(1).begin());
}

bool ResourceApplyProximalGradientDescentOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr ResourceApplyProximalGradientDescentOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void ResourceApplyProximalGradientDescentOp::use_lockingAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(use_lockingAttrName(), attr);
}

void ResourceApplyProximalGradientDescentOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value var, ::mlir::Value alpha, ::mlir::Value l1, ::mlir::Value l2, ::mlir::Value delta, ::mlir::BoolAttr use_locking) {
  odsState.addOperands(var);
  odsState.addOperands(alpha);
  odsState.addOperands(l1);
  odsState.addOperands(l2);
  odsState.addOperands(delta);
  odsState.addAttribute(use_lockingAttrName(odsState.name), use_locking);
}

void ResourceApplyProximalGradientDescentOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value var, ::mlir::Value alpha, ::mlir::Value l1, ::mlir::Value l2, ::mlir::Value delta, ::mlir::BoolAttr use_locking) {
  odsState.addOperands(var);
  odsState.addOperands(alpha);
  odsState.addOperands(l1);
  odsState.addOperands(l2);
  odsState.addOperands(delta);
  odsState.addAttribute(use_lockingAttrName(odsState.name), use_locking);
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void ResourceApplyProximalGradientDescentOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value var, ::mlir::Value alpha, ::mlir::Value l1, ::mlir::Value l2, ::mlir::Value delta, bool use_locking) {
  odsState.addOperands(var);
  odsState.addOperands(alpha);
  odsState.addOperands(l1);
  odsState.addOperands(l2);
  odsState.addOperands(delta);
  odsState.addAttribute(use_lockingAttrName(odsState.name), odsBuilder.getBoolAttr(use_locking));
}

void ResourceApplyProximalGradientDescentOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value var, ::mlir::Value alpha, ::mlir::Value l1, ::mlir::Value l2, ::mlir::Value delta, bool use_locking) {
  odsState.addOperands(var);
  odsState.addOperands(alpha);
  odsState.addOperands(l1);
  odsState.addOperands(l2);
  odsState.addOperands(delta);
  odsState.addAttribute(use_lockingAttrName(odsState.name), odsBuilder.getBoolAttr(use_locking));
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void ResourceApplyProximalGradientDescentOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 5u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 0u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult ResourceApplyProximalGradientDescentOp::verify() {
  {
    auto tblgen_use_locking = (*this)->getAttr(use_lockingAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_use_locking, "use_locking")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup3 = getODSOperands(3);

    for (auto v : valueGroup3) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup4 = getODSOperands(4);

    for (auto v : valueGroup4) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void ResourceApplyProximalGradientDescentOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  for (::mlir::Value value : getODSOperands(0))
    effects.emplace_back(::mlir::MemoryEffects::Read::get(), value, ::mlir::TF::ResourceEffects::Variable::get());
  for (::mlir::Value value : getODSOperands(0))
    effects.emplace_back(::mlir::MemoryEffects::Write::get(), value, ::mlir::TF::ResourceEffects::Variable::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::ResourceApplyProximalGradientDescentOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::ResourceApplyRMSPropOp definitions
//===----------------------------------------------------------------------===//

ResourceApplyRMSPropOpAdaptor::ResourceApplyRMSPropOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

ResourceApplyRMSPropOpAdaptor::ResourceApplyRMSPropOpAdaptor(ResourceApplyRMSPropOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange ResourceApplyRMSPropOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> ResourceApplyRMSPropOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange ResourceApplyRMSPropOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ResourceApplyRMSPropOpAdaptor::var() {
  return *getODSOperands(0).begin();
}

::mlir::Value ResourceApplyRMSPropOpAdaptor::ms() {
  return *getODSOperands(1).begin();
}

::mlir::Value ResourceApplyRMSPropOpAdaptor::mom() {
  return *getODSOperands(2).begin();
}

::mlir::Value ResourceApplyRMSPropOpAdaptor::lr() {
  return *getODSOperands(3).begin();
}

::mlir::Value ResourceApplyRMSPropOpAdaptor::rho() {
  return *getODSOperands(4).begin();
}

::mlir::Value ResourceApplyRMSPropOpAdaptor::momentum() {
  return *getODSOperands(5).begin();
}

::mlir::Value ResourceApplyRMSPropOpAdaptor::epsilon() {
  return *getODSOperands(6).begin();
}

::mlir::Value ResourceApplyRMSPropOpAdaptor::grad() {
  return *getODSOperands(7).begin();
}

::mlir::DictionaryAttr ResourceApplyRMSPropOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::BoolAttr ResourceApplyRMSPropOpAdaptor::use_locking() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("use_locking").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(false);
  return attr;
}

::mlir::LogicalResult ResourceApplyRMSPropOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_use_locking = odsAttrs.get("use_locking");
    if (tblgen_use_locking && !((tblgen_use_locking.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.ResourceApplyRMSProp' op ""attribute 'use_locking' failed to satisfy constraint: bool attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> ResourceApplyRMSPropOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range ResourceApplyRMSPropOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ResourceApplyRMSPropOp::var() {
  return *getODSOperands(0).begin();
}

::mlir::Value ResourceApplyRMSPropOp::ms() {
  return *getODSOperands(1).begin();
}

::mlir::Value ResourceApplyRMSPropOp::mom() {
  return *getODSOperands(2).begin();
}

::mlir::Value ResourceApplyRMSPropOp::lr() {
  return *getODSOperands(3).begin();
}

::mlir::Value ResourceApplyRMSPropOp::rho() {
  return *getODSOperands(4).begin();
}

::mlir::Value ResourceApplyRMSPropOp::momentum() {
  return *getODSOperands(5).begin();
}

::mlir::Value ResourceApplyRMSPropOp::epsilon() {
  return *getODSOperands(6).begin();
}

::mlir::Value ResourceApplyRMSPropOp::grad() {
  return *getODSOperands(7).begin();
}

::mlir::MutableOperandRange ResourceApplyRMSPropOp::varMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ResourceApplyRMSPropOp::msMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ResourceApplyRMSPropOp::momMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ResourceApplyRMSPropOp::lrMutable() {
  auto range = getODSOperandIndexAndLength(3);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ResourceApplyRMSPropOp::rhoMutable() {
  auto range = getODSOperandIndexAndLength(4);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ResourceApplyRMSPropOp::momentumMutable() {
  auto range = getODSOperandIndexAndLength(5);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ResourceApplyRMSPropOp::epsilonMutable() {
  auto range = getODSOperandIndexAndLength(6);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ResourceApplyRMSPropOp::gradMutable() {
  auto range = getODSOperandIndexAndLength(7);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> ResourceApplyRMSPropOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range ResourceApplyRMSPropOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::BoolAttr ResourceApplyRMSPropOp::use_lockingAttr() {
  return (*this)->getAttr(use_lockingAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool ResourceApplyRMSPropOp::use_locking() {
  auto attr = use_lockingAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(false).getValue();
  return attr.getValue();
}

::mlir::Type ResourceApplyRMSPropOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(3).begin());
}

bool ResourceApplyRMSPropOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr ResourceApplyRMSPropOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void ResourceApplyRMSPropOp::use_lockingAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(use_lockingAttrName(), attr);
}

void ResourceApplyRMSPropOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value var, ::mlir::Value ms, ::mlir::Value mom, ::mlir::Value lr, ::mlir::Value rho, ::mlir::Value momentum, ::mlir::Value epsilon, ::mlir::Value grad, ::mlir::BoolAttr use_locking) {
  odsState.addOperands(var);
  odsState.addOperands(ms);
  odsState.addOperands(mom);
  odsState.addOperands(lr);
  odsState.addOperands(rho);
  odsState.addOperands(momentum);
  odsState.addOperands(epsilon);
  odsState.addOperands(grad);
  odsState.addAttribute(use_lockingAttrName(odsState.name), use_locking);
}

void ResourceApplyRMSPropOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value var, ::mlir::Value ms, ::mlir::Value mom, ::mlir::Value lr, ::mlir::Value rho, ::mlir::Value momentum, ::mlir::Value epsilon, ::mlir::Value grad, ::mlir::BoolAttr use_locking) {
  odsState.addOperands(var);
  odsState.addOperands(ms);
  odsState.addOperands(mom);
  odsState.addOperands(lr);
  odsState.addOperands(rho);
  odsState.addOperands(momentum);
  odsState.addOperands(epsilon);
  odsState.addOperands(grad);
  odsState.addAttribute(use_lockingAttrName(odsState.name), use_locking);
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void ResourceApplyRMSPropOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value var, ::mlir::Value ms, ::mlir::Value mom, ::mlir::Value lr, ::mlir::Value rho, ::mlir::Value momentum, ::mlir::Value epsilon, ::mlir::Value grad, bool use_locking) {
  odsState.addOperands(var);
  odsState.addOperands(ms);
  odsState.addOperands(mom);
  odsState.addOperands(lr);
  odsState.addOperands(rho);
  odsState.addOperands(momentum);
  odsState.addOperands(epsilon);
  odsState.addOperands(grad);
  odsState.addAttribute(use_lockingAttrName(odsState.name), odsBuilder.getBoolAttr(use_locking));
}

void ResourceApplyRMSPropOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value var, ::mlir::Value ms, ::mlir::Value mom, ::mlir::Value lr, ::mlir::Value rho, ::mlir::Value momentum, ::mlir::Value epsilon, ::mlir::Value grad, bool use_locking) {
  odsState.addOperands(var);
  odsState.addOperands(ms);
  odsState.addOperands(mom);
  odsState.addOperands(lr);
  odsState.addOperands(rho);
  odsState.addOperands(momentum);
  odsState.addOperands(epsilon);
  odsState.addOperands(grad);
  odsState.addAttribute(use_lockingAttrName(odsState.name), odsBuilder.getBoolAttr(use_locking));
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void ResourceApplyRMSPropOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 8u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 0u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult ResourceApplyRMSPropOp::verify() {
  {
    auto tblgen_use_locking = (*this)->getAttr(use_lockingAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_use_locking, "use_locking")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup3 = getODSOperands(3);

    for (auto v : valueGroup3) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup4 = getODSOperands(4);

    for (auto v : valueGroup4) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup5 = getODSOperands(5);

    for (auto v : valueGroup5) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup6 = getODSOperands(6);

    for (auto v : valueGroup6) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup7 = getODSOperands(7);

    for (auto v : valueGroup7) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void ResourceApplyRMSPropOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  for (::mlir::Value value : getODSOperands(0))
    effects.emplace_back(::mlir::MemoryEffects::Read::get(), value, ::mlir::TF::ResourceEffects::Variable::get());
  for (::mlir::Value value : getODSOperands(0))
    effects.emplace_back(::mlir::MemoryEffects::Write::get(), value, ::mlir::TF::ResourceEffects::Variable::get());
  for (::mlir::Value value : getODSOperands(1))
    effects.emplace_back(::mlir::MemoryEffects::Read::get(), value, ::mlir::TF::ResourceEffects::Variable::get());
  for (::mlir::Value value : getODSOperands(1))
    effects.emplace_back(::mlir::MemoryEffects::Write::get(), value, ::mlir::TF::ResourceEffects::Variable::get());
  for (::mlir::Value value : getODSOperands(2))
    effects.emplace_back(::mlir::MemoryEffects::Read::get(), value, ::mlir::TF::ResourceEffects::Variable::get());
  for (::mlir::Value value : getODSOperands(2))
    effects.emplace_back(::mlir::MemoryEffects::Write::get(), value, ::mlir::TF::ResourceEffects::Variable::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::ResourceApplyRMSPropOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::ResourceGatherOp definitions
//===----------------------------------------------------------------------===//

ResourceGatherOpAdaptor::ResourceGatherOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

ResourceGatherOpAdaptor::ResourceGatherOpAdaptor(ResourceGatherOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange ResourceGatherOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> ResourceGatherOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange ResourceGatherOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ResourceGatherOpAdaptor::resource() {
  return *getODSOperands(0).begin();
}

::mlir::Value ResourceGatherOpAdaptor::indices() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr ResourceGatherOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::IntegerAttr ResourceGatherOpAdaptor::batch_dims() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("batch_dims").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), 0);
  return attr;
}

::mlir::BoolAttr ResourceGatherOpAdaptor::validate_indices() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("validate_indices").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(true);
  return attr;
}

::mlir::LogicalResult ResourceGatherOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_batch_dims = odsAttrs.get("batch_dims");
    if (tblgen_batch_dims && !(((tblgen_batch_dims.isa<::mlir::IntegerAttr>())) && ((tblgen_batch_dims.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.ResourceGather' op ""attribute 'batch_dims' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_validate_indices = odsAttrs.get("validate_indices");
    if (tblgen_validate_indices && !((tblgen_validate_indices.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.ResourceGather' op ""attribute 'validate_indices' failed to satisfy constraint: bool attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> ResourceGatherOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range ResourceGatherOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ResourceGatherOp::resource() {
  return *getODSOperands(0).begin();
}

::mlir::Value ResourceGatherOp::indices() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange ResourceGatherOp::resourceMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ResourceGatherOp::indicesMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> ResourceGatherOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range ResourceGatherOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ResourceGatherOp::output() {
  return *getODSResults(0).begin();
}

::mlir::IntegerAttr ResourceGatherOp::batch_dimsAttr() {
  return (*this)->getAttr(batch_dimsAttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t ResourceGatherOp::batch_dims() {
  auto attr = batch_dimsAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), 0).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

::mlir::BoolAttr ResourceGatherOp::validate_indicesAttr() {
  return (*this)->getAttr(validate_indicesAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool ResourceGatherOp::validate_indices() {
  auto attr = validate_indicesAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(true).getValue();
  return attr.getValue();
}

::mlir::Type ResourceGatherOp::Tindices() {
  return mlir::getElementTypeOrSelf(*getODSOperands(1).begin());
}

::mlir::Type ResourceGatherOp::dtype() {
  return mlir::getElementTypeOrSelf(*getODSResults(0).begin());
}

bool ResourceGatherOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "Tindices") return true;
  if (name == "dtype") return true;
 return false;
}

::mlir::DictionaryAttr ResourceGatherOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TindicesAttrName(),
::mlir::TypeAttr::get(Tindices())},
    {dtypeAttrName(),
::mlir::TypeAttr::get(dtype())}});
}

void ResourceGatherOp::batch_dimsAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(batch_dimsAttrName(), attr);
}

void ResourceGatherOp::validate_indicesAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(validate_indicesAttrName(), attr);
}

void ResourceGatherOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value resource, ::mlir::Value indices, ::mlir::IntegerAttr batch_dims, ::mlir::BoolAttr validate_indices) {
  odsState.addOperands(resource);
  odsState.addOperands(indices);
  odsState.addAttribute(batch_dimsAttrName(odsState.name), batch_dims);
  odsState.addAttribute(validate_indicesAttrName(odsState.name), validate_indices);
  odsState.addTypes(output);
}

void ResourceGatherOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value resource, ::mlir::Value indices, ::mlir::IntegerAttr batch_dims, ::mlir::BoolAttr validate_indices) {
  odsState.addOperands(resource);
  odsState.addOperands(indices);
  odsState.addAttribute(batch_dimsAttrName(odsState.name), batch_dims);
  odsState.addAttribute(validate_indicesAttrName(odsState.name), validate_indices);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void ResourceGatherOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value resource, ::mlir::Value indices, uint64_t batch_dims, bool validate_indices) {
  odsState.addOperands(resource);
  odsState.addOperands(indices);
  odsState.addAttribute(batch_dimsAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), batch_dims));
  odsState.addAttribute(validate_indicesAttrName(odsState.name), odsBuilder.getBoolAttr(validate_indices));
  odsState.addTypes(output);
}

void ResourceGatherOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value resource, ::mlir::Value indices, uint64_t batch_dims, bool validate_indices) {
  odsState.addOperands(resource);
  odsState.addOperands(indices);
  odsState.addAttribute(batch_dimsAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), batch_dims));
  odsState.addAttribute(validate_indicesAttrName(odsState.name), odsBuilder.getBoolAttr(validate_indices));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void ResourceGatherOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult ResourceGatherOp::verify() {
  {
    auto tblgen_batch_dims = (*this)->getAttr(batch_dimsAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_batch_dims, "batch_dims")))
      return ::mlir::failure();
  }
  {
    auto tblgen_validate_indices = (*this)->getAttr(validate_indicesAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_validate_indices, "validate_indices")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void ResourceGatherOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  for (::mlir::Value value : getODSOperands(0))
    effects.emplace_back(::mlir::MemoryEffects::Read::get(), value, ::mlir::TF::ResourceEffects::Variable::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::ResourceGatherOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::ResourceScatterAddOp definitions
//===----------------------------------------------------------------------===//

ResourceScatterAddOpAdaptor::ResourceScatterAddOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

ResourceScatterAddOpAdaptor::ResourceScatterAddOpAdaptor(ResourceScatterAddOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange ResourceScatterAddOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> ResourceScatterAddOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange ResourceScatterAddOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ResourceScatterAddOpAdaptor::resource() {
  return *getODSOperands(0).begin();
}

::mlir::Value ResourceScatterAddOpAdaptor::indices() {
  return *getODSOperands(1).begin();
}

::mlir::Value ResourceScatterAddOpAdaptor::updates() {
  return *getODSOperands(2).begin();
}

::mlir::DictionaryAttr ResourceScatterAddOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult ResourceScatterAddOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> ResourceScatterAddOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range ResourceScatterAddOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ResourceScatterAddOp::resource() {
  return *getODSOperands(0).begin();
}

::mlir::Value ResourceScatterAddOp::indices() {
  return *getODSOperands(1).begin();
}

::mlir::Value ResourceScatterAddOp::updates() {
  return *getODSOperands(2).begin();
}

::mlir::MutableOperandRange ResourceScatterAddOp::resourceMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ResourceScatterAddOp::indicesMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ResourceScatterAddOp::updatesMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> ResourceScatterAddOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range ResourceScatterAddOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Type ResourceScatterAddOp::Tindices() {
  return mlir::getElementTypeOrSelf(*getODSOperands(1).begin());
}

::mlir::Type ResourceScatterAddOp::dtype() {
  return mlir::getElementTypeOrSelf(*getODSOperands(2).begin());
}

bool ResourceScatterAddOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "Tindices") return true;
  if (name == "dtype") return true;
 return false;
}

::mlir::DictionaryAttr ResourceScatterAddOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TindicesAttrName(),
::mlir::TypeAttr::get(Tindices())},
    {dtypeAttrName(),
::mlir::TypeAttr::get(dtype())}});
}

void ResourceScatterAddOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value resource, ::mlir::Value indices, ::mlir::Value updates) {
  odsState.addOperands(resource);
  odsState.addOperands(indices);
  odsState.addOperands(updates);
}

void ResourceScatterAddOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value resource, ::mlir::Value indices, ::mlir::Value updates) {
  odsState.addOperands(resource);
  odsState.addOperands(indices);
  odsState.addOperands(updates);
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void ResourceScatterAddOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 3u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 0u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult ResourceScatterAddOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void ResourceScatterAddOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  for (::mlir::Value value : getODSOperands(0))
    effects.emplace_back(::mlir::MemoryEffects::Read::get(), value, ::mlir::TF::ResourceEffects::Variable::get());
  for (::mlir::Value value : getODSOperands(0))
    effects.emplace_back(::mlir::MemoryEffects::Write::get(), value, ::mlir::TF::ResourceEffects::Variable::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::ResourceScatterAddOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::ResourceScatterDivOp definitions
//===----------------------------------------------------------------------===//

ResourceScatterDivOpAdaptor::ResourceScatterDivOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

ResourceScatterDivOpAdaptor::ResourceScatterDivOpAdaptor(ResourceScatterDivOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange ResourceScatterDivOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> ResourceScatterDivOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange ResourceScatterDivOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ResourceScatterDivOpAdaptor::resource() {
  return *getODSOperands(0).begin();
}

::mlir::Value ResourceScatterDivOpAdaptor::indices() {
  return *getODSOperands(1).begin();
}

::mlir::Value ResourceScatterDivOpAdaptor::updates() {
  return *getODSOperands(2).begin();
}

::mlir::DictionaryAttr ResourceScatterDivOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult ResourceScatterDivOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> ResourceScatterDivOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range ResourceScatterDivOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ResourceScatterDivOp::resource() {
  return *getODSOperands(0).begin();
}

::mlir::Value ResourceScatterDivOp::indices() {
  return *getODSOperands(1).begin();
}

::mlir::Value ResourceScatterDivOp::updates() {
  return *getODSOperands(2).begin();
}

::mlir::MutableOperandRange ResourceScatterDivOp::resourceMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ResourceScatterDivOp::indicesMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ResourceScatterDivOp::updatesMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> ResourceScatterDivOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range ResourceScatterDivOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Type ResourceScatterDivOp::Tindices() {
  return mlir::getElementTypeOrSelf(*getODSOperands(1).begin());
}

::mlir::Type ResourceScatterDivOp::dtype() {
  return mlir::getElementTypeOrSelf(*getODSOperands(2).begin());
}

bool ResourceScatterDivOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "Tindices") return true;
  if (name == "dtype") return true;
 return false;
}

::mlir::DictionaryAttr ResourceScatterDivOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TindicesAttrName(),
::mlir::TypeAttr::get(Tindices())},
    {dtypeAttrName(),
::mlir::TypeAttr::get(dtype())}});
}

void ResourceScatterDivOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value resource, ::mlir::Value indices, ::mlir::Value updates) {
  odsState.addOperands(resource);
  odsState.addOperands(indices);
  odsState.addOperands(updates);
}

void ResourceScatterDivOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value resource, ::mlir::Value indices, ::mlir::Value updates) {
  odsState.addOperands(resource);
  odsState.addOperands(indices);
  odsState.addOperands(updates);
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void ResourceScatterDivOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 3u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 0u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult ResourceScatterDivOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void ResourceScatterDivOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  for (::mlir::Value value : getODSOperands(0))
    effects.emplace_back(::mlir::MemoryEffects::Read::get(), value, ::mlir::TF::ResourceEffects::Variable::get());
  for (::mlir::Value value : getODSOperands(0))
    effects.emplace_back(::mlir::MemoryEffects::Write::get(), value, ::mlir::TF::ResourceEffects::Variable::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::ResourceScatterDivOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::ResourceScatterMaxOp definitions
//===----------------------------------------------------------------------===//

ResourceScatterMaxOpAdaptor::ResourceScatterMaxOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

ResourceScatterMaxOpAdaptor::ResourceScatterMaxOpAdaptor(ResourceScatterMaxOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange ResourceScatterMaxOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> ResourceScatterMaxOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange ResourceScatterMaxOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ResourceScatterMaxOpAdaptor::resource() {
  return *getODSOperands(0).begin();
}

::mlir::Value ResourceScatterMaxOpAdaptor::indices() {
  return *getODSOperands(1).begin();
}

::mlir::Value ResourceScatterMaxOpAdaptor::updates() {
  return *getODSOperands(2).begin();
}

::mlir::DictionaryAttr ResourceScatterMaxOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult ResourceScatterMaxOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> ResourceScatterMaxOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range ResourceScatterMaxOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ResourceScatterMaxOp::resource() {
  return *getODSOperands(0).begin();
}

::mlir::Value ResourceScatterMaxOp::indices() {
  return *getODSOperands(1).begin();
}

::mlir::Value ResourceScatterMaxOp::updates() {
  return *getODSOperands(2).begin();
}

::mlir::MutableOperandRange ResourceScatterMaxOp::resourceMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ResourceScatterMaxOp::indicesMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ResourceScatterMaxOp::updatesMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> ResourceScatterMaxOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range ResourceScatterMaxOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Type ResourceScatterMaxOp::Tindices() {
  return mlir::getElementTypeOrSelf(*getODSOperands(1).begin());
}

::mlir::Type ResourceScatterMaxOp::dtype() {
  return mlir::getElementTypeOrSelf(*getODSOperands(2).begin());
}

bool ResourceScatterMaxOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "Tindices") return true;
  if (name == "dtype") return true;
 return false;
}

::mlir::DictionaryAttr ResourceScatterMaxOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TindicesAttrName(),
::mlir::TypeAttr::get(Tindices())},
    {dtypeAttrName(),
::mlir::TypeAttr::get(dtype())}});
}

void ResourceScatterMaxOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value resource, ::mlir::Value indices, ::mlir::Value updates) {
  odsState.addOperands(resource);
  odsState.addOperands(indices);
  odsState.addOperands(updates);
}

void ResourceScatterMaxOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value resource, ::mlir::Value indices, ::mlir::Value updates) {
  odsState.addOperands(resource);
  odsState.addOperands(indices);
  odsState.addOperands(updates);
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void ResourceScatterMaxOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 3u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 0u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult ResourceScatterMaxOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void ResourceScatterMaxOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  for (::mlir::Value value : getODSOperands(0))
    effects.emplace_back(::mlir::MemoryEffects::Read::get(), value, ::mlir::TF::ResourceEffects::Variable::get());
  for (::mlir::Value value : getODSOperands(0))
    effects.emplace_back(::mlir::MemoryEffects::Write::get(), value, ::mlir::TF::ResourceEffects::Variable::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::ResourceScatterMaxOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::ResourceScatterMinOp definitions
//===----------------------------------------------------------------------===//

ResourceScatterMinOpAdaptor::ResourceScatterMinOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

ResourceScatterMinOpAdaptor::ResourceScatterMinOpAdaptor(ResourceScatterMinOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange ResourceScatterMinOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> ResourceScatterMinOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange ResourceScatterMinOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ResourceScatterMinOpAdaptor::resource() {
  return *getODSOperands(0).begin();
}

::mlir::Value ResourceScatterMinOpAdaptor::indices() {
  return *getODSOperands(1).begin();
}

::mlir::Value ResourceScatterMinOpAdaptor::updates() {
  return *getODSOperands(2).begin();
}

::mlir::DictionaryAttr ResourceScatterMinOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult ResourceScatterMinOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> ResourceScatterMinOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range ResourceScatterMinOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ResourceScatterMinOp::resource() {
  return *getODSOperands(0).begin();
}

::mlir::Value ResourceScatterMinOp::indices() {
  return *getODSOperands(1).begin();
}

::mlir::Value ResourceScatterMinOp::updates() {
  return *getODSOperands(2).begin();
}

::mlir::MutableOperandRange ResourceScatterMinOp::resourceMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ResourceScatterMinOp::indicesMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ResourceScatterMinOp::updatesMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> ResourceScatterMinOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range ResourceScatterMinOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Type ResourceScatterMinOp::Tindices() {
  return mlir::getElementTypeOrSelf(*getODSOperands(1).begin());
}

::mlir::Type ResourceScatterMinOp::dtype() {
  return mlir::getElementTypeOrSelf(*getODSOperands(2).begin());
}

bool ResourceScatterMinOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "Tindices") return true;
  if (name == "dtype") return true;
 return false;
}

::mlir::DictionaryAttr ResourceScatterMinOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TindicesAttrName(),
::mlir::TypeAttr::get(Tindices())},
    {dtypeAttrName(),
::mlir::TypeAttr::get(dtype())}});
}

void ResourceScatterMinOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value resource, ::mlir::Value indices, ::mlir::Value updates) {
  odsState.addOperands(resource);
  odsState.addOperands(indices);
  odsState.addOperands(updates);
}

void ResourceScatterMinOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value resource, ::mlir::Value indices, ::mlir::Value updates) {
  odsState.addOperands(resource);
  odsState.addOperands(indices);
  odsState.addOperands(updates);
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void ResourceScatterMinOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 3u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 0u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult ResourceScatterMinOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void ResourceScatterMinOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  for (::mlir::Value value : getODSOperands(0))
    effects.emplace_back(::mlir::MemoryEffects::Read::get(), value, ::mlir::TF::ResourceEffects::Variable::get());
  for (::mlir::Value value : getODSOperands(0))
    effects.emplace_back(::mlir::MemoryEffects::Write::get(), value, ::mlir::TF::ResourceEffects::Variable::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::ResourceScatterMinOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::ResourceScatterMulOp definitions
//===----------------------------------------------------------------------===//

ResourceScatterMulOpAdaptor::ResourceScatterMulOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

ResourceScatterMulOpAdaptor::ResourceScatterMulOpAdaptor(ResourceScatterMulOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange ResourceScatterMulOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> ResourceScatterMulOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange ResourceScatterMulOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ResourceScatterMulOpAdaptor::resource() {
  return *getODSOperands(0).begin();
}

::mlir::Value ResourceScatterMulOpAdaptor::indices() {
  return *getODSOperands(1).begin();
}

::mlir::Value ResourceScatterMulOpAdaptor::updates() {
  return *getODSOperands(2).begin();
}

::mlir::DictionaryAttr ResourceScatterMulOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult ResourceScatterMulOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> ResourceScatterMulOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range ResourceScatterMulOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ResourceScatterMulOp::resource() {
  return *getODSOperands(0).begin();
}

::mlir::Value ResourceScatterMulOp::indices() {
  return *getODSOperands(1).begin();
}

::mlir::Value ResourceScatterMulOp::updates() {
  return *getODSOperands(2).begin();
}

::mlir::MutableOperandRange ResourceScatterMulOp::resourceMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ResourceScatterMulOp::indicesMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ResourceScatterMulOp::updatesMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> ResourceScatterMulOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range ResourceScatterMulOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Type ResourceScatterMulOp::Tindices() {
  return mlir::getElementTypeOrSelf(*getODSOperands(1).begin());
}

::mlir::Type ResourceScatterMulOp::dtype() {
  return mlir::getElementTypeOrSelf(*getODSOperands(2).begin());
}

bool ResourceScatterMulOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "Tindices") return true;
  if (name == "dtype") return true;
 return false;
}

::mlir::DictionaryAttr ResourceScatterMulOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TindicesAttrName(),
::mlir::TypeAttr::get(Tindices())},
    {dtypeAttrName(),
::mlir::TypeAttr::get(dtype())}});
}

void ResourceScatterMulOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value resource, ::mlir::Value indices, ::mlir::Value updates) {
  odsState.addOperands(resource);
  odsState.addOperands(indices);
  odsState.addOperands(updates);
}

void ResourceScatterMulOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value resource, ::mlir::Value indices, ::mlir::Value updates) {
  odsState.addOperands(resource);
  odsState.addOperands(indices);
  odsState.addOperands(updates);
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void ResourceScatterMulOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 3u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 0u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult ResourceScatterMulOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void ResourceScatterMulOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  for (::mlir::Value value : getODSOperands(0))
    effects.emplace_back(::mlir::MemoryEffects::Read::get(), value, ::mlir::TF::ResourceEffects::Variable::get());
  for (::mlir::Value value : getODSOperands(0))
    effects.emplace_back(::mlir::MemoryEffects::Write::get(), value, ::mlir::TF::ResourceEffects::Variable::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::ResourceScatterMulOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::ResourceScatterNdAddOp definitions
//===----------------------------------------------------------------------===//

ResourceScatterNdAddOpAdaptor::ResourceScatterNdAddOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

ResourceScatterNdAddOpAdaptor::ResourceScatterNdAddOpAdaptor(ResourceScatterNdAddOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange ResourceScatterNdAddOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> ResourceScatterNdAddOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange ResourceScatterNdAddOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ResourceScatterNdAddOpAdaptor::ref() {
  return *getODSOperands(0).begin();
}

::mlir::Value ResourceScatterNdAddOpAdaptor::indices() {
  return *getODSOperands(1).begin();
}

::mlir::Value ResourceScatterNdAddOpAdaptor::updates() {
  return *getODSOperands(2).begin();
}

::mlir::DictionaryAttr ResourceScatterNdAddOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::BoolAttr ResourceScatterNdAddOpAdaptor::use_locking() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("use_locking").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(true);
  return attr;
}

::mlir::LogicalResult ResourceScatterNdAddOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_use_locking = odsAttrs.get("use_locking");
    if (tblgen_use_locking && !((tblgen_use_locking.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.ResourceScatterNdAdd' op ""attribute 'use_locking' failed to satisfy constraint: bool attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> ResourceScatterNdAddOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range ResourceScatterNdAddOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ResourceScatterNdAddOp::ref() {
  return *getODSOperands(0).begin();
}

::mlir::Value ResourceScatterNdAddOp::indices() {
  return *getODSOperands(1).begin();
}

::mlir::Value ResourceScatterNdAddOp::updates() {
  return *getODSOperands(2).begin();
}

::mlir::MutableOperandRange ResourceScatterNdAddOp::refMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ResourceScatterNdAddOp::indicesMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ResourceScatterNdAddOp::updatesMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> ResourceScatterNdAddOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range ResourceScatterNdAddOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::BoolAttr ResourceScatterNdAddOp::use_lockingAttr() {
  return (*this)->getAttr(use_lockingAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool ResourceScatterNdAddOp::use_locking() {
  auto attr = use_lockingAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(true).getValue();
  return attr.getValue();
}

::mlir::Type ResourceScatterNdAddOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(2).begin());
}

::mlir::Type ResourceScatterNdAddOp::Tindices() {
  return mlir::getElementTypeOrSelf(*getODSOperands(1).begin());
}

bool ResourceScatterNdAddOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
  if (name == "Tindices") return true;
 return false;
}

::mlir::DictionaryAttr ResourceScatterNdAddOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())},
    {TindicesAttrName(),
::mlir::TypeAttr::get(Tindices())}});
}

void ResourceScatterNdAddOp::use_lockingAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(use_lockingAttrName(), attr);
}

void ResourceScatterNdAddOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value ref, ::mlir::Value indices, ::mlir::Value updates, ::mlir::BoolAttr use_locking) {
  odsState.addOperands(ref);
  odsState.addOperands(indices);
  odsState.addOperands(updates);
  odsState.addAttribute(use_lockingAttrName(odsState.name), use_locking);
}

void ResourceScatterNdAddOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value ref, ::mlir::Value indices, ::mlir::Value updates, ::mlir::BoolAttr use_locking) {
  odsState.addOperands(ref);
  odsState.addOperands(indices);
  odsState.addOperands(updates);
  odsState.addAttribute(use_lockingAttrName(odsState.name), use_locking);
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void ResourceScatterNdAddOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value ref, ::mlir::Value indices, ::mlir::Value updates, bool use_locking) {
  odsState.addOperands(ref);
  odsState.addOperands(indices);
  odsState.addOperands(updates);
  odsState.addAttribute(use_lockingAttrName(odsState.name), odsBuilder.getBoolAttr(use_locking));
}

void ResourceScatterNdAddOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value ref, ::mlir::Value indices, ::mlir::Value updates, bool use_locking) {
  odsState.addOperands(ref);
  odsState.addOperands(indices);
  odsState.addOperands(updates);
  odsState.addAttribute(use_lockingAttrName(odsState.name), odsBuilder.getBoolAttr(use_locking));
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void ResourceScatterNdAddOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 3u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 0u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult ResourceScatterNdAddOp::verify() {
  {
    auto tblgen_use_locking = (*this)->getAttr(use_lockingAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_use_locking, "use_locking")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void ResourceScatterNdAddOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  for (::mlir::Value value : getODSOperands(0))
    effects.emplace_back(::mlir::MemoryEffects::Read::get(), value, ::mlir::TF::ResourceEffects::Variable::get());
  for (::mlir::Value value : getODSOperands(0))
    effects.emplace_back(::mlir::MemoryEffects::Write::get(), value, ::mlir::TF::ResourceEffects::Variable::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::ResourceScatterNdAddOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::ResourceScatterNdSubOp definitions
//===----------------------------------------------------------------------===//

ResourceScatterNdSubOpAdaptor::ResourceScatterNdSubOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

ResourceScatterNdSubOpAdaptor::ResourceScatterNdSubOpAdaptor(ResourceScatterNdSubOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange ResourceScatterNdSubOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> ResourceScatterNdSubOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange ResourceScatterNdSubOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ResourceScatterNdSubOpAdaptor::ref() {
  return *getODSOperands(0).begin();
}

::mlir::Value ResourceScatterNdSubOpAdaptor::indices() {
  return *getODSOperands(1).begin();
}

::mlir::Value ResourceScatterNdSubOpAdaptor::updates() {
  return *getODSOperands(2).begin();
}

::mlir::DictionaryAttr ResourceScatterNdSubOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::BoolAttr ResourceScatterNdSubOpAdaptor::use_locking() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("use_locking").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(true);
  return attr;
}

::mlir::LogicalResult ResourceScatterNdSubOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_use_locking = odsAttrs.get("use_locking");
    if (tblgen_use_locking && !((tblgen_use_locking.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.ResourceScatterNdSub' op ""attribute 'use_locking' failed to satisfy constraint: bool attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> ResourceScatterNdSubOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range ResourceScatterNdSubOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ResourceScatterNdSubOp::ref() {
  return *getODSOperands(0).begin();
}

::mlir::Value ResourceScatterNdSubOp::indices() {
  return *getODSOperands(1).begin();
}

::mlir::Value ResourceScatterNdSubOp::updates() {
  return *getODSOperands(2).begin();
}

::mlir::MutableOperandRange ResourceScatterNdSubOp::refMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ResourceScatterNdSubOp::indicesMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ResourceScatterNdSubOp::updatesMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> ResourceScatterNdSubOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range ResourceScatterNdSubOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::BoolAttr ResourceScatterNdSubOp::use_lockingAttr() {
  return (*this)->getAttr(use_lockingAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool ResourceScatterNdSubOp::use_locking() {
  auto attr = use_lockingAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(true).getValue();
  return attr.getValue();
}

::mlir::Type ResourceScatterNdSubOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(2).begin());
}

::mlir::Type ResourceScatterNdSubOp::Tindices() {
  return mlir::getElementTypeOrSelf(*getODSOperands(1).begin());
}

bool ResourceScatterNdSubOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
  if (name == "Tindices") return true;
 return false;
}

::mlir::DictionaryAttr ResourceScatterNdSubOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())},
    {TindicesAttrName(),
::mlir::TypeAttr::get(Tindices())}});
}

void ResourceScatterNdSubOp::use_lockingAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(use_lockingAttrName(), attr);
}

void ResourceScatterNdSubOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value ref, ::mlir::Value indices, ::mlir::Value updates, ::mlir::BoolAttr use_locking) {
  odsState.addOperands(ref);
  odsState.addOperands(indices);
  odsState.addOperands(updates);
  odsState.addAttribute(use_lockingAttrName(odsState.name), use_locking);
}

void ResourceScatterNdSubOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value ref, ::mlir::Value indices, ::mlir::Value updates, ::mlir::BoolAttr use_locking) {
  odsState.addOperands(ref);
  odsState.addOperands(indices);
  odsState.addOperands(updates);
  odsState.addAttribute(use_lockingAttrName(odsState.name), use_locking);
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void ResourceScatterNdSubOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value ref, ::mlir::Value indices, ::mlir::Value updates, bool use_locking) {
  odsState.addOperands(ref);
  odsState.addOperands(indices);
  odsState.addOperands(updates);
  odsState.addAttribute(use_lockingAttrName(odsState.name), odsBuilder.getBoolAttr(use_locking));
}

void ResourceScatterNdSubOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value ref, ::mlir::Value indices, ::mlir::Value updates, bool use_locking) {
  odsState.addOperands(ref);
  odsState.addOperands(indices);
  odsState.addOperands(updates);
  odsState.addAttribute(use_lockingAttrName(odsState.name), odsBuilder.getBoolAttr(use_locking));
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void ResourceScatterNdSubOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 3u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 0u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult ResourceScatterNdSubOp::verify() {
  {
    auto tblgen_use_locking = (*this)->getAttr(use_lockingAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_use_locking, "use_locking")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void ResourceScatterNdSubOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  for (::mlir::Value value : getODSOperands(0))
    effects.emplace_back(::mlir::MemoryEffects::Read::get(), value, ::mlir::TF::ResourceEffects::Variable::get());
  for (::mlir::Value value : getODSOperands(0))
    effects.emplace_back(::mlir::MemoryEffects::Write::get(), value, ::mlir::TF::ResourceEffects::Variable::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::ResourceScatterNdSubOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::ResourceScatterNdUpdateOp definitions
//===----------------------------------------------------------------------===//

ResourceScatterNdUpdateOpAdaptor::ResourceScatterNdUpdateOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

ResourceScatterNdUpdateOpAdaptor::ResourceScatterNdUpdateOpAdaptor(ResourceScatterNdUpdateOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange ResourceScatterNdUpdateOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> ResourceScatterNdUpdateOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange ResourceScatterNdUpdateOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ResourceScatterNdUpdateOpAdaptor::ref() {
  return *getODSOperands(0).begin();
}

::mlir::Value ResourceScatterNdUpdateOpAdaptor::indices() {
  return *getODSOperands(1).begin();
}

::mlir::Value ResourceScatterNdUpdateOpAdaptor::updates() {
  return *getODSOperands(2).begin();
}

::mlir::DictionaryAttr ResourceScatterNdUpdateOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::BoolAttr ResourceScatterNdUpdateOpAdaptor::use_locking() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("use_locking").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(true);
  return attr;
}

::mlir::LogicalResult ResourceScatterNdUpdateOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_use_locking = odsAttrs.get("use_locking");
    if (tblgen_use_locking && !((tblgen_use_locking.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.ResourceScatterNdUpdate' op ""attribute 'use_locking' failed to satisfy constraint: bool attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> ResourceScatterNdUpdateOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range ResourceScatterNdUpdateOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ResourceScatterNdUpdateOp::ref() {
  return *getODSOperands(0).begin();
}

::mlir::Value ResourceScatterNdUpdateOp::indices() {
  return *getODSOperands(1).begin();
}

::mlir::Value ResourceScatterNdUpdateOp::updates() {
  return *getODSOperands(2).begin();
}

::mlir::MutableOperandRange ResourceScatterNdUpdateOp::refMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ResourceScatterNdUpdateOp::indicesMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ResourceScatterNdUpdateOp::updatesMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> ResourceScatterNdUpdateOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range ResourceScatterNdUpdateOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::BoolAttr ResourceScatterNdUpdateOp::use_lockingAttr() {
  return (*this)->getAttr(use_lockingAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool ResourceScatterNdUpdateOp::use_locking() {
  auto attr = use_lockingAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(true).getValue();
  return attr.getValue();
}

::mlir::Type ResourceScatterNdUpdateOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(2).begin());
}

::mlir::Type ResourceScatterNdUpdateOp::Tindices() {
  return mlir::getElementTypeOrSelf(*getODSOperands(1).begin());
}

bool ResourceScatterNdUpdateOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
  if (name == "Tindices") return true;
 return false;
}

::mlir::DictionaryAttr ResourceScatterNdUpdateOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())},
    {TindicesAttrName(),
::mlir::TypeAttr::get(Tindices())}});
}

void ResourceScatterNdUpdateOp::use_lockingAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(use_lockingAttrName(), attr);
}

void ResourceScatterNdUpdateOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value ref, ::mlir::Value indices, ::mlir::Value updates, ::mlir::BoolAttr use_locking) {
  odsState.addOperands(ref);
  odsState.addOperands(indices);
  odsState.addOperands(updates);
  odsState.addAttribute(use_lockingAttrName(odsState.name), use_locking);
}

void ResourceScatterNdUpdateOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value ref, ::mlir::Value indices, ::mlir::Value updates, ::mlir::BoolAttr use_locking) {
  odsState.addOperands(ref);
  odsState.addOperands(indices);
  odsState.addOperands(updates);
  odsState.addAttribute(use_lockingAttrName(odsState.name), use_locking);
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void ResourceScatterNdUpdateOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value ref, ::mlir::Value indices, ::mlir::Value updates, bool use_locking) {
  odsState.addOperands(ref);
  odsState.addOperands(indices);
  odsState.addOperands(updates);
  odsState.addAttribute(use_lockingAttrName(odsState.name), odsBuilder.getBoolAttr(use_locking));
}

void ResourceScatterNdUpdateOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value ref, ::mlir::Value indices, ::mlir::Value updates, bool use_locking) {
  odsState.addOperands(ref);
  odsState.addOperands(indices);
  odsState.addOperands(updates);
  odsState.addAttribute(use_lockingAttrName(odsState.name), odsBuilder.getBoolAttr(use_locking));
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void ResourceScatterNdUpdateOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 3u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 0u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult ResourceScatterNdUpdateOp::verify() {
  {
    auto tblgen_use_locking = (*this)->getAttr(use_lockingAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_use_locking, "use_locking")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void ResourceScatterNdUpdateOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  for (::mlir::Value value : getODSOperands(0))
    effects.emplace_back(::mlir::MemoryEffects::Read::get(), value, ::mlir::TF::ResourceEffects::Variable::get());
  for (::mlir::Value value : getODSOperands(0))
    effects.emplace_back(::mlir::MemoryEffects::Write::get(), value, ::mlir::TF::ResourceEffects::Variable::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::ResourceScatterNdUpdateOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::ResourceScatterSubOp definitions
//===----------------------------------------------------------------------===//

ResourceScatterSubOpAdaptor::ResourceScatterSubOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

ResourceScatterSubOpAdaptor::ResourceScatterSubOpAdaptor(ResourceScatterSubOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange ResourceScatterSubOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> ResourceScatterSubOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange ResourceScatterSubOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ResourceScatterSubOpAdaptor::resource() {
  return *getODSOperands(0).begin();
}

::mlir::Value ResourceScatterSubOpAdaptor::indices() {
  return *getODSOperands(1).begin();
}

::mlir::Value ResourceScatterSubOpAdaptor::updates() {
  return *getODSOperands(2).begin();
}

::mlir::DictionaryAttr ResourceScatterSubOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult ResourceScatterSubOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> ResourceScatterSubOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range ResourceScatterSubOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ResourceScatterSubOp::resource() {
  return *getODSOperands(0).begin();
}

::mlir::Value ResourceScatterSubOp::indices() {
  return *getODSOperands(1).begin();
}

::mlir::Value ResourceScatterSubOp::updates() {
  return *getODSOperands(2).begin();
}

::mlir::MutableOperandRange ResourceScatterSubOp::resourceMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ResourceScatterSubOp::indicesMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ResourceScatterSubOp::updatesMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> ResourceScatterSubOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range ResourceScatterSubOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Type ResourceScatterSubOp::Tindices() {
  return mlir::getElementTypeOrSelf(*getODSOperands(1).begin());
}

::mlir::Type ResourceScatterSubOp::dtype() {
  return mlir::getElementTypeOrSelf(*getODSOperands(2).begin());
}

bool ResourceScatterSubOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "Tindices") return true;
  if (name == "dtype") return true;
 return false;
}

::mlir::DictionaryAttr ResourceScatterSubOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TindicesAttrName(),
::mlir::TypeAttr::get(Tindices())},
    {dtypeAttrName(),
::mlir::TypeAttr::get(dtype())}});
}

void ResourceScatterSubOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value resource, ::mlir::Value indices, ::mlir::Value updates) {
  odsState.addOperands(resource);
  odsState.addOperands(indices);
  odsState.addOperands(updates);
}

void ResourceScatterSubOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value resource, ::mlir::Value indices, ::mlir::Value updates) {
  odsState.addOperands(resource);
  odsState.addOperands(indices);
  odsState.addOperands(updates);
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void ResourceScatterSubOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 3u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 0u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult ResourceScatterSubOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void ResourceScatterSubOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  for (::mlir::Value value : getODSOperands(0))
    effects.emplace_back(::mlir::MemoryEffects::Read::get(), value, ::mlir::TF::ResourceEffects::Variable::get());
  for (::mlir::Value value : getODSOperands(0))
    effects.emplace_back(::mlir::MemoryEffects::Write::get(), value, ::mlir::TF::ResourceEffects::Variable::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::ResourceScatterSubOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::ResourceScatterUpdateOp definitions
//===----------------------------------------------------------------------===//

ResourceScatterUpdateOpAdaptor::ResourceScatterUpdateOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

ResourceScatterUpdateOpAdaptor::ResourceScatterUpdateOpAdaptor(ResourceScatterUpdateOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange ResourceScatterUpdateOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> ResourceScatterUpdateOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange ResourceScatterUpdateOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ResourceScatterUpdateOpAdaptor::resource() {
  return *getODSOperands(0).begin();
}

::mlir::Value ResourceScatterUpdateOpAdaptor::indices() {
  return *getODSOperands(1).begin();
}

::mlir::Value ResourceScatterUpdateOpAdaptor::updates() {
  return *getODSOperands(2).begin();
}

::mlir::DictionaryAttr ResourceScatterUpdateOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult ResourceScatterUpdateOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> ResourceScatterUpdateOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range ResourceScatterUpdateOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ResourceScatterUpdateOp::resource() {
  return *getODSOperands(0).begin();
}

::mlir::Value ResourceScatterUpdateOp::indices() {
  return *getODSOperands(1).begin();
}

::mlir::Value ResourceScatterUpdateOp::updates() {
  return *getODSOperands(2).begin();
}

::mlir::MutableOperandRange ResourceScatterUpdateOp::resourceMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ResourceScatterUpdateOp::indicesMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ResourceScatterUpdateOp::updatesMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> ResourceScatterUpdateOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range ResourceScatterUpdateOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Type ResourceScatterUpdateOp::Tindices() {
  return mlir::getElementTypeOrSelf(*getODSOperands(1).begin());
}

::mlir::Type ResourceScatterUpdateOp::dtype() {
  return mlir::getElementTypeOrSelf(*getODSOperands(2).begin());
}

bool ResourceScatterUpdateOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "Tindices") return true;
  if (name == "dtype") return true;
 return false;
}

::mlir::DictionaryAttr ResourceScatterUpdateOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TindicesAttrName(),
::mlir::TypeAttr::get(Tindices())},
    {dtypeAttrName(),
::mlir::TypeAttr::get(dtype())}});
}

void ResourceScatterUpdateOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value resource, ::mlir::Value indices, ::mlir::Value updates) {
  odsState.addOperands(resource);
  odsState.addOperands(indices);
  odsState.addOperands(updates);
}

void ResourceScatterUpdateOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value resource, ::mlir::Value indices, ::mlir::Value updates) {
  odsState.addOperands(resource);
  odsState.addOperands(indices);
  odsState.addOperands(updates);
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void ResourceScatterUpdateOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 3u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 0u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult ResourceScatterUpdateOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void ResourceScatterUpdateOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  for (::mlir::Value value : getODSOperands(0))
    effects.emplace_back(::mlir::MemoryEffects::Read::get(), value, ::mlir::TF::ResourceEffects::Variable::get());
  for (::mlir::Value value : getODSOperands(0))
    effects.emplace_back(::mlir::MemoryEffects::Write::get(), value, ::mlir::TF::ResourceEffects::Variable::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::ResourceScatterUpdateOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::ResourceStridedSliceAssignOp definitions
//===----------------------------------------------------------------------===//

ResourceStridedSliceAssignOpAdaptor::ResourceStridedSliceAssignOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

ResourceStridedSliceAssignOpAdaptor::ResourceStridedSliceAssignOpAdaptor(ResourceStridedSliceAssignOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange ResourceStridedSliceAssignOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> ResourceStridedSliceAssignOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange ResourceStridedSliceAssignOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ResourceStridedSliceAssignOpAdaptor::ref() {
  return *getODSOperands(0).begin();
}

::mlir::Value ResourceStridedSliceAssignOpAdaptor::begin() {
  return *getODSOperands(1).begin();
}

::mlir::Value ResourceStridedSliceAssignOpAdaptor::end() {
  return *getODSOperands(2).begin();
}

::mlir::Value ResourceStridedSliceAssignOpAdaptor::strides() {
  return *getODSOperands(3).begin();
}

::mlir::Value ResourceStridedSliceAssignOpAdaptor::value() {
  return *getODSOperands(4).begin();
}

::mlir::DictionaryAttr ResourceStridedSliceAssignOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::IntegerAttr ResourceStridedSliceAssignOpAdaptor::begin_mask() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("begin_mask").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), 0);
  return attr;
}

::mlir::IntegerAttr ResourceStridedSliceAssignOpAdaptor::end_mask() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("end_mask").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), 0);
  return attr;
}

::mlir::IntegerAttr ResourceStridedSliceAssignOpAdaptor::ellipsis_mask() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("ellipsis_mask").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), 0);
  return attr;
}

::mlir::IntegerAttr ResourceStridedSliceAssignOpAdaptor::new_axis_mask() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("new_axis_mask").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), 0);
  return attr;
}

::mlir::IntegerAttr ResourceStridedSliceAssignOpAdaptor::shrink_axis_mask() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("shrink_axis_mask").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), 0);
  return attr;
}

::mlir::LogicalResult ResourceStridedSliceAssignOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_begin_mask = odsAttrs.get("begin_mask");
    if (tblgen_begin_mask && !(((tblgen_begin_mask.isa<::mlir::IntegerAttr>())) && ((tblgen_begin_mask.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.ResourceStridedSliceAssign' op ""attribute 'begin_mask' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_end_mask = odsAttrs.get("end_mask");
    if (tblgen_end_mask && !(((tblgen_end_mask.isa<::mlir::IntegerAttr>())) && ((tblgen_end_mask.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.ResourceStridedSliceAssign' op ""attribute 'end_mask' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_ellipsis_mask = odsAttrs.get("ellipsis_mask");
    if (tblgen_ellipsis_mask && !(((tblgen_ellipsis_mask.isa<::mlir::IntegerAttr>())) && ((tblgen_ellipsis_mask.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.ResourceStridedSliceAssign' op ""attribute 'ellipsis_mask' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_new_axis_mask = odsAttrs.get("new_axis_mask");
    if (tblgen_new_axis_mask && !(((tblgen_new_axis_mask.isa<::mlir::IntegerAttr>())) && ((tblgen_new_axis_mask.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.ResourceStridedSliceAssign' op ""attribute 'new_axis_mask' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_shrink_axis_mask = odsAttrs.get("shrink_axis_mask");
    if (tblgen_shrink_axis_mask && !(((tblgen_shrink_axis_mask.isa<::mlir::IntegerAttr>())) && ((tblgen_shrink_axis_mask.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.ResourceStridedSliceAssign' op ""attribute 'shrink_axis_mask' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> ResourceStridedSliceAssignOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range ResourceStridedSliceAssignOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ResourceStridedSliceAssignOp::ref() {
  return *getODSOperands(0).begin();
}

::mlir::Value ResourceStridedSliceAssignOp::begin() {
  return *getODSOperands(1).begin();
}

::mlir::Value ResourceStridedSliceAssignOp::end() {
  return *getODSOperands(2).begin();
}

::mlir::Value ResourceStridedSliceAssignOp::strides() {
  return *getODSOperands(3).begin();
}

::mlir::Value ResourceStridedSliceAssignOp::value() {
  return *getODSOperands(4).begin();
}

::mlir::MutableOperandRange ResourceStridedSliceAssignOp::refMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ResourceStridedSliceAssignOp::beginMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ResourceStridedSliceAssignOp::endMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ResourceStridedSliceAssignOp::stridesMutable() {
  auto range = getODSOperandIndexAndLength(3);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ResourceStridedSliceAssignOp::valueMutable() {
  auto range = getODSOperandIndexAndLength(4);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> ResourceStridedSliceAssignOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range ResourceStridedSliceAssignOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::IntegerAttr ResourceStridedSliceAssignOp::begin_maskAttr() {
  return (*this)->getAttr(begin_maskAttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t ResourceStridedSliceAssignOp::begin_mask() {
  auto attr = begin_maskAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), 0).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

::mlir::IntegerAttr ResourceStridedSliceAssignOp::end_maskAttr() {
  return (*this)->getAttr(end_maskAttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t ResourceStridedSliceAssignOp::end_mask() {
  auto attr = end_maskAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), 0).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

::mlir::IntegerAttr ResourceStridedSliceAssignOp::ellipsis_maskAttr() {
  return (*this)->getAttr(ellipsis_maskAttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t ResourceStridedSliceAssignOp::ellipsis_mask() {
  auto attr = ellipsis_maskAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), 0).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

::mlir::IntegerAttr ResourceStridedSliceAssignOp::new_axis_maskAttr() {
  return (*this)->getAttr(new_axis_maskAttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t ResourceStridedSliceAssignOp::new_axis_mask() {
  auto attr = new_axis_maskAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), 0).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

::mlir::IntegerAttr ResourceStridedSliceAssignOp::shrink_axis_maskAttr() {
  return (*this)->getAttr(shrink_axis_maskAttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t ResourceStridedSliceAssignOp::shrink_axis_mask() {
  auto attr = shrink_axis_maskAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), 0).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

::mlir::Type ResourceStridedSliceAssignOp::Index() {
  return mlir::getElementTypeOrSelf(*getODSOperands(1).begin());
}

::mlir::Type ResourceStridedSliceAssignOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(4).begin());
}

bool ResourceStridedSliceAssignOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "Index") return true;
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr ResourceStridedSliceAssignOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {IndexAttrName(),
::mlir::TypeAttr::get(Index())},
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void ResourceStridedSliceAssignOp::begin_maskAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(begin_maskAttrName(), attr);
}

void ResourceStridedSliceAssignOp::end_maskAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(end_maskAttrName(), attr);
}

void ResourceStridedSliceAssignOp::ellipsis_maskAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(ellipsis_maskAttrName(), attr);
}

void ResourceStridedSliceAssignOp::new_axis_maskAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(new_axis_maskAttrName(), attr);
}

void ResourceStridedSliceAssignOp::shrink_axis_maskAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(shrink_axis_maskAttrName(), attr);
}

void ResourceStridedSliceAssignOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value ref, ::mlir::Value begin, ::mlir::Value end, ::mlir::Value strides, ::mlir::Value value, ::mlir::IntegerAttr begin_mask, ::mlir::IntegerAttr end_mask, ::mlir::IntegerAttr ellipsis_mask, ::mlir::IntegerAttr new_axis_mask, ::mlir::IntegerAttr shrink_axis_mask) {
  odsState.addOperands(ref);
  odsState.addOperands(begin);
  odsState.addOperands(end);
  odsState.addOperands(strides);
  odsState.addOperands(value);
  odsState.addAttribute(begin_maskAttrName(odsState.name), begin_mask);
  odsState.addAttribute(end_maskAttrName(odsState.name), end_mask);
  odsState.addAttribute(ellipsis_maskAttrName(odsState.name), ellipsis_mask);
  odsState.addAttribute(new_axis_maskAttrName(odsState.name), new_axis_mask);
  odsState.addAttribute(shrink_axis_maskAttrName(odsState.name), shrink_axis_mask);
}

void ResourceStridedSliceAssignOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value ref, ::mlir::Value begin, ::mlir::Value end, ::mlir::Value strides, ::mlir::Value value, ::mlir::IntegerAttr begin_mask, ::mlir::IntegerAttr end_mask, ::mlir::IntegerAttr ellipsis_mask, ::mlir::IntegerAttr new_axis_mask, ::mlir::IntegerAttr shrink_axis_mask) {
  odsState.addOperands(ref);
  odsState.addOperands(begin);
  odsState.addOperands(end);
  odsState.addOperands(strides);
  odsState.addOperands(value);
  odsState.addAttribute(begin_maskAttrName(odsState.name), begin_mask);
  odsState.addAttribute(end_maskAttrName(odsState.name), end_mask);
  odsState.addAttribute(ellipsis_maskAttrName(odsState.name), ellipsis_mask);
  odsState.addAttribute(new_axis_maskAttrName(odsState.name), new_axis_mask);
  odsState.addAttribute(shrink_axis_maskAttrName(odsState.name), shrink_axis_mask);
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void ResourceStridedSliceAssignOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value ref, ::mlir::Value begin, ::mlir::Value end, ::mlir::Value strides, ::mlir::Value value, uint64_t begin_mask, uint64_t end_mask, uint64_t ellipsis_mask, uint64_t new_axis_mask, uint64_t shrink_axis_mask) {
  odsState.addOperands(ref);
  odsState.addOperands(begin);
  odsState.addOperands(end);
  odsState.addOperands(strides);
  odsState.addOperands(value);
  odsState.addAttribute(begin_maskAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), begin_mask));
  odsState.addAttribute(end_maskAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), end_mask));
  odsState.addAttribute(ellipsis_maskAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), ellipsis_mask));
  odsState.addAttribute(new_axis_maskAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), new_axis_mask));
  odsState.addAttribute(shrink_axis_maskAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), shrink_axis_mask));
}

void ResourceStridedSliceAssignOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value ref, ::mlir::Value begin, ::mlir::Value end, ::mlir::Value strides, ::mlir::Value value, uint64_t begin_mask, uint64_t end_mask, uint64_t ellipsis_mask, uint64_t new_axis_mask, uint64_t shrink_axis_mask) {
  odsState.addOperands(ref);
  odsState.addOperands(begin);
  odsState.addOperands(end);
  odsState.addOperands(strides);
  odsState.addOperands(value);
  odsState.addAttribute(begin_maskAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), begin_mask));
  odsState.addAttribute(end_maskAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), end_mask));
  odsState.addAttribute(ellipsis_maskAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), ellipsis_mask));
  odsState.addAttribute(new_axis_maskAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), new_axis_mask));
  odsState.addAttribute(shrink_axis_maskAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), shrink_axis_mask));
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void ResourceStridedSliceAssignOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 5u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 0u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult ResourceStridedSliceAssignOp::verify() {
  {
    auto tblgen_begin_mask = (*this)->getAttr(begin_maskAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_begin_mask, "begin_mask")))
      return ::mlir::failure();
  }
  {
    auto tblgen_end_mask = (*this)->getAttr(end_maskAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_end_mask, "end_mask")))
      return ::mlir::failure();
  }
  {
    auto tblgen_ellipsis_mask = (*this)->getAttr(ellipsis_maskAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_ellipsis_mask, "ellipsis_mask")))
      return ::mlir::failure();
  }
  {
    auto tblgen_new_axis_mask = (*this)->getAttr(new_axis_maskAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_new_axis_mask, "new_axis_mask")))
      return ::mlir::failure();
  }
  {
    auto tblgen_shrink_axis_mask = (*this)->getAttr(shrink_axis_maskAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_shrink_axis_mask, "shrink_axis_mask")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup3 = getODSOperands(3);

    for (auto v : valueGroup3) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup4 = getODSOperands(4);

    for (auto v : valueGroup4) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void ResourceStridedSliceAssignOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  for (::mlir::Value value : getODSOperands(0))
    effects.emplace_back(::mlir::MemoryEffects::Read::get(), value, ::mlir::TF::ResourceEffects::Variable::get());
  for (::mlir::Value value : getODSOperands(0))
    effects.emplace_back(::mlir::MemoryEffects::Write::get(), value, ::mlir::TF::ResourceEffects::Variable::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::ResourceStridedSliceAssignOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::RestoreOp definitions
//===----------------------------------------------------------------------===//

RestoreOpAdaptor::RestoreOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

RestoreOpAdaptor::RestoreOpAdaptor(RestoreOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange RestoreOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> RestoreOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange RestoreOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value RestoreOpAdaptor::file_pattern() {
  return *getODSOperands(0).begin();
}

::mlir::Value RestoreOpAdaptor::tensor_name() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr RestoreOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::IntegerAttr RestoreOpAdaptor::preferred_shard() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("preferred_shard").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), -1);
  return attr;
}

::mlir::LogicalResult RestoreOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_preferred_shard = odsAttrs.get("preferred_shard");
    if (tblgen_preferred_shard && !(((tblgen_preferred_shard.isa<::mlir::IntegerAttr>())) && ((tblgen_preferred_shard.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.Restore' op ""attribute 'preferred_shard' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> RestoreOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range RestoreOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value RestoreOp::file_pattern() {
  return *getODSOperands(0).begin();
}

::mlir::Value RestoreOp::tensor_name() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange RestoreOp::file_patternMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange RestoreOp::tensor_nameMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> RestoreOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range RestoreOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value RestoreOp::tensor() {
  return *getODSResults(0).begin();
}

::mlir::IntegerAttr RestoreOp::preferred_shardAttr() {
  return (*this)->getAttr(preferred_shardAttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t RestoreOp::preferred_shard() {
  auto attr = preferred_shardAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), -1).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

::mlir::Type RestoreOp::dt() {
  return mlir::getElementTypeOrSelf(*getODSResults(0).begin());
}

bool RestoreOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "dt") return true;
 return false;
}

::mlir::DictionaryAttr RestoreOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {dtAttrName(),
::mlir::TypeAttr::get(dt())}});
}

void RestoreOp::preferred_shardAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(preferred_shardAttrName(), attr);
}

void RestoreOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type tensor, ::mlir::Value file_pattern, ::mlir::Value tensor_name, ::mlir::IntegerAttr preferred_shard) {
  odsState.addOperands(file_pattern);
  odsState.addOperands(tensor_name);
  odsState.addAttribute(preferred_shardAttrName(odsState.name), preferred_shard);
  odsState.addTypes(tensor);
}

void RestoreOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value file_pattern, ::mlir::Value tensor_name, ::mlir::IntegerAttr preferred_shard) {
  odsState.addOperands(file_pattern);
  odsState.addOperands(tensor_name);
  odsState.addAttribute(preferred_shardAttrName(odsState.name), preferred_shard);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void RestoreOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type tensor, ::mlir::Value file_pattern, ::mlir::Value tensor_name, uint64_t preferred_shard) {
  odsState.addOperands(file_pattern);
  odsState.addOperands(tensor_name);
  odsState.addAttribute(preferred_shardAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), preferred_shard));
  odsState.addTypes(tensor);
}

void RestoreOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value file_pattern, ::mlir::Value tensor_name, uint64_t preferred_shard) {
  odsState.addOperands(file_pattern);
  odsState.addOperands(tensor_name);
  odsState.addAttribute(preferred_shardAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), preferred_shard));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void RestoreOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult RestoreOp::verify() {
  {
    auto tblgen_preferred_shard = (*this)->getAttr(preferred_shardAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_preferred_shard, "preferred_shard")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops19(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops19(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::RestoreOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::RestoreV2Op definitions
//===----------------------------------------------------------------------===//

RestoreV2OpAdaptor::RestoreV2OpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

RestoreV2OpAdaptor::RestoreV2OpAdaptor(RestoreV2Op &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange RestoreV2OpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> RestoreV2OpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange RestoreV2OpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value RestoreV2OpAdaptor::prefix() {
  return *getODSOperands(0).begin();
}

::mlir::Value RestoreV2OpAdaptor::tensor_names() {
  return *getODSOperands(1).begin();
}

::mlir::Value RestoreV2OpAdaptor::shape_and_slices() {
  return *getODSOperands(2).begin();
}

::mlir::DictionaryAttr RestoreV2OpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult RestoreV2OpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> RestoreV2Op::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range RestoreV2Op::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value RestoreV2Op::prefix() {
  return *getODSOperands(0).begin();
}

::mlir::Value RestoreV2Op::tensor_names() {
  return *getODSOperands(1).begin();
}

::mlir::Value RestoreV2Op::shape_and_slices() {
  return *getODSOperands(2).begin();
}

::mlir::MutableOperandRange RestoreV2Op::prefixMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange RestoreV2Op::tensor_namesMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange RestoreV2Op::shape_and_slicesMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> RestoreV2Op::getODSResultIndexAndLength(unsigned index) {
  bool isVariadic[] = {true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (getOperation()->getNumResults() - 0) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::Operation::result_range RestoreV2Op::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Operation::result_range RestoreV2Op::tensors() {
  return getODSResults(0);
}

mlir::ResultElementTypeRange RestoreV2Op::dtypes() {
  auto values = getODSResults(0);
return {mlir::ResultElementTypeIterator(values.begin()), mlir::ResultElementTypeIterator(values.end())};
}

bool RestoreV2Op::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "dtypes") return true;
 return false;
}

::mlir::DictionaryAttr RestoreV2Op::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {dtypesAttrName(),
ArrayAttr::get(ctx, 
    [&]() {
      llvm::SmallVector<Attribute, 4> ret;
      for (auto t : dtypes())
        ret.push_back(TypeAttr::get(t));
      return ret;
    }())}});
}

void RestoreV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange tensors, ::mlir::Value prefix, ::mlir::Value tensor_names, ::mlir::Value shape_and_slices) {
  odsState.addOperands(prefix);
  odsState.addOperands(tensor_names);
  odsState.addOperands(shape_and_slices);
  odsState.addTypes(tensors);
}

void RestoreV2Op::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 3u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult RestoreV2Op::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops19(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops19(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops19(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::RestoreV2Op)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::RetrieveTPUEmbeddingADAMParametersGradAccumDebugOp definitions
//===----------------------------------------------------------------------===//

RetrieveTPUEmbeddingADAMParametersGradAccumDebugOpAdaptor::RetrieveTPUEmbeddingADAMParametersGradAccumDebugOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

RetrieveTPUEmbeddingADAMParametersGradAccumDebugOpAdaptor::RetrieveTPUEmbeddingADAMParametersGradAccumDebugOpAdaptor(RetrieveTPUEmbeddingADAMParametersGradAccumDebugOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange RetrieveTPUEmbeddingADAMParametersGradAccumDebugOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> RetrieveTPUEmbeddingADAMParametersGradAccumDebugOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange RetrieveTPUEmbeddingADAMParametersGradAccumDebugOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::DictionaryAttr RetrieveTPUEmbeddingADAMParametersGradAccumDebugOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::IntegerAttr RetrieveTPUEmbeddingADAMParametersGradAccumDebugOpAdaptor::table_id() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("table_id").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), -1);
  return attr;
}

::mlir::StringAttr RetrieveTPUEmbeddingADAMParametersGradAccumDebugOpAdaptor::table_name() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("table_name").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("");
  return attr;
}

::mlir::IntegerAttr RetrieveTPUEmbeddingADAMParametersGradAccumDebugOpAdaptor::num_shards() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("num_shards").cast<::mlir::IntegerAttr>();
  return attr;
}

::mlir::IntegerAttr RetrieveTPUEmbeddingADAMParametersGradAccumDebugOpAdaptor::shard_id() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("shard_id").cast<::mlir::IntegerAttr>();
  return attr;
}

::mlir::StringAttr RetrieveTPUEmbeddingADAMParametersGradAccumDebugOpAdaptor::config() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("config").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("");
  return attr;
}

::mlir::LogicalResult RetrieveTPUEmbeddingADAMParametersGradAccumDebugOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_table_id = odsAttrs.get("table_id");
    if (tblgen_table_id && !(((tblgen_table_id.isa<::mlir::IntegerAttr>())) && ((tblgen_table_id.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.RetrieveTPUEmbeddingADAMParametersGradAccumDebug' op ""attribute 'table_id' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_table_name = odsAttrs.get("table_name");
    if (tblgen_table_name && !((tblgen_table_name.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.RetrieveTPUEmbeddingADAMParametersGradAccumDebug' op ""attribute 'table_name' failed to satisfy constraint: string attribute");
  }
  {
    auto tblgen_num_shards = odsAttrs.get("num_shards");
    if (!tblgen_num_shards)
      return emitError(loc, "'tf.RetrieveTPUEmbeddingADAMParametersGradAccumDebug' op ""requires attribute 'num_shards'");

    if (tblgen_num_shards && !(((tblgen_num_shards.isa<::mlir::IntegerAttr>())) && ((tblgen_num_shards.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.RetrieveTPUEmbeddingADAMParametersGradAccumDebug' op ""attribute 'num_shards' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_shard_id = odsAttrs.get("shard_id");
    if (!tblgen_shard_id)
      return emitError(loc, "'tf.RetrieveTPUEmbeddingADAMParametersGradAccumDebug' op ""requires attribute 'shard_id'");

    if (tblgen_shard_id && !(((tblgen_shard_id.isa<::mlir::IntegerAttr>())) && ((tblgen_shard_id.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.RetrieveTPUEmbeddingADAMParametersGradAccumDebug' op ""attribute 'shard_id' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_config = odsAttrs.get("config");
    if (tblgen_config && !((tblgen_config.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.RetrieveTPUEmbeddingADAMParametersGradAccumDebug' op ""attribute 'config' failed to satisfy constraint: string attribute");
  }
  return ::mlir::success();
}

void RetrieveTPUEmbeddingADAMParametersGradAccumDebugOp::getAsmResultNames(::mlir::OpAsmSetValueNameFn setNameFn) {
  auto resultGroup0 = getODSResults(0);
  if (!llvm::empty(resultGroup0))
    setNameFn(*resultGroup0.begin(), "parameters");
  auto resultGroup1 = getODSResults(1);
  if (!llvm::empty(resultGroup1))
    setNameFn(*resultGroup1.begin(), "momenta");
  auto resultGroup2 = getODSResults(2);
  if (!llvm::empty(resultGroup2))
    setNameFn(*resultGroup2.begin(), "velocities");
  auto resultGroup3 = getODSResults(3);
  if (!llvm::empty(resultGroup3))
    setNameFn(*resultGroup3.begin(), "gradient_accumulators");
}

std::pair<unsigned, unsigned> RetrieveTPUEmbeddingADAMParametersGradAccumDebugOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range RetrieveTPUEmbeddingADAMParametersGradAccumDebugOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

std::pair<unsigned, unsigned> RetrieveTPUEmbeddingADAMParametersGradAccumDebugOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range RetrieveTPUEmbeddingADAMParametersGradAccumDebugOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value RetrieveTPUEmbeddingADAMParametersGradAccumDebugOp::parameters() {
  return *getODSResults(0).begin();
}

::mlir::Value RetrieveTPUEmbeddingADAMParametersGradAccumDebugOp::momenta() {
  return *getODSResults(1).begin();
}

::mlir::Value RetrieveTPUEmbeddingADAMParametersGradAccumDebugOp::velocities() {
  return *getODSResults(2).begin();
}

::mlir::Value RetrieveTPUEmbeddingADAMParametersGradAccumDebugOp::gradient_accumulators() {
  return *getODSResults(3).begin();
}

::mlir::IntegerAttr RetrieveTPUEmbeddingADAMParametersGradAccumDebugOp::table_idAttr() {
  return (*this)->getAttr(table_idAttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t RetrieveTPUEmbeddingADAMParametersGradAccumDebugOp::table_id() {
  auto attr = table_idAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), -1).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

::mlir::StringAttr RetrieveTPUEmbeddingADAMParametersGradAccumDebugOp::table_nameAttr() {
  return (*this)->getAttr(table_nameAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef RetrieveTPUEmbeddingADAMParametersGradAccumDebugOp::table_name() {
  auto attr = table_nameAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("").getValue();
  return attr.getValue();
}

::mlir::IntegerAttr RetrieveTPUEmbeddingADAMParametersGradAccumDebugOp::num_shardsAttr() {
  return (*this)->getAttr(num_shardsAttrName()).cast<::mlir::IntegerAttr>();
}

uint64_t RetrieveTPUEmbeddingADAMParametersGradAccumDebugOp::num_shards() {
  auto attr = num_shardsAttr();
  return attr.getValue().getZExtValue();
}

::mlir::IntegerAttr RetrieveTPUEmbeddingADAMParametersGradAccumDebugOp::shard_idAttr() {
  return (*this)->getAttr(shard_idAttrName()).cast<::mlir::IntegerAttr>();
}

uint64_t RetrieveTPUEmbeddingADAMParametersGradAccumDebugOp::shard_id() {
  auto attr = shard_idAttr();
  return attr.getValue().getZExtValue();
}

::mlir::StringAttr RetrieveTPUEmbeddingADAMParametersGradAccumDebugOp::configAttr() {
  return (*this)->getAttr(configAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef RetrieveTPUEmbeddingADAMParametersGradAccumDebugOp::config() {
  auto attr = configAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("").getValue();
  return attr.getValue();
}

void RetrieveTPUEmbeddingADAMParametersGradAccumDebugOp::table_idAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(table_idAttrName(), attr);
}

void RetrieveTPUEmbeddingADAMParametersGradAccumDebugOp::table_nameAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(table_nameAttrName(), attr);
}

void RetrieveTPUEmbeddingADAMParametersGradAccumDebugOp::num_shardsAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(num_shardsAttrName(), attr);
}

void RetrieveTPUEmbeddingADAMParametersGradAccumDebugOp::shard_idAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(shard_idAttrName(), attr);
}

void RetrieveTPUEmbeddingADAMParametersGradAccumDebugOp::configAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(configAttrName(), attr);
}

void RetrieveTPUEmbeddingADAMParametersGradAccumDebugOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type parameters, ::mlir::Type momenta, ::mlir::Type velocities, ::mlir::Type gradient_accumulators, ::mlir::IntegerAttr table_id, ::mlir::StringAttr table_name, ::mlir::IntegerAttr num_shards, ::mlir::IntegerAttr shard_id, ::mlir::StringAttr config) {
  odsState.addAttribute(table_idAttrName(odsState.name), table_id);
  odsState.addAttribute(table_nameAttrName(odsState.name), table_name);
  odsState.addAttribute(num_shardsAttrName(odsState.name), num_shards);
  odsState.addAttribute(shard_idAttrName(odsState.name), shard_id);
  odsState.addAttribute(configAttrName(odsState.name), config);
  odsState.addTypes(parameters);
  odsState.addTypes(momenta);
  odsState.addTypes(velocities);
  odsState.addTypes(gradient_accumulators);
}

void RetrieveTPUEmbeddingADAMParametersGradAccumDebugOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::IntegerAttr table_id, ::mlir::StringAttr table_name, ::mlir::IntegerAttr num_shards, ::mlir::IntegerAttr shard_id, ::mlir::StringAttr config) {
  odsState.addAttribute(table_idAttrName(odsState.name), table_id);
  odsState.addAttribute(table_nameAttrName(odsState.name), table_name);
  odsState.addAttribute(num_shardsAttrName(odsState.name), num_shards);
  odsState.addAttribute(shard_idAttrName(odsState.name), shard_id);
  odsState.addAttribute(configAttrName(odsState.name), config);
  assert(resultTypes.size() == 4u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void RetrieveTPUEmbeddingADAMParametersGradAccumDebugOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type parameters, ::mlir::Type momenta, ::mlir::Type velocities, ::mlir::Type gradient_accumulators, uint64_t table_id, ::llvm::StringRef table_name, uint64_t num_shards, uint64_t shard_id, ::llvm::StringRef config) {
  odsState.addAttribute(table_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), table_id));
  odsState.addAttribute(table_nameAttrName(odsState.name), odsBuilder.getStringAttr(table_name));
  odsState.addAttribute(num_shardsAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), num_shards));
  odsState.addAttribute(shard_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), shard_id));
  odsState.addAttribute(configAttrName(odsState.name), odsBuilder.getStringAttr(config));
  odsState.addTypes(parameters);
  odsState.addTypes(momenta);
  odsState.addTypes(velocities);
  odsState.addTypes(gradient_accumulators);
}

void RetrieveTPUEmbeddingADAMParametersGradAccumDebugOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, uint64_t table_id, ::llvm::StringRef table_name, uint64_t num_shards, uint64_t shard_id, ::llvm::StringRef config) {
  odsState.addAttribute(table_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), table_id));
  odsState.addAttribute(table_nameAttrName(odsState.name), odsBuilder.getStringAttr(table_name));
  odsState.addAttribute(num_shardsAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), num_shards));
  odsState.addAttribute(shard_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), shard_id));
  odsState.addAttribute(configAttrName(odsState.name), odsBuilder.getStringAttr(config));
  assert(resultTypes.size() == 4u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void RetrieveTPUEmbeddingADAMParametersGradAccumDebugOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 0u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 4u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult RetrieveTPUEmbeddingADAMParametersGradAccumDebugOp::verify() {
  {
    auto tblgen_table_id = (*this)->getAttr(table_idAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_table_id, "table_id")))
      return ::mlir::failure();
  }
  {
    auto tblgen_table_name = (*this)->getAttr(table_nameAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_table_name, "table_name")))
      return ::mlir::failure();
  }
  {
    auto tblgen_num_shards = (*this)->getAttr(num_shardsAttrName());
    if (!tblgen_num_shards)
      return emitOpError("requires attribute 'num_shards'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_num_shards, "num_shards")))
      return ::mlir::failure();
  }
  {
    auto tblgen_shard_id = (*this)->getAttr(shard_idAttrName());
    if (!tblgen_shard_id)
      return emitOpError("requires attribute 'shard_id'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_shard_id, "shard_id")))
      return ::mlir::failure();
  }
  {
    auto tblgen_config = (*this)->getAttr(configAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_config, "config")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSResults(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSResults(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
    auto valueGroup3 = getODSResults(3);

    for (auto v : valueGroup3) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void RetrieveTPUEmbeddingADAMParametersGradAccumDebugOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  effects.emplace_back(::mlir::MemoryEffects::Write::get(), ::mlir::TF::ResourceEffects::MustExecute::get());
  effects.emplace_back(::mlir::MemoryEffects::Read::get(), ::mlir::TF::ResourceEffects::TPUEmbedding::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::RetrieveTPUEmbeddingADAMParametersGradAccumDebugOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::RetrieveTPUEmbeddingADAMParametersOp definitions
//===----------------------------------------------------------------------===//

RetrieveTPUEmbeddingADAMParametersOpAdaptor::RetrieveTPUEmbeddingADAMParametersOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

RetrieveTPUEmbeddingADAMParametersOpAdaptor::RetrieveTPUEmbeddingADAMParametersOpAdaptor(RetrieveTPUEmbeddingADAMParametersOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange RetrieveTPUEmbeddingADAMParametersOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> RetrieveTPUEmbeddingADAMParametersOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange RetrieveTPUEmbeddingADAMParametersOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::DictionaryAttr RetrieveTPUEmbeddingADAMParametersOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::IntegerAttr RetrieveTPUEmbeddingADAMParametersOpAdaptor::table_id() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("table_id").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), -1);
  return attr;
}

::mlir::StringAttr RetrieveTPUEmbeddingADAMParametersOpAdaptor::table_name() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("table_name").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("");
  return attr;
}

::mlir::IntegerAttr RetrieveTPUEmbeddingADAMParametersOpAdaptor::num_shards() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("num_shards").cast<::mlir::IntegerAttr>();
  return attr;
}

::mlir::IntegerAttr RetrieveTPUEmbeddingADAMParametersOpAdaptor::shard_id() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("shard_id").cast<::mlir::IntegerAttr>();
  return attr;
}

::mlir::StringAttr RetrieveTPUEmbeddingADAMParametersOpAdaptor::config() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("config").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("");
  return attr;
}

::mlir::LogicalResult RetrieveTPUEmbeddingADAMParametersOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_table_id = odsAttrs.get("table_id");
    if (tblgen_table_id && !(((tblgen_table_id.isa<::mlir::IntegerAttr>())) && ((tblgen_table_id.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.RetrieveTPUEmbeddingADAMParameters' op ""attribute 'table_id' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_table_name = odsAttrs.get("table_name");
    if (tblgen_table_name && !((tblgen_table_name.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.RetrieveTPUEmbeddingADAMParameters' op ""attribute 'table_name' failed to satisfy constraint: string attribute");
  }
  {
    auto tblgen_num_shards = odsAttrs.get("num_shards");
    if (!tblgen_num_shards)
      return emitError(loc, "'tf.RetrieveTPUEmbeddingADAMParameters' op ""requires attribute 'num_shards'");

    if (tblgen_num_shards && !(((tblgen_num_shards.isa<::mlir::IntegerAttr>())) && ((tblgen_num_shards.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.RetrieveTPUEmbeddingADAMParameters' op ""attribute 'num_shards' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_shard_id = odsAttrs.get("shard_id");
    if (!tblgen_shard_id)
      return emitError(loc, "'tf.RetrieveTPUEmbeddingADAMParameters' op ""requires attribute 'shard_id'");

    if (tblgen_shard_id && !(((tblgen_shard_id.isa<::mlir::IntegerAttr>())) && ((tblgen_shard_id.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.RetrieveTPUEmbeddingADAMParameters' op ""attribute 'shard_id' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_config = odsAttrs.get("config");
    if (tblgen_config && !((tblgen_config.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.RetrieveTPUEmbeddingADAMParameters' op ""attribute 'config' failed to satisfy constraint: string attribute");
  }
  return ::mlir::success();
}

void RetrieveTPUEmbeddingADAMParametersOp::getAsmResultNames(::mlir::OpAsmSetValueNameFn setNameFn) {
  auto resultGroup0 = getODSResults(0);
  if (!llvm::empty(resultGroup0))
    setNameFn(*resultGroup0.begin(), "parameters");
  auto resultGroup1 = getODSResults(1);
  if (!llvm::empty(resultGroup1))
    setNameFn(*resultGroup1.begin(), "momenta");
  auto resultGroup2 = getODSResults(2);
  if (!llvm::empty(resultGroup2))
    setNameFn(*resultGroup2.begin(), "velocities");
}

std::pair<unsigned, unsigned> RetrieveTPUEmbeddingADAMParametersOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range RetrieveTPUEmbeddingADAMParametersOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

std::pair<unsigned, unsigned> RetrieveTPUEmbeddingADAMParametersOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range RetrieveTPUEmbeddingADAMParametersOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value RetrieveTPUEmbeddingADAMParametersOp::parameters() {
  return *getODSResults(0).begin();
}

::mlir::Value RetrieveTPUEmbeddingADAMParametersOp::momenta() {
  return *getODSResults(1).begin();
}

::mlir::Value RetrieveTPUEmbeddingADAMParametersOp::velocities() {
  return *getODSResults(2).begin();
}

::mlir::IntegerAttr RetrieveTPUEmbeddingADAMParametersOp::table_idAttr() {
  return (*this)->getAttr(table_idAttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t RetrieveTPUEmbeddingADAMParametersOp::table_id() {
  auto attr = table_idAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), -1).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

::mlir::StringAttr RetrieveTPUEmbeddingADAMParametersOp::table_nameAttr() {
  return (*this)->getAttr(table_nameAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef RetrieveTPUEmbeddingADAMParametersOp::table_name() {
  auto attr = table_nameAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("").getValue();
  return attr.getValue();
}

::mlir::IntegerAttr RetrieveTPUEmbeddingADAMParametersOp::num_shardsAttr() {
  return (*this)->getAttr(num_shardsAttrName()).cast<::mlir::IntegerAttr>();
}

uint64_t RetrieveTPUEmbeddingADAMParametersOp::num_shards() {
  auto attr = num_shardsAttr();
  return attr.getValue().getZExtValue();
}

::mlir::IntegerAttr RetrieveTPUEmbeddingADAMParametersOp::shard_idAttr() {
  return (*this)->getAttr(shard_idAttrName()).cast<::mlir::IntegerAttr>();
}

uint64_t RetrieveTPUEmbeddingADAMParametersOp::shard_id() {
  auto attr = shard_idAttr();
  return attr.getValue().getZExtValue();
}

::mlir::StringAttr RetrieveTPUEmbeddingADAMParametersOp::configAttr() {
  return (*this)->getAttr(configAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef RetrieveTPUEmbeddingADAMParametersOp::config() {
  auto attr = configAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("").getValue();
  return attr.getValue();
}

void RetrieveTPUEmbeddingADAMParametersOp::table_idAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(table_idAttrName(), attr);
}

void RetrieveTPUEmbeddingADAMParametersOp::table_nameAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(table_nameAttrName(), attr);
}

void RetrieveTPUEmbeddingADAMParametersOp::num_shardsAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(num_shardsAttrName(), attr);
}

void RetrieveTPUEmbeddingADAMParametersOp::shard_idAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(shard_idAttrName(), attr);
}

void RetrieveTPUEmbeddingADAMParametersOp::configAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(configAttrName(), attr);
}

void RetrieveTPUEmbeddingADAMParametersOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type parameters, ::mlir::Type momenta, ::mlir::Type velocities, ::mlir::IntegerAttr table_id, ::mlir::StringAttr table_name, ::mlir::IntegerAttr num_shards, ::mlir::IntegerAttr shard_id, ::mlir::StringAttr config) {
  odsState.addAttribute(table_idAttrName(odsState.name), table_id);
  odsState.addAttribute(table_nameAttrName(odsState.name), table_name);
  odsState.addAttribute(num_shardsAttrName(odsState.name), num_shards);
  odsState.addAttribute(shard_idAttrName(odsState.name), shard_id);
  odsState.addAttribute(configAttrName(odsState.name), config);
  odsState.addTypes(parameters);
  odsState.addTypes(momenta);
  odsState.addTypes(velocities);
}

void RetrieveTPUEmbeddingADAMParametersOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::IntegerAttr table_id, ::mlir::StringAttr table_name, ::mlir::IntegerAttr num_shards, ::mlir::IntegerAttr shard_id, ::mlir::StringAttr config) {
  odsState.addAttribute(table_idAttrName(odsState.name), table_id);
  odsState.addAttribute(table_nameAttrName(odsState.name), table_name);
  odsState.addAttribute(num_shardsAttrName(odsState.name), num_shards);
  odsState.addAttribute(shard_idAttrName(odsState.name), shard_id);
  odsState.addAttribute(configAttrName(odsState.name), config);
  assert(resultTypes.size() == 3u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void RetrieveTPUEmbeddingADAMParametersOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type parameters, ::mlir::Type momenta, ::mlir::Type velocities, uint64_t table_id, ::llvm::StringRef table_name, uint64_t num_shards, uint64_t shard_id, ::llvm::StringRef config) {
  odsState.addAttribute(table_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), table_id));
  odsState.addAttribute(table_nameAttrName(odsState.name), odsBuilder.getStringAttr(table_name));
  odsState.addAttribute(num_shardsAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), num_shards));
  odsState.addAttribute(shard_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), shard_id));
  odsState.addAttribute(configAttrName(odsState.name), odsBuilder.getStringAttr(config));
  odsState.addTypes(parameters);
  odsState.addTypes(momenta);
  odsState.addTypes(velocities);
}

void RetrieveTPUEmbeddingADAMParametersOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, uint64_t table_id, ::llvm::StringRef table_name, uint64_t num_shards, uint64_t shard_id, ::llvm::StringRef config) {
  odsState.addAttribute(table_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), table_id));
  odsState.addAttribute(table_nameAttrName(odsState.name), odsBuilder.getStringAttr(table_name));
  odsState.addAttribute(num_shardsAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), num_shards));
  odsState.addAttribute(shard_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), shard_id));
  odsState.addAttribute(configAttrName(odsState.name), odsBuilder.getStringAttr(config));
  assert(resultTypes.size() == 3u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void RetrieveTPUEmbeddingADAMParametersOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 0u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 3u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult RetrieveTPUEmbeddingADAMParametersOp::verify() {
  {
    auto tblgen_table_id = (*this)->getAttr(table_idAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_table_id, "table_id")))
      return ::mlir::failure();
  }
  {
    auto tblgen_table_name = (*this)->getAttr(table_nameAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_table_name, "table_name")))
      return ::mlir::failure();
  }
  {
    auto tblgen_num_shards = (*this)->getAttr(num_shardsAttrName());
    if (!tblgen_num_shards)
      return emitOpError("requires attribute 'num_shards'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_num_shards, "num_shards")))
      return ::mlir::failure();
  }
  {
    auto tblgen_shard_id = (*this)->getAttr(shard_idAttrName());
    if (!tblgen_shard_id)
      return emitOpError("requires attribute 'shard_id'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_shard_id, "shard_id")))
      return ::mlir::failure();
  }
  {
    auto tblgen_config = (*this)->getAttr(configAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_config, "config")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSResults(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSResults(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void RetrieveTPUEmbeddingADAMParametersOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  effects.emplace_back(::mlir::MemoryEffects::Write::get(), ::mlir::TF::ResourceEffects::MustExecute::get());
  effects.emplace_back(::mlir::MemoryEffects::Read::get(), ::mlir::TF::ResourceEffects::TPUEmbedding::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::RetrieveTPUEmbeddingADAMParametersOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::RetrieveTPUEmbeddingAdadeltaParametersGradAccumDebugOp definitions
//===----------------------------------------------------------------------===//

RetrieveTPUEmbeddingAdadeltaParametersGradAccumDebugOpAdaptor::RetrieveTPUEmbeddingAdadeltaParametersGradAccumDebugOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

RetrieveTPUEmbeddingAdadeltaParametersGradAccumDebugOpAdaptor::RetrieveTPUEmbeddingAdadeltaParametersGradAccumDebugOpAdaptor(RetrieveTPUEmbeddingAdadeltaParametersGradAccumDebugOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange RetrieveTPUEmbeddingAdadeltaParametersGradAccumDebugOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> RetrieveTPUEmbeddingAdadeltaParametersGradAccumDebugOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange RetrieveTPUEmbeddingAdadeltaParametersGradAccumDebugOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::DictionaryAttr RetrieveTPUEmbeddingAdadeltaParametersGradAccumDebugOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::IntegerAttr RetrieveTPUEmbeddingAdadeltaParametersGradAccumDebugOpAdaptor::table_id() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("table_id").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), -1);
  return attr;
}

::mlir::StringAttr RetrieveTPUEmbeddingAdadeltaParametersGradAccumDebugOpAdaptor::table_name() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("table_name").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("");
  return attr;
}

::mlir::IntegerAttr RetrieveTPUEmbeddingAdadeltaParametersGradAccumDebugOpAdaptor::num_shards() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("num_shards").cast<::mlir::IntegerAttr>();
  return attr;
}

::mlir::IntegerAttr RetrieveTPUEmbeddingAdadeltaParametersGradAccumDebugOpAdaptor::shard_id() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("shard_id").cast<::mlir::IntegerAttr>();
  return attr;
}

::mlir::StringAttr RetrieveTPUEmbeddingAdadeltaParametersGradAccumDebugOpAdaptor::config() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("config").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("");
  return attr;
}

::mlir::LogicalResult RetrieveTPUEmbeddingAdadeltaParametersGradAccumDebugOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_table_id = odsAttrs.get("table_id");
    if (tblgen_table_id && !(((tblgen_table_id.isa<::mlir::IntegerAttr>())) && ((tblgen_table_id.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.RetrieveTPUEmbeddingAdadeltaParametersGradAccumDebug' op ""attribute 'table_id' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_table_name = odsAttrs.get("table_name");
    if (tblgen_table_name && !((tblgen_table_name.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.RetrieveTPUEmbeddingAdadeltaParametersGradAccumDebug' op ""attribute 'table_name' failed to satisfy constraint: string attribute");
  }
  {
    auto tblgen_num_shards = odsAttrs.get("num_shards");
    if (!tblgen_num_shards)
      return emitError(loc, "'tf.RetrieveTPUEmbeddingAdadeltaParametersGradAccumDebug' op ""requires attribute 'num_shards'");

    if (tblgen_num_shards && !(((tblgen_num_shards.isa<::mlir::IntegerAttr>())) && ((tblgen_num_shards.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.RetrieveTPUEmbeddingAdadeltaParametersGradAccumDebug' op ""attribute 'num_shards' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_shard_id = odsAttrs.get("shard_id");
    if (!tblgen_shard_id)
      return emitError(loc, "'tf.RetrieveTPUEmbeddingAdadeltaParametersGradAccumDebug' op ""requires attribute 'shard_id'");

    if (tblgen_shard_id && !(((tblgen_shard_id.isa<::mlir::IntegerAttr>())) && ((tblgen_shard_id.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.RetrieveTPUEmbeddingAdadeltaParametersGradAccumDebug' op ""attribute 'shard_id' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_config = odsAttrs.get("config");
    if (tblgen_config && !((tblgen_config.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.RetrieveTPUEmbeddingAdadeltaParametersGradAccumDebug' op ""attribute 'config' failed to satisfy constraint: string attribute");
  }
  return ::mlir::success();
}

void RetrieveTPUEmbeddingAdadeltaParametersGradAccumDebugOp::getAsmResultNames(::mlir::OpAsmSetValueNameFn setNameFn) {
  auto resultGroup0 = getODSResults(0);
  if (!llvm::empty(resultGroup0))
    setNameFn(*resultGroup0.begin(), "parameters");
  auto resultGroup1 = getODSResults(1);
  if (!llvm::empty(resultGroup1))
    setNameFn(*resultGroup1.begin(), "accumulators");
  auto resultGroup2 = getODSResults(2);
  if (!llvm::empty(resultGroup2))
    setNameFn(*resultGroup2.begin(), "updates");
  auto resultGroup3 = getODSResults(3);
  if (!llvm::empty(resultGroup3))
    setNameFn(*resultGroup3.begin(), "gradient_accumulators");
}

std::pair<unsigned, unsigned> RetrieveTPUEmbeddingAdadeltaParametersGradAccumDebugOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range RetrieveTPUEmbeddingAdadeltaParametersGradAccumDebugOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

std::pair<unsigned, unsigned> RetrieveTPUEmbeddingAdadeltaParametersGradAccumDebugOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range RetrieveTPUEmbeddingAdadeltaParametersGradAccumDebugOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value RetrieveTPUEmbeddingAdadeltaParametersGradAccumDebugOp::parameters() {
  return *getODSResults(0).begin();
}

::mlir::Value RetrieveTPUEmbeddingAdadeltaParametersGradAccumDebugOp::accumulators() {
  return *getODSResults(1).begin();
}

::mlir::Value RetrieveTPUEmbeddingAdadeltaParametersGradAccumDebugOp::updates() {
  return *getODSResults(2).begin();
}

::mlir::Value RetrieveTPUEmbeddingAdadeltaParametersGradAccumDebugOp::gradient_accumulators() {
  return *getODSResults(3).begin();
}

::mlir::IntegerAttr RetrieveTPUEmbeddingAdadeltaParametersGradAccumDebugOp::table_idAttr() {
  return (*this)->getAttr(table_idAttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t RetrieveTPUEmbeddingAdadeltaParametersGradAccumDebugOp::table_id() {
  auto attr = table_idAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), -1).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

::mlir::StringAttr RetrieveTPUEmbeddingAdadeltaParametersGradAccumDebugOp::table_nameAttr() {
  return (*this)->getAttr(table_nameAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef RetrieveTPUEmbeddingAdadeltaParametersGradAccumDebugOp::table_name() {
  auto attr = table_nameAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("").getValue();
  return attr.getValue();
}

::mlir::IntegerAttr RetrieveTPUEmbeddingAdadeltaParametersGradAccumDebugOp::num_shardsAttr() {
  return (*this)->getAttr(num_shardsAttrName()).cast<::mlir::IntegerAttr>();
}

uint64_t RetrieveTPUEmbeddingAdadeltaParametersGradAccumDebugOp::num_shards() {
  auto attr = num_shardsAttr();
  return attr.getValue().getZExtValue();
}

::mlir::IntegerAttr RetrieveTPUEmbeddingAdadeltaParametersGradAccumDebugOp::shard_idAttr() {
  return (*this)->getAttr(shard_idAttrName()).cast<::mlir::IntegerAttr>();
}

uint64_t RetrieveTPUEmbeddingAdadeltaParametersGradAccumDebugOp::shard_id() {
  auto attr = shard_idAttr();
  return attr.getValue().getZExtValue();
}

::mlir::StringAttr RetrieveTPUEmbeddingAdadeltaParametersGradAccumDebugOp::configAttr() {
  return (*this)->getAttr(configAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef RetrieveTPUEmbeddingAdadeltaParametersGradAccumDebugOp::config() {
  auto attr = configAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("").getValue();
  return attr.getValue();
}

void RetrieveTPUEmbeddingAdadeltaParametersGradAccumDebugOp::table_idAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(table_idAttrName(), attr);
}

void RetrieveTPUEmbeddingAdadeltaParametersGradAccumDebugOp::table_nameAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(table_nameAttrName(), attr);
}

void RetrieveTPUEmbeddingAdadeltaParametersGradAccumDebugOp::num_shardsAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(num_shardsAttrName(), attr);
}

void RetrieveTPUEmbeddingAdadeltaParametersGradAccumDebugOp::shard_idAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(shard_idAttrName(), attr);
}

void RetrieveTPUEmbeddingAdadeltaParametersGradAccumDebugOp::configAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(configAttrName(), attr);
}

void RetrieveTPUEmbeddingAdadeltaParametersGradAccumDebugOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type parameters, ::mlir::Type accumulators, ::mlir::Type updates, ::mlir::Type gradient_accumulators, ::mlir::IntegerAttr table_id, ::mlir::StringAttr table_name, ::mlir::IntegerAttr num_shards, ::mlir::IntegerAttr shard_id, ::mlir::StringAttr config) {
  odsState.addAttribute(table_idAttrName(odsState.name), table_id);
  odsState.addAttribute(table_nameAttrName(odsState.name), table_name);
  odsState.addAttribute(num_shardsAttrName(odsState.name), num_shards);
  odsState.addAttribute(shard_idAttrName(odsState.name), shard_id);
  odsState.addAttribute(configAttrName(odsState.name), config);
  odsState.addTypes(parameters);
  odsState.addTypes(accumulators);
  odsState.addTypes(updates);
  odsState.addTypes(gradient_accumulators);
}

void RetrieveTPUEmbeddingAdadeltaParametersGradAccumDebugOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::IntegerAttr table_id, ::mlir::StringAttr table_name, ::mlir::IntegerAttr num_shards, ::mlir::IntegerAttr shard_id, ::mlir::StringAttr config) {
  odsState.addAttribute(table_idAttrName(odsState.name), table_id);
  odsState.addAttribute(table_nameAttrName(odsState.name), table_name);
  odsState.addAttribute(num_shardsAttrName(odsState.name), num_shards);
  odsState.addAttribute(shard_idAttrName(odsState.name), shard_id);
  odsState.addAttribute(configAttrName(odsState.name), config);
  assert(resultTypes.size() == 4u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void RetrieveTPUEmbeddingAdadeltaParametersGradAccumDebugOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type parameters, ::mlir::Type accumulators, ::mlir::Type updates, ::mlir::Type gradient_accumulators, uint64_t table_id, ::llvm::StringRef table_name, uint64_t num_shards, uint64_t shard_id, ::llvm::StringRef config) {
  odsState.addAttribute(table_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), table_id));
  odsState.addAttribute(table_nameAttrName(odsState.name), odsBuilder.getStringAttr(table_name));
  odsState.addAttribute(num_shardsAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), num_shards));
  odsState.addAttribute(shard_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), shard_id));
  odsState.addAttribute(configAttrName(odsState.name), odsBuilder.getStringAttr(config));
  odsState.addTypes(parameters);
  odsState.addTypes(accumulators);
  odsState.addTypes(updates);
  odsState.addTypes(gradient_accumulators);
}

void RetrieveTPUEmbeddingAdadeltaParametersGradAccumDebugOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, uint64_t table_id, ::llvm::StringRef table_name, uint64_t num_shards, uint64_t shard_id, ::llvm::StringRef config) {
  odsState.addAttribute(table_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), table_id));
  odsState.addAttribute(table_nameAttrName(odsState.name), odsBuilder.getStringAttr(table_name));
  odsState.addAttribute(num_shardsAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), num_shards));
  odsState.addAttribute(shard_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), shard_id));
  odsState.addAttribute(configAttrName(odsState.name), odsBuilder.getStringAttr(config));
  assert(resultTypes.size() == 4u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void RetrieveTPUEmbeddingAdadeltaParametersGradAccumDebugOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 0u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 4u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult RetrieveTPUEmbeddingAdadeltaParametersGradAccumDebugOp::verify() {
  {
    auto tblgen_table_id = (*this)->getAttr(table_idAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_table_id, "table_id")))
      return ::mlir::failure();
  }
  {
    auto tblgen_table_name = (*this)->getAttr(table_nameAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_table_name, "table_name")))
      return ::mlir::failure();
  }
  {
    auto tblgen_num_shards = (*this)->getAttr(num_shardsAttrName());
    if (!tblgen_num_shards)
      return emitOpError("requires attribute 'num_shards'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_num_shards, "num_shards")))
      return ::mlir::failure();
  }
  {
    auto tblgen_shard_id = (*this)->getAttr(shard_idAttrName());
    if (!tblgen_shard_id)
      return emitOpError("requires attribute 'shard_id'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_shard_id, "shard_id")))
      return ::mlir::failure();
  }
  {
    auto tblgen_config = (*this)->getAttr(configAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_config, "config")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSResults(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSResults(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
    auto valueGroup3 = getODSResults(3);

    for (auto v : valueGroup3) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void RetrieveTPUEmbeddingAdadeltaParametersGradAccumDebugOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  effects.emplace_back(::mlir::MemoryEffects::Write::get(), ::mlir::TF::ResourceEffects::MustExecute::get());
  effects.emplace_back(::mlir::MemoryEffects::Read::get(), ::mlir::TF::ResourceEffects::TPUEmbedding::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::RetrieveTPUEmbeddingAdadeltaParametersGradAccumDebugOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::RetrieveTPUEmbeddingAdadeltaParametersOp definitions
//===----------------------------------------------------------------------===//

RetrieveTPUEmbeddingAdadeltaParametersOpAdaptor::RetrieveTPUEmbeddingAdadeltaParametersOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

RetrieveTPUEmbeddingAdadeltaParametersOpAdaptor::RetrieveTPUEmbeddingAdadeltaParametersOpAdaptor(RetrieveTPUEmbeddingAdadeltaParametersOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange RetrieveTPUEmbeddingAdadeltaParametersOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> RetrieveTPUEmbeddingAdadeltaParametersOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange RetrieveTPUEmbeddingAdadeltaParametersOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::DictionaryAttr RetrieveTPUEmbeddingAdadeltaParametersOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::IntegerAttr RetrieveTPUEmbeddingAdadeltaParametersOpAdaptor::table_id() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("table_id").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), -1);
  return attr;
}

::mlir::StringAttr RetrieveTPUEmbeddingAdadeltaParametersOpAdaptor::table_name() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("table_name").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("");
  return attr;
}

::mlir::IntegerAttr RetrieveTPUEmbeddingAdadeltaParametersOpAdaptor::num_shards() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("num_shards").cast<::mlir::IntegerAttr>();
  return attr;
}

::mlir::IntegerAttr RetrieveTPUEmbeddingAdadeltaParametersOpAdaptor::shard_id() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("shard_id").cast<::mlir::IntegerAttr>();
  return attr;
}

::mlir::StringAttr RetrieveTPUEmbeddingAdadeltaParametersOpAdaptor::config() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("config").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("");
  return attr;
}

::mlir::LogicalResult RetrieveTPUEmbeddingAdadeltaParametersOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_table_id = odsAttrs.get("table_id");
    if (tblgen_table_id && !(((tblgen_table_id.isa<::mlir::IntegerAttr>())) && ((tblgen_table_id.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.RetrieveTPUEmbeddingAdadeltaParameters' op ""attribute 'table_id' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_table_name = odsAttrs.get("table_name");
    if (tblgen_table_name && !((tblgen_table_name.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.RetrieveTPUEmbeddingAdadeltaParameters' op ""attribute 'table_name' failed to satisfy constraint: string attribute");
  }
  {
    auto tblgen_num_shards = odsAttrs.get("num_shards");
    if (!tblgen_num_shards)
      return emitError(loc, "'tf.RetrieveTPUEmbeddingAdadeltaParameters' op ""requires attribute 'num_shards'");

    if (tblgen_num_shards && !(((tblgen_num_shards.isa<::mlir::IntegerAttr>())) && ((tblgen_num_shards.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.RetrieveTPUEmbeddingAdadeltaParameters' op ""attribute 'num_shards' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_shard_id = odsAttrs.get("shard_id");
    if (!tblgen_shard_id)
      return emitError(loc, "'tf.RetrieveTPUEmbeddingAdadeltaParameters' op ""requires attribute 'shard_id'");

    if (tblgen_shard_id && !(((tblgen_shard_id.isa<::mlir::IntegerAttr>())) && ((tblgen_shard_id.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.RetrieveTPUEmbeddingAdadeltaParameters' op ""attribute 'shard_id' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_config = odsAttrs.get("config");
    if (tblgen_config && !((tblgen_config.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.RetrieveTPUEmbeddingAdadeltaParameters' op ""attribute 'config' failed to satisfy constraint: string attribute");
  }
  return ::mlir::success();
}

void RetrieveTPUEmbeddingAdadeltaParametersOp::getAsmResultNames(::mlir::OpAsmSetValueNameFn setNameFn) {
  auto resultGroup0 = getODSResults(0);
  if (!llvm::empty(resultGroup0))
    setNameFn(*resultGroup0.begin(), "parameters");
  auto resultGroup1 = getODSResults(1);
  if (!llvm::empty(resultGroup1))
    setNameFn(*resultGroup1.begin(), "accumulators");
  auto resultGroup2 = getODSResults(2);
  if (!llvm::empty(resultGroup2))
    setNameFn(*resultGroup2.begin(), "updates");
}

std::pair<unsigned, unsigned> RetrieveTPUEmbeddingAdadeltaParametersOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range RetrieveTPUEmbeddingAdadeltaParametersOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

std::pair<unsigned, unsigned> RetrieveTPUEmbeddingAdadeltaParametersOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range RetrieveTPUEmbeddingAdadeltaParametersOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value RetrieveTPUEmbeddingAdadeltaParametersOp::parameters() {
  return *getODSResults(0).begin();
}

::mlir::Value RetrieveTPUEmbeddingAdadeltaParametersOp::accumulators() {
  return *getODSResults(1).begin();
}

::mlir::Value RetrieveTPUEmbeddingAdadeltaParametersOp::updates() {
  return *getODSResults(2).begin();
}

::mlir::IntegerAttr RetrieveTPUEmbeddingAdadeltaParametersOp::table_idAttr() {
  return (*this)->getAttr(table_idAttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t RetrieveTPUEmbeddingAdadeltaParametersOp::table_id() {
  auto attr = table_idAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), -1).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

::mlir::StringAttr RetrieveTPUEmbeddingAdadeltaParametersOp::table_nameAttr() {
  return (*this)->getAttr(table_nameAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef RetrieveTPUEmbeddingAdadeltaParametersOp::table_name() {
  auto attr = table_nameAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("").getValue();
  return attr.getValue();
}

::mlir::IntegerAttr RetrieveTPUEmbeddingAdadeltaParametersOp::num_shardsAttr() {
  return (*this)->getAttr(num_shardsAttrName()).cast<::mlir::IntegerAttr>();
}

uint64_t RetrieveTPUEmbeddingAdadeltaParametersOp::num_shards() {
  auto attr = num_shardsAttr();
  return attr.getValue().getZExtValue();
}

::mlir::IntegerAttr RetrieveTPUEmbeddingAdadeltaParametersOp::shard_idAttr() {
  return (*this)->getAttr(shard_idAttrName()).cast<::mlir::IntegerAttr>();
}

uint64_t RetrieveTPUEmbeddingAdadeltaParametersOp::shard_id() {
  auto attr = shard_idAttr();
  return attr.getValue().getZExtValue();
}

::mlir::StringAttr RetrieveTPUEmbeddingAdadeltaParametersOp::configAttr() {
  return (*this)->getAttr(configAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef RetrieveTPUEmbeddingAdadeltaParametersOp::config() {
  auto attr = configAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("").getValue();
  return attr.getValue();
}

void RetrieveTPUEmbeddingAdadeltaParametersOp::table_idAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(table_idAttrName(), attr);
}

void RetrieveTPUEmbeddingAdadeltaParametersOp::table_nameAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(table_nameAttrName(), attr);
}

void RetrieveTPUEmbeddingAdadeltaParametersOp::num_shardsAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(num_shardsAttrName(), attr);
}

void RetrieveTPUEmbeddingAdadeltaParametersOp::shard_idAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(shard_idAttrName(), attr);
}

void RetrieveTPUEmbeddingAdadeltaParametersOp::configAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(configAttrName(), attr);
}

void RetrieveTPUEmbeddingAdadeltaParametersOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type parameters, ::mlir::Type accumulators, ::mlir::Type updates, ::mlir::IntegerAttr table_id, ::mlir::StringAttr table_name, ::mlir::IntegerAttr num_shards, ::mlir::IntegerAttr shard_id, ::mlir::StringAttr config) {
  odsState.addAttribute(table_idAttrName(odsState.name), table_id);
  odsState.addAttribute(table_nameAttrName(odsState.name), table_name);
  odsState.addAttribute(num_shardsAttrName(odsState.name), num_shards);
  odsState.addAttribute(shard_idAttrName(odsState.name), shard_id);
  odsState.addAttribute(configAttrName(odsState.name), config);
  odsState.addTypes(parameters);
  odsState.addTypes(accumulators);
  odsState.addTypes(updates);
}

void RetrieveTPUEmbeddingAdadeltaParametersOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::IntegerAttr table_id, ::mlir::StringAttr table_name, ::mlir::IntegerAttr num_shards, ::mlir::IntegerAttr shard_id, ::mlir::StringAttr config) {
  odsState.addAttribute(table_idAttrName(odsState.name), table_id);
  odsState.addAttribute(table_nameAttrName(odsState.name), table_name);
  odsState.addAttribute(num_shardsAttrName(odsState.name), num_shards);
  odsState.addAttribute(shard_idAttrName(odsState.name), shard_id);
  odsState.addAttribute(configAttrName(odsState.name), config);
  assert(resultTypes.size() == 3u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void RetrieveTPUEmbeddingAdadeltaParametersOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type parameters, ::mlir::Type accumulators, ::mlir::Type updates, uint64_t table_id, ::llvm::StringRef table_name, uint64_t num_shards, uint64_t shard_id, ::llvm::StringRef config) {
  odsState.addAttribute(table_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), table_id));
  odsState.addAttribute(table_nameAttrName(odsState.name), odsBuilder.getStringAttr(table_name));
  odsState.addAttribute(num_shardsAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), num_shards));
  odsState.addAttribute(shard_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), shard_id));
  odsState.addAttribute(configAttrName(odsState.name), odsBuilder.getStringAttr(config));
  odsState.addTypes(parameters);
  odsState.addTypes(accumulators);
  odsState.addTypes(updates);
}

void RetrieveTPUEmbeddingAdadeltaParametersOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, uint64_t table_id, ::llvm::StringRef table_name, uint64_t num_shards, uint64_t shard_id, ::llvm::StringRef config) {
  odsState.addAttribute(table_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), table_id));
  odsState.addAttribute(table_nameAttrName(odsState.name), odsBuilder.getStringAttr(table_name));
  odsState.addAttribute(num_shardsAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), num_shards));
  odsState.addAttribute(shard_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), shard_id));
  odsState.addAttribute(configAttrName(odsState.name), odsBuilder.getStringAttr(config));
  assert(resultTypes.size() == 3u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void RetrieveTPUEmbeddingAdadeltaParametersOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 0u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 3u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult RetrieveTPUEmbeddingAdadeltaParametersOp::verify() {
  {
    auto tblgen_table_id = (*this)->getAttr(table_idAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_table_id, "table_id")))
      return ::mlir::failure();
  }
  {
    auto tblgen_table_name = (*this)->getAttr(table_nameAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_table_name, "table_name")))
      return ::mlir::failure();
  }
  {
    auto tblgen_num_shards = (*this)->getAttr(num_shardsAttrName());
    if (!tblgen_num_shards)
      return emitOpError("requires attribute 'num_shards'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_num_shards, "num_shards")))
      return ::mlir::failure();
  }
  {
    auto tblgen_shard_id = (*this)->getAttr(shard_idAttrName());
    if (!tblgen_shard_id)
      return emitOpError("requires attribute 'shard_id'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_shard_id, "shard_id")))
      return ::mlir::failure();
  }
  {
    auto tblgen_config = (*this)->getAttr(configAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_config, "config")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSResults(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSResults(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void RetrieveTPUEmbeddingAdadeltaParametersOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  effects.emplace_back(::mlir::MemoryEffects::Write::get(), ::mlir::TF::ResourceEffects::MustExecute::get());
  effects.emplace_back(::mlir::MemoryEffects::Read::get(), ::mlir::TF::ResourceEffects::TPUEmbedding::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::RetrieveTPUEmbeddingAdadeltaParametersOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::RetrieveTPUEmbeddingAdagradParametersGradAccumDebugOp definitions
//===----------------------------------------------------------------------===//

RetrieveTPUEmbeddingAdagradParametersGradAccumDebugOpAdaptor::RetrieveTPUEmbeddingAdagradParametersGradAccumDebugOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

RetrieveTPUEmbeddingAdagradParametersGradAccumDebugOpAdaptor::RetrieveTPUEmbeddingAdagradParametersGradAccumDebugOpAdaptor(RetrieveTPUEmbeddingAdagradParametersGradAccumDebugOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange RetrieveTPUEmbeddingAdagradParametersGradAccumDebugOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> RetrieveTPUEmbeddingAdagradParametersGradAccumDebugOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange RetrieveTPUEmbeddingAdagradParametersGradAccumDebugOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::DictionaryAttr RetrieveTPUEmbeddingAdagradParametersGradAccumDebugOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::IntegerAttr RetrieveTPUEmbeddingAdagradParametersGradAccumDebugOpAdaptor::table_id() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("table_id").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), -1);
  return attr;
}

::mlir::StringAttr RetrieveTPUEmbeddingAdagradParametersGradAccumDebugOpAdaptor::table_name() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("table_name").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("");
  return attr;
}

::mlir::IntegerAttr RetrieveTPUEmbeddingAdagradParametersGradAccumDebugOpAdaptor::num_shards() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("num_shards").cast<::mlir::IntegerAttr>();
  return attr;
}

::mlir::IntegerAttr RetrieveTPUEmbeddingAdagradParametersGradAccumDebugOpAdaptor::shard_id() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("shard_id").cast<::mlir::IntegerAttr>();
  return attr;
}

::mlir::StringAttr RetrieveTPUEmbeddingAdagradParametersGradAccumDebugOpAdaptor::config() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("config").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("");
  return attr;
}

::mlir::LogicalResult RetrieveTPUEmbeddingAdagradParametersGradAccumDebugOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_table_id = odsAttrs.get("table_id");
    if (tblgen_table_id && !(((tblgen_table_id.isa<::mlir::IntegerAttr>())) && ((tblgen_table_id.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.RetrieveTPUEmbeddingAdagradParametersGradAccumDebug' op ""attribute 'table_id' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_table_name = odsAttrs.get("table_name");
    if (tblgen_table_name && !((tblgen_table_name.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.RetrieveTPUEmbeddingAdagradParametersGradAccumDebug' op ""attribute 'table_name' failed to satisfy constraint: string attribute");
  }
  {
    auto tblgen_num_shards = odsAttrs.get("num_shards");
    if (!tblgen_num_shards)
      return emitError(loc, "'tf.RetrieveTPUEmbeddingAdagradParametersGradAccumDebug' op ""requires attribute 'num_shards'");

    if (tblgen_num_shards && !(((tblgen_num_shards.isa<::mlir::IntegerAttr>())) && ((tblgen_num_shards.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.RetrieveTPUEmbeddingAdagradParametersGradAccumDebug' op ""attribute 'num_shards' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_shard_id = odsAttrs.get("shard_id");
    if (!tblgen_shard_id)
      return emitError(loc, "'tf.RetrieveTPUEmbeddingAdagradParametersGradAccumDebug' op ""requires attribute 'shard_id'");

    if (tblgen_shard_id && !(((tblgen_shard_id.isa<::mlir::IntegerAttr>())) && ((tblgen_shard_id.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.RetrieveTPUEmbeddingAdagradParametersGradAccumDebug' op ""attribute 'shard_id' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_config = odsAttrs.get("config");
    if (tblgen_config && !((tblgen_config.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.RetrieveTPUEmbeddingAdagradParametersGradAccumDebug' op ""attribute 'config' failed to satisfy constraint: string attribute");
  }
  return ::mlir::success();
}

void RetrieveTPUEmbeddingAdagradParametersGradAccumDebugOp::getAsmResultNames(::mlir::OpAsmSetValueNameFn setNameFn) {
  auto resultGroup0 = getODSResults(0);
  if (!llvm::empty(resultGroup0))
    setNameFn(*resultGroup0.begin(), "parameters");
  auto resultGroup1 = getODSResults(1);
  if (!llvm::empty(resultGroup1))
    setNameFn(*resultGroup1.begin(), "accumulators");
  auto resultGroup2 = getODSResults(2);
  if (!llvm::empty(resultGroup2))
    setNameFn(*resultGroup2.begin(), "gradient_accumulators");
}

std::pair<unsigned, unsigned> RetrieveTPUEmbeddingAdagradParametersGradAccumDebugOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range RetrieveTPUEmbeddingAdagradParametersGradAccumDebugOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

std::pair<unsigned, unsigned> RetrieveTPUEmbeddingAdagradParametersGradAccumDebugOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range RetrieveTPUEmbeddingAdagradParametersGradAccumDebugOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value RetrieveTPUEmbeddingAdagradParametersGradAccumDebugOp::parameters() {
  return *getODSResults(0).begin();
}

::mlir::Value RetrieveTPUEmbeddingAdagradParametersGradAccumDebugOp::accumulators() {
  return *getODSResults(1).begin();
}

::mlir::Value RetrieveTPUEmbeddingAdagradParametersGradAccumDebugOp::gradient_accumulators() {
  return *getODSResults(2).begin();
}

::mlir::IntegerAttr RetrieveTPUEmbeddingAdagradParametersGradAccumDebugOp::table_idAttr() {
  return (*this)->getAttr(table_idAttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t RetrieveTPUEmbeddingAdagradParametersGradAccumDebugOp::table_id() {
  auto attr = table_idAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), -1).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

::mlir::StringAttr RetrieveTPUEmbeddingAdagradParametersGradAccumDebugOp::table_nameAttr() {
  return (*this)->getAttr(table_nameAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef RetrieveTPUEmbeddingAdagradParametersGradAccumDebugOp::table_name() {
  auto attr = table_nameAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("").getValue();
  return attr.getValue();
}

::mlir::IntegerAttr RetrieveTPUEmbeddingAdagradParametersGradAccumDebugOp::num_shardsAttr() {
  return (*this)->getAttr(num_shardsAttrName()).cast<::mlir::IntegerAttr>();
}

uint64_t RetrieveTPUEmbeddingAdagradParametersGradAccumDebugOp::num_shards() {
  auto attr = num_shardsAttr();
  return attr.getValue().getZExtValue();
}

::mlir::IntegerAttr RetrieveTPUEmbeddingAdagradParametersGradAccumDebugOp::shard_idAttr() {
  return (*this)->getAttr(shard_idAttrName()).cast<::mlir::IntegerAttr>();
}

uint64_t RetrieveTPUEmbeddingAdagradParametersGradAccumDebugOp::shard_id() {
  auto attr = shard_idAttr();
  return attr.getValue().getZExtValue();
}

::mlir::StringAttr RetrieveTPUEmbeddingAdagradParametersGradAccumDebugOp::configAttr() {
  return (*this)->getAttr(configAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef RetrieveTPUEmbeddingAdagradParametersGradAccumDebugOp::config() {
  auto attr = configAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("").getValue();
  return attr.getValue();
}

void RetrieveTPUEmbeddingAdagradParametersGradAccumDebugOp::table_idAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(table_idAttrName(), attr);
}

void RetrieveTPUEmbeddingAdagradParametersGradAccumDebugOp::table_nameAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(table_nameAttrName(), attr);
}

void RetrieveTPUEmbeddingAdagradParametersGradAccumDebugOp::num_shardsAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(num_shardsAttrName(), attr);
}

void RetrieveTPUEmbeddingAdagradParametersGradAccumDebugOp::shard_idAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(shard_idAttrName(), attr);
}

void RetrieveTPUEmbeddingAdagradParametersGradAccumDebugOp::configAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(configAttrName(), attr);
}

void RetrieveTPUEmbeddingAdagradParametersGradAccumDebugOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type parameters, ::mlir::Type accumulators, ::mlir::Type gradient_accumulators, ::mlir::IntegerAttr table_id, ::mlir::StringAttr table_name, ::mlir::IntegerAttr num_shards, ::mlir::IntegerAttr shard_id, ::mlir::StringAttr config) {
  odsState.addAttribute(table_idAttrName(odsState.name), table_id);
  odsState.addAttribute(table_nameAttrName(odsState.name), table_name);
  odsState.addAttribute(num_shardsAttrName(odsState.name), num_shards);
  odsState.addAttribute(shard_idAttrName(odsState.name), shard_id);
  odsState.addAttribute(configAttrName(odsState.name), config);
  odsState.addTypes(parameters);
  odsState.addTypes(accumulators);
  odsState.addTypes(gradient_accumulators);
}

void RetrieveTPUEmbeddingAdagradParametersGradAccumDebugOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::IntegerAttr table_id, ::mlir::StringAttr table_name, ::mlir::IntegerAttr num_shards, ::mlir::IntegerAttr shard_id, ::mlir::StringAttr config) {
  odsState.addAttribute(table_idAttrName(odsState.name), table_id);
  odsState.addAttribute(table_nameAttrName(odsState.name), table_name);
  odsState.addAttribute(num_shardsAttrName(odsState.name), num_shards);
  odsState.addAttribute(shard_idAttrName(odsState.name), shard_id);
  odsState.addAttribute(configAttrName(odsState.name), config);
  assert(resultTypes.size() == 3u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void RetrieveTPUEmbeddingAdagradParametersGradAccumDebugOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type parameters, ::mlir::Type accumulators, ::mlir::Type gradient_accumulators, uint64_t table_id, ::llvm::StringRef table_name, uint64_t num_shards, uint64_t shard_id, ::llvm::StringRef config) {
  odsState.addAttribute(table_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), table_id));
  odsState.addAttribute(table_nameAttrName(odsState.name), odsBuilder.getStringAttr(table_name));
  odsState.addAttribute(num_shardsAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), num_shards));
  odsState.addAttribute(shard_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), shard_id));
  odsState.addAttribute(configAttrName(odsState.name), odsBuilder.getStringAttr(config));
  odsState.addTypes(parameters);
  odsState.addTypes(accumulators);
  odsState.addTypes(gradient_accumulators);
}

void RetrieveTPUEmbeddingAdagradParametersGradAccumDebugOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, uint64_t table_id, ::llvm::StringRef table_name, uint64_t num_shards, uint64_t shard_id, ::llvm::StringRef config) {
  odsState.addAttribute(table_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), table_id));
  odsState.addAttribute(table_nameAttrName(odsState.name), odsBuilder.getStringAttr(table_name));
  odsState.addAttribute(num_shardsAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), num_shards));
  odsState.addAttribute(shard_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), shard_id));
  odsState.addAttribute(configAttrName(odsState.name), odsBuilder.getStringAttr(config));
  assert(resultTypes.size() == 3u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void RetrieveTPUEmbeddingAdagradParametersGradAccumDebugOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 0u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 3u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult RetrieveTPUEmbeddingAdagradParametersGradAccumDebugOp::verify() {
  {
    auto tblgen_table_id = (*this)->getAttr(table_idAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_table_id, "table_id")))
      return ::mlir::failure();
  }
  {
    auto tblgen_table_name = (*this)->getAttr(table_nameAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_table_name, "table_name")))
      return ::mlir::failure();
  }
  {
    auto tblgen_num_shards = (*this)->getAttr(num_shardsAttrName());
    if (!tblgen_num_shards)
      return emitOpError("requires attribute 'num_shards'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_num_shards, "num_shards")))
      return ::mlir::failure();
  }
  {
    auto tblgen_shard_id = (*this)->getAttr(shard_idAttrName());
    if (!tblgen_shard_id)
      return emitOpError("requires attribute 'shard_id'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_shard_id, "shard_id")))
      return ::mlir::failure();
  }
  {
    auto tblgen_config = (*this)->getAttr(configAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_config, "config")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSResults(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSResults(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void RetrieveTPUEmbeddingAdagradParametersGradAccumDebugOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  effects.emplace_back(::mlir::MemoryEffects::Write::get(), ::mlir::TF::ResourceEffects::MustExecute::get());
  effects.emplace_back(::mlir::MemoryEffects::Read::get(), ::mlir::TF::ResourceEffects::TPUEmbedding::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::RetrieveTPUEmbeddingAdagradParametersGradAccumDebugOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::RetrieveTPUEmbeddingAdagradParametersOp definitions
//===----------------------------------------------------------------------===//

RetrieveTPUEmbeddingAdagradParametersOpAdaptor::RetrieveTPUEmbeddingAdagradParametersOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

RetrieveTPUEmbeddingAdagradParametersOpAdaptor::RetrieveTPUEmbeddingAdagradParametersOpAdaptor(RetrieveTPUEmbeddingAdagradParametersOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange RetrieveTPUEmbeddingAdagradParametersOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> RetrieveTPUEmbeddingAdagradParametersOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange RetrieveTPUEmbeddingAdagradParametersOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::DictionaryAttr RetrieveTPUEmbeddingAdagradParametersOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::IntegerAttr RetrieveTPUEmbeddingAdagradParametersOpAdaptor::table_id() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("table_id").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), -1);
  return attr;
}

::mlir::StringAttr RetrieveTPUEmbeddingAdagradParametersOpAdaptor::table_name() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("table_name").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("");
  return attr;
}

::mlir::IntegerAttr RetrieveTPUEmbeddingAdagradParametersOpAdaptor::num_shards() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("num_shards").cast<::mlir::IntegerAttr>();
  return attr;
}

::mlir::IntegerAttr RetrieveTPUEmbeddingAdagradParametersOpAdaptor::shard_id() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("shard_id").cast<::mlir::IntegerAttr>();
  return attr;
}

::mlir::StringAttr RetrieveTPUEmbeddingAdagradParametersOpAdaptor::config() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("config").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("");
  return attr;
}

::mlir::LogicalResult RetrieveTPUEmbeddingAdagradParametersOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_table_id = odsAttrs.get("table_id");
    if (tblgen_table_id && !(((tblgen_table_id.isa<::mlir::IntegerAttr>())) && ((tblgen_table_id.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.RetrieveTPUEmbeddingAdagradParameters' op ""attribute 'table_id' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_table_name = odsAttrs.get("table_name");
    if (tblgen_table_name && !((tblgen_table_name.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.RetrieveTPUEmbeddingAdagradParameters' op ""attribute 'table_name' failed to satisfy constraint: string attribute");
  }
  {
    auto tblgen_num_shards = odsAttrs.get("num_shards");
    if (!tblgen_num_shards)
      return emitError(loc, "'tf.RetrieveTPUEmbeddingAdagradParameters' op ""requires attribute 'num_shards'");

    if (tblgen_num_shards && !(((tblgen_num_shards.isa<::mlir::IntegerAttr>())) && ((tblgen_num_shards.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.RetrieveTPUEmbeddingAdagradParameters' op ""attribute 'num_shards' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_shard_id = odsAttrs.get("shard_id");
    if (!tblgen_shard_id)
      return emitError(loc, "'tf.RetrieveTPUEmbeddingAdagradParameters' op ""requires attribute 'shard_id'");

    if (tblgen_shard_id && !(((tblgen_shard_id.isa<::mlir::IntegerAttr>())) && ((tblgen_shard_id.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.RetrieveTPUEmbeddingAdagradParameters' op ""attribute 'shard_id' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_config = odsAttrs.get("config");
    if (tblgen_config && !((tblgen_config.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.RetrieveTPUEmbeddingAdagradParameters' op ""attribute 'config' failed to satisfy constraint: string attribute");
  }
  return ::mlir::success();
}

void RetrieveTPUEmbeddingAdagradParametersOp::getAsmResultNames(::mlir::OpAsmSetValueNameFn setNameFn) {
  auto resultGroup0 = getODSResults(0);
  if (!llvm::empty(resultGroup0))
    setNameFn(*resultGroup0.begin(), "parameters");
  auto resultGroup1 = getODSResults(1);
  if (!llvm::empty(resultGroup1))
    setNameFn(*resultGroup1.begin(), "accumulators");
}

std::pair<unsigned, unsigned> RetrieveTPUEmbeddingAdagradParametersOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range RetrieveTPUEmbeddingAdagradParametersOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

std::pair<unsigned, unsigned> RetrieveTPUEmbeddingAdagradParametersOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range RetrieveTPUEmbeddingAdagradParametersOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value RetrieveTPUEmbeddingAdagradParametersOp::parameters() {
  return *getODSResults(0).begin();
}

::mlir::Value RetrieveTPUEmbeddingAdagradParametersOp::accumulators() {
  return *getODSResults(1).begin();
}

::mlir::IntegerAttr RetrieveTPUEmbeddingAdagradParametersOp::table_idAttr() {
  return (*this)->getAttr(table_idAttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t RetrieveTPUEmbeddingAdagradParametersOp::table_id() {
  auto attr = table_idAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), -1).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

::mlir::StringAttr RetrieveTPUEmbeddingAdagradParametersOp::table_nameAttr() {
  return (*this)->getAttr(table_nameAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef RetrieveTPUEmbeddingAdagradParametersOp::table_name() {
  auto attr = table_nameAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("").getValue();
  return attr.getValue();
}

::mlir::IntegerAttr RetrieveTPUEmbeddingAdagradParametersOp::num_shardsAttr() {
  return (*this)->getAttr(num_shardsAttrName()).cast<::mlir::IntegerAttr>();
}

uint64_t RetrieveTPUEmbeddingAdagradParametersOp::num_shards() {
  auto attr = num_shardsAttr();
  return attr.getValue().getZExtValue();
}

::mlir::IntegerAttr RetrieveTPUEmbeddingAdagradParametersOp::shard_idAttr() {
  return (*this)->getAttr(shard_idAttrName()).cast<::mlir::IntegerAttr>();
}

uint64_t RetrieveTPUEmbeddingAdagradParametersOp::shard_id() {
  auto attr = shard_idAttr();
  return attr.getValue().getZExtValue();
}

::mlir::StringAttr RetrieveTPUEmbeddingAdagradParametersOp::configAttr() {
  return (*this)->getAttr(configAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef RetrieveTPUEmbeddingAdagradParametersOp::config() {
  auto attr = configAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("").getValue();
  return attr.getValue();
}

void RetrieveTPUEmbeddingAdagradParametersOp::table_idAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(table_idAttrName(), attr);
}

void RetrieveTPUEmbeddingAdagradParametersOp::table_nameAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(table_nameAttrName(), attr);
}

void RetrieveTPUEmbeddingAdagradParametersOp::num_shardsAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(num_shardsAttrName(), attr);
}

void RetrieveTPUEmbeddingAdagradParametersOp::shard_idAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(shard_idAttrName(), attr);
}

void RetrieveTPUEmbeddingAdagradParametersOp::configAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(configAttrName(), attr);
}

void RetrieveTPUEmbeddingAdagradParametersOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type parameters, ::mlir::Type accumulators, ::mlir::IntegerAttr table_id, ::mlir::StringAttr table_name, ::mlir::IntegerAttr num_shards, ::mlir::IntegerAttr shard_id, ::mlir::StringAttr config) {
  odsState.addAttribute(table_idAttrName(odsState.name), table_id);
  odsState.addAttribute(table_nameAttrName(odsState.name), table_name);
  odsState.addAttribute(num_shardsAttrName(odsState.name), num_shards);
  odsState.addAttribute(shard_idAttrName(odsState.name), shard_id);
  odsState.addAttribute(configAttrName(odsState.name), config);
  odsState.addTypes(parameters);
  odsState.addTypes(accumulators);
}

void RetrieveTPUEmbeddingAdagradParametersOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::IntegerAttr table_id, ::mlir::StringAttr table_name, ::mlir::IntegerAttr num_shards, ::mlir::IntegerAttr shard_id, ::mlir::StringAttr config) {
  odsState.addAttribute(table_idAttrName(odsState.name), table_id);
  odsState.addAttribute(table_nameAttrName(odsState.name), table_name);
  odsState.addAttribute(num_shardsAttrName(odsState.name), num_shards);
  odsState.addAttribute(shard_idAttrName(odsState.name), shard_id);
  odsState.addAttribute(configAttrName(odsState.name), config);
  assert(resultTypes.size() == 2u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void RetrieveTPUEmbeddingAdagradParametersOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type parameters, ::mlir::Type accumulators, uint64_t table_id, ::llvm::StringRef table_name, uint64_t num_shards, uint64_t shard_id, ::llvm::StringRef config) {
  odsState.addAttribute(table_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), table_id));
  odsState.addAttribute(table_nameAttrName(odsState.name), odsBuilder.getStringAttr(table_name));
  odsState.addAttribute(num_shardsAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), num_shards));
  odsState.addAttribute(shard_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), shard_id));
  odsState.addAttribute(configAttrName(odsState.name), odsBuilder.getStringAttr(config));
  odsState.addTypes(parameters);
  odsState.addTypes(accumulators);
}

void RetrieveTPUEmbeddingAdagradParametersOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, uint64_t table_id, ::llvm::StringRef table_name, uint64_t num_shards, uint64_t shard_id, ::llvm::StringRef config) {
  odsState.addAttribute(table_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), table_id));
  odsState.addAttribute(table_nameAttrName(odsState.name), odsBuilder.getStringAttr(table_name));
  odsState.addAttribute(num_shardsAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), num_shards));
  odsState.addAttribute(shard_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), shard_id));
  odsState.addAttribute(configAttrName(odsState.name), odsBuilder.getStringAttr(config));
  assert(resultTypes.size() == 2u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void RetrieveTPUEmbeddingAdagradParametersOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 0u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 2u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult RetrieveTPUEmbeddingAdagradParametersOp::verify() {
  {
    auto tblgen_table_id = (*this)->getAttr(table_idAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_table_id, "table_id")))
      return ::mlir::failure();
  }
  {
    auto tblgen_table_name = (*this)->getAttr(table_nameAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_table_name, "table_name")))
      return ::mlir::failure();
  }
  {
    auto tblgen_num_shards = (*this)->getAttr(num_shardsAttrName());
    if (!tblgen_num_shards)
      return emitOpError("requires attribute 'num_shards'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_num_shards, "num_shards")))
      return ::mlir::failure();
  }
  {
    auto tblgen_shard_id = (*this)->getAttr(shard_idAttrName());
    if (!tblgen_shard_id)
      return emitOpError("requires attribute 'shard_id'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_shard_id, "shard_id")))
      return ::mlir::failure();
  }
  {
    auto tblgen_config = (*this)->getAttr(configAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_config, "config")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSResults(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void RetrieveTPUEmbeddingAdagradParametersOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  effects.emplace_back(::mlir::MemoryEffects::Write::get(), ::mlir::TF::ResourceEffects::MustExecute::get());
  effects.emplace_back(::mlir::MemoryEffects::Read::get(), ::mlir::TF::ResourceEffects::TPUEmbedding::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::RetrieveTPUEmbeddingAdagradParametersOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::RetrieveTPUEmbeddingCenteredRMSPropParametersOp definitions
//===----------------------------------------------------------------------===//

RetrieveTPUEmbeddingCenteredRMSPropParametersOpAdaptor::RetrieveTPUEmbeddingCenteredRMSPropParametersOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

RetrieveTPUEmbeddingCenteredRMSPropParametersOpAdaptor::RetrieveTPUEmbeddingCenteredRMSPropParametersOpAdaptor(RetrieveTPUEmbeddingCenteredRMSPropParametersOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange RetrieveTPUEmbeddingCenteredRMSPropParametersOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> RetrieveTPUEmbeddingCenteredRMSPropParametersOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange RetrieveTPUEmbeddingCenteredRMSPropParametersOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::DictionaryAttr RetrieveTPUEmbeddingCenteredRMSPropParametersOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::IntegerAttr RetrieveTPUEmbeddingCenteredRMSPropParametersOpAdaptor::table_id() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("table_id").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), -1);
  return attr;
}

::mlir::StringAttr RetrieveTPUEmbeddingCenteredRMSPropParametersOpAdaptor::table_name() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("table_name").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("");
  return attr;
}

::mlir::IntegerAttr RetrieveTPUEmbeddingCenteredRMSPropParametersOpAdaptor::num_shards() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("num_shards").cast<::mlir::IntegerAttr>();
  return attr;
}

::mlir::IntegerAttr RetrieveTPUEmbeddingCenteredRMSPropParametersOpAdaptor::shard_id() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("shard_id").cast<::mlir::IntegerAttr>();
  return attr;
}

::mlir::StringAttr RetrieveTPUEmbeddingCenteredRMSPropParametersOpAdaptor::config() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("config").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("");
  return attr;
}

::mlir::LogicalResult RetrieveTPUEmbeddingCenteredRMSPropParametersOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_table_id = odsAttrs.get("table_id");
    if (tblgen_table_id && !(((tblgen_table_id.isa<::mlir::IntegerAttr>())) && ((tblgen_table_id.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.RetrieveTPUEmbeddingCenteredRMSPropParameters' op ""attribute 'table_id' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_table_name = odsAttrs.get("table_name");
    if (tblgen_table_name && !((tblgen_table_name.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.RetrieveTPUEmbeddingCenteredRMSPropParameters' op ""attribute 'table_name' failed to satisfy constraint: string attribute");
  }
  {
    auto tblgen_num_shards = odsAttrs.get("num_shards");
    if (!tblgen_num_shards)
      return emitError(loc, "'tf.RetrieveTPUEmbeddingCenteredRMSPropParameters' op ""requires attribute 'num_shards'");

    if (tblgen_num_shards && !(((tblgen_num_shards.isa<::mlir::IntegerAttr>())) && ((tblgen_num_shards.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.RetrieveTPUEmbeddingCenteredRMSPropParameters' op ""attribute 'num_shards' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_shard_id = odsAttrs.get("shard_id");
    if (!tblgen_shard_id)
      return emitError(loc, "'tf.RetrieveTPUEmbeddingCenteredRMSPropParameters' op ""requires attribute 'shard_id'");

    if (tblgen_shard_id && !(((tblgen_shard_id.isa<::mlir::IntegerAttr>())) && ((tblgen_shard_id.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.RetrieveTPUEmbeddingCenteredRMSPropParameters' op ""attribute 'shard_id' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_config = odsAttrs.get("config");
    if (tblgen_config && !((tblgen_config.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.RetrieveTPUEmbeddingCenteredRMSPropParameters' op ""attribute 'config' failed to satisfy constraint: string attribute");
  }
  return ::mlir::success();
}

void RetrieveTPUEmbeddingCenteredRMSPropParametersOp::getAsmResultNames(::mlir::OpAsmSetValueNameFn setNameFn) {
  auto resultGroup0 = getODSResults(0);
  if (!llvm::empty(resultGroup0))
    setNameFn(*resultGroup0.begin(), "parameters");
  auto resultGroup1 = getODSResults(1);
  if (!llvm::empty(resultGroup1))
    setNameFn(*resultGroup1.begin(), "ms");
  auto resultGroup2 = getODSResults(2);
  if (!llvm::empty(resultGroup2))
    setNameFn(*resultGroup2.begin(), "mom");
  auto resultGroup3 = getODSResults(3);
  if (!llvm::empty(resultGroup3))
    setNameFn(*resultGroup3.begin(), "mg");
}

std::pair<unsigned, unsigned> RetrieveTPUEmbeddingCenteredRMSPropParametersOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range RetrieveTPUEmbeddingCenteredRMSPropParametersOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

std::pair<unsigned, unsigned> RetrieveTPUEmbeddingCenteredRMSPropParametersOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range RetrieveTPUEmbeddingCenteredRMSPropParametersOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value RetrieveTPUEmbeddingCenteredRMSPropParametersOp::parameters() {
  return *getODSResults(0).begin();
}

::mlir::Value RetrieveTPUEmbeddingCenteredRMSPropParametersOp::ms() {
  return *getODSResults(1).begin();
}

::mlir::Value RetrieveTPUEmbeddingCenteredRMSPropParametersOp::mom() {
  return *getODSResults(2).begin();
}

::mlir::Value RetrieveTPUEmbeddingCenteredRMSPropParametersOp::mg() {
  return *getODSResults(3).begin();
}

::mlir::IntegerAttr RetrieveTPUEmbeddingCenteredRMSPropParametersOp::table_idAttr() {
  return (*this)->getAttr(table_idAttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t RetrieveTPUEmbeddingCenteredRMSPropParametersOp::table_id() {
  auto attr = table_idAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), -1).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

::mlir::StringAttr RetrieveTPUEmbeddingCenteredRMSPropParametersOp::table_nameAttr() {
  return (*this)->getAttr(table_nameAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef RetrieveTPUEmbeddingCenteredRMSPropParametersOp::table_name() {
  auto attr = table_nameAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("").getValue();
  return attr.getValue();
}

::mlir::IntegerAttr RetrieveTPUEmbeddingCenteredRMSPropParametersOp::num_shardsAttr() {
  return (*this)->getAttr(num_shardsAttrName()).cast<::mlir::IntegerAttr>();
}

uint64_t RetrieveTPUEmbeddingCenteredRMSPropParametersOp::num_shards() {
  auto attr = num_shardsAttr();
  return attr.getValue().getZExtValue();
}

::mlir::IntegerAttr RetrieveTPUEmbeddingCenteredRMSPropParametersOp::shard_idAttr() {
  return (*this)->getAttr(shard_idAttrName()).cast<::mlir::IntegerAttr>();
}

uint64_t RetrieveTPUEmbeddingCenteredRMSPropParametersOp::shard_id() {
  auto attr = shard_idAttr();
  return attr.getValue().getZExtValue();
}

::mlir::StringAttr RetrieveTPUEmbeddingCenteredRMSPropParametersOp::configAttr() {
  return (*this)->getAttr(configAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef RetrieveTPUEmbeddingCenteredRMSPropParametersOp::config() {
  auto attr = configAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("").getValue();
  return attr.getValue();
}

void RetrieveTPUEmbeddingCenteredRMSPropParametersOp::table_idAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(table_idAttrName(), attr);
}

void RetrieveTPUEmbeddingCenteredRMSPropParametersOp::table_nameAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(table_nameAttrName(), attr);
}

void RetrieveTPUEmbeddingCenteredRMSPropParametersOp::num_shardsAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(num_shardsAttrName(), attr);
}

void RetrieveTPUEmbeddingCenteredRMSPropParametersOp::shard_idAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(shard_idAttrName(), attr);
}

void RetrieveTPUEmbeddingCenteredRMSPropParametersOp::configAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(configAttrName(), attr);
}

void RetrieveTPUEmbeddingCenteredRMSPropParametersOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type parameters, ::mlir::Type ms, ::mlir::Type mom, ::mlir::Type mg, ::mlir::IntegerAttr table_id, ::mlir::StringAttr table_name, ::mlir::IntegerAttr num_shards, ::mlir::IntegerAttr shard_id, ::mlir::StringAttr config) {
  odsState.addAttribute(table_idAttrName(odsState.name), table_id);
  odsState.addAttribute(table_nameAttrName(odsState.name), table_name);
  odsState.addAttribute(num_shardsAttrName(odsState.name), num_shards);
  odsState.addAttribute(shard_idAttrName(odsState.name), shard_id);
  odsState.addAttribute(configAttrName(odsState.name), config);
  odsState.addTypes(parameters);
  odsState.addTypes(ms);
  odsState.addTypes(mom);
  odsState.addTypes(mg);
}

void RetrieveTPUEmbeddingCenteredRMSPropParametersOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::IntegerAttr table_id, ::mlir::StringAttr table_name, ::mlir::IntegerAttr num_shards, ::mlir::IntegerAttr shard_id, ::mlir::StringAttr config) {
  odsState.addAttribute(table_idAttrName(odsState.name), table_id);
  odsState.addAttribute(table_nameAttrName(odsState.name), table_name);
  odsState.addAttribute(num_shardsAttrName(odsState.name), num_shards);
  odsState.addAttribute(shard_idAttrName(odsState.name), shard_id);
  odsState.addAttribute(configAttrName(odsState.name), config);
  assert(resultTypes.size() == 4u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void RetrieveTPUEmbeddingCenteredRMSPropParametersOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type parameters, ::mlir::Type ms, ::mlir::Type mom, ::mlir::Type mg, uint64_t table_id, ::llvm::StringRef table_name, uint64_t num_shards, uint64_t shard_id, ::llvm::StringRef config) {
  odsState.addAttribute(table_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), table_id));
  odsState.addAttribute(table_nameAttrName(odsState.name), odsBuilder.getStringAttr(table_name));
  odsState.addAttribute(num_shardsAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), num_shards));
  odsState.addAttribute(shard_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), shard_id));
  odsState.addAttribute(configAttrName(odsState.name), odsBuilder.getStringAttr(config));
  odsState.addTypes(parameters);
  odsState.addTypes(ms);
  odsState.addTypes(mom);
  odsState.addTypes(mg);
}

void RetrieveTPUEmbeddingCenteredRMSPropParametersOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, uint64_t table_id, ::llvm::StringRef table_name, uint64_t num_shards, uint64_t shard_id, ::llvm::StringRef config) {
  odsState.addAttribute(table_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), table_id));
  odsState.addAttribute(table_nameAttrName(odsState.name), odsBuilder.getStringAttr(table_name));
  odsState.addAttribute(num_shardsAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), num_shards));
  odsState.addAttribute(shard_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), shard_id));
  odsState.addAttribute(configAttrName(odsState.name), odsBuilder.getStringAttr(config));
  assert(resultTypes.size() == 4u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void RetrieveTPUEmbeddingCenteredRMSPropParametersOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 0u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 4u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult RetrieveTPUEmbeddingCenteredRMSPropParametersOp::verify() {
  {
    auto tblgen_table_id = (*this)->getAttr(table_idAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_table_id, "table_id")))
      return ::mlir::failure();
  }
  {
    auto tblgen_table_name = (*this)->getAttr(table_nameAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_table_name, "table_name")))
      return ::mlir::failure();
  }
  {
    auto tblgen_num_shards = (*this)->getAttr(num_shardsAttrName());
    if (!tblgen_num_shards)
      return emitOpError("requires attribute 'num_shards'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_num_shards, "num_shards")))
      return ::mlir::failure();
  }
  {
    auto tblgen_shard_id = (*this)->getAttr(shard_idAttrName());
    if (!tblgen_shard_id)
      return emitOpError("requires attribute 'shard_id'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_shard_id, "shard_id")))
      return ::mlir::failure();
  }
  {
    auto tblgen_config = (*this)->getAttr(configAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_config, "config")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSResults(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSResults(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
    auto valueGroup3 = getODSResults(3);

    for (auto v : valueGroup3) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void RetrieveTPUEmbeddingCenteredRMSPropParametersOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  effects.emplace_back(::mlir::MemoryEffects::Write::get(), ::mlir::TF::ResourceEffects::MustExecute::get());
  effects.emplace_back(::mlir::MemoryEffects::Read::get(), ::mlir::TF::ResourceEffects::TPUEmbedding::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::RetrieveTPUEmbeddingCenteredRMSPropParametersOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::RetrieveTPUEmbeddingFTRLParametersGradAccumDebugOp definitions
//===----------------------------------------------------------------------===//

RetrieveTPUEmbeddingFTRLParametersGradAccumDebugOpAdaptor::RetrieveTPUEmbeddingFTRLParametersGradAccumDebugOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

RetrieveTPUEmbeddingFTRLParametersGradAccumDebugOpAdaptor::RetrieveTPUEmbeddingFTRLParametersGradAccumDebugOpAdaptor(RetrieveTPUEmbeddingFTRLParametersGradAccumDebugOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange RetrieveTPUEmbeddingFTRLParametersGradAccumDebugOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> RetrieveTPUEmbeddingFTRLParametersGradAccumDebugOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange RetrieveTPUEmbeddingFTRLParametersGradAccumDebugOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::DictionaryAttr RetrieveTPUEmbeddingFTRLParametersGradAccumDebugOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::IntegerAttr RetrieveTPUEmbeddingFTRLParametersGradAccumDebugOpAdaptor::table_id() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("table_id").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), -1);
  return attr;
}

::mlir::StringAttr RetrieveTPUEmbeddingFTRLParametersGradAccumDebugOpAdaptor::table_name() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("table_name").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("");
  return attr;
}

::mlir::IntegerAttr RetrieveTPUEmbeddingFTRLParametersGradAccumDebugOpAdaptor::num_shards() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("num_shards").cast<::mlir::IntegerAttr>();
  return attr;
}

::mlir::IntegerAttr RetrieveTPUEmbeddingFTRLParametersGradAccumDebugOpAdaptor::shard_id() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("shard_id").cast<::mlir::IntegerAttr>();
  return attr;
}

::mlir::StringAttr RetrieveTPUEmbeddingFTRLParametersGradAccumDebugOpAdaptor::config() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("config").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("");
  return attr;
}

::mlir::LogicalResult RetrieveTPUEmbeddingFTRLParametersGradAccumDebugOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_table_id = odsAttrs.get("table_id");
    if (tblgen_table_id && !(((tblgen_table_id.isa<::mlir::IntegerAttr>())) && ((tblgen_table_id.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.RetrieveTPUEmbeddingFTRLParametersGradAccumDebug' op ""attribute 'table_id' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_table_name = odsAttrs.get("table_name");
    if (tblgen_table_name && !((tblgen_table_name.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.RetrieveTPUEmbeddingFTRLParametersGradAccumDebug' op ""attribute 'table_name' failed to satisfy constraint: string attribute");
  }
  {
    auto tblgen_num_shards = odsAttrs.get("num_shards");
    if (!tblgen_num_shards)
      return emitError(loc, "'tf.RetrieveTPUEmbeddingFTRLParametersGradAccumDebug' op ""requires attribute 'num_shards'");

    if (tblgen_num_shards && !(((tblgen_num_shards.isa<::mlir::IntegerAttr>())) && ((tblgen_num_shards.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.RetrieveTPUEmbeddingFTRLParametersGradAccumDebug' op ""attribute 'num_shards' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_shard_id = odsAttrs.get("shard_id");
    if (!tblgen_shard_id)
      return emitError(loc, "'tf.RetrieveTPUEmbeddingFTRLParametersGradAccumDebug' op ""requires attribute 'shard_id'");

    if (tblgen_shard_id && !(((tblgen_shard_id.isa<::mlir::IntegerAttr>())) && ((tblgen_shard_id.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.RetrieveTPUEmbeddingFTRLParametersGradAccumDebug' op ""attribute 'shard_id' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_config = odsAttrs.get("config");
    if (tblgen_config && !((tblgen_config.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.RetrieveTPUEmbeddingFTRLParametersGradAccumDebug' op ""attribute 'config' failed to satisfy constraint: string attribute");
  }
  return ::mlir::success();
}

void RetrieveTPUEmbeddingFTRLParametersGradAccumDebugOp::getAsmResultNames(::mlir::OpAsmSetValueNameFn setNameFn) {
  auto resultGroup0 = getODSResults(0);
  if (!llvm::empty(resultGroup0))
    setNameFn(*resultGroup0.begin(), "parameters");
  auto resultGroup1 = getODSResults(1);
  if (!llvm::empty(resultGroup1))
    setNameFn(*resultGroup1.begin(), "accumulators");
  auto resultGroup2 = getODSResults(2);
  if (!llvm::empty(resultGroup2))
    setNameFn(*resultGroup2.begin(), "linears");
  auto resultGroup3 = getODSResults(3);
  if (!llvm::empty(resultGroup3))
    setNameFn(*resultGroup3.begin(), "gradient_accumulators");
}

std::pair<unsigned, unsigned> RetrieveTPUEmbeddingFTRLParametersGradAccumDebugOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range RetrieveTPUEmbeddingFTRLParametersGradAccumDebugOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

std::pair<unsigned, unsigned> RetrieveTPUEmbeddingFTRLParametersGradAccumDebugOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range RetrieveTPUEmbeddingFTRLParametersGradAccumDebugOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value RetrieveTPUEmbeddingFTRLParametersGradAccumDebugOp::parameters() {
  return *getODSResults(0).begin();
}

::mlir::Value RetrieveTPUEmbeddingFTRLParametersGradAccumDebugOp::accumulators() {
  return *getODSResults(1).begin();
}

::mlir::Value RetrieveTPUEmbeddingFTRLParametersGradAccumDebugOp::linears() {
  return *getODSResults(2).begin();
}

::mlir::Value RetrieveTPUEmbeddingFTRLParametersGradAccumDebugOp::gradient_accumulators() {
  return *getODSResults(3).begin();
}

::mlir::IntegerAttr RetrieveTPUEmbeddingFTRLParametersGradAccumDebugOp::table_idAttr() {
  return (*this)->getAttr(table_idAttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t RetrieveTPUEmbeddingFTRLParametersGradAccumDebugOp::table_id() {
  auto attr = table_idAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), -1).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

::mlir::StringAttr RetrieveTPUEmbeddingFTRLParametersGradAccumDebugOp::table_nameAttr() {
  return (*this)->getAttr(table_nameAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef RetrieveTPUEmbeddingFTRLParametersGradAccumDebugOp::table_name() {
  auto attr = table_nameAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("").getValue();
  return attr.getValue();
}

::mlir::IntegerAttr RetrieveTPUEmbeddingFTRLParametersGradAccumDebugOp::num_shardsAttr() {
  return (*this)->getAttr(num_shardsAttrName()).cast<::mlir::IntegerAttr>();
}

uint64_t RetrieveTPUEmbeddingFTRLParametersGradAccumDebugOp::num_shards() {
  auto attr = num_shardsAttr();
  return attr.getValue().getZExtValue();
}

::mlir::IntegerAttr RetrieveTPUEmbeddingFTRLParametersGradAccumDebugOp::shard_idAttr() {
  return (*this)->getAttr(shard_idAttrName()).cast<::mlir::IntegerAttr>();
}

uint64_t RetrieveTPUEmbeddingFTRLParametersGradAccumDebugOp::shard_id() {
  auto attr = shard_idAttr();
  return attr.getValue().getZExtValue();
}

::mlir::StringAttr RetrieveTPUEmbeddingFTRLParametersGradAccumDebugOp::configAttr() {
  return (*this)->getAttr(configAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef RetrieveTPUEmbeddingFTRLParametersGradAccumDebugOp::config() {
  auto attr = configAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("").getValue();
  return attr.getValue();
}

void RetrieveTPUEmbeddingFTRLParametersGradAccumDebugOp::table_idAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(table_idAttrName(), attr);
}

void RetrieveTPUEmbeddingFTRLParametersGradAccumDebugOp::table_nameAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(table_nameAttrName(), attr);
}

void RetrieveTPUEmbeddingFTRLParametersGradAccumDebugOp::num_shardsAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(num_shardsAttrName(), attr);
}

void RetrieveTPUEmbeddingFTRLParametersGradAccumDebugOp::shard_idAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(shard_idAttrName(), attr);
}

void RetrieveTPUEmbeddingFTRLParametersGradAccumDebugOp::configAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(configAttrName(), attr);
}

void RetrieveTPUEmbeddingFTRLParametersGradAccumDebugOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type parameters, ::mlir::Type accumulators, ::mlir::Type linears, ::mlir::Type gradient_accumulators, ::mlir::IntegerAttr table_id, ::mlir::StringAttr table_name, ::mlir::IntegerAttr num_shards, ::mlir::IntegerAttr shard_id, ::mlir::StringAttr config) {
  odsState.addAttribute(table_idAttrName(odsState.name), table_id);
  odsState.addAttribute(table_nameAttrName(odsState.name), table_name);
  odsState.addAttribute(num_shardsAttrName(odsState.name), num_shards);
  odsState.addAttribute(shard_idAttrName(odsState.name), shard_id);
  odsState.addAttribute(configAttrName(odsState.name), config);
  odsState.addTypes(parameters);
  odsState.addTypes(accumulators);
  odsState.addTypes(linears);
  odsState.addTypes(gradient_accumulators);
}

void RetrieveTPUEmbeddingFTRLParametersGradAccumDebugOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::IntegerAttr table_id, ::mlir::StringAttr table_name, ::mlir::IntegerAttr num_shards, ::mlir::IntegerAttr shard_id, ::mlir::StringAttr config) {
  odsState.addAttribute(table_idAttrName(odsState.name), table_id);
  odsState.addAttribute(table_nameAttrName(odsState.name), table_name);
  odsState.addAttribute(num_shardsAttrName(odsState.name), num_shards);
  odsState.addAttribute(shard_idAttrName(odsState.name), shard_id);
  odsState.addAttribute(configAttrName(odsState.name), config);
  assert(resultTypes.size() == 4u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void RetrieveTPUEmbeddingFTRLParametersGradAccumDebugOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type parameters, ::mlir::Type accumulators, ::mlir::Type linears, ::mlir::Type gradient_accumulators, uint64_t table_id, ::llvm::StringRef table_name, uint64_t num_shards, uint64_t shard_id, ::llvm::StringRef config) {
  odsState.addAttribute(table_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), table_id));
  odsState.addAttribute(table_nameAttrName(odsState.name), odsBuilder.getStringAttr(table_name));
  odsState.addAttribute(num_shardsAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), num_shards));
  odsState.addAttribute(shard_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), shard_id));
  odsState.addAttribute(configAttrName(odsState.name), odsBuilder.getStringAttr(config));
  odsState.addTypes(parameters);
  odsState.addTypes(accumulators);
  odsState.addTypes(linears);
  odsState.addTypes(gradient_accumulators);
}

void RetrieveTPUEmbeddingFTRLParametersGradAccumDebugOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, uint64_t table_id, ::llvm::StringRef table_name, uint64_t num_shards, uint64_t shard_id, ::llvm::StringRef config) {
  odsState.addAttribute(table_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), table_id));
  odsState.addAttribute(table_nameAttrName(odsState.name), odsBuilder.getStringAttr(table_name));
  odsState.addAttribute(num_shardsAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), num_shards));
  odsState.addAttribute(shard_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), shard_id));
  odsState.addAttribute(configAttrName(odsState.name), odsBuilder.getStringAttr(config));
  assert(resultTypes.size() == 4u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void RetrieveTPUEmbeddingFTRLParametersGradAccumDebugOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 0u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 4u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult RetrieveTPUEmbeddingFTRLParametersGradAccumDebugOp::verify() {
  {
    auto tblgen_table_id = (*this)->getAttr(table_idAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_table_id, "table_id")))
      return ::mlir::failure();
  }
  {
    auto tblgen_table_name = (*this)->getAttr(table_nameAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_table_name, "table_name")))
      return ::mlir::failure();
  }
  {
    auto tblgen_num_shards = (*this)->getAttr(num_shardsAttrName());
    if (!tblgen_num_shards)
      return emitOpError("requires attribute 'num_shards'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_num_shards, "num_shards")))
      return ::mlir::failure();
  }
  {
    auto tblgen_shard_id = (*this)->getAttr(shard_idAttrName());
    if (!tblgen_shard_id)
      return emitOpError("requires attribute 'shard_id'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_shard_id, "shard_id")))
      return ::mlir::failure();
  }
  {
    auto tblgen_config = (*this)->getAttr(configAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_config, "config")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSResults(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSResults(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
    auto valueGroup3 = getODSResults(3);

    for (auto v : valueGroup3) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void RetrieveTPUEmbeddingFTRLParametersGradAccumDebugOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  effects.emplace_back(::mlir::MemoryEffects::Write::get(), ::mlir::TF::ResourceEffects::MustExecute::get());
  effects.emplace_back(::mlir::MemoryEffects::Read::get(), ::mlir::TF::ResourceEffects::TPUEmbedding::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::RetrieveTPUEmbeddingFTRLParametersGradAccumDebugOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::RetrieveTPUEmbeddingFTRLParametersOp definitions
//===----------------------------------------------------------------------===//

RetrieveTPUEmbeddingFTRLParametersOpAdaptor::RetrieveTPUEmbeddingFTRLParametersOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

RetrieveTPUEmbeddingFTRLParametersOpAdaptor::RetrieveTPUEmbeddingFTRLParametersOpAdaptor(RetrieveTPUEmbeddingFTRLParametersOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange RetrieveTPUEmbeddingFTRLParametersOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> RetrieveTPUEmbeddingFTRLParametersOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange RetrieveTPUEmbeddingFTRLParametersOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::DictionaryAttr RetrieveTPUEmbeddingFTRLParametersOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::IntegerAttr RetrieveTPUEmbeddingFTRLParametersOpAdaptor::table_id() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("table_id").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), -1);
  return attr;
}

::mlir::StringAttr RetrieveTPUEmbeddingFTRLParametersOpAdaptor::table_name() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("table_name").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("");
  return attr;
}

::mlir::IntegerAttr RetrieveTPUEmbeddingFTRLParametersOpAdaptor::num_shards() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("num_shards").cast<::mlir::IntegerAttr>();
  return attr;
}

::mlir::IntegerAttr RetrieveTPUEmbeddingFTRLParametersOpAdaptor::shard_id() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("shard_id").cast<::mlir::IntegerAttr>();
  return attr;
}

::mlir::StringAttr RetrieveTPUEmbeddingFTRLParametersOpAdaptor::config() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("config").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("");
  return attr;
}

::mlir::LogicalResult RetrieveTPUEmbeddingFTRLParametersOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_table_id = odsAttrs.get("table_id");
    if (tblgen_table_id && !(((tblgen_table_id.isa<::mlir::IntegerAttr>())) && ((tblgen_table_id.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.RetrieveTPUEmbeddingFTRLParameters' op ""attribute 'table_id' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_table_name = odsAttrs.get("table_name");
    if (tblgen_table_name && !((tblgen_table_name.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.RetrieveTPUEmbeddingFTRLParameters' op ""attribute 'table_name' failed to satisfy constraint: string attribute");
  }
  {
    auto tblgen_num_shards = odsAttrs.get("num_shards");
    if (!tblgen_num_shards)
      return emitError(loc, "'tf.RetrieveTPUEmbeddingFTRLParameters' op ""requires attribute 'num_shards'");

    if (tblgen_num_shards && !(((tblgen_num_shards.isa<::mlir::IntegerAttr>())) && ((tblgen_num_shards.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.RetrieveTPUEmbeddingFTRLParameters' op ""attribute 'num_shards' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_shard_id = odsAttrs.get("shard_id");
    if (!tblgen_shard_id)
      return emitError(loc, "'tf.RetrieveTPUEmbeddingFTRLParameters' op ""requires attribute 'shard_id'");

    if (tblgen_shard_id && !(((tblgen_shard_id.isa<::mlir::IntegerAttr>())) && ((tblgen_shard_id.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.RetrieveTPUEmbeddingFTRLParameters' op ""attribute 'shard_id' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_config = odsAttrs.get("config");
    if (tblgen_config && !((tblgen_config.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.RetrieveTPUEmbeddingFTRLParameters' op ""attribute 'config' failed to satisfy constraint: string attribute");
  }
  return ::mlir::success();
}

void RetrieveTPUEmbeddingFTRLParametersOp::getAsmResultNames(::mlir::OpAsmSetValueNameFn setNameFn) {
  auto resultGroup0 = getODSResults(0);
  if (!llvm::empty(resultGroup0))
    setNameFn(*resultGroup0.begin(), "parameters");
  auto resultGroup1 = getODSResults(1);
  if (!llvm::empty(resultGroup1))
    setNameFn(*resultGroup1.begin(), "accumulators");
  auto resultGroup2 = getODSResults(2);
  if (!llvm::empty(resultGroup2))
    setNameFn(*resultGroup2.begin(), "linears");
}

std::pair<unsigned, unsigned> RetrieveTPUEmbeddingFTRLParametersOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range RetrieveTPUEmbeddingFTRLParametersOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

std::pair<unsigned, unsigned> RetrieveTPUEmbeddingFTRLParametersOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range RetrieveTPUEmbeddingFTRLParametersOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value RetrieveTPUEmbeddingFTRLParametersOp::parameters() {
  return *getODSResults(0).begin();
}

::mlir::Value RetrieveTPUEmbeddingFTRLParametersOp::accumulators() {
  return *getODSResults(1).begin();
}

::mlir::Value RetrieveTPUEmbeddingFTRLParametersOp::linears() {
  return *getODSResults(2).begin();
}

::mlir::IntegerAttr RetrieveTPUEmbeddingFTRLParametersOp::table_idAttr() {
  return (*this)->getAttr(table_idAttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t RetrieveTPUEmbeddingFTRLParametersOp::table_id() {
  auto attr = table_idAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), -1).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

::mlir::StringAttr RetrieveTPUEmbeddingFTRLParametersOp::table_nameAttr() {
  return (*this)->getAttr(table_nameAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef RetrieveTPUEmbeddingFTRLParametersOp::table_name() {
  auto attr = table_nameAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("").getValue();
  return attr.getValue();
}

::mlir::IntegerAttr RetrieveTPUEmbeddingFTRLParametersOp::num_shardsAttr() {
  return (*this)->getAttr(num_shardsAttrName()).cast<::mlir::IntegerAttr>();
}

uint64_t RetrieveTPUEmbeddingFTRLParametersOp::num_shards() {
  auto attr = num_shardsAttr();
  return attr.getValue().getZExtValue();
}

::mlir::IntegerAttr RetrieveTPUEmbeddingFTRLParametersOp::shard_idAttr() {
  return (*this)->getAttr(shard_idAttrName()).cast<::mlir::IntegerAttr>();
}

uint64_t RetrieveTPUEmbeddingFTRLParametersOp::shard_id() {
  auto attr = shard_idAttr();
  return attr.getValue().getZExtValue();
}

::mlir::StringAttr RetrieveTPUEmbeddingFTRLParametersOp::configAttr() {
  return (*this)->getAttr(configAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef RetrieveTPUEmbeddingFTRLParametersOp::config() {
  auto attr = configAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("").getValue();
  return attr.getValue();
}

void RetrieveTPUEmbeddingFTRLParametersOp::table_idAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(table_idAttrName(), attr);
}

void RetrieveTPUEmbeddingFTRLParametersOp::table_nameAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(table_nameAttrName(), attr);
}

void RetrieveTPUEmbeddingFTRLParametersOp::num_shardsAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(num_shardsAttrName(), attr);
}

void RetrieveTPUEmbeddingFTRLParametersOp::shard_idAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(shard_idAttrName(), attr);
}

void RetrieveTPUEmbeddingFTRLParametersOp::configAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(configAttrName(), attr);
}

void RetrieveTPUEmbeddingFTRLParametersOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type parameters, ::mlir::Type accumulators, ::mlir::Type linears, ::mlir::IntegerAttr table_id, ::mlir::StringAttr table_name, ::mlir::IntegerAttr num_shards, ::mlir::IntegerAttr shard_id, ::mlir::StringAttr config) {
  odsState.addAttribute(table_idAttrName(odsState.name), table_id);
  odsState.addAttribute(table_nameAttrName(odsState.name), table_name);
  odsState.addAttribute(num_shardsAttrName(odsState.name), num_shards);
  odsState.addAttribute(shard_idAttrName(odsState.name), shard_id);
  odsState.addAttribute(configAttrName(odsState.name), config);
  odsState.addTypes(parameters);
  odsState.addTypes(accumulators);
  odsState.addTypes(linears);
}

void RetrieveTPUEmbeddingFTRLParametersOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::IntegerAttr table_id, ::mlir::StringAttr table_name, ::mlir::IntegerAttr num_shards, ::mlir::IntegerAttr shard_id, ::mlir::StringAttr config) {
  odsState.addAttribute(table_idAttrName(odsState.name), table_id);
  odsState.addAttribute(table_nameAttrName(odsState.name), table_name);
  odsState.addAttribute(num_shardsAttrName(odsState.name), num_shards);
  odsState.addAttribute(shard_idAttrName(odsState.name), shard_id);
  odsState.addAttribute(configAttrName(odsState.name), config);
  assert(resultTypes.size() == 3u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void RetrieveTPUEmbeddingFTRLParametersOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type parameters, ::mlir::Type accumulators, ::mlir::Type linears, uint64_t table_id, ::llvm::StringRef table_name, uint64_t num_shards, uint64_t shard_id, ::llvm::StringRef config) {
  odsState.addAttribute(table_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), table_id));
  odsState.addAttribute(table_nameAttrName(odsState.name), odsBuilder.getStringAttr(table_name));
  odsState.addAttribute(num_shardsAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), num_shards));
  odsState.addAttribute(shard_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), shard_id));
  odsState.addAttribute(configAttrName(odsState.name), odsBuilder.getStringAttr(config));
  odsState.addTypes(parameters);
  odsState.addTypes(accumulators);
  odsState.addTypes(linears);
}

void RetrieveTPUEmbeddingFTRLParametersOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, uint64_t table_id, ::llvm::StringRef table_name, uint64_t num_shards, uint64_t shard_id, ::llvm::StringRef config) {
  odsState.addAttribute(table_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), table_id));
  odsState.addAttribute(table_nameAttrName(odsState.name), odsBuilder.getStringAttr(table_name));
  odsState.addAttribute(num_shardsAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), num_shards));
  odsState.addAttribute(shard_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), shard_id));
  odsState.addAttribute(configAttrName(odsState.name), odsBuilder.getStringAttr(config));
  assert(resultTypes.size() == 3u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void RetrieveTPUEmbeddingFTRLParametersOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 0u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 3u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult RetrieveTPUEmbeddingFTRLParametersOp::verify() {
  {
    auto tblgen_table_id = (*this)->getAttr(table_idAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_table_id, "table_id")))
      return ::mlir::failure();
  }
  {
    auto tblgen_table_name = (*this)->getAttr(table_nameAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_table_name, "table_name")))
      return ::mlir::failure();
  }
  {
    auto tblgen_num_shards = (*this)->getAttr(num_shardsAttrName());
    if (!tblgen_num_shards)
      return emitOpError("requires attribute 'num_shards'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_num_shards, "num_shards")))
      return ::mlir::failure();
  }
  {
    auto tblgen_shard_id = (*this)->getAttr(shard_idAttrName());
    if (!tblgen_shard_id)
      return emitOpError("requires attribute 'shard_id'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_shard_id, "shard_id")))
      return ::mlir::failure();
  }
  {
    auto tblgen_config = (*this)->getAttr(configAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_config, "config")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSResults(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSResults(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void RetrieveTPUEmbeddingFTRLParametersOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  effects.emplace_back(::mlir::MemoryEffects::Write::get(), ::mlir::TF::ResourceEffects::MustExecute::get());
  effects.emplace_back(::mlir::MemoryEffects::Read::get(), ::mlir::TF::ResourceEffects::TPUEmbedding::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::RetrieveTPUEmbeddingFTRLParametersOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::RetrieveTPUEmbeddingMDLAdagradLightParametersOp definitions
//===----------------------------------------------------------------------===//

RetrieveTPUEmbeddingMDLAdagradLightParametersOpAdaptor::RetrieveTPUEmbeddingMDLAdagradLightParametersOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

RetrieveTPUEmbeddingMDLAdagradLightParametersOpAdaptor::RetrieveTPUEmbeddingMDLAdagradLightParametersOpAdaptor(RetrieveTPUEmbeddingMDLAdagradLightParametersOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange RetrieveTPUEmbeddingMDLAdagradLightParametersOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> RetrieveTPUEmbeddingMDLAdagradLightParametersOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange RetrieveTPUEmbeddingMDLAdagradLightParametersOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::DictionaryAttr RetrieveTPUEmbeddingMDLAdagradLightParametersOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::IntegerAttr RetrieveTPUEmbeddingMDLAdagradLightParametersOpAdaptor::table_id() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("table_id").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), -1);
  return attr;
}

::mlir::StringAttr RetrieveTPUEmbeddingMDLAdagradLightParametersOpAdaptor::table_name() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("table_name").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("");
  return attr;
}

::mlir::IntegerAttr RetrieveTPUEmbeddingMDLAdagradLightParametersOpAdaptor::num_shards() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("num_shards").cast<::mlir::IntegerAttr>();
  return attr;
}

::mlir::IntegerAttr RetrieveTPUEmbeddingMDLAdagradLightParametersOpAdaptor::shard_id() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("shard_id").cast<::mlir::IntegerAttr>();
  return attr;
}

::mlir::StringAttr RetrieveTPUEmbeddingMDLAdagradLightParametersOpAdaptor::config() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("config").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("");
  return attr;
}

::mlir::LogicalResult RetrieveTPUEmbeddingMDLAdagradLightParametersOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_table_id = odsAttrs.get("table_id");
    if (tblgen_table_id && !(((tblgen_table_id.isa<::mlir::IntegerAttr>())) && ((tblgen_table_id.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.RetrieveTPUEmbeddingMDLAdagradLightParameters' op ""attribute 'table_id' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_table_name = odsAttrs.get("table_name");
    if (tblgen_table_name && !((tblgen_table_name.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.RetrieveTPUEmbeddingMDLAdagradLightParameters' op ""attribute 'table_name' failed to satisfy constraint: string attribute");
  }
  {
    auto tblgen_num_shards = odsAttrs.get("num_shards");
    if (!tblgen_num_shards)
      return emitError(loc, "'tf.RetrieveTPUEmbeddingMDLAdagradLightParameters' op ""requires attribute 'num_shards'");

    if (tblgen_num_shards && !(((tblgen_num_shards.isa<::mlir::IntegerAttr>())) && ((tblgen_num_shards.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.RetrieveTPUEmbeddingMDLAdagradLightParameters' op ""attribute 'num_shards' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_shard_id = odsAttrs.get("shard_id");
    if (!tblgen_shard_id)
      return emitError(loc, "'tf.RetrieveTPUEmbeddingMDLAdagradLightParameters' op ""requires attribute 'shard_id'");

    if (tblgen_shard_id && !(((tblgen_shard_id.isa<::mlir::IntegerAttr>())) && ((tblgen_shard_id.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.RetrieveTPUEmbeddingMDLAdagradLightParameters' op ""attribute 'shard_id' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_config = odsAttrs.get("config");
    if (tblgen_config && !((tblgen_config.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.RetrieveTPUEmbeddingMDLAdagradLightParameters' op ""attribute 'config' failed to satisfy constraint: string attribute");
  }
  return ::mlir::success();
}

void RetrieveTPUEmbeddingMDLAdagradLightParametersOp::getAsmResultNames(::mlir::OpAsmSetValueNameFn setNameFn) {
  auto resultGroup0 = getODSResults(0);
  if (!llvm::empty(resultGroup0))
    setNameFn(*resultGroup0.begin(), "parameters");
  auto resultGroup1 = getODSResults(1);
  if (!llvm::empty(resultGroup1))
    setNameFn(*resultGroup1.begin(), "accumulators");
  auto resultGroup2 = getODSResults(2);
  if (!llvm::empty(resultGroup2))
    setNameFn(*resultGroup2.begin(), "weights");
  auto resultGroup3 = getODSResults(3);
  if (!llvm::empty(resultGroup3))
    setNameFn(*resultGroup3.begin(), "benefits");
}

std::pair<unsigned, unsigned> RetrieveTPUEmbeddingMDLAdagradLightParametersOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range RetrieveTPUEmbeddingMDLAdagradLightParametersOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

std::pair<unsigned, unsigned> RetrieveTPUEmbeddingMDLAdagradLightParametersOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range RetrieveTPUEmbeddingMDLAdagradLightParametersOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value RetrieveTPUEmbeddingMDLAdagradLightParametersOp::parameters() {
  return *getODSResults(0).begin();
}

::mlir::Value RetrieveTPUEmbeddingMDLAdagradLightParametersOp::accumulators() {
  return *getODSResults(1).begin();
}

::mlir::Value RetrieveTPUEmbeddingMDLAdagradLightParametersOp::weights() {
  return *getODSResults(2).begin();
}

::mlir::Value RetrieveTPUEmbeddingMDLAdagradLightParametersOp::benefits() {
  return *getODSResults(3).begin();
}

::mlir::IntegerAttr RetrieveTPUEmbeddingMDLAdagradLightParametersOp::table_idAttr() {
  return (*this)->getAttr(table_idAttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t RetrieveTPUEmbeddingMDLAdagradLightParametersOp::table_id() {
  auto attr = table_idAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), -1).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

::mlir::StringAttr RetrieveTPUEmbeddingMDLAdagradLightParametersOp::table_nameAttr() {
  return (*this)->getAttr(table_nameAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef RetrieveTPUEmbeddingMDLAdagradLightParametersOp::table_name() {
  auto attr = table_nameAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("").getValue();
  return attr.getValue();
}

::mlir::IntegerAttr RetrieveTPUEmbeddingMDLAdagradLightParametersOp::num_shardsAttr() {
  return (*this)->getAttr(num_shardsAttrName()).cast<::mlir::IntegerAttr>();
}

uint64_t RetrieveTPUEmbeddingMDLAdagradLightParametersOp::num_shards() {
  auto attr = num_shardsAttr();
  return attr.getValue().getZExtValue();
}

::mlir::IntegerAttr RetrieveTPUEmbeddingMDLAdagradLightParametersOp::shard_idAttr() {
  return (*this)->getAttr(shard_idAttrName()).cast<::mlir::IntegerAttr>();
}

uint64_t RetrieveTPUEmbeddingMDLAdagradLightParametersOp::shard_id() {
  auto attr = shard_idAttr();
  return attr.getValue().getZExtValue();
}

::mlir::StringAttr RetrieveTPUEmbeddingMDLAdagradLightParametersOp::configAttr() {
  return (*this)->getAttr(configAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef RetrieveTPUEmbeddingMDLAdagradLightParametersOp::config() {
  auto attr = configAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("").getValue();
  return attr.getValue();
}

void RetrieveTPUEmbeddingMDLAdagradLightParametersOp::table_idAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(table_idAttrName(), attr);
}

void RetrieveTPUEmbeddingMDLAdagradLightParametersOp::table_nameAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(table_nameAttrName(), attr);
}

void RetrieveTPUEmbeddingMDLAdagradLightParametersOp::num_shardsAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(num_shardsAttrName(), attr);
}

void RetrieveTPUEmbeddingMDLAdagradLightParametersOp::shard_idAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(shard_idAttrName(), attr);
}

void RetrieveTPUEmbeddingMDLAdagradLightParametersOp::configAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(configAttrName(), attr);
}

void RetrieveTPUEmbeddingMDLAdagradLightParametersOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type parameters, ::mlir::Type accumulators, ::mlir::Type weights, ::mlir::Type benefits, ::mlir::IntegerAttr table_id, ::mlir::StringAttr table_name, ::mlir::IntegerAttr num_shards, ::mlir::IntegerAttr shard_id, ::mlir::StringAttr config) {
  odsState.addAttribute(table_idAttrName(odsState.name), table_id);
  odsState.addAttribute(table_nameAttrName(odsState.name), table_name);
  odsState.addAttribute(num_shardsAttrName(odsState.name), num_shards);
  odsState.addAttribute(shard_idAttrName(odsState.name), shard_id);
  odsState.addAttribute(configAttrName(odsState.name), config);
  odsState.addTypes(parameters);
  odsState.addTypes(accumulators);
  odsState.addTypes(weights);
  odsState.addTypes(benefits);
}

void RetrieveTPUEmbeddingMDLAdagradLightParametersOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::IntegerAttr table_id, ::mlir::StringAttr table_name, ::mlir::IntegerAttr num_shards, ::mlir::IntegerAttr shard_id, ::mlir::StringAttr config) {
  odsState.addAttribute(table_idAttrName(odsState.name), table_id);
  odsState.addAttribute(table_nameAttrName(odsState.name), table_name);
  odsState.addAttribute(num_shardsAttrName(odsState.name), num_shards);
  odsState.addAttribute(shard_idAttrName(odsState.name), shard_id);
  odsState.addAttribute(configAttrName(odsState.name), config);
  assert(resultTypes.size() == 4u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void RetrieveTPUEmbeddingMDLAdagradLightParametersOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type parameters, ::mlir::Type accumulators, ::mlir::Type weights, ::mlir::Type benefits, uint64_t table_id, ::llvm::StringRef table_name, uint64_t num_shards, uint64_t shard_id, ::llvm::StringRef config) {
  odsState.addAttribute(table_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), table_id));
  odsState.addAttribute(table_nameAttrName(odsState.name), odsBuilder.getStringAttr(table_name));
  odsState.addAttribute(num_shardsAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), num_shards));
  odsState.addAttribute(shard_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), shard_id));
  odsState.addAttribute(configAttrName(odsState.name), odsBuilder.getStringAttr(config));
  odsState.addTypes(parameters);
  odsState.addTypes(accumulators);
  odsState.addTypes(weights);
  odsState.addTypes(benefits);
}

void RetrieveTPUEmbeddingMDLAdagradLightParametersOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, uint64_t table_id, ::llvm::StringRef table_name, uint64_t num_shards, uint64_t shard_id, ::llvm::StringRef config) {
  odsState.addAttribute(table_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), table_id));
  odsState.addAttribute(table_nameAttrName(odsState.name), odsBuilder.getStringAttr(table_name));
  odsState.addAttribute(num_shardsAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), num_shards));
  odsState.addAttribute(shard_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), shard_id));
  odsState.addAttribute(configAttrName(odsState.name), odsBuilder.getStringAttr(config));
  assert(resultTypes.size() == 4u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void RetrieveTPUEmbeddingMDLAdagradLightParametersOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 0u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 4u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult RetrieveTPUEmbeddingMDLAdagradLightParametersOp::verify() {
  {
    auto tblgen_table_id = (*this)->getAttr(table_idAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_table_id, "table_id")))
      return ::mlir::failure();
  }
  {
    auto tblgen_table_name = (*this)->getAttr(table_nameAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_table_name, "table_name")))
      return ::mlir::failure();
  }
  {
    auto tblgen_num_shards = (*this)->getAttr(num_shardsAttrName());
    if (!tblgen_num_shards)
      return emitOpError("requires attribute 'num_shards'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_num_shards, "num_shards")))
      return ::mlir::failure();
  }
  {
    auto tblgen_shard_id = (*this)->getAttr(shard_idAttrName());
    if (!tblgen_shard_id)
      return emitOpError("requires attribute 'shard_id'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_shard_id, "shard_id")))
      return ::mlir::failure();
  }
  {
    auto tblgen_config = (*this)->getAttr(configAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_config, "config")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSResults(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSResults(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
    auto valueGroup3 = getODSResults(3);

    for (auto v : valueGroup3) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void RetrieveTPUEmbeddingMDLAdagradLightParametersOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  effects.emplace_back(::mlir::MemoryEffects::Write::get(), ::mlir::TF::ResourceEffects::MustExecute::get());
  effects.emplace_back(::mlir::MemoryEffects::Read::get(), ::mlir::TF::ResourceEffects::TPUEmbedding::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::RetrieveTPUEmbeddingMDLAdagradLightParametersOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::RetrieveTPUEmbeddingMomentumParametersGradAccumDebugOp definitions
//===----------------------------------------------------------------------===//

RetrieveTPUEmbeddingMomentumParametersGradAccumDebugOpAdaptor::RetrieveTPUEmbeddingMomentumParametersGradAccumDebugOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

RetrieveTPUEmbeddingMomentumParametersGradAccumDebugOpAdaptor::RetrieveTPUEmbeddingMomentumParametersGradAccumDebugOpAdaptor(RetrieveTPUEmbeddingMomentumParametersGradAccumDebugOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange RetrieveTPUEmbeddingMomentumParametersGradAccumDebugOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> RetrieveTPUEmbeddingMomentumParametersGradAccumDebugOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange RetrieveTPUEmbeddingMomentumParametersGradAccumDebugOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::DictionaryAttr RetrieveTPUEmbeddingMomentumParametersGradAccumDebugOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::IntegerAttr RetrieveTPUEmbeddingMomentumParametersGradAccumDebugOpAdaptor::table_id() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("table_id").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), -1);
  return attr;
}

::mlir::StringAttr RetrieveTPUEmbeddingMomentumParametersGradAccumDebugOpAdaptor::table_name() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("table_name").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("");
  return attr;
}

::mlir::IntegerAttr RetrieveTPUEmbeddingMomentumParametersGradAccumDebugOpAdaptor::num_shards() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("num_shards").cast<::mlir::IntegerAttr>();
  return attr;
}

::mlir::IntegerAttr RetrieveTPUEmbeddingMomentumParametersGradAccumDebugOpAdaptor::shard_id() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("shard_id").cast<::mlir::IntegerAttr>();
  return attr;
}

::mlir::StringAttr RetrieveTPUEmbeddingMomentumParametersGradAccumDebugOpAdaptor::config() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("config").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("");
  return attr;
}

::mlir::LogicalResult RetrieveTPUEmbeddingMomentumParametersGradAccumDebugOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_table_id = odsAttrs.get("table_id");
    if (tblgen_table_id && !(((tblgen_table_id.isa<::mlir::IntegerAttr>())) && ((tblgen_table_id.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.RetrieveTPUEmbeddingMomentumParametersGradAccumDebug' op ""attribute 'table_id' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_table_name = odsAttrs.get("table_name");
    if (tblgen_table_name && !((tblgen_table_name.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.RetrieveTPUEmbeddingMomentumParametersGradAccumDebug' op ""attribute 'table_name' failed to satisfy constraint: string attribute");
  }
  {
    auto tblgen_num_shards = odsAttrs.get("num_shards");
    if (!tblgen_num_shards)
      return emitError(loc, "'tf.RetrieveTPUEmbeddingMomentumParametersGradAccumDebug' op ""requires attribute 'num_shards'");

    if (tblgen_num_shards && !(((tblgen_num_shards.isa<::mlir::IntegerAttr>())) && ((tblgen_num_shards.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.RetrieveTPUEmbeddingMomentumParametersGradAccumDebug' op ""attribute 'num_shards' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_shard_id = odsAttrs.get("shard_id");
    if (!tblgen_shard_id)
      return emitError(loc, "'tf.RetrieveTPUEmbeddingMomentumParametersGradAccumDebug' op ""requires attribute 'shard_id'");

    if (tblgen_shard_id && !(((tblgen_shard_id.isa<::mlir::IntegerAttr>())) && ((tblgen_shard_id.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.RetrieveTPUEmbeddingMomentumParametersGradAccumDebug' op ""attribute 'shard_id' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_config = odsAttrs.get("config");
    if (tblgen_config && !((tblgen_config.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.RetrieveTPUEmbeddingMomentumParametersGradAccumDebug' op ""attribute 'config' failed to satisfy constraint: string attribute");
  }
  return ::mlir::success();
}

void RetrieveTPUEmbeddingMomentumParametersGradAccumDebugOp::getAsmResultNames(::mlir::OpAsmSetValueNameFn setNameFn) {
  auto resultGroup0 = getODSResults(0);
  if (!llvm::empty(resultGroup0))
    setNameFn(*resultGroup0.begin(), "parameters");
  auto resultGroup1 = getODSResults(1);
  if (!llvm::empty(resultGroup1))
    setNameFn(*resultGroup1.begin(), "momenta");
  auto resultGroup2 = getODSResults(2);
  if (!llvm::empty(resultGroup2))
    setNameFn(*resultGroup2.begin(), "gradient_accumulators");
}

std::pair<unsigned, unsigned> RetrieveTPUEmbeddingMomentumParametersGradAccumDebugOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range RetrieveTPUEmbeddingMomentumParametersGradAccumDebugOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

std::pair<unsigned, unsigned> RetrieveTPUEmbeddingMomentumParametersGradAccumDebugOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range RetrieveTPUEmbeddingMomentumParametersGradAccumDebugOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value RetrieveTPUEmbeddingMomentumParametersGradAccumDebugOp::parameters() {
  return *getODSResults(0).begin();
}

::mlir::Value RetrieveTPUEmbeddingMomentumParametersGradAccumDebugOp::momenta() {
  return *getODSResults(1).begin();
}

::mlir::Value RetrieveTPUEmbeddingMomentumParametersGradAccumDebugOp::gradient_accumulators() {
  return *getODSResults(2).begin();
}

::mlir::IntegerAttr RetrieveTPUEmbeddingMomentumParametersGradAccumDebugOp::table_idAttr() {
  return (*this)->getAttr(table_idAttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t RetrieveTPUEmbeddingMomentumParametersGradAccumDebugOp::table_id() {
  auto attr = table_idAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), -1).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

::mlir::StringAttr RetrieveTPUEmbeddingMomentumParametersGradAccumDebugOp::table_nameAttr() {
  return (*this)->getAttr(table_nameAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef RetrieveTPUEmbeddingMomentumParametersGradAccumDebugOp::table_name() {
  auto attr = table_nameAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("").getValue();
  return attr.getValue();
}

::mlir::IntegerAttr RetrieveTPUEmbeddingMomentumParametersGradAccumDebugOp::num_shardsAttr() {
  return (*this)->getAttr(num_shardsAttrName()).cast<::mlir::IntegerAttr>();
}

uint64_t RetrieveTPUEmbeddingMomentumParametersGradAccumDebugOp::num_shards() {
  auto attr = num_shardsAttr();
  return attr.getValue().getZExtValue();
}

::mlir::IntegerAttr RetrieveTPUEmbeddingMomentumParametersGradAccumDebugOp::shard_idAttr() {
  return (*this)->getAttr(shard_idAttrName()).cast<::mlir::IntegerAttr>();
}

uint64_t RetrieveTPUEmbeddingMomentumParametersGradAccumDebugOp::shard_id() {
  auto attr = shard_idAttr();
  return attr.getValue().getZExtValue();
}

::mlir::StringAttr RetrieveTPUEmbeddingMomentumParametersGradAccumDebugOp::configAttr() {
  return (*this)->getAttr(configAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef RetrieveTPUEmbeddingMomentumParametersGradAccumDebugOp::config() {
  auto attr = configAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("").getValue();
  return attr.getValue();
}

void RetrieveTPUEmbeddingMomentumParametersGradAccumDebugOp::table_idAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(table_idAttrName(), attr);
}

void RetrieveTPUEmbeddingMomentumParametersGradAccumDebugOp::table_nameAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(table_nameAttrName(), attr);
}

void RetrieveTPUEmbeddingMomentumParametersGradAccumDebugOp::num_shardsAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(num_shardsAttrName(), attr);
}

void RetrieveTPUEmbeddingMomentumParametersGradAccumDebugOp::shard_idAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(shard_idAttrName(), attr);
}

void RetrieveTPUEmbeddingMomentumParametersGradAccumDebugOp::configAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(configAttrName(), attr);
}

void RetrieveTPUEmbeddingMomentumParametersGradAccumDebugOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type parameters, ::mlir::Type momenta, ::mlir::Type gradient_accumulators, ::mlir::IntegerAttr table_id, ::mlir::StringAttr table_name, ::mlir::IntegerAttr num_shards, ::mlir::IntegerAttr shard_id, ::mlir::StringAttr config) {
  odsState.addAttribute(table_idAttrName(odsState.name), table_id);
  odsState.addAttribute(table_nameAttrName(odsState.name), table_name);
  odsState.addAttribute(num_shardsAttrName(odsState.name), num_shards);
  odsState.addAttribute(shard_idAttrName(odsState.name), shard_id);
  odsState.addAttribute(configAttrName(odsState.name), config);
  odsState.addTypes(parameters);
  odsState.addTypes(momenta);
  odsState.addTypes(gradient_accumulators);
}

void RetrieveTPUEmbeddingMomentumParametersGradAccumDebugOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::IntegerAttr table_id, ::mlir::StringAttr table_name, ::mlir::IntegerAttr num_shards, ::mlir::IntegerAttr shard_id, ::mlir::StringAttr config) {
  odsState.addAttribute(table_idAttrName(odsState.name), table_id);
  odsState.addAttribute(table_nameAttrName(odsState.name), table_name);
  odsState.addAttribute(num_shardsAttrName(odsState.name), num_shards);
  odsState.addAttribute(shard_idAttrName(odsState.name), shard_id);
  odsState.addAttribute(configAttrName(odsState.name), config);
  assert(resultTypes.size() == 3u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void RetrieveTPUEmbeddingMomentumParametersGradAccumDebugOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type parameters, ::mlir::Type momenta, ::mlir::Type gradient_accumulators, uint64_t table_id, ::llvm::StringRef table_name, uint64_t num_shards, uint64_t shard_id, ::llvm::StringRef config) {
  odsState.addAttribute(table_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), table_id));
  odsState.addAttribute(table_nameAttrName(odsState.name), odsBuilder.getStringAttr(table_name));
  odsState.addAttribute(num_shardsAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), num_shards));
  odsState.addAttribute(shard_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), shard_id));
  odsState.addAttribute(configAttrName(odsState.name), odsBuilder.getStringAttr(config));
  odsState.addTypes(parameters);
  odsState.addTypes(momenta);
  odsState.addTypes(gradient_accumulators);
}

void RetrieveTPUEmbeddingMomentumParametersGradAccumDebugOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, uint64_t table_id, ::llvm::StringRef table_name, uint64_t num_shards, uint64_t shard_id, ::llvm::StringRef config) {
  odsState.addAttribute(table_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), table_id));
  odsState.addAttribute(table_nameAttrName(odsState.name), odsBuilder.getStringAttr(table_name));
  odsState.addAttribute(num_shardsAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), num_shards));
  odsState.addAttribute(shard_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), shard_id));
  odsState.addAttribute(configAttrName(odsState.name), odsBuilder.getStringAttr(config));
  assert(resultTypes.size() == 3u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void RetrieveTPUEmbeddingMomentumParametersGradAccumDebugOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 0u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 3u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult RetrieveTPUEmbeddingMomentumParametersGradAccumDebugOp::verify() {
  {
    auto tblgen_table_id = (*this)->getAttr(table_idAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_table_id, "table_id")))
      return ::mlir::failure();
  }
  {
    auto tblgen_table_name = (*this)->getAttr(table_nameAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_table_name, "table_name")))
      return ::mlir::failure();
  }
  {
    auto tblgen_num_shards = (*this)->getAttr(num_shardsAttrName());
    if (!tblgen_num_shards)
      return emitOpError("requires attribute 'num_shards'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_num_shards, "num_shards")))
      return ::mlir::failure();
  }
  {
    auto tblgen_shard_id = (*this)->getAttr(shard_idAttrName());
    if (!tblgen_shard_id)
      return emitOpError("requires attribute 'shard_id'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_shard_id, "shard_id")))
      return ::mlir::failure();
  }
  {
    auto tblgen_config = (*this)->getAttr(configAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_config, "config")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSResults(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSResults(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void RetrieveTPUEmbeddingMomentumParametersGradAccumDebugOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  effects.emplace_back(::mlir::MemoryEffects::Write::get(), ::mlir::TF::ResourceEffects::MustExecute::get());
  effects.emplace_back(::mlir::MemoryEffects::Read::get(), ::mlir::TF::ResourceEffects::TPUEmbedding::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::RetrieveTPUEmbeddingMomentumParametersGradAccumDebugOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::RetrieveTPUEmbeddingMomentumParametersOp definitions
//===----------------------------------------------------------------------===//

RetrieveTPUEmbeddingMomentumParametersOpAdaptor::RetrieveTPUEmbeddingMomentumParametersOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

RetrieveTPUEmbeddingMomentumParametersOpAdaptor::RetrieveTPUEmbeddingMomentumParametersOpAdaptor(RetrieveTPUEmbeddingMomentumParametersOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange RetrieveTPUEmbeddingMomentumParametersOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> RetrieveTPUEmbeddingMomentumParametersOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange RetrieveTPUEmbeddingMomentumParametersOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::DictionaryAttr RetrieveTPUEmbeddingMomentumParametersOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::IntegerAttr RetrieveTPUEmbeddingMomentumParametersOpAdaptor::table_id() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("table_id").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), -1);
  return attr;
}

::mlir::StringAttr RetrieveTPUEmbeddingMomentumParametersOpAdaptor::table_name() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("table_name").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("");
  return attr;
}

::mlir::IntegerAttr RetrieveTPUEmbeddingMomentumParametersOpAdaptor::num_shards() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("num_shards").cast<::mlir::IntegerAttr>();
  return attr;
}

::mlir::IntegerAttr RetrieveTPUEmbeddingMomentumParametersOpAdaptor::shard_id() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("shard_id").cast<::mlir::IntegerAttr>();
  return attr;
}

::mlir::StringAttr RetrieveTPUEmbeddingMomentumParametersOpAdaptor::config() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("config").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("");
  return attr;
}

::mlir::LogicalResult RetrieveTPUEmbeddingMomentumParametersOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_table_id = odsAttrs.get("table_id");
    if (tblgen_table_id && !(((tblgen_table_id.isa<::mlir::IntegerAttr>())) && ((tblgen_table_id.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.RetrieveTPUEmbeddingMomentumParameters' op ""attribute 'table_id' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_table_name = odsAttrs.get("table_name");
    if (tblgen_table_name && !((tblgen_table_name.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.RetrieveTPUEmbeddingMomentumParameters' op ""attribute 'table_name' failed to satisfy constraint: string attribute");
  }
  {
    auto tblgen_num_shards = odsAttrs.get("num_shards");
    if (!tblgen_num_shards)
      return emitError(loc, "'tf.RetrieveTPUEmbeddingMomentumParameters' op ""requires attribute 'num_shards'");

    if (tblgen_num_shards && !(((tblgen_num_shards.isa<::mlir::IntegerAttr>())) && ((tblgen_num_shards.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.RetrieveTPUEmbeddingMomentumParameters' op ""attribute 'num_shards' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_shard_id = odsAttrs.get("shard_id");
    if (!tblgen_shard_id)
      return emitError(loc, "'tf.RetrieveTPUEmbeddingMomentumParameters' op ""requires attribute 'shard_id'");

    if (tblgen_shard_id && !(((tblgen_shard_id.isa<::mlir::IntegerAttr>())) && ((tblgen_shard_id.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.RetrieveTPUEmbeddingMomentumParameters' op ""attribute 'shard_id' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_config = odsAttrs.get("config");
    if (tblgen_config && !((tblgen_config.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.RetrieveTPUEmbeddingMomentumParameters' op ""attribute 'config' failed to satisfy constraint: string attribute");
  }
  return ::mlir::success();
}

void RetrieveTPUEmbeddingMomentumParametersOp::getAsmResultNames(::mlir::OpAsmSetValueNameFn setNameFn) {
  auto resultGroup0 = getODSResults(0);
  if (!llvm::empty(resultGroup0))
    setNameFn(*resultGroup0.begin(), "parameters");
  auto resultGroup1 = getODSResults(1);
  if (!llvm::empty(resultGroup1))
    setNameFn(*resultGroup1.begin(), "momenta");
}

std::pair<unsigned, unsigned> RetrieveTPUEmbeddingMomentumParametersOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range RetrieveTPUEmbeddingMomentumParametersOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

std::pair<unsigned, unsigned> RetrieveTPUEmbeddingMomentumParametersOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range RetrieveTPUEmbeddingMomentumParametersOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value RetrieveTPUEmbeddingMomentumParametersOp::parameters() {
  return *getODSResults(0).begin();
}

::mlir::Value RetrieveTPUEmbeddingMomentumParametersOp::momenta() {
  return *getODSResults(1).begin();
}

::mlir::IntegerAttr RetrieveTPUEmbeddingMomentumParametersOp::table_idAttr() {
  return (*this)->getAttr(table_idAttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t RetrieveTPUEmbeddingMomentumParametersOp::table_id() {
  auto attr = table_idAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), -1).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

::mlir::StringAttr RetrieveTPUEmbeddingMomentumParametersOp::table_nameAttr() {
  return (*this)->getAttr(table_nameAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef RetrieveTPUEmbeddingMomentumParametersOp::table_name() {
  auto attr = table_nameAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("").getValue();
  return attr.getValue();
}

::mlir::IntegerAttr RetrieveTPUEmbeddingMomentumParametersOp::num_shardsAttr() {
  return (*this)->getAttr(num_shardsAttrName()).cast<::mlir::IntegerAttr>();
}

uint64_t RetrieveTPUEmbeddingMomentumParametersOp::num_shards() {
  auto attr = num_shardsAttr();
  return attr.getValue().getZExtValue();
}

::mlir::IntegerAttr RetrieveTPUEmbeddingMomentumParametersOp::shard_idAttr() {
  return (*this)->getAttr(shard_idAttrName()).cast<::mlir::IntegerAttr>();
}

uint64_t RetrieveTPUEmbeddingMomentumParametersOp::shard_id() {
  auto attr = shard_idAttr();
  return attr.getValue().getZExtValue();
}

::mlir::StringAttr RetrieveTPUEmbeddingMomentumParametersOp::configAttr() {
  return (*this)->getAttr(configAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef RetrieveTPUEmbeddingMomentumParametersOp::config() {
  auto attr = configAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("").getValue();
  return attr.getValue();
}

void RetrieveTPUEmbeddingMomentumParametersOp::table_idAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(table_idAttrName(), attr);
}

void RetrieveTPUEmbeddingMomentumParametersOp::table_nameAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(table_nameAttrName(), attr);
}

void RetrieveTPUEmbeddingMomentumParametersOp::num_shardsAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(num_shardsAttrName(), attr);
}

void RetrieveTPUEmbeddingMomentumParametersOp::shard_idAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(shard_idAttrName(), attr);
}

void RetrieveTPUEmbeddingMomentumParametersOp::configAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(configAttrName(), attr);
}

void RetrieveTPUEmbeddingMomentumParametersOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type parameters, ::mlir::Type momenta, ::mlir::IntegerAttr table_id, ::mlir::StringAttr table_name, ::mlir::IntegerAttr num_shards, ::mlir::IntegerAttr shard_id, ::mlir::StringAttr config) {
  odsState.addAttribute(table_idAttrName(odsState.name), table_id);
  odsState.addAttribute(table_nameAttrName(odsState.name), table_name);
  odsState.addAttribute(num_shardsAttrName(odsState.name), num_shards);
  odsState.addAttribute(shard_idAttrName(odsState.name), shard_id);
  odsState.addAttribute(configAttrName(odsState.name), config);
  odsState.addTypes(parameters);
  odsState.addTypes(momenta);
}

void RetrieveTPUEmbeddingMomentumParametersOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::IntegerAttr table_id, ::mlir::StringAttr table_name, ::mlir::IntegerAttr num_shards, ::mlir::IntegerAttr shard_id, ::mlir::StringAttr config) {
  odsState.addAttribute(table_idAttrName(odsState.name), table_id);
  odsState.addAttribute(table_nameAttrName(odsState.name), table_name);
  odsState.addAttribute(num_shardsAttrName(odsState.name), num_shards);
  odsState.addAttribute(shard_idAttrName(odsState.name), shard_id);
  odsState.addAttribute(configAttrName(odsState.name), config);
  assert(resultTypes.size() == 2u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void RetrieveTPUEmbeddingMomentumParametersOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type parameters, ::mlir::Type momenta, uint64_t table_id, ::llvm::StringRef table_name, uint64_t num_shards, uint64_t shard_id, ::llvm::StringRef config) {
  odsState.addAttribute(table_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), table_id));
  odsState.addAttribute(table_nameAttrName(odsState.name), odsBuilder.getStringAttr(table_name));
  odsState.addAttribute(num_shardsAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), num_shards));
  odsState.addAttribute(shard_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), shard_id));
  odsState.addAttribute(configAttrName(odsState.name), odsBuilder.getStringAttr(config));
  odsState.addTypes(parameters);
  odsState.addTypes(momenta);
}

void RetrieveTPUEmbeddingMomentumParametersOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, uint64_t table_id, ::llvm::StringRef table_name, uint64_t num_shards, uint64_t shard_id, ::llvm::StringRef config) {
  odsState.addAttribute(table_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), table_id));
  odsState.addAttribute(table_nameAttrName(odsState.name), odsBuilder.getStringAttr(table_name));
  odsState.addAttribute(num_shardsAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), num_shards));
  odsState.addAttribute(shard_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), shard_id));
  odsState.addAttribute(configAttrName(odsState.name), odsBuilder.getStringAttr(config));
  assert(resultTypes.size() == 2u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void RetrieveTPUEmbeddingMomentumParametersOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 0u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 2u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult RetrieveTPUEmbeddingMomentumParametersOp::verify() {
  {
    auto tblgen_table_id = (*this)->getAttr(table_idAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_table_id, "table_id")))
      return ::mlir::failure();
  }
  {
    auto tblgen_table_name = (*this)->getAttr(table_nameAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_table_name, "table_name")))
      return ::mlir::failure();
  }
  {
    auto tblgen_num_shards = (*this)->getAttr(num_shardsAttrName());
    if (!tblgen_num_shards)
      return emitOpError("requires attribute 'num_shards'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_num_shards, "num_shards")))
      return ::mlir::failure();
  }
  {
    auto tblgen_shard_id = (*this)->getAttr(shard_idAttrName());
    if (!tblgen_shard_id)
      return emitOpError("requires attribute 'shard_id'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_shard_id, "shard_id")))
      return ::mlir::failure();
  }
  {
    auto tblgen_config = (*this)->getAttr(configAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_config, "config")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSResults(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void RetrieveTPUEmbeddingMomentumParametersOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  effects.emplace_back(::mlir::MemoryEffects::Write::get(), ::mlir::TF::ResourceEffects::MustExecute::get());
  effects.emplace_back(::mlir::MemoryEffects::Read::get(), ::mlir::TF::ResourceEffects::TPUEmbedding::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::RetrieveTPUEmbeddingMomentumParametersOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::RetrieveTPUEmbeddingProximalAdagradParametersGradAccumDebugOp definitions
//===----------------------------------------------------------------------===//

RetrieveTPUEmbeddingProximalAdagradParametersGradAccumDebugOpAdaptor::RetrieveTPUEmbeddingProximalAdagradParametersGradAccumDebugOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

RetrieveTPUEmbeddingProximalAdagradParametersGradAccumDebugOpAdaptor::RetrieveTPUEmbeddingProximalAdagradParametersGradAccumDebugOpAdaptor(RetrieveTPUEmbeddingProximalAdagradParametersGradAccumDebugOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange RetrieveTPUEmbeddingProximalAdagradParametersGradAccumDebugOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> RetrieveTPUEmbeddingProximalAdagradParametersGradAccumDebugOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange RetrieveTPUEmbeddingProximalAdagradParametersGradAccumDebugOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::DictionaryAttr RetrieveTPUEmbeddingProximalAdagradParametersGradAccumDebugOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::IntegerAttr RetrieveTPUEmbeddingProximalAdagradParametersGradAccumDebugOpAdaptor::table_id() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("table_id").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), -1);
  return attr;
}

::mlir::StringAttr RetrieveTPUEmbeddingProximalAdagradParametersGradAccumDebugOpAdaptor::table_name() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("table_name").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("");
  return attr;
}

::mlir::IntegerAttr RetrieveTPUEmbeddingProximalAdagradParametersGradAccumDebugOpAdaptor::num_shards() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("num_shards").cast<::mlir::IntegerAttr>();
  return attr;
}

::mlir::IntegerAttr RetrieveTPUEmbeddingProximalAdagradParametersGradAccumDebugOpAdaptor::shard_id() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("shard_id").cast<::mlir::IntegerAttr>();
  return attr;
}

::mlir::StringAttr RetrieveTPUEmbeddingProximalAdagradParametersGradAccumDebugOpAdaptor::config() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("config").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("");
  return attr;
}

::mlir::LogicalResult RetrieveTPUEmbeddingProximalAdagradParametersGradAccumDebugOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_table_id = odsAttrs.get("table_id");
    if (tblgen_table_id && !(((tblgen_table_id.isa<::mlir::IntegerAttr>())) && ((tblgen_table_id.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.RetrieveTPUEmbeddingProximalAdagradParametersGradAccumDebug' op ""attribute 'table_id' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_table_name = odsAttrs.get("table_name");
    if (tblgen_table_name && !((tblgen_table_name.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.RetrieveTPUEmbeddingProximalAdagradParametersGradAccumDebug' op ""attribute 'table_name' failed to satisfy constraint: string attribute");
  }
  {
    auto tblgen_num_shards = odsAttrs.get("num_shards");
    if (!tblgen_num_shards)
      return emitError(loc, "'tf.RetrieveTPUEmbeddingProximalAdagradParametersGradAccumDebug' op ""requires attribute 'num_shards'");

    if (tblgen_num_shards && !(((tblgen_num_shards.isa<::mlir::IntegerAttr>())) && ((tblgen_num_shards.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.RetrieveTPUEmbeddingProximalAdagradParametersGradAccumDebug' op ""attribute 'num_shards' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_shard_id = odsAttrs.get("shard_id");
    if (!tblgen_shard_id)
      return emitError(loc, "'tf.RetrieveTPUEmbeddingProximalAdagradParametersGradAccumDebug' op ""requires attribute 'shard_id'");

    if (tblgen_shard_id && !(((tblgen_shard_id.isa<::mlir::IntegerAttr>())) && ((tblgen_shard_id.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.RetrieveTPUEmbeddingProximalAdagradParametersGradAccumDebug' op ""attribute 'shard_id' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_config = odsAttrs.get("config");
    if (tblgen_config && !((tblgen_config.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.RetrieveTPUEmbeddingProximalAdagradParametersGradAccumDebug' op ""attribute 'config' failed to satisfy constraint: string attribute");
  }
  return ::mlir::success();
}

void RetrieveTPUEmbeddingProximalAdagradParametersGradAccumDebugOp::getAsmResultNames(::mlir::OpAsmSetValueNameFn setNameFn) {
  auto resultGroup0 = getODSResults(0);
  if (!llvm::empty(resultGroup0))
    setNameFn(*resultGroup0.begin(), "parameters");
  auto resultGroup1 = getODSResults(1);
  if (!llvm::empty(resultGroup1))
    setNameFn(*resultGroup1.begin(), "accumulators");
  auto resultGroup2 = getODSResults(2);
  if (!llvm::empty(resultGroup2))
    setNameFn(*resultGroup2.begin(), "gradient_accumulators");
}

std::pair<unsigned, unsigned> RetrieveTPUEmbeddingProximalAdagradParametersGradAccumDebugOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range RetrieveTPUEmbeddingProximalAdagradParametersGradAccumDebugOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

std::pair<unsigned, unsigned> RetrieveTPUEmbeddingProximalAdagradParametersGradAccumDebugOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range RetrieveTPUEmbeddingProximalAdagradParametersGradAccumDebugOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value RetrieveTPUEmbeddingProximalAdagradParametersGradAccumDebugOp::parameters() {
  return *getODSResults(0).begin();
}

::mlir::Value RetrieveTPUEmbeddingProximalAdagradParametersGradAccumDebugOp::accumulators() {
  return *getODSResults(1).begin();
}

::mlir::Value RetrieveTPUEmbeddingProximalAdagradParametersGradAccumDebugOp::gradient_accumulators() {
  return *getODSResults(2).begin();
}

::mlir::IntegerAttr RetrieveTPUEmbeddingProximalAdagradParametersGradAccumDebugOp::table_idAttr() {
  return (*this)->getAttr(table_idAttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t RetrieveTPUEmbeddingProximalAdagradParametersGradAccumDebugOp::table_id() {
  auto attr = table_idAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), -1).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

::mlir::StringAttr RetrieveTPUEmbeddingProximalAdagradParametersGradAccumDebugOp::table_nameAttr() {
  return (*this)->getAttr(table_nameAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef RetrieveTPUEmbeddingProximalAdagradParametersGradAccumDebugOp::table_name() {
  auto attr = table_nameAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("").getValue();
  return attr.getValue();
}

::mlir::IntegerAttr RetrieveTPUEmbeddingProximalAdagradParametersGradAccumDebugOp::num_shardsAttr() {
  return (*this)->getAttr(num_shardsAttrName()).cast<::mlir::IntegerAttr>();
}

uint64_t RetrieveTPUEmbeddingProximalAdagradParametersGradAccumDebugOp::num_shards() {
  auto attr = num_shardsAttr();
  return attr.getValue().getZExtValue();
}

::mlir::IntegerAttr RetrieveTPUEmbeddingProximalAdagradParametersGradAccumDebugOp::shard_idAttr() {
  return (*this)->getAttr(shard_idAttrName()).cast<::mlir::IntegerAttr>();
}

uint64_t RetrieveTPUEmbeddingProximalAdagradParametersGradAccumDebugOp::shard_id() {
  auto attr = shard_idAttr();
  return attr.getValue().getZExtValue();
}

::mlir::StringAttr RetrieveTPUEmbeddingProximalAdagradParametersGradAccumDebugOp::configAttr() {
  return (*this)->getAttr(configAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef RetrieveTPUEmbeddingProximalAdagradParametersGradAccumDebugOp::config() {
  auto attr = configAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("").getValue();
  return attr.getValue();
}

void RetrieveTPUEmbeddingProximalAdagradParametersGradAccumDebugOp::table_idAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(table_idAttrName(), attr);
}

void RetrieveTPUEmbeddingProximalAdagradParametersGradAccumDebugOp::table_nameAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(table_nameAttrName(), attr);
}

void RetrieveTPUEmbeddingProximalAdagradParametersGradAccumDebugOp::num_shardsAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(num_shardsAttrName(), attr);
}

void RetrieveTPUEmbeddingProximalAdagradParametersGradAccumDebugOp::shard_idAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(shard_idAttrName(), attr);
}

void RetrieveTPUEmbeddingProximalAdagradParametersGradAccumDebugOp::configAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(configAttrName(), attr);
}

void RetrieveTPUEmbeddingProximalAdagradParametersGradAccumDebugOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type parameters, ::mlir::Type accumulators, ::mlir::Type gradient_accumulators, ::mlir::IntegerAttr table_id, ::mlir::StringAttr table_name, ::mlir::IntegerAttr num_shards, ::mlir::IntegerAttr shard_id, ::mlir::StringAttr config) {
  odsState.addAttribute(table_idAttrName(odsState.name), table_id);
  odsState.addAttribute(table_nameAttrName(odsState.name), table_name);
  odsState.addAttribute(num_shardsAttrName(odsState.name), num_shards);
  odsState.addAttribute(shard_idAttrName(odsState.name), shard_id);
  odsState.addAttribute(configAttrName(odsState.name), config);
  odsState.addTypes(parameters);
  odsState.addTypes(accumulators);
  odsState.addTypes(gradient_accumulators);
}

void RetrieveTPUEmbeddingProximalAdagradParametersGradAccumDebugOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::IntegerAttr table_id, ::mlir::StringAttr table_name, ::mlir::IntegerAttr num_shards, ::mlir::IntegerAttr shard_id, ::mlir::StringAttr config) {
  odsState.addAttribute(table_idAttrName(odsState.name), table_id);
  odsState.addAttribute(table_nameAttrName(odsState.name), table_name);
  odsState.addAttribute(num_shardsAttrName(odsState.name), num_shards);
  odsState.addAttribute(shard_idAttrName(odsState.name), shard_id);
  odsState.addAttribute(configAttrName(odsState.name), config);
  assert(resultTypes.size() == 3u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void RetrieveTPUEmbeddingProximalAdagradParametersGradAccumDebugOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type parameters, ::mlir::Type accumulators, ::mlir::Type gradient_accumulators, uint64_t table_id, ::llvm::StringRef table_name, uint64_t num_shards, uint64_t shard_id, ::llvm::StringRef config) {
  odsState.addAttribute(table_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), table_id));
  odsState.addAttribute(table_nameAttrName(odsState.name), odsBuilder.getStringAttr(table_name));
  odsState.addAttribute(num_shardsAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), num_shards));
  odsState.addAttribute(shard_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), shard_id));
  odsState.addAttribute(configAttrName(odsState.name), odsBuilder.getStringAttr(config));
  odsState.addTypes(parameters);
  odsState.addTypes(accumulators);
  odsState.addTypes(gradient_accumulators);
}

void RetrieveTPUEmbeddingProximalAdagradParametersGradAccumDebugOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, uint64_t table_id, ::llvm::StringRef table_name, uint64_t num_shards, uint64_t shard_id, ::llvm::StringRef config) {
  odsState.addAttribute(table_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), table_id));
  odsState.addAttribute(table_nameAttrName(odsState.name), odsBuilder.getStringAttr(table_name));
  odsState.addAttribute(num_shardsAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), num_shards));
  odsState.addAttribute(shard_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), shard_id));
  odsState.addAttribute(configAttrName(odsState.name), odsBuilder.getStringAttr(config));
  assert(resultTypes.size() == 3u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void RetrieveTPUEmbeddingProximalAdagradParametersGradAccumDebugOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 0u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 3u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult RetrieveTPUEmbeddingProximalAdagradParametersGradAccumDebugOp::verify() {
  {
    auto tblgen_table_id = (*this)->getAttr(table_idAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_table_id, "table_id")))
      return ::mlir::failure();
  }
  {
    auto tblgen_table_name = (*this)->getAttr(table_nameAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_table_name, "table_name")))
      return ::mlir::failure();
  }
  {
    auto tblgen_num_shards = (*this)->getAttr(num_shardsAttrName());
    if (!tblgen_num_shards)
      return emitOpError("requires attribute 'num_shards'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_num_shards, "num_shards")))
      return ::mlir::failure();
  }
  {
    auto tblgen_shard_id = (*this)->getAttr(shard_idAttrName());
    if (!tblgen_shard_id)
      return emitOpError("requires attribute 'shard_id'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_shard_id, "shard_id")))
      return ::mlir::failure();
  }
  {
    auto tblgen_config = (*this)->getAttr(configAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_config, "config")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSResults(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSResults(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void RetrieveTPUEmbeddingProximalAdagradParametersGradAccumDebugOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  effects.emplace_back(::mlir::MemoryEffects::Write::get(), ::mlir::TF::ResourceEffects::MustExecute::get());
  effects.emplace_back(::mlir::MemoryEffects::Read::get(), ::mlir::TF::ResourceEffects::TPUEmbedding::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::RetrieveTPUEmbeddingProximalAdagradParametersGradAccumDebugOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::RetrieveTPUEmbeddingProximalAdagradParametersOp definitions
//===----------------------------------------------------------------------===//

RetrieveTPUEmbeddingProximalAdagradParametersOpAdaptor::RetrieveTPUEmbeddingProximalAdagradParametersOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

RetrieveTPUEmbeddingProximalAdagradParametersOpAdaptor::RetrieveTPUEmbeddingProximalAdagradParametersOpAdaptor(RetrieveTPUEmbeddingProximalAdagradParametersOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange RetrieveTPUEmbeddingProximalAdagradParametersOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> RetrieveTPUEmbeddingProximalAdagradParametersOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange RetrieveTPUEmbeddingProximalAdagradParametersOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::DictionaryAttr RetrieveTPUEmbeddingProximalAdagradParametersOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::IntegerAttr RetrieveTPUEmbeddingProximalAdagradParametersOpAdaptor::table_id() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("table_id").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), -1);
  return attr;
}

::mlir::StringAttr RetrieveTPUEmbeddingProximalAdagradParametersOpAdaptor::table_name() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("table_name").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("");
  return attr;
}

::mlir::IntegerAttr RetrieveTPUEmbeddingProximalAdagradParametersOpAdaptor::num_shards() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("num_shards").cast<::mlir::IntegerAttr>();
  return attr;
}

::mlir::IntegerAttr RetrieveTPUEmbeddingProximalAdagradParametersOpAdaptor::shard_id() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("shard_id").cast<::mlir::IntegerAttr>();
  return attr;
}

::mlir::StringAttr RetrieveTPUEmbeddingProximalAdagradParametersOpAdaptor::config() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("config").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("");
  return attr;
}

::mlir::LogicalResult RetrieveTPUEmbeddingProximalAdagradParametersOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_table_id = odsAttrs.get("table_id");
    if (tblgen_table_id && !(((tblgen_table_id.isa<::mlir::IntegerAttr>())) && ((tblgen_table_id.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.RetrieveTPUEmbeddingProximalAdagradParameters' op ""attribute 'table_id' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_table_name = odsAttrs.get("table_name");
    if (tblgen_table_name && !((tblgen_table_name.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.RetrieveTPUEmbeddingProximalAdagradParameters' op ""attribute 'table_name' failed to satisfy constraint: string attribute");
  }
  {
    auto tblgen_num_shards = odsAttrs.get("num_shards");
    if (!tblgen_num_shards)
      return emitError(loc, "'tf.RetrieveTPUEmbeddingProximalAdagradParameters' op ""requires attribute 'num_shards'");

    if (tblgen_num_shards && !(((tblgen_num_shards.isa<::mlir::IntegerAttr>())) && ((tblgen_num_shards.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.RetrieveTPUEmbeddingProximalAdagradParameters' op ""attribute 'num_shards' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_shard_id = odsAttrs.get("shard_id");
    if (!tblgen_shard_id)
      return emitError(loc, "'tf.RetrieveTPUEmbeddingProximalAdagradParameters' op ""requires attribute 'shard_id'");

    if (tblgen_shard_id && !(((tblgen_shard_id.isa<::mlir::IntegerAttr>())) && ((tblgen_shard_id.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.RetrieveTPUEmbeddingProximalAdagradParameters' op ""attribute 'shard_id' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_config = odsAttrs.get("config");
    if (tblgen_config && !((tblgen_config.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.RetrieveTPUEmbeddingProximalAdagradParameters' op ""attribute 'config' failed to satisfy constraint: string attribute");
  }
  return ::mlir::success();
}

void RetrieveTPUEmbeddingProximalAdagradParametersOp::getAsmResultNames(::mlir::OpAsmSetValueNameFn setNameFn) {
  auto resultGroup0 = getODSResults(0);
  if (!llvm::empty(resultGroup0))
    setNameFn(*resultGroup0.begin(), "parameters");
  auto resultGroup1 = getODSResults(1);
  if (!llvm::empty(resultGroup1))
    setNameFn(*resultGroup1.begin(), "accumulators");
}

std::pair<unsigned, unsigned> RetrieveTPUEmbeddingProximalAdagradParametersOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range RetrieveTPUEmbeddingProximalAdagradParametersOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

std::pair<unsigned, unsigned> RetrieveTPUEmbeddingProximalAdagradParametersOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range RetrieveTPUEmbeddingProximalAdagradParametersOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value RetrieveTPUEmbeddingProximalAdagradParametersOp::parameters() {
  return *getODSResults(0).begin();
}

::mlir::Value RetrieveTPUEmbeddingProximalAdagradParametersOp::accumulators() {
  return *getODSResults(1).begin();
}

::mlir::IntegerAttr RetrieveTPUEmbeddingProximalAdagradParametersOp::table_idAttr() {
  return (*this)->getAttr(table_idAttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t RetrieveTPUEmbeddingProximalAdagradParametersOp::table_id() {
  auto attr = table_idAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), -1).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

::mlir::StringAttr RetrieveTPUEmbeddingProximalAdagradParametersOp::table_nameAttr() {
  return (*this)->getAttr(table_nameAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef RetrieveTPUEmbeddingProximalAdagradParametersOp::table_name() {
  auto attr = table_nameAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("").getValue();
  return attr.getValue();
}

::mlir::IntegerAttr RetrieveTPUEmbeddingProximalAdagradParametersOp::num_shardsAttr() {
  return (*this)->getAttr(num_shardsAttrName()).cast<::mlir::IntegerAttr>();
}

uint64_t RetrieveTPUEmbeddingProximalAdagradParametersOp::num_shards() {
  auto attr = num_shardsAttr();
  return attr.getValue().getZExtValue();
}

::mlir::IntegerAttr RetrieveTPUEmbeddingProximalAdagradParametersOp::shard_idAttr() {
  return (*this)->getAttr(shard_idAttrName()).cast<::mlir::IntegerAttr>();
}

uint64_t RetrieveTPUEmbeddingProximalAdagradParametersOp::shard_id() {
  auto attr = shard_idAttr();
  return attr.getValue().getZExtValue();
}

::mlir::StringAttr RetrieveTPUEmbeddingProximalAdagradParametersOp::configAttr() {
  return (*this)->getAttr(configAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef RetrieveTPUEmbeddingProximalAdagradParametersOp::config() {
  auto attr = configAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("").getValue();
  return attr.getValue();
}

void RetrieveTPUEmbeddingProximalAdagradParametersOp::table_idAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(table_idAttrName(), attr);
}

void RetrieveTPUEmbeddingProximalAdagradParametersOp::table_nameAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(table_nameAttrName(), attr);
}

void RetrieveTPUEmbeddingProximalAdagradParametersOp::num_shardsAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(num_shardsAttrName(), attr);
}

void RetrieveTPUEmbeddingProximalAdagradParametersOp::shard_idAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(shard_idAttrName(), attr);
}

void RetrieveTPUEmbeddingProximalAdagradParametersOp::configAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(configAttrName(), attr);
}

void RetrieveTPUEmbeddingProximalAdagradParametersOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type parameters, ::mlir::Type accumulators, ::mlir::IntegerAttr table_id, ::mlir::StringAttr table_name, ::mlir::IntegerAttr num_shards, ::mlir::IntegerAttr shard_id, ::mlir::StringAttr config) {
  odsState.addAttribute(table_idAttrName(odsState.name), table_id);
  odsState.addAttribute(table_nameAttrName(odsState.name), table_name);
  odsState.addAttribute(num_shardsAttrName(odsState.name), num_shards);
  odsState.addAttribute(shard_idAttrName(odsState.name), shard_id);
  odsState.addAttribute(configAttrName(odsState.name), config);
  odsState.addTypes(parameters);
  odsState.addTypes(accumulators);
}

void RetrieveTPUEmbeddingProximalAdagradParametersOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::IntegerAttr table_id, ::mlir::StringAttr table_name, ::mlir::IntegerAttr num_shards, ::mlir::IntegerAttr shard_id, ::mlir::StringAttr config) {
  odsState.addAttribute(table_idAttrName(odsState.name), table_id);
  odsState.addAttribute(table_nameAttrName(odsState.name), table_name);
  odsState.addAttribute(num_shardsAttrName(odsState.name), num_shards);
  odsState.addAttribute(shard_idAttrName(odsState.name), shard_id);
  odsState.addAttribute(configAttrName(odsState.name), config);
  assert(resultTypes.size() == 2u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void RetrieveTPUEmbeddingProximalAdagradParametersOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type parameters, ::mlir::Type accumulators, uint64_t table_id, ::llvm::StringRef table_name, uint64_t num_shards, uint64_t shard_id, ::llvm::StringRef config) {
  odsState.addAttribute(table_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), table_id));
  odsState.addAttribute(table_nameAttrName(odsState.name), odsBuilder.getStringAttr(table_name));
  odsState.addAttribute(num_shardsAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), num_shards));
  odsState.addAttribute(shard_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), shard_id));
  odsState.addAttribute(configAttrName(odsState.name), odsBuilder.getStringAttr(config));
  odsState.addTypes(parameters);
  odsState.addTypes(accumulators);
}

void RetrieveTPUEmbeddingProximalAdagradParametersOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, uint64_t table_id, ::llvm::StringRef table_name, uint64_t num_shards, uint64_t shard_id, ::llvm::StringRef config) {
  odsState.addAttribute(table_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), table_id));
  odsState.addAttribute(table_nameAttrName(odsState.name), odsBuilder.getStringAttr(table_name));
  odsState.addAttribute(num_shardsAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), num_shards));
  odsState.addAttribute(shard_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), shard_id));
  odsState.addAttribute(configAttrName(odsState.name), odsBuilder.getStringAttr(config));
  assert(resultTypes.size() == 2u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void RetrieveTPUEmbeddingProximalAdagradParametersOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 0u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 2u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult RetrieveTPUEmbeddingProximalAdagradParametersOp::verify() {
  {
    auto tblgen_table_id = (*this)->getAttr(table_idAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_table_id, "table_id")))
      return ::mlir::failure();
  }
  {
    auto tblgen_table_name = (*this)->getAttr(table_nameAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_table_name, "table_name")))
      return ::mlir::failure();
  }
  {
    auto tblgen_num_shards = (*this)->getAttr(num_shardsAttrName());
    if (!tblgen_num_shards)
      return emitOpError("requires attribute 'num_shards'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_num_shards, "num_shards")))
      return ::mlir::failure();
  }
  {
    auto tblgen_shard_id = (*this)->getAttr(shard_idAttrName());
    if (!tblgen_shard_id)
      return emitOpError("requires attribute 'shard_id'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_shard_id, "shard_id")))
      return ::mlir::failure();
  }
  {
    auto tblgen_config = (*this)->getAttr(configAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_config, "config")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSResults(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void RetrieveTPUEmbeddingProximalAdagradParametersOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  effects.emplace_back(::mlir::MemoryEffects::Write::get(), ::mlir::TF::ResourceEffects::MustExecute::get());
  effects.emplace_back(::mlir::MemoryEffects::Read::get(), ::mlir::TF::ResourceEffects::TPUEmbedding::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::RetrieveTPUEmbeddingProximalAdagradParametersOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::RetrieveTPUEmbeddingProximalYogiParametersGradAccumDebugOp definitions
//===----------------------------------------------------------------------===//

RetrieveTPUEmbeddingProximalYogiParametersGradAccumDebugOpAdaptor::RetrieveTPUEmbeddingProximalYogiParametersGradAccumDebugOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

RetrieveTPUEmbeddingProximalYogiParametersGradAccumDebugOpAdaptor::RetrieveTPUEmbeddingProximalYogiParametersGradAccumDebugOpAdaptor(RetrieveTPUEmbeddingProximalYogiParametersGradAccumDebugOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange RetrieveTPUEmbeddingProximalYogiParametersGradAccumDebugOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> RetrieveTPUEmbeddingProximalYogiParametersGradAccumDebugOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange RetrieveTPUEmbeddingProximalYogiParametersGradAccumDebugOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::DictionaryAttr RetrieveTPUEmbeddingProximalYogiParametersGradAccumDebugOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::IntegerAttr RetrieveTPUEmbeddingProximalYogiParametersGradAccumDebugOpAdaptor::table_id() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("table_id").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), -1);
  return attr;
}

::mlir::StringAttr RetrieveTPUEmbeddingProximalYogiParametersGradAccumDebugOpAdaptor::table_name() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("table_name").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("");
  return attr;
}

::mlir::IntegerAttr RetrieveTPUEmbeddingProximalYogiParametersGradAccumDebugOpAdaptor::num_shards() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("num_shards").cast<::mlir::IntegerAttr>();
  return attr;
}

::mlir::IntegerAttr RetrieveTPUEmbeddingProximalYogiParametersGradAccumDebugOpAdaptor::shard_id() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("shard_id").cast<::mlir::IntegerAttr>();
  return attr;
}

::mlir::StringAttr RetrieveTPUEmbeddingProximalYogiParametersGradAccumDebugOpAdaptor::config() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("config").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("");
  return attr;
}

::mlir::LogicalResult RetrieveTPUEmbeddingProximalYogiParametersGradAccumDebugOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_table_id = odsAttrs.get("table_id");
    if (tblgen_table_id && !(((tblgen_table_id.isa<::mlir::IntegerAttr>())) && ((tblgen_table_id.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.RetrieveTPUEmbeddingProximalYogiParametersGradAccumDebug' op ""attribute 'table_id' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_table_name = odsAttrs.get("table_name");
    if (tblgen_table_name && !((tblgen_table_name.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.RetrieveTPUEmbeddingProximalYogiParametersGradAccumDebug' op ""attribute 'table_name' failed to satisfy constraint: string attribute");
  }
  {
    auto tblgen_num_shards = odsAttrs.get("num_shards");
    if (!tblgen_num_shards)
      return emitError(loc, "'tf.RetrieveTPUEmbeddingProximalYogiParametersGradAccumDebug' op ""requires attribute 'num_shards'");

    if (tblgen_num_shards && !(((tblgen_num_shards.isa<::mlir::IntegerAttr>())) && ((tblgen_num_shards.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.RetrieveTPUEmbeddingProximalYogiParametersGradAccumDebug' op ""attribute 'num_shards' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_shard_id = odsAttrs.get("shard_id");
    if (!tblgen_shard_id)
      return emitError(loc, "'tf.RetrieveTPUEmbeddingProximalYogiParametersGradAccumDebug' op ""requires attribute 'shard_id'");

    if (tblgen_shard_id && !(((tblgen_shard_id.isa<::mlir::IntegerAttr>())) && ((tblgen_shard_id.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.RetrieveTPUEmbeddingProximalYogiParametersGradAccumDebug' op ""attribute 'shard_id' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_config = odsAttrs.get("config");
    if (tblgen_config && !((tblgen_config.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.RetrieveTPUEmbeddingProximalYogiParametersGradAccumDebug' op ""attribute 'config' failed to satisfy constraint: string attribute");
  }
  return ::mlir::success();
}

void RetrieveTPUEmbeddingProximalYogiParametersGradAccumDebugOp::getAsmResultNames(::mlir::OpAsmSetValueNameFn setNameFn) {
  auto resultGroup0 = getODSResults(0);
  if (!llvm::empty(resultGroup0))
    setNameFn(*resultGroup0.begin(), "parameters");
  auto resultGroup1 = getODSResults(1);
  if (!llvm::empty(resultGroup1))
    setNameFn(*resultGroup1.begin(), "v");
  auto resultGroup2 = getODSResults(2);
  if (!llvm::empty(resultGroup2))
    setNameFn(*resultGroup2.begin(), "m");
  auto resultGroup3 = getODSResults(3);
  if (!llvm::empty(resultGroup3))
    setNameFn(*resultGroup3.begin(), "gradient_accumulators");
}

std::pair<unsigned, unsigned> RetrieveTPUEmbeddingProximalYogiParametersGradAccumDebugOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range RetrieveTPUEmbeddingProximalYogiParametersGradAccumDebugOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

std::pair<unsigned, unsigned> RetrieveTPUEmbeddingProximalYogiParametersGradAccumDebugOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range RetrieveTPUEmbeddingProximalYogiParametersGradAccumDebugOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value RetrieveTPUEmbeddingProximalYogiParametersGradAccumDebugOp::parameters() {
  return *getODSResults(0).begin();
}

::mlir::Value RetrieveTPUEmbeddingProximalYogiParametersGradAccumDebugOp::v() {
  return *getODSResults(1).begin();
}

::mlir::Value RetrieveTPUEmbeddingProximalYogiParametersGradAccumDebugOp::m() {
  return *getODSResults(2).begin();
}

::mlir::Value RetrieveTPUEmbeddingProximalYogiParametersGradAccumDebugOp::gradient_accumulators() {
  return *getODSResults(3).begin();
}

::mlir::IntegerAttr RetrieveTPUEmbeddingProximalYogiParametersGradAccumDebugOp::table_idAttr() {
  return (*this)->getAttr(table_idAttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t RetrieveTPUEmbeddingProximalYogiParametersGradAccumDebugOp::table_id() {
  auto attr = table_idAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), -1).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

::mlir::StringAttr RetrieveTPUEmbeddingProximalYogiParametersGradAccumDebugOp::table_nameAttr() {
  return (*this)->getAttr(table_nameAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef RetrieveTPUEmbeddingProximalYogiParametersGradAccumDebugOp::table_name() {
  auto attr = table_nameAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("").getValue();
  return attr.getValue();
}

::mlir::IntegerAttr RetrieveTPUEmbeddingProximalYogiParametersGradAccumDebugOp::num_shardsAttr() {
  return (*this)->getAttr(num_shardsAttrName()).cast<::mlir::IntegerAttr>();
}

uint64_t RetrieveTPUEmbeddingProximalYogiParametersGradAccumDebugOp::num_shards() {
  auto attr = num_shardsAttr();
  return attr.getValue().getZExtValue();
}

::mlir::IntegerAttr RetrieveTPUEmbeddingProximalYogiParametersGradAccumDebugOp::shard_idAttr() {
  return (*this)->getAttr(shard_idAttrName()).cast<::mlir::IntegerAttr>();
}

uint64_t RetrieveTPUEmbeddingProximalYogiParametersGradAccumDebugOp::shard_id() {
  auto attr = shard_idAttr();
  return attr.getValue().getZExtValue();
}

::mlir::StringAttr RetrieveTPUEmbeddingProximalYogiParametersGradAccumDebugOp::configAttr() {
  return (*this)->getAttr(configAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef RetrieveTPUEmbeddingProximalYogiParametersGradAccumDebugOp::config() {
  auto attr = configAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("").getValue();
  return attr.getValue();
}

void RetrieveTPUEmbeddingProximalYogiParametersGradAccumDebugOp::table_idAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(table_idAttrName(), attr);
}

void RetrieveTPUEmbeddingProximalYogiParametersGradAccumDebugOp::table_nameAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(table_nameAttrName(), attr);
}

void RetrieveTPUEmbeddingProximalYogiParametersGradAccumDebugOp::num_shardsAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(num_shardsAttrName(), attr);
}

void RetrieveTPUEmbeddingProximalYogiParametersGradAccumDebugOp::shard_idAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(shard_idAttrName(), attr);
}

void RetrieveTPUEmbeddingProximalYogiParametersGradAccumDebugOp::configAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(configAttrName(), attr);
}

void RetrieveTPUEmbeddingProximalYogiParametersGradAccumDebugOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type parameters, ::mlir::Type v, ::mlir::Type m, ::mlir::Type gradient_accumulators, ::mlir::IntegerAttr table_id, ::mlir::StringAttr table_name, ::mlir::IntegerAttr num_shards, ::mlir::IntegerAttr shard_id, ::mlir::StringAttr config) {
  odsState.addAttribute(table_idAttrName(odsState.name), table_id);
  odsState.addAttribute(table_nameAttrName(odsState.name), table_name);
  odsState.addAttribute(num_shardsAttrName(odsState.name), num_shards);
  odsState.addAttribute(shard_idAttrName(odsState.name), shard_id);
  odsState.addAttribute(configAttrName(odsState.name), config);
  odsState.addTypes(parameters);
  odsState.addTypes(v);
  odsState.addTypes(m);
  odsState.addTypes(gradient_accumulators);
}

void RetrieveTPUEmbeddingProximalYogiParametersGradAccumDebugOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::IntegerAttr table_id, ::mlir::StringAttr table_name, ::mlir::IntegerAttr num_shards, ::mlir::IntegerAttr shard_id, ::mlir::StringAttr config) {
  odsState.addAttribute(table_idAttrName(odsState.name), table_id);
  odsState.addAttribute(table_nameAttrName(odsState.name), table_name);
  odsState.addAttribute(num_shardsAttrName(odsState.name), num_shards);
  odsState.addAttribute(shard_idAttrName(odsState.name), shard_id);
  odsState.addAttribute(configAttrName(odsState.name), config);
  assert(resultTypes.size() == 4u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void RetrieveTPUEmbeddingProximalYogiParametersGradAccumDebugOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type parameters, ::mlir::Type v, ::mlir::Type m, ::mlir::Type gradient_accumulators, uint64_t table_id, ::llvm::StringRef table_name, uint64_t num_shards, uint64_t shard_id, ::llvm::StringRef config) {
  odsState.addAttribute(table_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), table_id));
  odsState.addAttribute(table_nameAttrName(odsState.name), odsBuilder.getStringAttr(table_name));
  odsState.addAttribute(num_shardsAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), num_shards));
  odsState.addAttribute(shard_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), shard_id));
  odsState.addAttribute(configAttrName(odsState.name), odsBuilder.getStringAttr(config));
  odsState.addTypes(parameters);
  odsState.addTypes(v);
  odsState.addTypes(m);
  odsState.addTypes(gradient_accumulators);
}

void RetrieveTPUEmbeddingProximalYogiParametersGradAccumDebugOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, uint64_t table_id, ::llvm::StringRef table_name, uint64_t num_shards, uint64_t shard_id, ::llvm::StringRef config) {
  odsState.addAttribute(table_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), table_id));
  odsState.addAttribute(table_nameAttrName(odsState.name), odsBuilder.getStringAttr(table_name));
  odsState.addAttribute(num_shardsAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), num_shards));
  odsState.addAttribute(shard_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), shard_id));
  odsState.addAttribute(configAttrName(odsState.name), odsBuilder.getStringAttr(config));
  assert(resultTypes.size() == 4u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void RetrieveTPUEmbeddingProximalYogiParametersGradAccumDebugOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 0u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 4u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult RetrieveTPUEmbeddingProximalYogiParametersGradAccumDebugOp::verify() {
  {
    auto tblgen_table_id = (*this)->getAttr(table_idAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_table_id, "table_id")))
      return ::mlir::failure();
  }
  {
    auto tblgen_table_name = (*this)->getAttr(table_nameAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_table_name, "table_name")))
      return ::mlir::failure();
  }
  {
    auto tblgen_num_shards = (*this)->getAttr(num_shardsAttrName());
    if (!tblgen_num_shards)
      return emitOpError("requires attribute 'num_shards'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_num_shards, "num_shards")))
      return ::mlir::failure();
  }
  {
    auto tblgen_shard_id = (*this)->getAttr(shard_idAttrName());
    if (!tblgen_shard_id)
      return emitOpError("requires attribute 'shard_id'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_shard_id, "shard_id")))
      return ::mlir::failure();
  }
  {
    auto tblgen_config = (*this)->getAttr(configAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_config, "config")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSResults(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSResults(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
    auto valueGroup3 = getODSResults(3);

    for (auto v : valueGroup3) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void RetrieveTPUEmbeddingProximalYogiParametersGradAccumDebugOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  effects.emplace_back(::mlir::MemoryEffects::Write::get(), ::mlir::TF::ResourceEffects::MustExecute::get());
  effects.emplace_back(::mlir::MemoryEffects::Read::get(), ::mlir::TF::ResourceEffects::TPUEmbedding::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::RetrieveTPUEmbeddingProximalYogiParametersGradAccumDebugOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::RetrieveTPUEmbeddingProximalYogiParametersOp definitions
//===----------------------------------------------------------------------===//

RetrieveTPUEmbeddingProximalYogiParametersOpAdaptor::RetrieveTPUEmbeddingProximalYogiParametersOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

RetrieveTPUEmbeddingProximalYogiParametersOpAdaptor::RetrieveTPUEmbeddingProximalYogiParametersOpAdaptor(RetrieveTPUEmbeddingProximalYogiParametersOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange RetrieveTPUEmbeddingProximalYogiParametersOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> RetrieveTPUEmbeddingProximalYogiParametersOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange RetrieveTPUEmbeddingProximalYogiParametersOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::DictionaryAttr RetrieveTPUEmbeddingProximalYogiParametersOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::IntegerAttr RetrieveTPUEmbeddingProximalYogiParametersOpAdaptor::table_id() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("table_id").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), -1);
  return attr;
}

::mlir::StringAttr RetrieveTPUEmbeddingProximalYogiParametersOpAdaptor::table_name() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("table_name").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("");
  return attr;
}

::mlir::IntegerAttr RetrieveTPUEmbeddingProximalYogiParametersOpAdaptor::num_shards() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("num_shards").cast<::mlir::IntegerAttr>();
  return attr;
}

::mlir::IntegerAttr RetrieveTPUEmbeddingProximalYogiParametersOpAdaptor::shard_id() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("shard_id").cast<::mlir::IntegerAttr>();
  return attr;
}

::mlir::StringAttr RetrieveTPUEmbeddingProximalYogiParametersOpAdaptor::config() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("config").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("");
  return attr;
}

::mlir::LogicalResult RetrieveTPUEmbeddingProximalYogiParametersOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_table_id = odsAttrs.get("table_id");
    if (tblgen_table_id && !(((tblgen_table_id.isa<::mlir::IntegerAttr>())) && ((tblgen_table_id.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.RetrieveTPUEmbeddingProximalYogiParameters' op ""attribute 'table_id' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_table_name = odsAttrs.get("table_name");
    if (tblgen_table_name && !((tblgen_table_name.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.RetrieveTPUEmbeddingProximalYogiParameters' op ""attribute 'table_name' failed to satisfy constraint: string attribute");
  }
  {
    auto tblgen_num_shards = odsAttrs.get("num_shards");
    if (!tblgen_num_shards)
      return emitError(loc, "'tf.RetrieveTPUEmbeddingProximalYogiParameters' op ""requires attribute 'num_shards'");

    if (tblgen_num_shards && !(((tblgen_num_shards.isa<::mlir::IntegerAttr>())) && ((tblgen_num_shards.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.RetrieveTPUEmbeddingProximalYogiParameters' op ""attribute 'num_shards' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_shard_id = odsAttrs.get("shard_id");
    if (!tblgen_shard_id)
      return emitError(loc, "'tf.RetrieveTPUEmbeddingProximalYogiParameters' op ""requires attribute 'shard_id'");

    if (tblgen_shard_id && !(((tblgen_shard_id.isa<::mlir::IntegerAttr>())) && ((tblgen_shard_id.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.RetrieveTPUEmbeddingProximalYogiParameters' op ""attribute 'shard_id' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_config = odsAttrs.get("config");
    if (tblgen_config && !((tblgen_config.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.RetrieveTPUEmbeddingProximalYogiParameters' op ""attribute 'config' failed to satisfy constraint: string attribute");
  }
  return ::mlir::success();
}

void RetrieveTPUEmbeddingProximalYogiParametersOp::getAsmResultNames(::mlir::OpAsmSetValueNameFn setNameFn) {
  auto resultGroup0 = getODSResults(0);
  if (!llvm::empty(resultGroup0))
    setNameFn(*resultGroup0.begin(), "parameters");
  auto resultGroup1 = getODSResults(1);
  if (!llvm::empty(resultGroup1))
    setNameFn(*resultGroup1.begin(), "v");
  auto resultGroup2 = getODSResults(2);
  if (!llvm::empty(resultGroup2))
    setNameFn(*resultGroup2.begin(), "m");
}

std::pair<unsigned, unsigned> RetrieveTPUEmbeddingProximalYogiParametersOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range RetrieveTPUEmbeddingProximalYogiParametersOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

std::pair<unsigned, unsigned> RetrieveTPUEmbeddingProximalYogiParametersOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range RetrieveTPUEmbeddingProximalYogiParametersOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value RetrieveTPUEmbeddingProximalYogiParametersOp::parameters() {
  return *getODSResults(0).begin();
}

::mlir::Value RetrieveTPUEmbeddingProximalYogiParametersOp::v() {
  return *getODSResults(1).begin();
}

::mlir::Value RetrieveTPUEmbeddingProximalYogiParametersOp::m() {
  return *getODSResults(2).begin();
}

::mlir::IntegerAttr RetrieveTPUEmbeddingProximalYogiParametersOp::table_idAttr() {
  return (*this)->getAttr(table_idAttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t RetrieveTPUEmbeddingProximalYogiParametersOp::table_id() {
  auto attr = table_idAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), -1).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

::mlir::StringAttr RetrieveTPUEmbeddingProximalYogiParametersOp::table_nameAttr() {
  return (*this)->getAttr(table_nameAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef RetrieveTPUEmbeddingProximalYogiParametersOp::table_name() {
  auto attr = table_nameAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("").getValue();
  return attr.getValue();
}

::mlir::IntegerAttr RetrieveTPUEmbeddingProximalYogiParametersOp::num_shardsAttr() {
  return (*this)->getAttr(num_shardsAttrName()).cast<::mlir::IntegerAttr>();
}

uint64_t RetrieveTPUEmbeddingProximalYogiParametersOp::num_shards() {
  auto attr = num_shardsAttr();
  return attr.getValue().getZExtValue();
}

::mlir::IntegerAttr RetrieveTPUEmbeddingProximalYogiParametersOp::shard_idAttr() {
  return (*this)->getAttr(shard_idAttrName()).cast<::mlir::IntegerAttr>();
}

uint64_t RetrieveTPUEmbeddingProximalYogiParametersOp::shard_id() {
  auto attr = shard_idAttr();
  return attr.getValue().getZExtValue();
}

::mlir::StringAttr RetrieveTPUEmbeddingProximalYogiParametersOp::configAttr() {
  return (*this)->getAttr(configAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef RetrieveTPUEmbeddingProximalYogiParametersOp::config() {
  auto attr = configAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("").getValue();
  return attr.getValue();
}

void RetrieveTPUEmbeddingProximalYogiParametersOp::table_idAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(table_idAttrName(), attr);
}

void RetrieveTPUEmbeddingProximalYogiParametersOp::table_nameAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(table_nameAttrName(), attr);
}

void RetrieveTPUEmbeddingProximalYogiParametersOp::num_shardsAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(num_shardsAttrName(), attr);
}

void RetrieveTPUEmbeddingProximalYogiParametersOp::shard_idAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(shard_idAttrName(), attr);
}

void RetrieveTPUEmbeddingProximalYogiParametersOp::configAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(configAttrName(), attr);
}

void RetrieveTPUEmbeddingProximalYogiParametersOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type parameters, ::mlir::Type v, ::mlir::Type m, ::mlir::IntegerAttr table_id, ::mlir::StringAttr table_name, ::mlir::IntegerAttr num_shards, ::mlir::IntegerAttr shard_id, ::mlir::StringAttr config) {
  odsState.addAttribute(table_idAttrName(odsState.name), table_id);
  odsState.addAttribute(table_nameAttrName(odsState.name), table_name);
  odsState.addAttribute(num_shardsAttrName(odsState.name), num_shards);
  odsState.addAttribute(shard_idAttrName(odsState.name), shard_id);
  odsState.addAttribute(configAttrName(odsState.name), config);
  odsState.addTypes(parameters);
  odsState.addTypes(v);
  odsState.addTypes(m);
}

void RetrieveTPUEmbeddingProximalYogiParametersOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::IntegerAttr table_id, ::mlir::StringAttr table_name, ::mlir::IntegerAttr num_shards, ::mlir::IntegerAttr shard_id, ::mlir::StringAttr config) {
  odsState.addAttribute(table_idAttrName(odsState.name), table_id);
  odsState.addAttribute(table_nameAttrName(odsState.name), table_name);
  odsState.addAttribute(num_shardsAttrName(odsState.name), num_shards);
  odsState.addAttribute(shard_idAttrName(odsState.name), shard_id);
  odsState.addAttribute(configAttrName(odsState.name), config);
  assert(resultTypes.size() == 3u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void RetrieveTPUEmbeddingProximalYogiParametersOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type parameters, ::mlir::Type v, ::mlir::Type m, uint64_t table_id, ::llvm::StringRef table_name, uint64_t num_shards, uint64_t shard_id, ::llvm::StringRef config) {
  odsState.addAttribute(table_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), table_id));
  odsState.addAttribute(table_nameAttrName(odsState.name), odsBuilder.getStringAttr(table_name));
  odsState.addAttribute(num_shardsAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), num_shards));
  odsState.addAttribute(shard_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), shard_id));
  odsState.addAttribute(configAttrName(odsState.name), odsBuilder.getStringAttr(config));
  odsState.addTypes(parameters);
  odsState.addTypes(v);
  odsState.addTypes(m);
}

void RetrieveTPUEmbeddingProximalYogiParametersOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, uint64_t table_id, ::llvm::StringRef table_name, uint64_t num_shards, uint64_t shard_id, ::llvm::StringRef config) {
  odsState.addAttribute(table_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), table_id));
  odsState.addAttribute(table_nameAttrName(odsState.name), odsBuilder.getStringAttr(table_name));
  odsState.addAttribute(num_shardsAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), num_shards));
  odsState.addAttribute(shard_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), shard_id));
  odsState.addAttribute(configAttrName(odsState.name), odsBuilder.getStringAttr(config));
  assert(resultTypes.size() == 3u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void RetrieveTPUEmbeddingProximalYogiParametersOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 0u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 3u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult RetrieveTPUEmbeddingProximalYogiParametersOp::verify() {
  {
    auto tblgen_table_id = (*this)->getAttr(table_idAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_table_id, "table_id")))
      return ::mlir::failure();
  }
  {
    auto tblgen_table_name = (*this)->getAttr(table_nameAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_table_name, "table_name")))
      return ::mlir::failure();
  }
  {
    auto tblgen_num_shards = (*this)->getAttr(num_shardsAttrName());
    if (!tblgen_num_shards)
      return emitOpError("requires attribute 'num_shards'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_num_shards, "num_shards")))
      return ::mlir::failure();
  }
  {
    auto tblgen_shard_id = (*this)->getAttr(shard_idAttrName());
    if (!tblgen_shard_id)
      return emitOpError("requires attribute 'shard_id'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_shard_id, "shard_id")))
      return ::mlir::failure();
  }
  {
    auto tblgen_config = (*this)->getAttr(configAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_config, "config")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSResults(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSResults(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void RetrieveTPUEmbeddingProximalYogiParametersOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  effects.emplace_back(::mlir::MemoryEffects::Write::get(), ::mlir::TF::ResourceEffects::MustExecute::get());
  effects.emplace_back(::mlir::MemoryEffects::Read::get(), ::mlir::TF::ResourceEffects::TPUEmbedding::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::RetrieveTPUEmbeddingProximalYogiParametersOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::RetrieveTPUEmbeddingRMSPropParametersGradAccumDebugOp definitions
//===----------------------------------------------------------------------===//

RetrieveTPUEmbeddingRMSPropParametersGradAccumDebugOpAdaptor::RetrieveTPUEmbeddingRMSPropParametersGradAccumDebugOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

RetrieveTPUEmbeddingRMSPropParametersGradAccumDebugOpAdaptor::RetrieveTPUEmbeddingRMSPropParametersGradAccumDebugOpAdaptor(RetrieveTPUEmbeddingRMSPropParametersGradAccumDebugOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange RetrieveTPUEmbeddingRMSPropParametersGradAccumDebugOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> RetrieveTPUEmbeddingRMSPropParametersGradAccumDebugOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange RetrieveTPUEmbeddingRMSPropParametersGradAccumDebugOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::DictionaryAttr RetrieveTPUEmbeddingRMSPropParametersGradAccumDebugOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::IntegerAttr RetrieveTPUEmbeddingRMSPropParametersGradAccumDebugOpAdaptor::table_id() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("table_id").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), -1);
  return attr;
}

::mlir::StringAttr RetrieveTPUEmbeddingRMSPropParametersGradAccumDebugOpAdaptor::table_name() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("table_name").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("");
  return attr;
}

::mlir::IntegerAttr RetrieveTPUEmbeddingRMSPropParametersGradAccumDebugOpAdaptor::num_shards() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("num_shards").cast<::mlir::IntegerAttr>();
  return attr;
}

::mlir::IntegerAttr RetrieveTPUEmbeddingRMSPropParametersGradAccumDebugOpAdaptor::shard_id() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("shard_id").cast<::mlir::IntegerAttr>();
  return attr;
}

::mlir::StringAttr RetrieveTPUEmbeddingRMSPropParametersGradAccumDebugOpAdaptor::config() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("config").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("");
  return attr;
}

::mlir::LogicalResult RetrieveTPUEmbeddingRMSPropParametersGradAccumDebugOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_table_id = odsAttrs.get("table_id");
    if (tblgen_table_id && !(((tblgen_table_id.isa<::mlir::IntegerAttr>())) && ((tblgen_table_id.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.RetrieveTPUEmbeddingRMSPropParametersGradAccumDebug' op ""attribute 'table_id' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_table_name = odsAttrs.get("table_name");
    if (tblgen_table_name && !((tblgen_table_name.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.RetrieveTPUEmbeddingRMSPropParametersGradAccumDebug' op ""attribute 'table_name' failed to satisfy constraint: string attribute");
  }
  {
    auto tblgen_num_shards = odsAttrs.get("num_shards");
    if (!tblgen_num_shards)
      return emitError(loc, "'tf.RetrieveTPUEmbeddingRMSPropParametersGradAccumDebug' op ""requires attribute 'num_shards'");

    if (tblgen_num_shards && !(((tblgen_num_shards.isa<::mlir::IntegerAttr>())) && ((tblgen_num_shards.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.RetrieveTPUEmbeddingRMSPropParametersGradAccumDebug' op ""attribute 'num_shards' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_shard_id = odsAttrs.get("shard_id");
    if (!tblgen_shard_id)
      return emitError(loc, "'tf.RetrieveTPUEmbeddingRMSPropParametersGradAccumDebug' op ""requires attribute 'shard_id'");

    if (tblgen_shard_id && !(((tblgen_shard_id.isa<::mlir::IntegerAttr>())) && ((tblgen_shard_id.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.RetrieveTPUEmbeddingRMSPropParametersGradAccumDebug' op ""attribute 'shard_id' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_config = odsAttrs.get("config");
    if (tblgen_config && !((tblgen_config.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.RetrieveTPUEmbeddingRMSPropParametersGradAccumDebug' op ""attribute 'config' failed to satisfy constraint: string attribute");
  }
  return ::mlir::success();
}

void RetrieveTPUEmbeddingRMSPropParametersGradAccumDebugOp::getAsmResultNames(::mlir::OpAsmSetValueNameFn setNameFn) {
  auto resultGroup0 = getODSResults(0);
  if (!llvm::empty(resultGroup0))
    setNameFn(*resultGroup0.begin(), "parameters");
  auto resultGroup1 = getODSResults(1);
  if (!llvm::empty(resultGroup1))
    setNameFn(*resultGroup1.begin(), "ms");
  auto resultGroup2 = getODSResults(2);
  if (!llvm::empty(resultGroup2))
    setNameFn(*resultGroup2.begin(), "mom");
  auto resultGroup3 = getODSResults(3);
  if (!llvm::empty(resultGroup3))
    setNameFn(*resultGroup3.begin(), "gradient_accumulators");
}

std::pair<unsigned, unsigned> RetrieveTPUEmbeddingRMSPropParametersGradAccumDebugOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range RetrieveTPUEmbeddingRMSPropParametersGradAccumDebugOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

std::pair<unsigned, unsigned> RetrieveTPUEmbeddingRMSPropParametersGradAccumDebugOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range RetrieveTPUEmbeddingRMSPropParametersGradAccumDebugOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value RetrieveTPUEmbeddingRMSPropParametersGradAccumDebugOp::parameters() {
  return *getODSResults(0).begin();
}

::mlir::Value RetrieveTPUEmbeddingRMSPropParametersGradAccumDebugOp::ms() {
  return *getODSResults(1).begin();
}

::mlir::Value RetrieveTPUEmbeddingRMSPropParametersGradAccumDebugOp::mom() {
  return *getODSResults(2).begin();
}

::mlir::Value RetrieveTPUEmbeddingRMSPropParametersGradAccumDebugOp::gradient_accumulators() {
  return *getODSResults(3).begin();
}

::mlir::IntegerAttr RetrieveTPUEmbeddingRMSPropParametersGradAccumDebugOp::table_idAttr() {
  return (*this)->getAttr(table_idAttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t RetrieveTPUEmbeddingRMSPropParametersGradAccumDebugOp::table_id() {
  auto attr = table_idAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), -1).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

::mlir::StringAttr RetrieveTPUEmbeddingRMSPropParametersGradAccumDebugOp::table_nameAttr() {
  return (*this)->getAttr(table_nameAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef RetrieveTPUEmbeddingRMSPropParametersGradAccumDebugOp::table_name() {
  auto attr = table_nameAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("").getValue();
  return attr.getValue();
}

::mlir::IntegerAttr RetrieveTPUEmbeddingRMSPropParametersGradAccumDebugOp::num_shardsAttr() {
  return (*this)->getAttr(num_shardsAttrName()).cast<::mlir::IntegerAttr>();
}

uint64_t RetrieveTPUEmbeddingRMSPropParametersGradAccumDebugOp::num_shards() {
  auto attr = num_shardsAttr();
  return attr.getValue().getZExtValue();
}

::mlir::IntegerAttr RetrieveTPUEmbeddingRMSPropParametersGradAccumDebugOp::shard_idAttr() {
  return (*this)->getAttr(shard_idAttrName()).cast<::mlir::IntegerAttr>();
}

uint64_t RetrieveTPUEmbeddingRMSPropParametersGradAccumDebugOp::shard_id() {
  auto attr = shard_idAttr();
  return attr.getValue().getZExtValue();
}

::mlir::StringAttr RetrieveTPUEmbeddingRMSPropParametersGradAccumDebugOp::configAttr() {
  return (*this)->getAttr(configAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef RetrieveTPUEmbeddingRMSPropParametersGradAccumDebugOp::config() {
  auto attr = configAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("").getValue();
  return attr.getValue();
}

void RetrieveTPUEmbeddingRMSPropParametersGradAccumDebugOp::table_idAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(table_idAttrName(), attr);
}

void RetrieveTPUEmbeddingRMSPropParametersGradAccumDebugOp::table_nameAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(table_nameAttrName(), attr);
}

void RetrieveTPUEmbeddingRMSPropParametersGradAccumDebugOp::num_shardsAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(num_shardsAttrName(), attr);
}

void RetrieveTPUEmbeddingRMSPropParametersGradAccumDebugOp::shard_idAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(shard_idAttrName(), attr);
}

void RetrieveTPUEmbeddingRMSPropParametersGradAccumDebugOp::configAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(configAttrName(), attr);
}

void RetrieveTPUEmbeddingRMSPropParametersGradAccumDebugOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type parameters, ::mlir::Type ms, ::mlir::Type mom, ::mlir::Type gradient_accumulators, ::mlir::IntegerAttr table_id, ::mlir::StringAttr table_name, ::mlir::IntegerAttr num_shards, ::mlir::IntegerAttr shard_id, ::mlir::StringAttr config) {
  odsState.addAttribute(table_idAttrName(odsState.name), table_id);
  odsState.addAttribute(table_nameAttrName(odsState.name), table_name);
  odsState.addAttribute(num_shardsAttrName(odsState.name), num_shards);
  odsState.addAttribute(shard_idAttrName(odsState.name), shard_id);
  odsState.addAttribute(configAttrName(odsState.name), config);
  odsState.addTypes(parameters);
  odsState.addTypes(ms);
  odsState.addTypes(mom);
  odsState.addTypes(gradient_accumulators);
}

void RetrieveTPUEmbeddingRMSPropParametersGradAccumDebugOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::IntegerAttr table_id, ::mlir::StringAttr table_name, ::mlir::IntegerAttr num_shards, ::mlir::IntegerAttr shard_id, ::mlir::StringAttr config) {
  odsState.addAttribute(table_idAttrName(odsState.name), table_id);
  odsState.addAttribute(table_nameAttrName(odsState.name), table_name);
  odsState.addAttribute(num_shardsAttrName(odsState.name), num_shards);
  odsState.addAttribute(shard_idAttrName(odsState.name), shard_id);
  odsState.addAttribute(configAttrName(odsState.name), config);
  assert(resultTypes.size() == 4u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void RetrieveTPUEmbeddingRMSPropParametersGradAccumDebugOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type parameters, ::mlir::Type ms, ::mlir::Type mom, ::mlir::Type gradient_accumulators, uint64_t table_id, ::llvm::StringRef table_name, uint64_t num_shards, uint64_t shard_id, ::llvm::StringRef config) {
  odsState.addAttribute(table_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), table_id));
  odsState.addAttribute(table_nameAttrName(odsState.name), odsBuilder.getStringAttr(table_name));
  odsState.addAttribute(num_shardsAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), num_shards));
  odsState.addAttribute(shard_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), shard_id));
  odsState.addAttribute(configAttrName(odsState.name), odsBuilder.getStringAttr(config));
  odsState.addTypes(parameters);
  odsState.addTypes(ms);
  odsState.addTypes(mom);
  odsState.addTypes(gradient_accumulators);
}

void RetrieveTPUEmbeddingRMSPropParametersGradAccumDebugOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, uint64_t table_id, ::llvm::StringRef table_name, uint64_t num_shards, uint64_t shard_id, ::llvm::StringRef config) {
  odsState.addAttribute(table_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), table_id));
  odsState.addAttribute(table_nameAttrName(odsState.name), odsBuilder.getStringAttr(table_name));
  odsState.addAttribute(num_shardsAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), num_shards));
  odsState.addAttribute(shard_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), shard_id));
  odsState.addAttribute(configAttrName(odsState.name), odsBuilder.getStringAttr(config));
  assert(resultTypes.size() == 4u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void RetrieveTPUEmbeddingRMSPropParametersGradAccumDebugOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 0u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 4u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult RetrieveTPUEmbeddingRMSPropParametersGradAccumDebugOp::verify() {
  {
    auto tblgen_table_id = (*this)->getAttr(table_idAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_table_id, "table_id")))
      return ::mlir::failure();
  }
  {
    auto tblgen_table_name = (*this)->getAttr(table_nameAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_table_name, "table_name")))
      return ::mlir::failure();
  }
  {
    auto tblgen_num_shards = (*this)->getAttr(num_shardsAttrName());
    if (!tblgen_num_shards)
      return emitOpError("requires attribute 'num_shards'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_num_shards, "num_shards")))
      return ::mlir::failure();
  }
  {
    auto tblgen_shard_id = (*this)->getAttr(shard_idAttrName());
    if (!tblgen_shard_id)
      return emitOpError("requires attribute 'shard_id'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_shard_id, "shard_id")))
      return ::mlir::failure();
  }
  {
    auto tblgen_config = (*this)->getAttr(configAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_config, "config")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSResults(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSResults(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
    auto valueGroup3 = getODSResults(3);

    for (auto v : valueGroup3) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void RetrieveTPUEmbeddingRMSPropParametersGradAccumDebugOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  effects.emplace_back(::mlir::MemoryEffects::Write::get(), ::mlir::TF::ResourceEffects::MustExecute::get());
  effects.emplace_back(::mlir::MemoryEffects::Read::get(), ::mlir::TF::ResourceEffects::TPUEmbedding::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::RetrieveTPUEmbeddingRMSPropParametersGradAccumDebugOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::RetrieveTPUEmbeddingRMSPropParametersOp definitions
//===----------------------------------------------------------------------===//

RetrieveTPUEmbeddingRMSPropParametersOpAdaptor::RetrieveTPUEmbeddingRMSPropParametersOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

RetrieveTPUEmbeddingRMSPropParametersOpAdaptor::RetrieveTPUEmbeddingRMSPropParametersOpAdaptor(RetrieveTPUEmbeddingRMSPropParametersOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange RetrieveTPUEmbeddingRMSPropParametersOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> RetrieveTPUEmbeddingRMSPropParametersOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange RetrieveTPUEmbeddingRMSPropParametersOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::DictionaryAttr RetrieveTPUEmbeddingRMSPropParametersOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::IntegerAttr RetrieveTPUEmbeddingRMSPropParametersOpAdaptor::table_id() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("table_id").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), -1);
  return attr;
}

::mlir::StringAttr RetrieveTPUEmbeddingRMSPropParametersOpAdaptor::table_name() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("table_name").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("");
  return attr;
}

::mlir::IntegerAttr RetrieveTPUEmbeddingRMSPropParametersOpAdaptor::num_shards() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("num_shards").cast<::mlir::IntegerAttr>();
  return attr;
}

::mlir::IntegerAttr RetrieveTPUEmbeddingRMSPropParametersOpAdaptor::shard_id() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("shard_id").cast<::mlir::IntegerAttr>();
  return attr;
}

::mlir::StringAttr RetrieveTPUEmbeddingRMSPropParametersOpAdaptor::config() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("config").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("");
  return attr;
}

::mlir::LogicalResult RetrieveTPUEmbeddingRMSPropParametersOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_table_id = odsAttrs.get("table_id");
    if (tblgen_table_id && !(((tblgen_table_id.isa<::mlir::IntegerAttr>())) && ((tblgen_table_id.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.RetrieveTPUEmbeddingRMSPropParameters' op ""attribute 'table_id' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_table_name = odsAttrs.get("table_name");
    if (tblgen_table_name && !((tblgen_table_name.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.RetrieveTPUEmbeddingRMSPropParameters' op ""attribute 'table_name' failed to satisfy constraint: string attribute");
  }
  {
    auto tblgen_num_shards = odsAttrs.get("num_shards");
    if (!tblgen_num_shards)
      return emitError(loc, "'tf.RetrieveTPUEmbeddingRMSPropParameters' op ""requires attribute 'num_shards'");

    if (tblgen_num_shards && !(((tblgen_num_shards.isa<::mlir::IntegerAttr>())) && ((tblgen_num_shards.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.RetrieveTPUEmbeddingRMSPropParameters' op ""attribute 'num_shards' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_shard_id = odsAttrs.get("shard_id");
    if (!tblgen_shard_id)
      return emitError(loc, "'tf.RetrieveTPUEmbeddingRMSPropParameters' op ""requires attribute 'shard_id'");

    if (tblgen_shard_id && !(((tblgen_shard_id.isa<::mlir::IntegerAttr>())) && ((tblgen_shard_id.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.RetrieveTPUEmbeddingRMSPropParameters' op ""attribute 'shard_id' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_config = odsAttrs.get("config");
    if (tblgen_config && !((tblgen_config.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.RetrieveTPUEmbeddingRMSPropParameters' op ""attribute 'config' failed to satisfy constraint: string attribute");
  }
  return ::mlir::success();
}

void RetrieveTPUEmbeddingRMSPropParametersOp::getAsmResultNames(::mlir::OpAsmSetValueNameFn setNameFn) {
  auto resultGroup0 = getODSResults(0);
  if (!llvm::empty(resultGroup0))
    setNameFn(*resultGroup0.begin(), "parameters");
  auto resultGroup1 = getODSResults(1);
  if (!llvm::empty(resultGroup1))
    setNameFn(*resultGroup1.begin(), "ms");
  auto resultGroup2 = getODSResults(2);
  if (!llvm::empty(resultGroup2))
    setNameFn(*resultGroup2.begin(), "mom");
}

std::pair<unsigned, unsigned> RetrieveTPUEmbeddingRMSPropParametersOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range RetrieveTPUEmbeddingRMSPropParametersOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

std::pair<unsigned, unsigned> RetrieveTPUEmbeddingRMSPropParametersOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range RetrieveTPUEmbeddingRMSPropParametersOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value RetrieveTPUEmbeddingRMSPropParametersOp::parameters() {
  return *getODSResults(0).begin();
}

::mlir::Value RetrieveTPUEmbeddingRMSPropParametersOp::ms() {
  return *getODSResults(1).begin();
}

::mlir::Value RetrieveTPUEmbeddingRMSPropParametersOp::mom() {
  return *getODSResults(2).begin();
}

::mlir::IntegerAttr RetrieveTPUEmbeddingRMSPropParametersOp::table_idAttr() {
  return (*this)->getAttr(table_idAttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t RetrieveTPUEmbeddingRMSPropParametersOp::table_id() {
  auto attr = table_idAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), -1).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

::mlir::StringAttr RetrieveTPUEmbeddingRMSPropParametersOp::table_nameAttr() {
  return (*this)->getAttr(table_nameAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef RetrieveTPUEmbeddingRMSPropParametersOp::table_name() {
  auto attr = table_nameAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("").getValue();
  return attr.getValue();
}

::mlir::IntegerAttr RetrieveTPUEmbeddingRMSPropParametersOp::num_shardsAttr() {
  return (*this)->getAttr(num_shardsAttrName()).cast<::mlir::IntegerAttr>();
}

uint64_t RetrieveTPUEmbeddingRMSPropParametersOp::num_shards() {
  auto attr = num_shardsAttr();
  return attr.getValue().getZExtValue();
}

::mlir::IntegerAttr RetrieveTPUEmbeddingRMSPropParametersOp::shard_idAttr() {
  return (*this)->getAttr(shard_idAttrName()).cast<::mlir::IntegerAttr>();
}

uint64_t RetrieveTPUEmbeddingRMSPropParametersOp::shard_id() {
  auto attr = shard_idAttr();
  return attr.getValue().getZExtValue();
}

::mlir::StringAttr RetrieveTPUEmbeddingRMSPropParametersOp::configAttr() {
  return (*this)->getAttr(configAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef RetrieveTPUEmbeddingRMSPropParametersOp::config() {
  auto attr = configAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("").getValue();
  return attr.getValue();
}

void RetrieveTPUEmbeddingRMSPropParametersOp::table_idAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(table_idAttrName(), attr);
}

void RetrieveTPUEmbeddingRMSPropParametersOp::table_nameAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(table_nameAttrName(), attr);
}

void RetrieveTPUEmbeddingRMSPropParametersOp::num_shardsAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(num_shardsAttrName(), attr);
}

void RetrieveTPUEmbeddingRMSPropParametersOp::shard_idAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(shard_idAttrName(), attr);
}

void RetrieveTPUEmbeddingRMSPropParametersOp::configAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(configAttrName(), attr);
}

void RetrieveTPUEmbeddingRMSPropParametersOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type parameters, ::mlir::Type ms, ::mlir::Type mom, ::mlir::IntegerAttr table_id, ::mlir::StringAttr table_name, ::mlir::IntegerAttr num_shards, ::mlir::IntegerAttr shard_id, ::mlir::StringAttr config) {
  odsState.addAttribute(table_idAttrName(odsState.name), table_id);
  odsState.addAttribute(table_nameAttrName(odsState.name), table_name);
  odsState.addAttribute(num_shardsAttrName(odsState.name), num_shards);
  odsState.addAttribute(shard_idAttrName(odsState.name), shard_id);
  odsState.addAttribute(configAttrName(odsState.name), config);
  odsState.addTypes(parameters);
  odsState.addTypes(ms);
  odsState.addTypes(mom);
}

void RetrieveTPUEmbeddingRMSPropParametersOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::IntegerAttr table_id, ::mlir::StringAttr table_name, ::mlir::IntegerAttr num_shards, ::mlir::IntegerAttr shard_id, ::mlir::StringAttr config) {
  odsState.addAttribute(table_idAttrName(odsState.name), table_id);
  odsState.addAttribute(table_nameAttrName(odsState.name), table_name);
  odsState.addAttribute(num_shardsAttrName(odsState.name), num_shards);
  odsState.addAttribute(shard_idAttrName(odsState.name), shard_id);
  odsState.addAttribute(configAttrName(odsState.name), config);
  assert(resultTypes.size() == 3u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void RetrieveTPUEmbeddingRMSPropParametersOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type parameters, ::mlir::Type ms, ::mlir::Type mom, uint64_t table_id, ::llvm::StringRef table_name, uint64_t num_shards, uint64_t shard_id, ::llvm::StringRef config) {
  odsState.addAttribute(table_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), table_id));
  odsState.addAttribute(table_nameAttrName(odsState.name), odsBuilder.getStringAttr(table_name));
  odsState.addAttribute(num_shardsAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), num_shards));
  odsState.addAttribute(shard_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), shard_id));
  odsState.addAttribute(configAttrName(odsState.name), odsBuilder.getStringAttr(config));
  odsState.addTypes(parameters);
  odsState.addTypes(ms);
  odsState.addTypes(mom);
}

void RetrieveTPUEmbeddingRMSPropParametersOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, uint64_t table_id, ::llvm::StringRef table_name, uint64_t num_shards, uint64_t shard_id, ::llvm::StringRef config) {
  odsState.addAttribute(table_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), table_id));
  odsState.addAttribute(table_nameAttrName(odsState.name), odsBuilder.getStringAttr(table_name));
  odsState.addAttribute(num_shardsAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), num_shards));
  odsState.addAttribute(shard_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), shard_id));
  odsState.addAttribute(configAttrName(odsState.name), odsBuilder.getStringAttr(config));
  assert(resultTypes.size() == 3u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void RetrieveTPUEmbeddingRMSPropParametersOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 0u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 3u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult RetrieveTPUEmbeddingRMSPropParametersOp::verify() {
  {
    auto tblgen_table_id = (*this)->getAttr(table_idAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_table_id, "table_id")))
      return ::mlir::failure();
  }
  {
    auto tblgen_table_name = (*this)->getAttr(table_nameAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_table_name, "table_name")))
      return ::mlir::failure();
  }
  {
    auto tblgen_num_shards = (*this)->getAttr(num_shardsAttrName());
    if (!tblgen_num_shards)
      return emitOpError("requires attribute 'num_shards'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_num_shards, "num_shards")))
      return ::mlir::failure();
  }
  {
    auto tblgen_shard_id = (*this)->getAttr(shard_idAttrName());
    if (!tblgen_shard_id)
      return emitOpError("requires attribute 'shard_id'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_shard_id, "shard_id")))
      return ::mlir::failure();
  }
  {
    auto tblgen_config = (*this)->getAttr(configAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_config, "config")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSResults(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSResults(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void RetrieveTPUEmbeddingRMSPropParametersOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  effects.emplace_back(::mlir::MemoryEffects::Write::get(), ::mlir::TF::ResourceEffects::MustExecute::get());
  effects.emplace_back(::mlir::MemoryEffects::Read::get(), ::mlir::TF::ResourceEffects::TPUEmbedding::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::RetrieveTPUEmbeddingRMSPropParametersOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::RetrieveTPUEmbeddingStochasticGradientDescentParametersGradAccumDebugOp definitions
//===----------------------------------------------------------------------===//

RetrieveTPUEmbeddingStochasticGradientDescentParametersGradAccumDebugOpAdaptor::RetrieveTPUEmbeddingStochasticGradientDescentParametersGradAccumDebugOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

RetrieveTPUEmbeddingStochasticGradientDescentParametersGradAccumDebugOpAdaptor::RetrieveTPUEmbeddingStochasticGradientDescentParametersGradAccumDebugOpAdaptor(RetrieveTPUEmbeddingStochasticGradientDescentParametersGradAccumDebugOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange RetrieveTPUEmbeddingStochasticGradientDescentParametersGradAccumDebugOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> RetrieveTPUEmbeddingStochasticGradientDescentParametersGradAccumDebugOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange RetrieveTPUEmbeddingStochasticGradientDescentParametersGradAccumDebugOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::DictionaryAttr RetrieveTPUEmbeddingStochasticGradientDescentParametersGradAccumDebugOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::IntegerAttr RetrieveTPUEmbeddingStochasticGradientDescentParametersGradAccumDebugOpAdaptor::table_id() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("table_id").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), -1);
  return attr;
}

::mlir::StringAttr RetrieveTPUEmbeddingStochasticGradientDescentParametersGradAccumDebugOpAdaptor::table_name() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("table_name").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("");
  return attr;
}

::mlir::IntegerAttr RetrieveTPUEmbeddingStochasticGradientDescentParametersGradAccumDebugOpAdaptor::num_shards() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("num_shards").cast<::mlir::IntegerAttr>();
  return attr;
}

::mlir::IntegerAttr RetrieveTPUEmbeddingStochasticGradientDescentParametersGradAccumDebugOpAdaptor::shard_id() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("shard_id").cast<::mlir::IntegerAttr>();
  return attr;
}

::mlir::StringAttr RetrieveTPUEmbeddingStochasticGradientDescentParametersGradAccumDebugOpAdaptor::config() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("config").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("");
  return attr;
}

::mlir::LogicalResult RetrieveTPUEmbeddingStochasticGradientDescentParametersGradAccumDebugOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_table_id = odsAttrs.get("table_id");
    if (tblgen_table_id && !(((tblgen_table_id.isa<::mlir::IntegerAttr>())) && ((tblgen_table_id.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.RetrieveTPUEmbeddingStochasticGradientDescentParametersGradAccumDebug' op ""attribute 'table_id' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_table_name = odsAttrs.get("table_name");
    if (tblgen_table_name && !((tblgen_table_name.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.RetrieveTPUEmbeddingStochasticGradientDescentParametersGradAccumDebug' op ""attribute 'table_name' failed to satisfy constraint: string attribute");
  }
  {
    auto tblgen_num_shards = odsAttrs.get("num_shards");
    if (!tblgen_num_shards)
      return emitError(loc, "'tf.RetrieveTPUEmbeddingStochasticGradientDescentParametersGradAccumDebug' op ""requires attribute 'num_shards'");

    if (tblgen_num_shards && !(((tblgen_num_shards.isa<::mlir::IntegerAttr>())) && ((tblgen_num_shards.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.RetrieveTPUEmbeddingStochasticGradientDescentParametersGradAccumDebug' op ""attribute 'num_shards' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_shard_id = odsAttrs.get("shard_id");
    if (!tblgen_shard_id)
      return emitError(loc, "'tf.RetrieveTPUEmbeddingStochasticGradientDescentParametersGradAccumDebug' op ""requires attribute 'shard_id'");

    if (tblgen_shard_id && !(((tblgen_shard_id.isa<::mlir::IntegerAttr>())) && ((tblgen_shard_id.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.RetrieveTPUEmbeddingStochasticGradientDescentParametersGradAccumDebug' op ""attribute 'shard_id' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_config = odsAttrs.get("config");
    if (tblgen_config && !((tblgen_config.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.RetrieveTPUEmbeddingStochasticGradientDescentParametersGradAccumDebug' op ""attribute 'config' failed to satisfy constraint: string attribute");
  }
  return ::mlir::success();
}

void RetrieveTPUEmbeddingStochasticGradientDescentParametersGradAccumDebugOp::getAsmResultNames(::mlir::OpAsmSetValueNameFn setNameFn) {
  auto resultGroup0 = getODSResults(0);
  if (!llvm::empty(resultGroup0))
    setNameFn(*resultGroup0.begin(), "parameters");
  auto resultGroup1 = getODSResults(1);
  if (!llvm::empty(resultGroup1))
    setNameFn(*resultGroup1.begin(), "gradient_accumulators");
}

std::pair<unsigned, unsigned> RetrieveTPUEmbeddingStochasticGradientDescentParametersGradAccumDebugOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range RetrieveTPUEmbeddingStochasticGradientDescentParametersGradAccumDebugOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

std::pair<unsigned, unsigned> RetrieveTPUEmbeddingStochasticGradientDescentParametersGradAccumDebugOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range RetrieveTPUEmbeddingStochasticGradientDescentParametersGradAccumDebugOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value RetrieveTPUEmbeddingStochasticGradientDescentParametersGradAccumDebugOp::parameters() {
  return *getODSResults(0).begin();
}

::mlir::Value RetrieveTPUEmbeddingStochasticGradientDescentParametersGradAccumDebugOp::gradient_accumulators() {
  return *getODSResults(1).begin();
}

::mlir::IntegerAttr RetrieveTPUEmbeddingStochasticGradientDescentParametersGradAccumDebugOp::table_idAttr() {
  return (*this)->getAttr(table_idAttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t RetrieveTPUEmbeddingStochasticGradientDescentParametersGradAccumDebugOp::table_id() {
  auto attr = table_idAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), -1).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

::mlir::StringAttr RetrieveTPUEmbeddingStochasticGradientDescentParametersGradAccumDebugOp::table_nameAttr() {
  return (*this)->getAttr(table_nameAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef RetrieveTPUEmbeddingStochasticGradientDescentParametersGradAccumDebugOp::table_name() {
  auto attr = table_nameAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("").getValue();
  return attr.getValue();
}

::mlir::IntegerAttr RetrieveTPUEmbeddingStochasticGradientDescentParametersGradAccumDebugOp::num_shardsAttr() {
  return (*this)->getAttr(num_shardsAttrName()).cast<::mlir::IntegerAttr>();
}

uint64_t RetrieveTPUEmbeddingStochasticGradientDescentParametersGradAccumDebugOp::num_shards() {
  auto attr = num_shardsAttr();
  return attr.getValue().getZExtValue();
}

::mlir::IntegerAttr RetrieveTPUEmbeddingStochasticGradientDescentParametersGradAccumDebugOp::shard_idAttr() {
  return (*this)->getAttr(shard_idAttrName()).cast<::mlir::IntegerAttr>();
}

uint64_t RetrieveTPUEmbeddingStochasticGradientDescentParametersGradAccumDebugOp::shard_id() {
  auto attr = shard_idAttr();
  return attr.getValue().getZExtValue();
}

::mlir::StringAttr RetrieveTPUEmbeddingStochasticGradientDescentParametersGradAccumDebugOp::configAttr() {
  return (*this)->getAttr(configAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef RetrieveTPUEmbeddingStochasticGradientDescentParametersGradAccumDebugOp::config() {
  auto attr = configAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("").getValue();
  return attr.getValue();
}

void RetrieveTPUEmbeddingStochasticGradientDescentParametersGradAccumDebugOp::table_idAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(table_idAttrName(), attr);
}

void RetrieveTPUEmbeddingStochasticGradientDescentParametersGradAccumDebugOp::table_nameAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(table_nameAttrName(), attr);
}

void RetrieveTPUEmbeddingStochasticGradientDescentParametersGradAccumDebugOp::num_shardsAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(num_shardsAttrName(), attr);
}

void RetrieveTPUEmbeddingStochasticGradientDescentParametersGradAccumDebugOp::shard_idAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(shard_idAttrName(), attr);
}

void RetrieveTPUEmbeddingStochasticGradientDescentParametersGradAccumDebugOp::configAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(configAttrName(), attr);
}

void RetrieveTPUEmbeddingStochasticGradientDescentParametersGradAccumDebugOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type parameters, ::mlir::Type gradient_accumulators, ::mlir::IntegerAttr table_id, ::mlir::StringAttr table_name, ::mlir::IntegerAttr num_shards, ::mlir::IntegerAttr shard_id, ::mlir::StringAttr config) {
  odsState.addAttribute(table_idAttrName(odsState.name), table_id);
  odsState.addAttribute(table_nameAttrName(odsState.name), table_name);
  odsState.addAttribute(num_shardsAttrName(odsState.name), num_shards);
  odsState.addAttribute(shard_idAttrName(odsState.name), shard_id);
  odsState.addAttribute(configAttrName(odsState.name), config);
  odsState.addTypes(parameters);
  odsState.addTypes(gradient_accumulators);
}

void RetrieveTPUEmbeddingStochasticGradientDescentParametersGradAccumDebugOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::IntegerAttr table_id, ::mlir::StringAttr table_name, ::mlir::IntegerAttr num_shards, ::mlir::IntegerAttr shard_id, ::mlir::StringAttr config) {
  odsState.addAttribute(table_idAttrName(odsState.name), table_id);
  odsState.addAttribute(table_nameAttrName(odsState.name), table_name);
  odsState.addAttribute(num_shardsAttrName(odsState.name), num_shards);
  odsState.addAttribute(shard_idAttrName(odsState.name), shard_id);
  odsState.addAttribute(configAttrName(odsState.name), config);
  assert(resultTypes.size() == 2u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void RetrieveTPUEmbeddingStochasticGradientDescentParametersGradAccumDebugOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type parameters, ::mlir::Type gradient_accumulators, uint64_t table_id, ::llvm::StringRef table_name, uint64_t num_shards, uint64_t shard_id, ::llvm::StringRef config) {
  odsState.addAttribute(table_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), table_id));
  odsState.addAttribute(table_nameAttrName(odsState.name), odsBuilder.getStringAttr(table_name));
  odsState.addAttribute(num_shardsAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), num_shards));
  odsState.addAttribute(shard_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), shard_id));
  odsState.addAttribute(configAttrName(odsState.name), odsBuilder.getStringAttr(config));
  odsState.addTypes(parameters);
  odsState.addTypes(gradient_accumulators);
}

void RetrieveTPUEmbeddingStochasticGradientDescentParametersGradAccumDebugOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, uint64_t table_id, ::llvm::StringRef table_name, uint64_t num_shards, uint64_t shard_id, ::llvm::StringRef config) {
  odsState.addAttribute(table_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), table_id));
  odsState.addAttribute(table_nameAttrName(odsState.name), odsBuilder.getStringAttr(table_name));
  odsState.addAttribute(num_shardsAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), num_shards));
  odsState.addAttribute(shard_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), shard_id));
  odsState.addAttribute(configAttrName(odsState.name), odsBuilder.getStringAttr(config));
  assert(resultTypes.size() == 2u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void RetrieveTPUEmbeddingStochasticGradientDescentParametersGradAccumDebugOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 0u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 2u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult RetrieveTPUEmbeddingStochasticGradientDescentParametersGradAccumDebugOp::verify() {
  {
    auto tblgen_table_id = (*this)->getAttr(table_idAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_table_id, "table_id")))
      return ::mlir::failure();
  }
  {
    auto tblgen_table_name = (*this)->getAttr(table_nameAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_table_name, "table_name")))
      return ::mlir::failure();
  }
  {
    auto tblgen_num_shards = (*this)->getAttr(num_shardsAttrName());
    if (!tblgen_num_shards)
      return emitOpError("requires attribute 'num_shards'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_num_shards, "num_shards")))
      return ::mlir::failure();
  }
  {
    auto tblgen_shard_id = (*this)->getAttr(shard_idAttrName());
    if (!tblgen_shard_id)
      return emitOpError("requires attribute 'shard_id'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_shard_id, "shard_id")))
      return ::mlir::failure();
  }
  {
    auto tblgen_config = (*this)->getAttr(configAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_config, "config")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSResults(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void RetrieveTPUEmbeddingStochasticGradientDescentParametersGradAccumDebugOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  effects.emplace_back(::mlir::MemoryEffects::Write::get(), ::mlir::TF::ResourceEffects::MustExecute::get());
  effects.emplace_back(::mlir::MemoryEffects::Read::get(), ::mlir::TF::ResourceEffects::TPUEmbedding::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::RetrieveTPUEmbeddingStochasticGradientDescentParametersGradAccumDebugOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::RetrieveTPUEmbeddingStochasticGradientDescentParametersOp definitions
//===----------------------------------------------------------------------===//

RetrieveTPUEmbeddingStochasticGradientDescentParametersOpAdaptor::RetrieveTPUEmbeddingStochasticGradientDescentParametersOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

RetrieveTPUEmbeddingStochasticGradientDescentParametersOpAdaptor::RetrieveTPUEmbeddingStochasticGradientDescentParametersOpAdaptor(RetrieveTPUEmbeddingStochasticGradientDescentParametersOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange RetrieveTPUEmbeddingStochasticGradientDescentParametersOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> RetrieveTPUEmbeddingStochasticGradientDescentParametersOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange RetrieveTPUEmbeddingStochasticGradientDescentParametersOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::DictionaryAttr RetrieveTPUEmbeddingStochasticGradientDescentParametersOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::IntegerAttr RetrieveTPUEmbeddingStochasticGradientDescentParametersOpAdaptor::table_id() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("table_id").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), -1);
  return attr;
}

::mlir::StringAttr RetrieveTPUEmbeddingStochasticGradientDescentParametersOpAdaptor::table_name() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("table_name").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("");
  return attr;
}

::mlir::IntegerAttr RetrieveTPUEmbeddingStochasticGradientDescentParametersOpAdaptor::num_shards() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("num_shards").cast<::mlir::IntegerAttr>();
  return attr;
}

::mlir::IntegerAttr RetrieveTPUEmbeddingStochasticGradientDescentParametersOpAdaptor::shard_id() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("shard_id").cast<::mlir::IntegerAttr>();
  return attr;
}

::mlir::StringAttr RetrieveTPUEmbeddingStochasticGradientDescentParametersOpAdaptor::config() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("config").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("");
  return attr;
}

::mlir::LogicalResult RetrieveTPUEmbeddingStochasticGradientDescentParametersOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_table_id = odsAttrs.get("table_id");
    if (tblgen_table_id && !(((tblgen_table_id.isa<::mlir::IntegerAttr>())) && ((tblgen_table_id.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.RetrieveTPUEmbeddingStochasticGradientDescentParameters' op ""attribute 'table_id' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_table_name = odsAttrs.get("table_name");
    if (tblgen_table_name && !((tblgen_table_name.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.RetrieveTPUEmbeddingStochasticGradientDescentParameters' op ""attribute 'table_name' failed to satisfy constraint: string attribute");
  }
  {
    auto tblgen_num_shards = odsAttrs.get("num_shards");
    if (!tblgen_num_shards)
      return emitError(loc, "'tf.RetrieveTPUEmbeddingStochasticGradientDescentParameters' op ""requires attribute 'num_shards'");

    if (tblgen_num_shards && !(((tblgen_num_shards.isa<::mlir::IntegerAttr>())) && ((tblgen_num_shards.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.RetrieveTPUEmbeddingStochasticGradientDescentParameters' op ""attribute 'num_shards' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_shard_id = odsAttrs.get("shard_id");
    if (!tblgen_shard_id)
      return emitError(loc, "'tf.RetrieveTPUEmbeddingStochasticGradientDescentParameters' op ""requires attribute 'shard_id'");

    if (tblgen_shard_id && !(((tblgen_shard_id.isa<::mlir::IntegerAttr>())) && ((tblgen_shard_id.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.RetrieveTPUEmbeddingStochasticGradientDescentParameters' op ""attribute 'shard_id' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_config = odsAttrs.get("config");
    if (tblgen_config && !((tblgen_config.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.RetrieveTPUEmbeddingStochasticGradientDescentParameters' op ""attribute 'config' failed to satisfy constraint: string attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> RetrieveTPUEmbeddingStochasticGradientDescentParametersOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range RetrieveTPUEmbeddingStochasticGradientDescentParametersOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

std::pair<unsigned, unsigned> RetrieveTPUEmbeddingStochasticGradientDescentParametersOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range RetrieveTPUEmbeddingStochasticGradientDescentParametersOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value RetrieveTPUEmbeddingStochasticGradientDescentParametersOp::parameters() {
  return *getODSResults(0).begin();
}

::mlir::IntegerAttr RetrieveTPUEmbeddingStochasticGradientDescentParametersOp::table_idAttr() {
  return (*this)->getAttr(table_idAttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t RetrieveTPUEmbeddingStochasticGradientDescentParametersOp::table_id() {
  auto attr = table_idAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), -1).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

::mlir::StringAttr RetrieveTPUEmbeddingStochasticGradientDescentParametersOp::table_nameAttr() {
  return (*this)->getAttr(table_nameAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef RetrieveTPUEmbeddingStochasticGradientDescentParametersOp::table_name() {
  auto attr = table_nameAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("").getValue();
  return attr.getValue();
}

::mlir::IntegerAttr RetrieveTPUEmbeddingStochasticGradientDescentParametersOp::num_shardsAttr() {
  return (*this)->getAttr(num_shardsAttrName()).cast<::mlir::IntegerAttr>();
}

uint64_t RetrieveTPUEmbeddingStochasticGradientDescentParametersOp::num_shards() {
  auto attr = num_shardsAttr();
  return attr.getValue().getZExtValue();
}

::mlir::IntegerAttr RetrieveTPUEmbeddingStochasticGradientDescentParametersOp::shard_idAttr() {
  return (*this)->getAttr(shard_idAttrName()).cast<::mlir::IntegerAttr>();
}

uint64_t RetrieveTPUEmbeddingStochasticGradientDescentParametersOp::shard_id() {
  auto attr = shard_idAttr();
  return attr.getValue().getZExtValue();
}

::mlir::StringAttr RetrieveTPUEmbeddingStochasticGradientDescentParametersOp::configAttr() {
  return (*this)->getAttr(configAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef RetrieveTPUEmbeddingStochasticGradientDescentParametersOp::config() {
  auto attr = configAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("").getValue();
  return attr.getValue();
}

void RetrieveTPUEmbeddingStochasticGradientDescentParametersOp::table_idAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(table_idAttrName(), attr);
}

void RetrieveTPUEmbeddingStochasticGradientDescentParametersOp::table_nameAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(table_nameAttrName(), attr);
}

void RetrieveTPUEmbeddingStochasticGradientDescentParametersOp::num_shardsAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(num_shardsAttrName(), attr);
}

void RetrieveTPUEmbeddingStochasticGradientDescentParametersOp::shard_idAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(shard_idAttrName(), attr);
}

void RetrieveTPUEmbeddingStochasticGradientDescentParametersOp::configAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(configAttrName(), attr);
}

void RetrieveTPUEmbeddingStochasticGradientDescentParametersOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type parameters, ::mlir::IntegerAttr table_id, ::mlir::StringAttr table_name, ::mlir::IntegerAttr num_shards, ::mlir::IntegerAttr shard_id, ::mlir::StringAttr config) {
  odsState.addAttribute(table_idAttrName(odsState.name), table_id);
  odsState.addAttribute(table_nameAttrName(odsState.name), table_name);
  odsState.addAttribute(num_shardsAttrName(odsState.name), num_shards);
  odsState.addAttribute(shard_idAttrName(odsState.name), shard_id);
  odsState.addAttribute(configAttrName(odsState.name), config);
  odsState.addTypes(parameters);
}

void RetrieveTPUEmbeddingStochasticGradientDescentParametersOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::IntegerAttr table_id, ::mlir::StringAttr table_name, ::mlir::IntegerAttr num_shards, ::mlir::IntegerAttr shard_id, ::mlir::StringAttr config) {
  odsState.addAttribute(table_idAttrName(odsState.name), table_id);
  odsState.addAttribute(table_nameAttrName(odsState.name), table_name);
  odsState.addAttribute(num_shardsAttrName(odsState.name), num_shards);
  odsState.addAttribute(shard_idAttrName(odsState.name), shard_id);
  odsState.addAttribute(configAttrName(odsState.name), config);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void RetrieveTPUEmbeddingStochasticGradientDescentParametersOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type parameters, uint64_t table_id, ::llvm::StringRef table_name, uint64_t num_shards, uint64_t shard_id, ::llvm::StringRef config) {
  odsState.addAttribute(table_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), table_id));
  odsState.addAttribute(table_nameAttrName(odsState.name), odsBuilder.getStringAttr(table_name));
  odsState.addAttribute(num_shardsAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), num_shards));
  odsState.addAttribute(shard_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), shard_id));
  odsState.addAttribute(configAttrName(odsState.name), odsBuilder.getStringAttr(config));
  odsState.addTypes(parameters);
}

void RetrieveTPUEmbeddingStochasticGradientDescentParametersOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, uint64_t table_id, ::llvm::StringRef table_name, uint64_t num_shards, uint64_t shard_id, ::llvm::StringRef config) {
  odsState.addAttribute(table_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), table_id));
  odsState.addAttribute(table_nameAttrName(odsState.name), odsBuilder.getStringAttr(table_name));
  odsState.addAttribute(num_shardsAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), num_shards));
  odsState.addAttribute(shard_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), shard_id));
  odsState.addAttribute(configAttrName(odsState.name), odsBuilder.getStringAttr(config));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void RetrieveTPUEmbeddingStochasticGradientDescentParametersOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 0u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult RetrieveTPUEmbeddingStochasticGradientDescentParametersOp::verify() {
  {
    auto tblgen_table_id = (*this)->getAttr(table_idAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_table_id, "table_id")))
      return ::mlir::failure();
  }
  {
    auto tblgen_table_name = (*this)->getAttr(table_nameAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_table_name, "table_name")))
      return ::mlir::failure();
  }
  {
    auto tblgen_num_shards = (*this)->getAttr(num_shardsAttrName());
    if (!tblgen_num_shards)
      return emitOpError("requires attribute 'num_shards'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_num_shards, "num_shards")))
      return ::mlir::failure();
  }
  {
    auto tblgen_shard_id = (*this)->getAttr(shard_idAttrName());
    if (!tblgen_shard_id)
      return emitOpError("requires attribute 'shard_id'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_shard_id, "shard_id")))
      return ::mlir::failure();
  }
  {
    auto tblgen_config = (*this)->getAttr(configAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_config, "config")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void RetrieveTPUEmbeddingStochasticGradientDescentParametersOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  effects.emplace_back(::mlir::MemoryEffects::Write::get(), ::mlir::TF::ResourceEffects::MustExecute::get());
  effects.emplace_back(::mlir::MemoryEffects::Read::get(), ::mlir::TF::ResourceEffects::TPUEmbedding::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::RetrieveTPUEmbeddingStochasticGradientDescentParametersOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::ReverseOp definitions
//===----------------------------------------------------------------------===//

ReverseOpAdaptor::ReverseOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

ReverseOpAdaptor::ReverseOpAdaptor(ReverseOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange ReverseOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> ReverseOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange ReverseOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ReverseOpAdaptor::tensor() {
  return *getODSOperands(0).begin();
}

::mlir::Value ReverseOpAdaptor::dims() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr ReverseOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult ReverseOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> ReverseOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range ReverseOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ReverseOp::tensor() {
  return *getODSOperands(0).begin();
}

::mlir::Value ReverseOp::dims() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange ReverseOp::tensorMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ReverseOp::dimsMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> ReverseOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range ReverseOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ReverseOp::output() {
  return *getODSResults(0).begin();
}

::mlir::Type ReverseOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool ReverseOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr ReverseOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void ReverseOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value tensor, ::mlir::Value dims) {
  odsState.addOperands(tensor);
  odsState.addOperands(dims);
  odsState.addTypes(output);
}

void ReverseOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value tensor, ::mlir::Value dims) {
  odsState.addOperands(tensor);
  odsState.addOperands(dims);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void ReverseOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult ReverseOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops56(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops8(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops56(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void ReverseOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::ReverseOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::ReverseSequenceOp definitions
//===----------------------------------------------------------------------===//

ReverseSequenceOpAdaptor::ReverseSequenceOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

ReverseSequenceOpAdaptor::ReverseSequenceOpAdaptor(ReverseSequenceOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange ReverseSequenceOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> ReverseSequenceOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange ReverseSequenceOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ReverseSequenceOpAdaptor::input() {
  return *getODSOperands(0).begin();
}

::mlir::Value ReverseSequenceOpAdaptor::seq_lengths() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr ReverseSequenceOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::IntegerAttr ReverseSequenceOpAdaptor::seq_dim() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("seq_dim").cast<::mlir::IntegerAttr>();
  return attr;
}

::mlir::IntegerAttr ReverseSequenceOpAdaptor::batch_dim() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("batch_dim").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), 0);
  return attr;
}

::mlir::LogicalResult ReverseSequenceOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_seq_dim = odsAttrs.get("seq_dim");
    if (!tblgen_seq_dim)
      return emitError(loc, "'tf.ReverseSequence' op ""requires attribute 'seq_dim'");

    if (tblgen_seq_dim && !(((tblgen_seq_dim.isa<::mlir::IntegerAttr>())) && ((tblgen_seq_dim.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.ReverseSequence' op ""attribute 'seq_dim' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_batch_dim = odsAttrs.get("batch_dim");
    if (tblgen_batch_dim && !(((tblgen_batch_dim.isa<::mlir::IntegerAttr>())) && ((tblgen_batch_dim.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.ReverseSequence' op ""attribute 'batch_dim' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> ReverseSequenceOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range ReverseSequenceOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ReverseSequenceOp::input() {
  return *getODSOperands(0).begin();
}

::mlir::Value ReverseSequenceOp::seq_lengths() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange ReverseSequenceOp::inputMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ReverseSequenceOp::seq_lengthsMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> ReverseSequenceOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range ReverseSequenceOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ReverseSequenceOp::output() {
  return *getODSResults(0).begin();
}

::mlir::IntegerAttr ReverseSequenceOp::seq_dimAttr() {
  return (*this)->getAttr(seq_dimAttrName()).cast<::mlir::IntegerAttr>();
}

uint64_t ReverseSequenceOp::seq_dim() {
  auto attr = seq_dimAttr();
  return attr.getValue().getZExtValue();
}

::mlir::IntegerAttr ReverseSequenceOp::batch_dimAttr() {
  return (*this)->getAttr(batch_dimAttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t ReverseSequenceOp::batch_dim() {
  auto attr = batch_dimAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), 0).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

::mlir::Type ReverseSequenceOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

::mlir::Type ReverseSequenceOp::Tlen() {
  return mlir::getElementTypeOrSelf(*getODSOperands(1).begin());
}

bool ReverseSequenceOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
  if (name == "Tlen") return true;
 return false;
}

::mlir::DictionaryAttr ReverseSequenceOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())},
    {TlenAttrName(),
::mlir::TypeAttr::get(Tlen())}});
}

void ReverseSequenceOp::seq_dimAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(seq_dimAttrName(), attr);
}

void ReverseSequenceOp::batch_dimAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(batch_dimAttrName(), attr);
}

void ReverseSequenceOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input, ::mlir::Value seq_lengths, ::mlir::IntegerAttr seq_dim, ::mlir::IntegerAttr batch_dim) {
  odsState.addOperands(input);
  odsState.addOperands(seq_lengths);
  odsState.addAttribute(seq_dimAttrName(odsState.name), seq_dim);
  odsState.addAttribute(batch_dimAttrName(odsState.name), batch_dim);
  odsState.addTypes(output);
}

void ReverseSequenceOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::Value seq_lengths, ::mlir::IntegerAttr seq_dim, ::mlir::IntegerAttr batch_dim) {
  odsState.addOperands(input);
  odsState.addOperands(seq_lengths);
  odsState.addAttribute(seq_dimAttrName(odsState.name), seq_dim);
  odsState.addAttribute(batch_dimAttrName(odsState.name), batch_dim);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void ReverseSequenceOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input, ::mlir::Value seq_lengths, uint64_t seq_dim, uint64_t batch_dim) {
  odsState.addOperands(input);
  odsState.addOperands(seq_lengths);
  odsState.addAttribute(seq_dimAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), seq_dim));
  odsState.addAttribute(batch_dimAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), batch_dim));
  odsState.addTypes(output);
}

void ReverseSequenceOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::Value seq_lengths, uint64_t seq_dim, uint64_t batch_dim) {
  odsState.addOperands(input);
  odsState.addOperands(seq_lengths);
  odsState.addAttribute(seq_dimAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), seq_dim));
  odsState.addAttribute(batch_dimAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), batch_dim));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void ReverseSequenceOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult ReverseSequenceOp::verify() {
  {
    auto tblgen_seq_dim = (*this)->getAttr(seq_dimAttrName());
    if (!tblgen_seq_dim)
      return emitOpError("requires attribute 'seq_dim'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_seq_dim, "seq_dim")))
      return ::mlir::failure();
  }
  {
    auto tblgen_batch_dim = (*this)->getAttr(batch_dimAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_batch_dim, "batch_dim")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void ReverseSequenceOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::ReverseSequenceOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::ReverseV2Op definitions
//===----------------------------------------------------------------------===//

ReverseV2OpAdaptor::ReverseV2OpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

ReverseV2OpAdaptor::ReverseV2OpAdaptor(ReverseV2Op &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange ReverseV2OpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> ReverseV2OpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange ReverseV2OpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ReverseV2OpAdaptor::tensor() {
  return *getODSOperands(0).begin();
}

::mlir::Value ReverseV2OpAdaptor::axis() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr ReverseV2OpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult ReverseV2OpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> ReverseV2Op::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range ReverseV2Op::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ReverseV2Op::tensor() {
  return *getODSOperands(0).begin();
}

::mlir::Value ReverseV2Op::axis() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange ReverseV2Op::tensorMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ReverseV2Op::axisMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> ReverseV2Op::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range ReverseV2Op::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ReverseV2Op::output() {
  return *getODSResults(0).begin();
}

::mlir::Type ReverseV2Op::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

::mlir::Type ReverseV2Op::Tidx() {
  return mlir::getElementTypeOrSelf(*getODSOperands(1).begin());
}

bool ReverseV2Op::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
  if (name == "Tidx") return true;
 return false;
}

::mlir::DictionaryAttr ReverseV2Op::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())},
    {TidxAttrName(),
::mlir::TypeAttr::get(Tidx())}});
}

void ReverseV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value tensor, ::mlir::Value axis) {
  odsState.addOperands(tensor);
  odsState.addOperands(axis);
  odsState.addTypes(output);
}

void ReverseV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value tensor, ::mlir::Value axis) {
  odsState.addOperands(tensor);
  odsState.addOperands(axis);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void ReverseV2Op::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult ReverseV2Op::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops56(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops56(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void ReverseV2Op::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::ReverseV2Op)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::RightShiftOp definitions
//===----------------------------------------------------------------------===//

RightShiftOpAdaptor::RightShiftOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

RightShiftOpAdaptor::RightShiftOpAdaptor(RightShiftOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange RightShiftOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> RightShiftOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange RightShiftOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value RightShiftOpAdaptor::x() {
  return *getODSOperands(0).begin();
}

::mlir::Value RightShiftOpAdaptor::y() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr RightShiftOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult RightShiftOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> RightShiftOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range RightShiftOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value RightShiftOp::x() {
  return *getODSOperands(0).begin();
}

::mlir::Value RightShiftOp::y() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange RightShiftOp::xMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange RightShiftOp::yMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> RightShiftOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range RightShiftOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value RightShiftOp::z() {
  return *getODSResults(0).begin();
}

::mlir::Type RightShiftOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool RightShiftOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr RightShiftOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void RightShiftOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, Value x, Value y) {
  auto resultType =
      OpTrait::util::getBroadcastedType(x.getType(), y.getType());
  if (!resultType)
    mlir::emitError(odsState.location, "non-broadcastable operands");
  return build(odsBuilder, odsState, resultType, x, y);
}

void RightShiftOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type z, ::mlir::Value x, ::mlir::Value y) {
  odsState.addOperands(x);
  odsState.addOperands(y);
  odsState.addTypes(z);
}

void RightShiftOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value x, ::mlir::Value y) {
  odsState.addOperands(x);
  odsState.addOperands(y);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void RightShiftOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult RightShiftOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops27(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops27(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops27(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void RightShiftOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::RightShiftOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::RintOp definitions
//===----------------------------------------------------------------------===//

RintOpAdaptor::RintOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

RintOpAdaptor::RintOpAdaptor(RintOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange RintOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> RintOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange RintOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value RintOpAdaptor::x() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr RintOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult RintOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> RintOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range RintOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value RintOp::x() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange RintOp::xMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> RintOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range RintOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value RintOp::y() {
  return *getODSResults(0).begin();
}

::mlir::Type RintOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool RintOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr RintOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void RintOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type y, ::mlir::Value x) {
  odsState.addOperands(x);
  odsState.addTypes(y);
}

void RintOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value x) {
  odsState.addOperands(x);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void RintOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

void RintOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value x) {
  odsState.addOperands(x);
  odsState.addTypes({x.getType()});

}

void RintOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  odsState.addTypes({operands[0].getType()});

}

::mlir::LogicalResult RintOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void RintOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::RintOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::RiscAddOp definitions
//===----------------------------------------------------------------------===//

RiscAddOpAdaptor::RiscAddOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

RiscAddOpAdaptor::RiscAddOpAdaptor(RiscAddOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange RiscAddOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> RiscAddOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange RiscAddOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value RiscAddOpAdaptor::x() {
  return *getODSOperands(0).begin();
}

::mlir::Value RiscAddOpAdaptor::y() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr RiscAddOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult RiscAddOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> RiscAddOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range RiscAddOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value RiscAddOp::x() {
  return *getODSOperands(0).begin();
}

::mlir::Value RiscAddOp::y() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange RiscAddOp::xMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange RiscAddOp::yMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> RiscAddOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range RiscAddOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value RiscAddOp::z() {
  return *getODSResults(0).begin();
}

::mlir::Type RiscAddOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool RiscAddOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr RiscAddOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void RiscAddOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type z, ::mlir::Value x, ::mlir::Value y) {
  odsState.addOperands(x);
  odsState.addOperands(y);
  odsState.addTypes(z);
}

void RiscAddOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value x, ::mlir::Value y) {
  odsState.addOperands(x);
  odsState.addOperands(y);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void RiscAddOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult RiscAddOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void RiscAddOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::RiscAddOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::RiscDotOp definitions
//===----------------------------------------------------------------------===//

RiscDotOpAdaptor::RiscDotOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

RiscDotOpAdaptor::RiscDotOpAdaptor(RiscDotOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange RiscDotOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> RiscDotOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange RiscDotOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value RiscDotOpAdaptor::a() {
  return *getODSOperands(0).begin();
}

::mlir::Value RiscDotOpAdaptor::b() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr RiscDotOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::BoolAttr RiscDotOpAdaptor::transpose_a() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("transpose_a").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(false);
  return attr;
}

::mlir::BoolAttr RiscDotOpAdaptor::transpose_b() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("transpose_b").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(false);
  return attr;
}

::mlir::LogicalResult RiscDotOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_transpose_a = odsAttrs.get("transpose_a");
    if (tblgen_transpose_a && !((tblgen_transpose_a.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.RiscDot' op ""attribute 'transpose_a' failed to satisfy constraint: bool attribute");
  }
  {
    auto tblgen_transpose_b = odsAttrs.get("transpose_b");
    if (tblgen_transpose_b && !((tblgen_transpose_b.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.RiscDot' op ""attribute 'transpose_b' failed to satisfy constraint: bool attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> RiscDotOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range RiscDotOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value RiscDotOp::a() {
  return *getODSOperands(0).begin();
}

::mlir::Value RiscDotOp::b() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange RiscDotOp::aMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange RiscDotOp::bMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> RiscDotOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range RiscDotOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value RiscDotOp::product() {
  return *getODSResults(0).begin();
}

::mlir::BoolAttr RiscDotOp::transpose_aAttr() {
  return (*this)->getAttr(transpose_aAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool RiscDotOp::transpose_a() {
  auto attr = transpose_aAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(false).getValue();
  return attr.getValue();
}

::mlir::BoolAttr RiscDotOp::transpose_bAttr() {
  return (*this)->getAttr(transpose_bAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool RiscDotOp::transpose_b() {
  auto attr = transpose_bAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(false).getValue();
  return attr.getValue();
}

::mlir::Type RiscDotOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool RiscDotOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr RiscDotOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void RiscDotOp::transpose_aAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(transpose_aAttrName(), attr);
}

void RiscDotOp::transpose_bAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(transpose_bAttrName(), attr);
}

void RiscDotOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type product, ::mlir::Value a, ::mlir::Value b, ::mlir::BoolAttr transpose_a, ::mlir::BoolAttr transpose_b) {
  odsState.addOperands(a);
  odsState.addOperands(b);
  odsState.addAttribute(transpose_aAttrName(odsState.name), transpose_a);
  odsState.addAttribute(transpose_bAttrName(odsState.name), transpose_b);
  odsState.addTypes(product);
}

void RiscDotOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value a, ::mlir::Value b, ::mlir::BoolAttr transpose_a, ::mlir::BoolAttr transpose_b) {
  odsState.addOperands(a);
  odsState.addOperands(b);
  odsState.addAttribute(transpose_aAttrName(odsState.name), transpose_a);
  odsState.addAttribute(transpose_bAttrName(odsState.name), transpose_b);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void RiscDotOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type product, ::mlir::Value a, ::mlir::Value b, bool transpose_a, bool transpose_b) {
  odsState.addOperands(a);
  odsState.addOperands(b);
  odsState.addAttribute(transpose_aAttrName(odsState.name), odsBuilder.getBoolAttr(transpose_a));
  odsState.addAttribute(transpose_bAttrName(odsState.name), odsBuilder.getBoolAttr(transpose_b));
  odsState.addTypes(product);
}

void RiscDotOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value a, ::mlir::Value b, bool transpose_a, bool transpose_b) {
  odsState.addOperands(a);
  odsState.addOperands(b);
  odsState.addAttribute(transpose_aAttrName(odsState.name), odsBuilder.getBoolAttr(transpose_a));
  odsState.addAttribute(transpose_bAttrName(odsState.name), odsBuilder.getBoolAttr(transpose_b));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void RiscDotOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult RiscDotOp::verify() {
  {
    auto tblgen_transpose_a = (*this)->getAttr(transpose_aAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_transpose_a, "transpose_a")))
      return ::mlir::failure();
  }
  {
    auto tblgen_transpose_b = (*this)->getAttr(transpose_bAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_transpose_b, "transpose_b")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void RiscDotOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::RiscDotOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::RngReadAndSkipOp definitions
//===----------------------------------------------------------------------===//

RngReadAndSkipOpAdaptor::RngReadAndSkipOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

RngReadAndSkipOpAdaptor::RngReadAndSkipOpAdaptor(RngReadAndSkipOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange RngReadAndSkipOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> RngReadAndSkipOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange RngReadAndSkipOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value RngReadAndSkipOpAdaptor::resource() {
  return *getODSOperands(0).begin();
}

::mlir::Value RngReadAndSkipOpAdaptor::alg() {
  return *getODSOperands(1).begin();
}

::mlir::Value RngReadAndSkipOpAdaptor::delta() {
  return *getODSOperands(2).begin();
}

::mlir::DictionaryAttr RngReadAndSkipOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult RngReadAndSkipOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> RngReadAndSkipOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range RngReadAndSkipOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value RngReadAndSkipOp::resource() {
  return *getODSOperands(0).begin();
}

::mlir::Value RngReadAndSkipOp::alg() {
  return *getODSOperands(1).begin();
}

::mlir::Value RngReadAndSkipOp::delta() {
  return *getODSOperands(2).begin();
}

::mlir::MutableOperandRange RngReadAndSkipOp::resourceMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange RngReadAndSkipOp::algMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange RngReadAndSkipOp::deltaMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> RngReadAndSkipOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range RngReadAndSkipOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value RngReadAndSkipOp::value() {
  return *getODSResults(0).begin();
}

void RngReadAndSkipOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type value, ::mlir::Value resource, ::mlir::Value alg, ::mlir::Value delta) {
  odsState.addOperands(resource);
  odsState.addOperands(alg);
  odsState.addOperands(delta);
  odsState.addTypes(value);
}

void RngReadAndSkipOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value resource, ::mlir::Value alg, ::mlir::Value delta) {
  odsState.addOperands(resource);
  odsState.addOperands(alg);
  odsState.addOperands(delta);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void RngReadAndSkipOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 3u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult RngReadAndSkipOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops11(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops57(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops16(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::RngReadAndSkipOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::RollOp definitions
//===----------------------------------------------------------------------===//

RollOpAdaptor::RollOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

RollOpAdaptor::RollOpAdaptor(RollOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange RollOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> RollOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange RollOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value RollOpAdaptor::input() {
  return *getODSOperands(0).begin();
}

::mlir::Value RollOpAdaptor::shift() {
  return *getODSOperands(1).begin();
}

::mlir::Value RollOpAdaptor::axis() {
  return *getODSOperands(2).begin();
}

::mlir::DictionaryAttr RollOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult RollOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> RollOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range RollOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value RollOp::input() {
  return *getODSOperands(0).begin();
}

::mlir::Value RollOp::shift() {
  return *getODSOperands(1).begin();
}

::mlir::Value RollOp::axis() {
  return *getODSOperands(2).begin();
}

::mlir::MutableOperandRange RollOp::inputMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange RollOp::shiftMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange RollOp::axisMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> RollOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range RollOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value RollOp::output() {
  return *getODSResults(0).begin();
}

::mlir::Type RollOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

::mlir::Type RollOp::Taxis() {
  return mlir::getElementTypeOrSelf(*getODSOperands(2).begin());
}

::mlir::Type RollOp::Tshift() {
  return mlir::getElementTypeOrSelf(*getODSOperands(1).begin());
}

bool RollOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
  if (name == "Taxis") return true;
  if (name == "Tshift") return true;
 return false;
}

::mlir::DictionaryAttr RollOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())},
    {TaxisAttrName(),
::mlir::TypeAttr::get(Taxis())},
    {TshiftAttrName(),
::mlir::TypeAttr::get(Tshift())}});
}

void RollOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input, ::mlir::Value shift, ::mlir::Value axis) {
  odsState.addOperands(input);
  odsState.addOperands(shift);
  odsState.addOperands(axis);
  odsState.addTypes(output);
}

void RollOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::Value shift, ::mlir::Value axis) {
  odsState.addOperands(input);
  odsState.addOperands(shift);
  odsState.addOperands(axis);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void RollOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 3u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult RollOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void RollOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::RollOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::RoundOp definitions
//===----------------------------------------------------------------------===//

RoundOpAdaptor::RoundOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

RoundOpAdaptor::RoundOpAdaptor(RoundOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange RoundOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> RoundOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange RoundOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value RoundOpAdaptor::x() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr RoundOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult RoundOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> RoundOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range RoundOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value RoundOp::x() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange RoundOp::xMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> RoundOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range RoundOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value RoundOp::y() {
  return *getODSResults(0).begin();
}

::mlir::Type RoundOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool RoundOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr RoundOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void RoundOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type y, ::mlir::Value x) {
  odsState.addOperands(x);
  odsState.addTypes(y);
}

void RoundOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value x) {
  odsState.addOperands(x);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void RoundOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

void RoundOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value x) {
  odsState.addOperands(x);
  odsState.addTypes({x.getType()});

}

void RoundOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  odsState.addTypes({operands[0].getType()});

}

::mlir::LogicalResult RoundOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops1(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops1(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void RoundOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::RoundOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::RsqrtGradOp definitions
//===----------------------------------------------------------------------===//

RsqrtGradOpAdaptor::RsqrtGradOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

RsqrtGradOpAdaptor::RsqrtGradOpAdaptor(RsqrtGradOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange RsqrtGradOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> RsqrtGradOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange RsqrtGradOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value RsqrtGradOpAdaptor::y() {
  return *getODSOperands(0).begin();
}

::mlir::Value RsqrtGradOpAdaptor::dy() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr RsqrtGradOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult RsqrtGradOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> RsqrtGradOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range RsqrtGradOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value RsqrtGradOp::y() {
  return *getODSOperands(0).begin();
}

::mlir::Value RsqrtGradOp::dy() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange RsqrtGradOp::yMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange RsqrtGradOp::dyMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> RsqrtGradOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range RsqrtGradOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value RsqrtGradOp::z() {
  return *getODSResults(0).begin();
}

::mlir::Type RsqrtGradOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool RsqrtGradOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr RsqrtGradOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void RsqrtGradOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type z, ::mlir::Value y, ::mlir::Value dy) {
  odsState.addOperands(y);
  odsState.addOperands(dy);
  odsState.addTypes(z);
}

void RsqrtGradOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value y, ::mlir::Value dy) {
  odsState.addOperands(y);
  odsState.addOperands(dy);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void RsqrtGradOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult RsqrtGradOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops2(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops2(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops2(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void RsqrtGradOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::RsqrtGradOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::RsqrtOp definitions
//===----------------------------------------------------------------------===//

RsqrtOpAdaptor::RsqrtOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

RsqrtOpAdaptor::RsqrtOpAdaptor(RsqrtOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange RsqrtOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> RsqrtOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange RsqrtOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value RsqrtOpAdaptor::x() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr RsqrtOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult RsqrtOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> RsqrtOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range RsqrtOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value RsqrtOp::x() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange RsqrtOp::xMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> RsqrtOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range RsqrtOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value RsqrtOp::y() {
  return *getODSResults(0).begin();
}

::mlir::Type RsqrtOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool RsqrtOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr RsqrtOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void RsqrtOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type y, ::mlir::Value x) {
  odsState.addOperands(x);
  odsState.addTypes(y);
}

void RsqrtOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value x) {
  odsState.addOperands(x);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void RsqrtOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

void RsqrtOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value x) {
  odsState.addOperands(x);
  odsState.addTypes({x.getType()});

}

void RsqrtOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  odsState.addTypes({operands[0].getType()});

}

::mlir::LogicalResult RsqrtOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops2(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops2(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void RsqrtOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::RsqrtOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::SaveOp definitions
//===----------------------------------------------------------------------===//

SaveOpAdaptor::SaveOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

SaveOpAdaptor::SaveOpAdaptor(SaveOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange SaveOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> SaveOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  bool isVariadic[] = {false, false, true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (odsOperands.size() - 2) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::ValueRange SaveOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SaveOpAdaptor::filename() {
  return *getODSOperands(0).begin();
}

::mlir::Value SaveOpAdaptor::tensor_names() {
  return *getODSOperands(1).begin();
}

::mlir::ValueRange SaveOpAdaptor::data() {
  return getODSOperands(2);
}

::mlir::DictionaryAttr SaveOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult SaveOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> SaveOp::getODSOperandIndexAndLength(unsigned index) {
  bool isVariadic[] = {false, false, true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (getOperation()->getNumOperands() - 2) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::Operation::operand_range SaveOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SaveOp::filename() {
  return *getODSOperands(0).begin();
}

::mlir::Value SaveOp::tensor_names() {
  return *getODSOperands(1).begin();
}

::mlir::Operation::operand_range SaveOp::data() {
  return getODSOperands(2);
}

::mlir::MutableOperandRange SaveOp::filenameMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange SaveOp::tensor_namesMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange SaveOp::dataMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> SaveOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range SaveOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

mlir::OperandElementTypeRange SaveOp::T() {
  auto values = getODSOperands(2);
return {mlir::OperandElementTypeIterator(values.begin()), mlir::OperandElementTypeIterator(values.end())};
}

bool SaveOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr SaveOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
ArrayAttr::get(ctx, 
    [&]() {
      llvm::SmallVector<Attribute, 4> ret;
      for (auto t : T())
        ret.push_back(TypeAttr::get(t));
      return ret;
    }())}});
}

void SaveOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value filename, ::mlir::Value tensor_names, ::mlir::ValueRange data) {
  odsState.addOperands(filename);
  odsState.addOperands(tensor_names);
  odsState.addOperands(data);
}

void SaveOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value filename, ::mlir::Value tensor_names, ::mlir::ValueRange data) {
  odsState.addOperands(filename);
  odsState.addOperands(tensor_names);
  odsState.addOperands(data);
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void SaveOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() >= 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 0u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult SaveOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops19(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops19(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::SaveOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::SaveSlicesOp definitions
//===----------------------------------------------------------------------===//

SaveSlicesOpAdaptor::SaveSlicesOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

SaveSlicesOpAdaptor::SaveSlicesOpAdaptor(SaveSlicesOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange SaveSlicesOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> SaveSlicesOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  bool isVariadic[] = {false, false, false, true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (odsOperands.size() - 3) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::ValueRange SaveSlicesOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SaveSlicesOpAdaptor::filename() {
  return *getODSOperands(0).begin();
}

::mlir::Value SaveSlicesOpAdaptor::tensor_names() {
  return *getODSOperands(1).begin();
}

::mlir::Value SaveSlicesOpAdaptor::shapes_and_slices() {
  return *getODSOperands(2).begin();
}

::mlir::ValueRange SaveSlicesOpAdaptor::data() {
  return getODSOperands(3);
}

::mlir::DictionaryAttr SaveSlicesOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult SaveSlicesOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> SaveSlicesOp::getODSOperandIndexAndLength(unsigned index) {
  bool isVariadic[] = {false, false, false, true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (getOperation()->getNumOperands() - 3) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::Operation::operand_range SaveSlicesOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SaveSlicesOp::filename() {
  return *getODSOperands(0).begin();
}

::mlir::Value SaveSlicesOp::tensor_names() {
  return *getODSOperands(1).begin();
}

::mlir::Value SaveSlicesOp::shapes_and_slices() {
  return *getODSOperands(2).begin();
}

::mlir::Operation::operand_range SaveSlicesOp::data() {
  return getODSOperands(3);
}

::mlir::MutableOperandRange SaveSlicesOp::filenameMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange SaveSlicesOp::tensor_namesMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange SaveSlicesOp::shapes_and_slicesMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange SaveSlicesOp::dataMutable() {
  auto range = getODSOperandIndexAndLength(3);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> SaveSlicesOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range SaveSlicesOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

mlir::OperandElementTypeRange SaveSlicesOp::T() {
  auto values = getODSOperands(3);
return {mlir::OperandElementTypeIterator(values.begin()), mlir::OperandElementTypeIterator(values.end())};
}

bool SaveSlicesOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr SaveSlicesOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
ArrayAttr::get(ctx, 
    [&]() {
      llvm::SmallVector<Attribute, 4> ret;
      for (auto t : T())
        ret.push_back(TypeAttr::get(t));
      return ret;
    }())}});
}

void SaveSlicesOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value filename, ::mlir::Value tensor_names, ::mlir::Value shapes_and_slices, ::mlir::ValueRange data) {
  odsState.addOperands(filename);
  odsState.addOperands(tensor_names);
  odsState.addOperands(shapes_and_slices);
  odsState.addOperands(data);
}

void SaveSlicesOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value filename, ::mlir::Value tensor_names, ::mlir::Value shapes_and_slices, ::mlir::ValueRange data) {
  odsState.addOperands(filename);
  odsState.addOperands(tensor_names);
  odsState.addOperands(shapes_and_slices);
  odsState.addOperands(data);
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void SaveSlicesOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() >= 3u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 0u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult SaveSlicesOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops19(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops19(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops19(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup3 = getODSOperands(3);

    for (auto v : valueGroup3) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::SaveSlicesOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::SaveV2Op definitions
//===----------------------------------------------------------------------===//

SaveV2OpAdaptor::SaveV2OpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

SaveV2OpAdaptor::SaveV2OpAdaptor(SaveV2Op &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange SaveV2OpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> SaveV2OpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  bool isVariadic[] = {false, false, false, true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (odsOperands.size() - 3) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::ValueRange SaveV2OpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SaveV2OpAdaptor::prefix() {
  return *getODSOperands(0).begin();
}

::mlir::Value SaveV2OpAdaptor::tensor_names() {
  return *getODSOperands(1).begin();
}

::mlir::Value SaveV2OpAdaptor::shape_and_slices() {
  return *getODSOperands(2).begin();
}

::mlir::ValueRange SaveV2OpAdaptor::tensors() {
  return getODSOperands(3);
}

::mlir::DictionaryAttr SaveV2OpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult SaveV2OpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> SaveV2Op::getODSOperandIndexAndLength(unsigned index) {
  bool isVariadic[] = {false, false, false, true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (getOperation()->getNumOperands() - 3) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::Operation::operand_range SaveV2Op::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SaveV2Op::prefix() {
  return *getODSOperands(0).begin();
}

::mlir::Value SaveV2Op::tensor_names() {
  return *getODSOperands(1).begin();
}

::mlir::Value SaveV2Op::shape_and_slices() {
  return *getODSOperands(2).begin();
}

::mlir::Operation::operand_range SaveV2Op::tensors() {
  return getODSOperands(3);
}

::mlir::MutableOperandRange SaveV2Op::prefixMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange SaveV2Op::tensor_namesMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange SaveV2Op::shape_and_slicesMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange SaveV2Op::tensorsMutable() {
  auto range = getODSOperandIndexAndLength(3);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> SaveV2Op::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range SaveV2Op::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

mlir::OperandElementTypeRange SaveV2Op::dtypes() {
  auto values = getODSOperands(3);
return {mlir::OperandElementTypeIterator(values.begin()), mlir::OperandElementTypeIterator(values.end())};
}

bool SaveV2Op::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "dtypes") return true;
 return false;
}

::mlir::DictionaryAttr SaveV2Op::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {dtypesAttrName(),
ArrayAttr::get(ctx, 
    [&]() {
      llvm::SmallVector<Attribute, 4> ret;
      for (auto t : dtypes())
        ret.push_back(TypeAttr::get(t));
      return ret;
    }())}});
}

void SaveV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value prefix, ::mlir::Value tensor_names, ::mlir::Value shape_and_slices, ::mlir::ValueRange tensors) {
  odsState.addOperands(prefix);
  odsState.addOperands(tensor_names);
  odsState.addOperands(shape_and_slices);
  odsState.addOperands(tensors);
}

void SaveV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value prefix, ::mlir::Value tensor_names, ::mlir::Value shape_and_slices, ::mlir::ValueRange tensors) {
  odsState.addOperands(prefix);
  odsState.addOperands(tensor_names);
  odsState.addOperands(shape_and_slices);
  odsState.addOperands(tensors);
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void SaveV2Op::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() >= 3u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 0u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult SaveV2Op::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops19(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops19(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops19(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup3 = getODSOperands(3);

    for (auto v : valueGroup3) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::SaveV2Op)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::ScatterNdOp definitions
//===----------------------------------------------------------------------===//

ScatterNdOpAdaptor::ScatterNdOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

ScatterNdOpAdaptor::ScatterNdOpAdaptor(ScatterNdOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange ScatterNdOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> ScatterNdOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange ScatterNdOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ScatterNdOpAdaptor::indices() {
  return *getODSOperands(0).begin();
}

::mlir::Value ScatterNdOpAdaptor::updates() {
  return *getODSOperands(1).begin();
}

::mlir::Value ScatterNdOpAdaptor::shape() {
  return *getODSOperands(2).begin();
}

::mlir::DictionaryAttr ScatterNdOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult ScatterNdOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> ScatterNdOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range ScatterNdOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ScatterNdOp::indices() {
  return *getODSOperands(0).begin();
}

::mlir::Value ScatterNdOp::updates() {
  return *getODSOperands(1).begin();
}

::mlir::Value ScatterNdOp::shape() {
  return *getODSOperands(2).begin();
}

::mlir::MutableOperandRange ScatterNdOp::indicesMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ScatterNdOp::updatesMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ScatterNdOp::shapeMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> ScatterNdOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range ScatterNdOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ScatterNdOp::output() {
  return *getODSResults(0).begin();
}

::mlir::Type ScatterNdOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(1).begin());
}

::mlir::Type ScatterNdOp::Tindices() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool ScatterNdOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
  if (name == "Tindices") return true;
 return false;
}

::mlir::DictionaryAttr ScatterNdOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())},
    {TindicesAttrName(),
::mlir::TypeAttr::get(Tindices())}});
}

void ScatterNdOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value indices, ::mlir::Value updates, ::mlir::Value shape) {
  odsState.addOperands(indices);
  odsState.addOperands(updates);
  odsState.addOperands(shape);
  odsState.addTypes(output);
}

void ScatterNdOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value indices, ::mlir::Value updates, ::mlir::Value shape) {
  odsState.addOperands(indices);
  odsState.addOperands(updates);
  odsState.addOperands(shape);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void ScatterNdOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 3u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult ScatterNdOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void ScatterNdOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::ScatterNdOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::SegmentMaxOp definitions
//===----------------------------------------------------------------------===//

SegmentMaxOpAdaptor::SegmentMaxOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

SegmentMaxOpAdaptor::SegmentMaxOpAdaptor(SegmentMaxOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange SegmentMaxOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> SegmentMaxOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange SegmentMaxOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SegmentMaxOpAdaptor::data() {
  return *getODSOperands(0).begin();
}

::mlir::Value SegmentMaxOpAdaptor::segment_ids() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr SegmentMaxOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult SegmentMaxOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> SegmentMaxOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range SegmentMaxOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SegmentMaxOp::data() {
  return *getODSOperands(0).begin();
}

::mlir::Value SegmentMaxOp::segment_ids() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange SegmentMaxOp::dataMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange SegmentMaxOp::segment_idsMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> SegmentMaxOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range SegmentMaxOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SegmentMaxOp::output() {
  return *getODSResults(0).begin();
}

::mlir::Type SegmentMaxOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

::mlir::Type SegmentMaxOp::Tindices() {
  return mlir::getElementTypeOrSelf(*getODSOperands(1).begin());
}

bool SegmentMaxOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
  if (name == "Tindices") return true;
 return false;
}

::mlir::DictionaryAttr SegmentMaxOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())},
    {TindicesAttrName(),
::mlir::TypeAttr::get(Tindices())}});
}

void SegmentMaxOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value data, ::mlir::Value segment_ids) {
  odsState.addOperands(data);
  odsState.addOperands(segment_ids);
  odsState.addTypes(output);
}

void SegmentMaxOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value data, ::mlir::Value segment_ids) {
  odsState.addOperands(data);
  odsState.addOperands(segment_ids);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void SegmentMaxOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult SegmentMaxOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops35(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops35(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void SegmentMaxOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::SegmentMaxOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::SegmentMeanOp definitions
//===----------------------------------------------------------------------===//

SegmentMeanOpAdaptor::SegmentMeanOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

SegmentMeanOpAdaptor::SegmentMeanOpAdaptor(SegmentMeanOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange SegmentMeanOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> SegmentMeanOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange SegmentMeanOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SegmentMeanOpAdaptor::data() {
  return *getODSOperands(0).begin();
}

::mlir::Value SegmentMeanOpAdaptor::segment_ids() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr SegmentMeanOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult SegmentMeanOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> SegmentMeanOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range SegmentMeanOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SegmentMeanOp::data() {
  return *getODSOperands(0).begin();
}

::mlir::Value SegmentMeanOp::segment_ids() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange SegmentMeanOp::dataMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange SegmentMeanOp::segment_idsMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> SegmentMeanOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range SegmentMeanOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SegmentMeanOp::output() {
  return *getODSResults(0).begin();
}

::mlir::Type SegmentMeanOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

::mlir::Type SegmentMeanOp::Tindices() {
  return mlir::getElementTypeOrSelf(*getODSOperands(1).begin());
}

bool SegmentMeanOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
  if (name == "Tindices") return true;
 return false;
}

::mlir::DictionaryAttr SegmentMeanOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())},
    {TindicesAttrName(),
::mlir::TypeAttr::get(Tindices())}});
}

void SegmentMeanOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value data, ::mlir::Value segment_ids) {
  odsState.addOperands(data);
  odsState.addOperands(segment_ids);
  odsState.addTypes(output);
}

void SegmentMeanOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value data, ::mlir::Value segment_ids) {
  odsState.addOperands(data);
  odsState.addOperands(segment_ids);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void SegmentMeanOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult SegmentMeanOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void SegmentMeanOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::SegmentMeanOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::SegmentMinOp definitions
//===----------------------------------------------------------------------===//

SegmentMinOpAdaptor::SegmentMinOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

SegmentMinOpAdaptor::SegmentMinOpAdaptor(SegmentMinOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange SegmentMinOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> SegmentMinOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange SegmentMinOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SegmentMinOpAdaptor::data() {
  return *getODSOperands(0).begin();
}

::mlir::Value SegmentMinOpAdaptor::segment_ids() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr SegmentMinOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult SegmentMinOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> SegmentMinOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range SegmentMinOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SegmentMinOp::data() {
  return *getODSOperands(0).begin();
}

::mlir::Value SegmentMinOp::segment_ids() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange SegmentMinOp::dataMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange SegmentMinOp::segment_idsMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> SegmentMinOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range SegmentMinOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SegmentMinOp::output() {
  return *getODSResults(0).begin();
}

::mlir::Type SegmentMinOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

::mlir::Type SegmentMinOp::Tindices() {
  return mlir::getElementTypeOrSelf(*getODSOperands(1).begin());
}

bool SegmentMinOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
  if (name == "Tindices") return true;
 return false;
}

::mlir::DictionaryAttr SegmentMinOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())},
    {TindicesAttrName(),
::mlir::TypeAttr::get(Tindices())}});
}

void SegmentMinOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value data, ::mlir::Value segment_ids) {
  odsState.addOperands(data);
  odsState.addOperands(segment_ids);
  odsState.addTypes(output);
}

void SegmentMinOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value data, ::mlir::Value segment_ids) {
  odsState.addOperands(data);
  odsState.addOperands(segment_ids);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void SegmentMinOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult SegmentMinOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops35(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops35(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void SegmentMinOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::SegmentMinOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::SegmentProdOp definitions
//===----------------------------------------------------------------------===//

SegmentProdOpAdaptor::SegmentProdOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

SegmentProdOpAdaptor::SegmentProdOpAdaptor(SegmentProdOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange SegmentProdOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> SegmentProdOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange SegmentProdOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SegmentProdOpAdaptor::data() {
  return *getODSOperands(0).begin();
}

::mlir::Value SegmentProdOpAdaptor::segment_ids() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr SegmentProdOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult SegmentProdOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> SegmentProdOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range SegmentProdOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SegmentProdOp::data() {
  return *getODSOperands(0).begin();
}

::mlir::Value SegmentProdOp::segment_ids() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange SegmentProdOp::dataMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange SegmentProdOp::segment_idsMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> SegmentProdOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range SegmentProdOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SegmentProdOp::output() {
  return *getODSResults(0).begin();
}

::mlir::Type SegmentProdOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

::mlir::Type SegmentProdOp::Tindices() {
  return mlir::getElementTypeOrSelf(*getODSOperands(1).begin());
}

bool SegmentProdOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
  if (name == "Tindices") return true;
 return false;
}

::mlir::DictionaryAttr SegmentProdOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())},
    {TindicesAttrName(),
::mlir::TypeAttr::get(Tindices())}});
}

void SegmentProdOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value data, ::mlir::Value segment_ids) {
  odsState.addOperands(data);
  odsState.addOperands(segment_ids);
  odsState.addTypes(output);
}

void SegmentProdOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value data, ::mlir::Value segment_ids) {
  odsState.addOperands(data);
  odsState.addOperands(segment_ids);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void SegmentProdOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult SegmentProdOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void SegmentProdOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::SegmentProdOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::SegmentSumOp definitions
//===----------------------------------------------------------------------===//

SegmentSumOpAdaptor::SegmentSumOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

SegmentSumOpAdaptor::SegmentSumOpAdaptor(SegmentSumOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange SegmentSumOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> SegmentSumOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange SegmentSumOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SegmentSumOpAdaptor::data() {
  return *getODSOperands(0).begin();
}

::mlir::Value SegmentSumOpAdaptor::segment_ids() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr SegmentSumOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult SegmentSumOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> SegmentSumOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range SegmentSumOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SegmentSumOp::data() {
  return *getODSOperands(0).begin();
}

::mlir::Value SegmentSumOp::segment_ids() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange SegmentSumOp::dataMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange SegmentSumOp::segment_idsMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> SegmentSumOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range SegmentSumOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SegmentSumOp::output() {
  return *getODSResults(0).begin();
}

::mlir::Type SegmentSumOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

::mlir::Type SegmentSumOp::Tindices() {
  return mlir::getElementTypeOrSelf(*getODSOperands(1).begin());
}

bool SegmentSumOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
  if (name == "Tindices") return true;
 return false;
}

::mlir::DictionaryAttr SegmentSumOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())},
    {TindicesAttrName(),
::mlir::TypeAttr::get(Tindices())}});
}

void SegmentSumOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value data, ::mlir::Value segment_ids) {
  odsState.addOperands(data);
  odsState.addOperands(segment_ids);
  odsState.addTypes(output);
}

void SegmentSumOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value data, ::mlir::Value segment_ids) {
  odsState.addOperands(data);
  odsState.addOperands(segment_ids);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void SegmentSumOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult SegmentSumOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void SegmentSumOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::SegmentSumOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::SelectOp definitions
//===----------------------------------------------------------------------===//

SelectOpAdaptor::SelectOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

SelectOpAdaptor::SelectOpAdaptor(SelectOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange SelectOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> SelectOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange SelectOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SelectOpAdaptor::condition() {
  return *getODSOperands(0).begin();
}

::mlir::Value SelectOpAdaptor::t() {
  return *getODSOperands(1).begin();
}

::mlir::Value SelectOpAdaptor::e() {
  return *getODSOperands(2).begin();
}

::mlir::DictionaryAttr SelectOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult SelectOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> SelectOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range SelectOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SelectOp::condition() {
  return *getODSOperands(0).begin();
}

::mlir::Value SelectOp::t() {
  return *getODSOperands(1).begin();
}

::mlir::Value SelectOp::e() {
  return *getODSOperands(2).begin();
}

::mlir::MutableOperandRange SelectOp::conditionMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange SelectOp::tMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange SelectOp::eMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> SelectOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range SelectOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SelectOp::output() {
  return *getODSResults(0).begin();
}

::mlir::Type SelectOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(1).begin());
}

bool SelectOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr SelectOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void SelectOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value condition, ::mlir::Value t, ::mlir::Value e) {
  odsState.addOperands(condition);
  odsState.addOperands(t);
  odsState.addOperands(e);
  odsState.addTypes(output);
}

void SelectOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value condition, ::mlir::Value t, ::mlir::Value e) {
  odsState.addOperands(condition);
  odsState.addOperands(t);
  odsState.addOperands(e);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void SelectOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 3u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult SelectOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops8(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return Verify(*this);
}

void SelectOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::SelectOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::SelectV2Op definitions
//===----------------------------------------------------------------------===//

SelectV2OpAdaptor::SelectV2OpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

SelectV2OpAdaptor::SelectV2OpAdaptor(SelectV2Op &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange SelectV2OpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> SelectV2OpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange SelectV2OpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SelectV2OpAdaptor::condition() {
  return *getODSOperands(0).begin();
}

::mlir::Value SelectV2OpAdaptor::t() {
  return *getODSOperands(1).begin();
}

::mlir::Value SelectV2OpAdaptor::e() {
  return *getODSOperands(2).begin();
}

::mlir::DictionaryAttr SelectV2OpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult SelectV2OpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> SelectV2Op::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range SelectV2Op::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SelectV2Op::condition() {
  return *getODSOperands(0).begin();
}

::mlir::Value SelectV2Op::t() {
  return *getODSOperands(1).begin();
}

::mlir::Value SelectV2Op::e() {
  return *getODSOperands(2).begin();
}

::mlir::MutableOperandRange SelectV2Op::conditionMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange SelectV2Op::tMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange SelectV2Op::eMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> SelectV2Op::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range SelectV2Op::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SelectV2Op::output() {
  return *getODSResults(0).begin();
}

::mlir::Type SelectV2Op::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(1).begin());
}

bool SelectV2Op::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr SelectV2Op::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void SelectV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value condition, ::mlir::Value t, ::mlir::Value e) {
  odsState.addOperands(condition);
  odsState.addOperands(t);
  odsState.addOperands(e);
  odsState.addTypes(output);
}

void SelectV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value condition, ::mlir::Value t, ::mlir::Value e) {
  odsState.addOperands(condition);
  odsState.addOperands(t);
  odsState.addOperands(e);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void SelectV2Op::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 3u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult SelectV2Op::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops8(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void SelectV2Op::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::SelectV2Op)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::SelfAdjointEigV2Op definitions
//===----------------------------------------------------------------------===//

SelfAdjointEigV2OpAdaptor::SelfAdjointEigV2OpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

SelfAdjointEigV2OpAdaptor::SelfAdjointEigV2OpAdaptor(SelfAdjointEigV2Op &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange SelfAdjointEigV2OpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> SelfAdjointEigV2OpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange SelfAdjointEigV2OpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SelfAdjointEigV2OpAdaptor::input() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr SelfAdjointEigV2OpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::BoolAttr SelfAdjointEigV2OpAdaptor::compute_v() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("compute_v").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(true);
  return attr;
}

::mlir::LogicalResult SelfAdjointEigV2OpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_compute_v = odsAttrs.get("compute_v");
    if (tblgen_compute_v && !((tblgen_compute_v.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.SelfAdjointEigV2' op ""attribute 'compute_v' failed to satisfy constraint: bool attribute");
  }
  return ::mlir::success();
}

void SelfAdjointEigV2Op::getAsmResultNames(::mlir::OpAsmSetValueNameFn setNameFn) {
  auto resultGroup0 = getODSResults(0);
  if (!llvm::empty(resultGroup0))
    setNameFn(*resultGroup0.begin(), "e");
  auto resultGroup1 = getODSResults(1);
  if (!llvm::empty(resultGroup1))
    setNameFn(*resultGroup1.begin(), "v");
}

std::pair<unsigned, unsigned> SelfAdjointEigV2Op::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range SelfAdjointEigV2Op::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SelfAdjointEigV2Op::input() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange SelfAdjointEigV2Op::inputMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> SelfAdjointEigV2Op::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range SelfAdjointEigV2Op::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SelfAdjointEigV2Op::e() {
  return *getODSResults(0).begin();
}

::mlir::Value SelfAdjointEigV2Op::v() {
  return *getODSResults(1).begin();
}

::mlir::BoolAttr SelfAdjointEigV2Op::compute_vAttr() {
  return (*this)->getAttr(compute_vAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool SelfAdjointEigV2Op::compute_v() {
  auto attr = compute_vAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(true).getValue();
  return attr.getValue();
}

::mlir::Type SelfAdjointEigV2Op::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool SelfAdjointEigV2Op::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr SelfAdjointEigV2Op::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void SelfAdjointEigV2Op::compute_vAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(compute_vAttrName(), attr);
}

void SelfAdjointEigV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type e, ::mlir::Type v, ::mlir::Value input, ::mlir::BoolAttr compute_v) {
  odsState.addOperands(input);
  odsState.addAttribute(compute_vAttrName(odsState.name), compute_v);
  odsState.addTypes(e);
  odsState.addTypes(v);
}

void SelfAdjointEigV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::BoolAttr compute_v) {
  odsState.addOperands(input);
  odsState.addAttribute(compute_vAttrName(odsState.name), compute_v);
  assert(resultTypes.size() == 2u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void SelfAdjointEigV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type e, ::mlir::Type v, ::mlir::Value input, bool compute_v) {
  odsState.addOperands(input);
  odsState.addAttribute(compute_vAttrName(odsState.name), odsBuilder.getBoolAttr(compute_v));
  odsState.addTypes(e);
  odsState.addTypes(v);
}

void SelfAdjointEigV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, bool compute_v) {
  odsState.addOperands(input);
  odsState.addAttribute(compute_vAttrName(odsState.name), odsBuilder.getBoolAttr(compute_v));
  assert(resultTypes.size() == 2u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void SelfAdjointEigV2Op::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 2u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult SelfAdjointEigV2Op::verify() {
  {
    auto tblgen_compute_v = (*this)->getAttr(compute_vAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_compute_v, "compute_v")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops29(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops29(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSResults(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops29(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void SelfAdjointEigV2Op::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::SelfAdjointEigV2Op)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::SeluGradOp definitions
//===----------------------------------------------------------------------===//

SeluGradOpAdaptor::SeluGradOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

SeluGradOpAdaptor::SeluGradOpAdaptor(SeluGradOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange SeluGradOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> SeluGradOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange SeluGradOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SeluGradOpAdaptor::gradients() {
  return *getODSOperands(0).begin();
}

::mlir::Value SeluGradOpAdaptor::outputs() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr SeluGradOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult SeluGradOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> SeluGradOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range SeluGradOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SeluGradOp::gradients() {
  return *getODSOperands(0).begin();
}

::mlir::Value SeluGradOp::outputs() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange SeluGradOp::gradientsMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange SeluGradOp::outputsMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> SeluGradOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range SeluGradOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SeluGradOp::backprops() {
  return *getODSResults(0).begin();
}

::mlir::Type SeluGradOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool SeluGradOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr SeluGradOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void SeluGradOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type backprops, ::mlir::Value gradients, ::mlir::Value outputs) {
  odsState.addOperands(gradients);
  odsState.addOperands(outputs);
  odsState.addTypes(backprops);
}

void SeluGradOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value gradients, ::mlir::Value outputs) {
  odsState.addOperands(gradients);
  odsState.addOperands(outputs);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void SeluGradOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult SeluGradOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void SeluGradOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::SeluGradOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::SeluOp definitions
//===----------------------------------------------------------------------===//

SeluOpAdaptor::SeluOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

SeluOpAdaptor::SeluOpAdaptor(SeluOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange SeluOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> SeluOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange SeluOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SeluOpAdaptor::features() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr SeluOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult SeluOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> SeluOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range SeluOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SeluOp::features() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange SeluOp::featuresMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> SeluOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range SeluOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SeluOp::activations() {
  return *getODSResults(0).begin();
}

::mlir::Type SeluOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool SeluOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr SeluOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void SeluOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type activations, ::mlir::Value features) {
  odsState.addOperands(features);
  odsState.addTypes(activations);
}

void SeluOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value features) {
  odsState.addOperands(features);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void SeluOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult SeluOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void SeluOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::SeluOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::SendOp definitions
//===----------------------------------------------------------------------===//

SendOpAdaptor::SendOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

SendOpAdaptor::SendOpAdaptor(SendOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange SendOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> SendOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange SendOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SendOpAdaptor::tensor() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr SendOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::StringAttr SendOpAdaptor::tensor_name() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("tensor_name").cast<::mlir::StringAttr>();
  return attr;
}

::mlir::StringAttr SendOpAdaptor::send_device() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("send_device").cast<::mlir::StringAttr>();
  return attr;
}

::mlir::IntegerAttr SendOpAdaptor::send_device_incarnation() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("send_device_incarnation").cast<::mlir::IntegerAttr>();
  return attr;
}

::mlir::StringAttr SendOpAdaptor::recv_device() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("recv_device").cast<::mlir::StringAttr>();
  return attr;
}

::mlir::BoolAttr SendOpAdaptor::client_terminated() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("client_terminated").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(false);
  return attr;
}

::mlir::LogicalResult SendOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_tensor_name = odsAttrs.get("tensor_name");
    if (!tblgen_tensor_name)
      return emitError(loc, "'tf.Send' op ""requires attribute 'tensor_name'");

    if (tblgen_tensor_name && !((tblgen_tensor_name.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.Send' op ""attribute 'tensor_name' failed to satisfy constraint: string attribute");
  }
  {
    auto tblgen_send_device = odsAttrs.get("send_device");
    if (!tblgen_send_device)
      return emitError(loc, "'tf.Send' op ""requires attribute 'send_device'");

    if (tblgen_send_device && !((tblgen_send_device.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.Send' op ""attribute 'send_device' failed to satisfy constraint: string attribute");
  }
  {
    auto tblgen_send_device_incarnation = odsAttrs.get("send_device_incarnation");
    if (!tblgen_send_device_incarnation)
      return emitError(loc, "'tf.Send' op ""requires attribute 'send_device_incarnation'");

    if (tblgen_send_device_incarnation && !(((tblgen_send_device_incarnation.isa<::mlir::IntegerAttr>())) && ((tblgen_send_device_incarnation.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.Send' op ""attribute 'send_device_incarnation' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_recv_device = odsAttrs.get("recv_device");
    if (!tblgen_recv_device)
      return emitError(loc, "'tf.Send' op ""requires attribute 'recv_device'");

    if (tblgen_recv_device && !((tblgen_recv_device.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.Send' op ""attribute 'recv_device' failed to satisfy constraint: string attribute");
  }
  {
    auto tblgen_client_terminated = odsAttrs.get("client_terminated");
    if (tblgen_client_terminated && !((tblgen_client_terminated.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.Send' op ""attribute 'client_terminated' failed to satisfy constraint: bool attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> SendOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range SendOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SendOp::tensor() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange SendOp::tensorMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> SendOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range SendOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::StringAttr SendOp::tensor_nameAttr() {
  return (*this)->getAttr(tensor_nameAttrName()).cast<::mlir::StringAttr>();
}

::llvm::StringRef SendOp::tensor_name() {
  auto attr = tensor_nameAttr();
  return attr.getValue();
}

::mlir::StringAttr SendOp::send_deviceAttr() {
  return (*this)->getAttr(send_deviceAttrName()).cast<::mlir::StringAttr>();
}

::llvm::StringRef SendOp::send_device() {
  auto attr = send_deviceAttr();
  return attr.getValue();
}

::mlir::IntegerAttr SendOp::send_device_incarnationAttr() {
  return (*this)->getAttr(send_device_incarnationAttrName()).cast<::mlir::IntegerAttr>();
}

uint64_t SendOp::send_device_incarnation() {
  auto attr = send_device_incarnationAttr();
  return attr.getValue().getZExtValue();
}

::mlir::StringAttr SendOp::recv_deviceAttr() {
  return (*this)->getAttr(recv_deviceAttrName()).cast<::mlir::StringAttr>();
}

::llvm::StringRef SendOp::recv_device() {
  auto attr = recv_deviceAttr();
  return attr.getValue();
}

::mlir::BoolAttr SendOp::client_terminatedAttr() {
  return (*this)->getAttr(client_terminatedAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool SendOp::client_terminated() {
  auto attr = client_terminatedAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(false).getValue();
  return attr.getValue();
}

::mlir::Type SendOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool SendOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr SendOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void SendOp::tensor_nameAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(tensor_nameAttrName(), attr);
}

void SendOp::send_deviceAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(send_deviceAttrName(), attr);
}

void SendOp::send_device_incarnationAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(send_device_incarnationAttrName(), attr);
}

void SendOp::recv_deviceAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(recv_deviceAttrName(), attr);
}

void SendOp::client_terminatedAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(client_terminatedAttrName(), attr);
}

void SendOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value tensor, ::mlir::StringAttr tensor_name, ::mlir::StringAttr send_device, ::mlir::IntegerAttr send_device_incarnation, ::mlir::StringAttr recv_device, ::mlir::BoolAttr client_terminated) {
  odsState.addOperands(tensor);
  odsState.addAttribute(tensor_nameAttrName(odsState.name), tensor_name);
  odsState.addAttribute(send_deviceAttrName(odsState.name), send_device);
  odsState.addAttribute(send_device_incarnationAttrName(odsState.name), send_device_incarnation);
  odsState.addAttribute(recv_deviceAttrName(odsState.name), recv_device);
  odsState.addAttribute(client_terminatedAttrName(odsState.name), client_terminated);
}

void SendOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value tensor, ::mlir::StringAttr tensor_name, ::mlir::StringAttr send_device, ::mlir::IntegerAttr send_device_incarnation, ::mlir::StringAttr recv_device, ::mlir::BoolAttr client_terminated) {
  odsState.addOperands(tensor);
  odsState.addAttribute(tensor_nameAttrName(odsState.name), tensor_name);
  odsState.addAttribute(send_deviceAttrName(odsState.name), send_device);
  odsState.addAttribute(send_device_incarnationAttrName(odsState.name), send_device_incarnation);
  odsState.addAttribute(recv_deviceAttrName(odsState.name), recv_device);
  odsState.addAttribute(client_terminatedAttrName(odsState.name), client_terminated);
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void SendOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value tensor, ::llvm::StringRef tensor_name, ::llvm::StringRef send_device, uint64_t send_device_incarnation, ::llvm::StringRef recv_device, bool client_terminated) {
  odsState.addOperands(tensor);
  odsState.addAttribute(tensor_nameAttrName(odsState.name), odsBuilder.getStringAttr(tensor_name));
  odsState.addAttribute(send_deviceAttrName(odsState.name), odsBuilder.getStringAttr(send_device));
  odsState.addAttribute(send_device_incarnationAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), send_device_incarnation));
  odsState.addAttribute(recv_deviceAttrName(odsState.name), odsBuilder.getStringAttr(recv_device));
  odsState.addAttribute(client_terminatedAttrName(odsState.name), odsBuilder.getBoolAttr(client_terminated));
}

void SendOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value tensor, ::llvm::StringRef tensor_name, ::llvm::StringRef send_device, uint64_t send_device_incarnation, ::llvm::StringRef recv_device, bool client_terminated) {
  odsState.addOperands(tensor);
  odsState.addAttribute(tensor_nameAttrName(odsState.name), odsBuilder.getStringAttr(tensor_name));
  odsState.addAttribute(send_deviceAttrName(odsState.name), odsBuilder.getStringAttr(send_device));
  odsState.addAttribute(send_device_incarnationAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), send_device_incarnation));
  odsState.addAttribute(recv_deviceAttrName(odsState.name), odsBuilder.getStringAttr(recv_device));
  odsState.addAttribute(client_terminatedAttrName(odsState.name), odsBuilder.getBoolAttr(client_terminated));
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void SendOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 0u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult SendOp::verify() {
  {
    auto tblgen_tensor_name = (*this)->getAttr(tensor_nameAttrName());
    if (!tblgen_tensor_name)
      return emitOpError("requires attribute 'tensor_name'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_tensor_name, "tensor_name")))
      return ::mlir::failure();
  }
  {
    auto tblgen_send_device = (*this)->getAttr(send_deviceAttrName());
    if (!tblgen_send_device)
      return emitOpError("requires attribute 'send_device'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_send_device, "send_device")))
      return ::mlir::failure();
  }
  {
    auto tblgen_send_device_incarnation = (*this)->getAttr(send_device_incarnationAttrName());
    if (!tblgen_send_device_incarnation)
      return emitOpError("requires attribute 'send_device_incarnation'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_send_device_incarnation, "send_device_incarnation")))
      return ::mlir::failure();
  }
  {
    auto tblgen_recv_device = (*this)->getAttr(recv_deviceAttrName());
    if (!tblgen_recv_device)
      return emitOpError("requires attribute 'recv_device'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_recv_device, "recv_device")))
      return ::mlir::failure();
  }
  {
    auto tblgen_client_terminated = (*this)->getAttr(client_terminatedAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_client_terminated, "client_terminated")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::SendOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::SendTPUEmbeddingGradientsOp definitions
//===----------------------------------------------------------------------===//

SendTPUEmbeddingGradientsOpAdaptor::SendTPUEmbeddingGradientsOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

SendTPUEmbeddingGradientsOpAdaptor::SendTPUEmbeddingGradientsOpAdaptor(SendTPUEmbeddingGradientsOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange SendTPUEmbeddingGradientsOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> SendTPUEmbeddingGradientsOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  assert(odsAttrs && "missing segment size attribute for op");
  auto sizeAttr = odsAttrs.get("operand_segment_sizes").cast<::mlir::DenseIntElementsAttr>();

  const uint32_t *sizeAttrValueIt = &*sizeAttr.value_begin<uint32_t>();
  if (sizeAttr.isSplat())
    return {*sizeAttrValueIt * index, *sizeAttrValueIt};

  unsigned start = 0;
  for (unsigned i = 0; i < index; ++i)
    start += sizeAttrValueIt[i];
  return {start, sizeAttrValueIt[index]};
}

::mlir::ValueRange SendTPUEmbeddingGradientsOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::ValueRange SendTPUEmbeddingGradientsOpAdaptor::inputs() {
  return getODSOperands(0);
}

::mlir::ValueRange SendTPUEmbeddingGradientsOpAdaptor::learning_rates() {
  return getODSOperands(1);
}

::mlir::DictionaryAttr SendTPUEmbeddingGradientsOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::StringAttr SendTPUEmbeddingGradientsOpAdaptor::config() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("config").cast<::mlir::StringAttr>();
  return attr;
}

::mlir::LogicalResult SendTPUEmbeddingGradientsOpAdaptor::verify(::mlir::Location loc) {
  {
    auto sizeAttr = odsAttrs.get("operand_segment_sizes").dyn_cast<::mlir::DenseIntElementsAttr>();
    if (!sizeAttr)
      return emitError(loc, "'tf.SendTPUEmbeddingGradients' op ""missing segment sizes attribute 'operand_segment_sizes'");
    auto numElements =
        sizeAttr.getType().cast<::mlir::ShapedType>().getNumElements();
    if (numElements != 2)
      return emitError(loc, "'tf.SendTPUEmbeddingGradients' op ""'operand_segment_sizes' attribute for specifying operand segments must have 2 "
                "elements, but got ") << numElements;
  }
    {
    auto tblgen_config = odsAttrs.get("config");
    if (!tblgen_config)
      return emitError(loc, "'tf.SendTPUEmbeddingGradients' op ""requires attribute 'config'");

    if (tblgen_config && !((tblgen_config.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.SendTPUEmbeddingGradients' op ""attribute 'config' failed to satisfy constraint: string attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> SendTPUEmbeddingGradientsOp::getODSOperandIndexAndLength(unsigned index) {
  auto sizeAttr =
      (*this)->getAttr(operand_segment_sizesAttrName()).cast<::mlir::DenseIntElementsAttr>();

  const uint32_t *sizeAttrValueIt = &*sizeAttr.value_begin<uint32_t>();
  if (sizeAttr.isSplat())
    return {*sizeAttrValueIt * index, *sizeAttrValueIt};

  unsigned start = 0;
  for (unsigned i = 0; i < index; ++i)
    start += sizeAttrValueIt[i];
  return {start, sizeAttrValueIt[index]};
}

::mlir::Operation::operand_range SendTPUEmbeddingGradientsOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Operation::operand_range SendTPUEmbeddingGradientsOp::inputs() {
  return getODSOperands(0);
}

::mlir::Operation::operand_range SendTPUEmbeddingGradientsOp::learning_rates() {
  return getODSOperands(1);
}

::mlir::MutableOperandRange SendTPUEmbeddingGradientsOp::inputsMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second, ::mlir::MutableOperandRange::OperandSegment(0u, *getOperation()->getAttrDictionary().getNamed(operand_segment_sizesAttrName())));
  return mutableRange;
}

::mlir::MutableOperandRange SendTPUEmbeddingGradientsOp::learning_ratesMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second, ::mlir::MutableOperandRange::OperandSegment(1u, *getOperation()->getAttrDictionary().getNamed(operand_segment_sizesAttrName())));
  return mutableRange;
}

std::pair<unsigned, unsigned> SendTPUEmbeddingGradientsOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range SendTPUEmbeddingGradientsOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::StringAttr SendTPUEmbeddingGradientsOp::configAttr() {
  return (*this)->getAttr(configAttrName()).cast<::mlir::StringAttr>();
}

::llvm::StringRef SendTPUEmbeddingGradientsOp::config() {
  auto attr = configAttr();
  return attr.getValue();
}

size_t SendTPUEmbeddingGradientsOp::N() {
  auto range = getODSOperands(0);
return std::distance(range.begin(), range.end());
}

size_t SendTPUEmbeddingGradientsOp::NN() {
  auto range = getODSOperands(1);
return std::distance(range.begin(), range.end());
}

bool SendTPUEmbeddingGradientsOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "N") return true;
  if (name == "NN") return true;
 return false;
}

::mlir::DictionaryAttr SendTPUEmbeddingGradientsOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {NAttrName(),
odsBuilder.getI64IntegerAttr(N())},
    {NNAttrName(),
odsBuilder.getI64IntegerAttr(NN())}});
}

void SendTPUEmbeddingGradientsOp::configAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(configAttrName(), attr);
}

void SendTPUEmbeddingGradientsOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange inputs, ::mlir::ValueRange learning_rates, ::mlir::StringAttr config) {
  odsState.addOperands(inputs);
  odsState.addOperands(learning_rates);
  odsState.addAttribute(operand_segment_sizesAttrName(odsState.name), odsBuilder.getI32VectorAttr({static_cast<int32_t>(inputs.size()), static_cast<int32_t>(learning_rates.size())}));
  odsState.addAttribute(configAttrName(odsState.name), config);
}

void SendTPUEmbeddingGradientsOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange inputs, ::mlir::ValueRange learning_rates, ::mlir::StringAttr config) {
  odsState.addOperands(inputs);
  odsState.addOperands(learning_rates);
  odsState.addAttribute(operand_segment_sizesAttrName(odsState.name), odsBuilder.getI32VectorAttr({static_cast<int32_t>(inputs.size()), static_cast<int32_t>(learning_rates.size())}));
  odsState.addAttribute(configAttrName(odsState.name), config);
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void SendTPUEmbeddingGradientsOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange inputs, ::mlir::ValueRange learning_rates, ::llvm::StringRef config) {
  odsState.addOperands(inputs);
  odsState.addOperands(learning_rates);
  odsState.addAttribute(operand_segment_sizesAttrName(odsState.name), odsBuilder.getI32VectorAttr({static_cast<int32_t>(inputs.size()), static_cast<int32_t>(learning_rates.size())}));
  odsState.addAttribute(configAttrName(odsState.name), odsBuilder.getStringAttr(config));
}

void SendTPUEmbeddingGradientsOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange inputs, ::mlir::ValueRange learning_rates, ::llvm::StringRef config) {
  odsState.addOperands(inputs);
  odsState.addOperands(learning_rates);
  odsState.addAttribute(operand_segment_sizesAttrName(odsState.name), odsBuilder.getI32VectorAttr({static_cast<int32_t>(inputs.size()), static_cast<int32_t>(learning_rates.size())}));
  odsState.addAttribute(configAttrName(odsState.name), odsBuilder.getStringAttr(config));
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void SendTPUEmbeddingGradientsOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 0u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult SendTPUEmbeddingGradientsOp::verify() {
  {
    auto sizeAttr = (*this)->getAttr(operand_segment_sizesAttrName()).dyn_cast<::mlir::DenseIntElementsAttr>();
    if (!sizeAttr)
      return emitOpError("missing segment sizes attribute 'operand_segment_sizes'");
    auto numElements =
        sizeAttr.getType().cast<::mlir::ShapedType>().getNumElements();
    if (numElements != 2)
      return emitOpError("'operand_segment_sizes' attribute for specifying operand segments must have 2 "
                "elements, but got ") << numElements;
  }
    {
    auto tblgen_config = (*this)->getAttr(configAttrName());
    if (!tblgen_config)
      return emitOpError("requires attribute 'config'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_config, "config")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void SendTPUEmbeddingGradientsOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  effects.emplace_back(::mlir::MemoryEffects::Write::get(), ::mlir::TF::ResourceEffects::MustExecute::get());
  effects.emplace_back(::mlir::MemoryEffects::Read::get(), ::mlir::TF::ResourceEffects::TPUEmbedding::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::SendTPUEmbeddingGradientsOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::SerializeIteratorOp definitions
//===----------------------------------------------------------------------===//

SerializeIteratorOpAdaptor::SerializeIteratorOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

SerializeIteratorOpAdaptor::SerializeIteratorOpAdaptor(SerializeIteratorOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange SerializeIteratorOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> SerializeIteratorOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange SerializeIteratorOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SerializeIteratorOpAdaptor::resource_handle() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr SerializeIteratorOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::IntegerAttr SerializeIteratorOpAdaptor::external_state_policy() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("external_state_policy").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), 0);
  return attr;
}

::mlir::LogicalResult SerializeIteratorOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_external_state_policy = odsAttrs.get("external_state_policy");
    if (tblgen_external_state_policy && !(((tblgen_external_state_policy.isa<::mlir::IntegerAttr>())) && ((tblgen_external_state_policy.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.SerializeIterator' op ""attribute 'external_state_policy' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> SerializeIteratorOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range SerializeIteratorOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SerializeIteratorOp::resource_handle() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange SerializeIteratorOp::resource_handleMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> SerializeIteratorOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range SerializeIteratorOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SerializeIteratorOp::serialized() {
  return *getODSResults(0).begin();
}

::mlir::IntegerAttr SerializeIteratorOp::external_state_policyAttr() {
  return (*this)->getAttr(external_state_policyAttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t SerializeIteratorOp::external_state_policy() {
  auto attr = external_state_policyAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), 0).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

void SerializeIteratorOp::external_state_policyAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(external_state_policyAttrName(), attr);
}

void SerializeIteratorOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type serialized, ::mlir::Value resource_handle, ::mlir::IntegerAttr external_state_policy) {
  odsState.addOperands(resource_handle);
  odsState.addAttribute(external_state_policyAttrName(odsState.name), external_state_policy);
  odsState.addTypes(serialized);
}

void SerializeIteratorOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value resource_handle, ::mlir::IntegerAttr external_state_policy) {
  odsState.addOperands(resource_handle);
  odsState.addAttribute(external_state_policyAttrName(odsState.name), external_state_policy);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void SerializeIteratorOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type serialized, ::mlir::Value resource_handle, uint64_t external_state_policy) {
  odsState.addOperands(resource_handle);
  odsState.addAttribute(external_state_policyAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), external_state_policy));
  odsState.addTypes(serialized);
}

void SerializeIteratorOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value resource_handle, uint64_t external_state_policy) {
  odsState.addOperands(resource_handle);
  odsState.addAttribute(external_state_policyAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), external_state_policy));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void SerializeIteratorOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult SerializeIteratorOp::verify() {
  {
    auto tblgen_external_state_policy = (*this)->getAttr(external_state_policyAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_external_state_policy, "external_state_policy")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops15(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void SerializeIteratorOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  for (::mlir::Value value : getODSOperands(0))
    effects.emplace_back(::mlir::MemoryEffects::Read::get(), value, ::mlir::TF::ResourceEffects::DatasetIterator::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::SerializeIteratorOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::SerializeSparseOp definitions
//===----------------------------------------------------------------------===//

SerializeSparseOpAdaptor::SerializeSparseOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

SerializeSparseOpAdaptor::SerializeSparseOpAdaptor(SerializeSparseOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange SerializeSparseOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> SerializeSparseOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange SerializeSparseOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SerializeSparseOpAdaptor::sparse_indices() {
  return *getODSOperands(0).begin();
}

::mlir::Value SerializeSparseOpAdaptor::sparse_values() {
  return *getODSOperands(1).begin();
}

::mlir::Value SerializeSparseOpAdaptor::sparse_shape() {
  return *getODSOperands(2).begin();
}

::mlir::DictionaryAttr SerializeSparseOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult SerializeSparseOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> SerializeSparseOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range SerializeSparseOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SerializeSparseOp::sparse_indices() {
  return *getODSOperands(0).begin();
}

::mlir::Value SerializeSparseOp::sparse_values() {
  return *getODSOperands(1).begin();
}

::mlir::Value SerializeSparseOp::sparse_shape() {
  return *getODSOperands(2).begin();
}

::mlir::MutableOperandRange SerializeSparseOp::sparse_indicesMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange SerializeSparseOp::sparse_valuesMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange SerializeSparseOp::sparse_shapeMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> SerializeSparseOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range SerializeSparseOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SerializeSparseOp::serialized_sparse() {
  return *getODSResults(0).begin();
}

::mlir::Type SerializeSparseOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(1).begin());
}

::mlir::Type SerializeSparseOp::out_type() {
  return mlir::getElementTypeOrSelf(*getODSResults(0).begin());
}

bool SerializeSparseOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
  if (name == "out_type") return true;
 return false;
}

::mlir::DictionaryAttr SerializeSparseOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())},
    {out_typeAttrName(),
::mlir::TypeAttr::get(out_type())}});
}

void SerializeSparseOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type serialized_sparse, ::mlir::Value sparse_indices, ::mlir::Value sparse_values, ::mlir::Value sparse_shape) {
  odsState.addOperands(sparse_indices);
  odsState.addOperands(sparse_values);
  odsState.addOperands(sparse_shape);
  odsState.addTypes(serialized_sparse);
}

void SerializeSparseOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value sparse_indices, ::mlir::Value sparse_values, ::mlir::Value sparse_shape) {
  odsState.addOperands(sparse_indices);
  odsState.addOperands(sparse_values);
  odsState.addOperands(sparse_shape);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void SerializeSparseOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 3u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult SerializeSparseOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops16(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops16(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops42(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void SerializeSparseOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::SerializeSparseOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::SetStaticDimensionBoundsOp definitions
//===----------------------------------------------------------------------===//

SetStaticDimensionBoundsOpAdaptor::SetStaticDimensionBoundsOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

SetStaticDimensionBoundsOpAdaptor::SetStaticDimensionBoundsOpAdaptor(SetStaticDimensionBoundsOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange SetStaticDimensionBoundsOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> SetStaticDimensionBoundsOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange SetStaticDimensionBoundsOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SetStaticDimensionBoundsOpAdaptor::input() {
  return *getODSOperands(0).begin();
}

::mlir::Value SetStaticDimensionBoundsOpAdaptor::static_shape() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr SetStaticDimensionBoundsOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult SetStaticDimensionBoundsOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> SetStaticDimensionBoundsOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range SetStaticDimensionBoundsOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SetStaticDimensionBoundsOp::input() {
  return *getODSOperands(0).begin();
}

::mlir::Value SetStaticDimensionBoundsOp::static_shape() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange SetStaticDimensionBoundsOp::inputMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange SetStaticDimensionBoundsOp::static_shapeMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> SetStaticDimensionBoundsOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range SetStaticDimensionBoundsOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SetStaticDimensionBoundsOp::output() {
  return *getODSResults(0).begin();
}

void SetStaticDimensionBoundsOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input, ::mlir::Value static_shape) {
  odsState.addOperands(input);
  odsState.addOperands(static_shape);
  odsState.addTypes(output);
}

void SetStaticDimensionBoundsOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::Value static_shape) {
  odsState.addOperands(input);
  odsState.addOperands(static_shape);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void SetStaticDimensionBoundsOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult SetStaticDimensionBoundsOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return Verify(*this);
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::SetStaticDimensionBoundsOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::ShapeNOp definitions
//===----------------------------------------------------------------------===//

ShapeNOpAdaptor::ShapeNOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

ShapeNOpAdaptor::ShapeNOpAdaptor(ShapeNOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange ShapeNOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> ShapeNOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  bool isVariadic[] = {true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (odsOperands.size() - 0) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::ValueRange ShapeNOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::ValueRange ShapeNOpAdaptor::input() {
  return getODSOperands(0);
}

::mlir::DictionaryAttr ShapeNOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult ShapeNOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> ShapeNOp::getODSOperandIndexAndLength(unsigned index) {
  bool isVariadic[] = {true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (getOperation()->getNumOperands() - 0) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::Operation::operand_range ShapeNOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Operation::operand_range ShapeNOp::input() {
  return getODSOperands(0);
}

::mlir::MutableOperandRange ShapeNOp::inputMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> ShapeNOp::getODSResultIndexAndLength(unsigned index) {
  bool isVariadic[] = {true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (getOperation()->getNumResults() - 0) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::Operation::result_range ShapeNOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Operation::result_range ShapeNOp::output() {
  return getODSResults(0);
}

size_t ShapeNOp::N() {
  auto range = getODSOperands(0);
return std::distance(range.begin(), range.end());
}

::mlir::Type ShapeNOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

::mlir::Type ShapeNOp::out_type() {
  return mlir::getElementTypeOrSelf(*getODSResults(0).begin());
}

bool ShapeNOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "N") return true;
  if (name == "T") return true;
  if (name == "out_type") return true;
 return false;
}

::mlir::DictionaryAttr ShapeNOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {NAttrName(),
odsBuilder.getI64IntegerAttr(N())},
    {TAttrName(),
::mlir::TypeAttr::get(T())},
    {out_typeAttrName(),
::mlir::TypeAttr::get(out_type())}});
}

void ShapeNOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult ShapeNOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return Verify(*this);
}

void ShapeNOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::ShapeNOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::ShapeOp definitions
//===----------------------------------------------------------------------===//

ShapeOpAdaptor::ShapeOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

ShapeOpAdaptor::ShapeOpAdaptor(ShapeOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange ShapeOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> ShapeOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange ShapeOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ShapeOpAdaptor::input() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr ShapeOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult ShapeOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> ShapeOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range ShapeOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ShapeOp::input() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange ShapeOp::inputMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> ShapeOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range ShapeOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ShapeOp::output() {
  return *getODSResults(0).begin();
}

::mlir::Type ShapeOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

::mlir::Type ShapeOp::out_type() {
  return mlir::getElementTypeOrSelf(*getODSResults(0).begin());
}

bool ShapeOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
  if (name == "out_type") return true;
 return false;
}

::mlir::DictionaryAttr ShapeOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())},
    {out_typeAttrName(),
::mlir::TypeAttr::get(out_type())}});
}

void ShapeOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input) {
  odsState.addOperands(input);
  odsState.addTypes(output);
}

void ShapeOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input) {
  odsState.addOperands(input);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void ShapeOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult ShapeOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return Verify(*this);
}

void ShapeOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::ShapeOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::ShardedFilenameOp definitions
//===----------------------------------------------------------------------===//

ShardedFilenameOpAdaptor::ShardedFilenameOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

ShardedFilenameOpAdaptor::ShardedFilenameOpAdaptor(ShardedFilenameOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange ShardedFilenameOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> ShardedFilenameOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange ShardedFilenameOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ShardedFilenameOpAdaptor::basename() {
  return *getODSOperands(0).begin();
}

::mlir::Value ShardedFilenameOpAdaptor::shard() {
  return *getODSOperands(1).begin();
}

::mlir::Value ShardedFilenameOpAdaptor::num_shards() {
  return *getODSOperands(2).begin();
}

::mlir::DictionaryAttr ShardedFilenameOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult ShardedFilenameOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> ShardedFilenameOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range ShardedFilenameOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ShardedFilenameOp::basename() {
  return *getODSOperands(0).begin();
}

::mlir::Value ShardedFilenameOp::shard() {
  return *getODSOperands(1).begin();
}

::mlir::Value ShardedFilenameOp::num_shards() {
  return *getODSOperands(2).begin();
}

::mlir::MutableOperandRange ShardedFilenameOp::basenameMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ShardedFilenameOp::shardMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ShardedFilenameOp::num_shardsMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> ShardedFilenameOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range ShardedFilenameOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ShardedFilenameOp::filename() {
  return *getODSResults(0).begin();
}

void ShardedFilenameOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type filename, ::mlir::Value basename, ::mlir::Value shard, ::mlir::Value num_shards) {
  odsState.addOperands(basename);
  odsState.addOperands(shard);
  odsState.addOperands(num_shards);
  odsState.addTypes(filename);
}

void ShardedFilenameOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value basename, ::mlir::Value shard, ::mlir::Value num_shards) {
  odsState.addOperands(basename);
  odsState.addOperands(shard);
  odsState.addOperands(num_shards);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void ShardedFilenameOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 3u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult ShardedFilenameOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops19(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops11(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops11(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops19(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void ShardedFilenameOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::ShardedFilenameOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::ShuffleAndRepeatDatasetV2Op definitions
//===----------------------------------------------------------------------===//

ShuffleAndRepeatDatasetV2OpAdaptor::ShuffleAndRepeatDatasetV2OpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

ShuffleAndRepeatDatasetV2OpAdaptor::ShuffleAndRepeatDatasetV2OpAdaptor(ShuffleAndRepeatDatasetV2Op &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange ShuffleAndRepeatDatasetV2OpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> ShuffleAndRepeatDatasetV2OpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange ShuffleAndRepeatDatasetV2OpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ShuffleAndRepeatDatasetV2OpAdaptor::input_dataset() {
  return *getODSOperands(0).begin();
}

::mlir::Value ShuffleAndRepeatDatasetV2OpAdaptor::buffer_size() {
  return *getODSOperands(1).begin();
}

::mlir::Value ShuffleAndRepeatDatasetV2OpAdaptor::seed() {
  return *getODSOperands(2).begin();
}

::mlir::Value ShuffleAndRepeatDatasetV2OpAdaptor::seed2() {
  return *getODSOperands(3).begin();
}

::mlir::Value ShuffleAndRepeatDatasetV2OpAdaptor::count() {
  return *getODSOperands(4).begin();
}

::mlir::Value ShuffleAndRepeatDatasetV2OpAdaptor::seed_generator() {
  return *getODSOperands(5).begin();
}

::mlir::DictionaryAttr ShuffleAndRepeatDatasetV2OpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::BoolAttr ShuffleAndRepeatDatasetV2OpAdaptor::reshuffle_each_iteration() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("reshuffle_each_iteration").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(true);
  return attr;
}

::mlir::ArrayAttr ShuffleAndRepeatDatasetV2OpAdaptor::output_types() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("output_types").cast<::mlir::ArrayAttr>();
  return attr;
}

::mlir::ArrayAttr ShuffleAndRepeatDatasetV2OpAdaptor::output_shapes() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("output_shapes").cast<::mlir::ArrayAttr>();
  return attr;
}

::mlir::StringAttr ShuffleAndRepeatDatasetV2OpAdaptor::metadata() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("metadata").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("");
  return attr;
}

::mlir::LogicalResult ShuffleAndRepeatDatasetV2OpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_reshuffle_each_iteration = odsAttrs.get("reshuffle_each_iteration");
    if (tblgen_reshuffle_each_iteration && !((tblgen_reshuffle_each_iteration.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.ShuffleAndRepeatDatasetV2' op ""attribute 'reshuffle_each_iteration' failed to satisfy constraint: bool attribute");
  }
  {
    auto tblgen_output_types = odsAttrs.get("output_types");
    if (!tblgen_output_types)
      return emitError(loc, "'tf.ShuffleAndRepeatDatasetV2' op ""requires attribute 'output_types'");

    if (tblgen_output_types && !((((tblgen_output_types.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_output_types.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return ((attr.isa<::mlir::TypeAttr>())) && ((attr.cast<::mlir::TypeAttr>().getValue().isa<::mlir::Type>())); }))) && ((tblgen_output_types.cast<::mlir::ArrayAttr>().size() >= 1))))
      return emitError(loc, "'tf.ShuffleAndRepeatDatasetV2' op ""attribute 'output_types' failed to satisfy constraint: type array attribute with at least 1 elements");
  }
  {
    auto tblgen_output_shapes = odsAttrs.get("output_shapes");
    if (!tblgen_output_shapes)
      return emitError(loc, "'tf.ShuffleAndRepeatDatasetV2' op ""requires attribute 'output_shapes'");

    if (tblgen_output_shapes && !((((tblgen_output_shapes.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_output_shapes.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return (attr.isa<mlir::TF::ShapeAttr>()); }))) && ((tblgen_output_shapes.cast<::mlir::ArrayAttr>().size() >= 1))))
      return emitError(loc, "'tf.ShuffleAndRepeatDatasetV2' op ""attribute 'output_shapes' failed to satisfy constraint: tensorflow shape attribute array with at least 1 elements");
  }
  {
    auto tblgen_metadata = odsAttrs.get("metadata");
    if (tblgen_metadata && !((tblgen_metadata.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.ShuffleAndRepeatDatasetV2' op ""attribute 'metadata' failed to satisfy constraint: string attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> ShuffleAndRepeatDatasetV2Op::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range ShuffleAndRepeatDatasetV2Op::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ShuffleAndRepeatDatasetV2Op::input_dataset() {
  return *getODSOperands(0).begin();
}

::mlir::Value ShuffleAndRepeatDatasetV2Op::buffer_size() {
  return *getODSOperands(1).begin();
}

::mlir::Value ShuffleAndRepeatDatasetV2Op::seed() {
  return *getODSOperands(2).begin();
}

::mlir::Value ShuffleAndRepeatDatasetV2Op::seed2() {
  return *getODSOperands(3).begin();
}

::mlir::Value ShuffleAndRepeatDatasetV2Op::count() {
  return *getODSOperands(4).begin();
}

::mlir::Value ShuffleAndRepeatDatasetV2Op::seed_generator() {
  return *getODSOperands(5).begin();
}

::mlir::MutableOperandRange ShuffleAndRepeatDatasetV2Op::input_datasetMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ShuffleAndRepeatDatasetV2Op::buffer_sizeMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ShuffleAndRepeatDatasetV2Op::seedMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ShuffleAndRepeatDatasetV2Op::seed2Mutable() {
  auto range = getODSOperandIndexAndLength(3);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ShuffleAndRepeatDatasetV2Op::countMutable() {
  auto range = getODSOperandIndexAndLength(4);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ShuffleAndRepeatDatasetV2Op::seed_generatorMutable() {
  auto range = getODSOperandIndexAndLength(5);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> ShuffleAndRepeatDatasetV2Op::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range ShuffleAndRepeatDatasetV2Op::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ShuffleAndRepeatDatasetV2Op::handle() {
  return *getODSResults(0).begin();
}

::mlir::BoolAttr ShuffleAndRepeatDatasetV2Op::reshuffle_each_iterationAttr() {
  return (*this)->getAttr(reshuffle_each_iterationAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool ShuffleAndRepeatDatasetV2Op::reshuffle_each_iteration() {
  auto attr = reshuffle_each_iterationAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(true).getValue();
  return attr.getValue();
}

::mlir::ArrayAttr ShuffleAndRepeatDatasetV2Op::output_typesAttr() {
  return (*this)->getAttr(output_typesAttrName()).cast<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr ShuffleAndRepeatDatasetV2Op::output_types() {
  auto attr = output_typesAttr();
  return attr;
}

::mlir::ArrayAttr ShuffleAndRepeatDatasetV2Op::output_shapesAttr() {
  return (*this)->getAttr(output_shapesAttrName()).cast<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr ShuffleAndRepeatDatasetV2Op::output_shapes() {
  auto attr = output_shapesAttr();
  return attr;
}

::mlir::StringAttr ShuffleAndRepeatDatasetV2Op::metadataAttr() {
  return (*this)->getAttr(metadataAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef ShuffleAndRepeatDatasetV2Op::metadata() {
  auto attr = metadataAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("").getValue();
  return attr.getValue();
}

void ShuffleAndRepeatDatasetV2Op::reshuffle_each_iterationAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(reshuffle_each_iterationAttrName(), attr);
}

void ShuffleAndRepeatDatasetV2Op::output_typesAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(output_typesAttrName(), attr);
}

void ShuffleAndRepeatDatasetV2Op::output_shapesAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(output_shapesAttrName(), attr);
}

void ShuffleAndRepeatDatasetV2Op::metadataAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(metadataAttrName(), attr);
}

void ShuffleAndRepeatDatasetV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type handle, ::mlir::Value input_dataset, ::mlir::Value buffer_size, ::mlir::Value seed, ::mlir::Value seed2, ::mlir::Value count, ::mlir::Value seed_generator, ::mlir::BoolAttr reshuffle_each_iteration, ::mlir::ArrayAttr output_types, ::mlir::ArrayAttr output_shapes, ::mlir::StringAttr metadata) {
  odsState.addOperands(input_dataset);
  odsState.addOperands(buffer_size);
  odsState.addOperands(seed);
  odsState.addOperands(seed2);
  odsState.addOperands(count);
  odsState.addOperands(seed_generator);
  odsState.addAttribute(reshuffle_each_iterationAttrName(odsState.name), reshuffle_each_iteration);
  odsState.addAttribute(output_typesAttrName(odsState.name), output_types);
  odsState.addAttribute(output_shapesAttrName(odsState.name), output_shapes);
  odsState.addAttribute(metadataAttrName(odsState.name), metadata);
  odsState.addTypes(handle);
}

void ShuffleAndRepeatDatasetV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input_dataset, ::mlir::Value buffer_size, ::mlir::Value seed, ::mlir::Value seed2, ::mlir::Value count, ::mlir::Value seed_generator, ::mlir::BoolAttr reshuffle_each_iteration, ::mlir::ArrayAttr output_types, ::mlir::ArrayAttr output_shapes, ::mlir::StringAttr metadata) {
  odsState.addOperands(input_dataset);
  odsState.addOperands(buffer_size);
  odsState.addOperands(seed);
  odsState.addOperands(seed2);
  odsState.addOperands(count);
  odsState.addOperands(seed_generator);
  odsState.addAttribute(reshuffle_each_iterationAttrName(odsState.name), reshuffle_each_iteration);
  odsState.addAttribute(output_typesAttrName(odsState.name), output_types);
  odsState.addAttribute(output_shapesAttrName(odsState.name), output_shapes);
  odsState.addAttribute(metadataAttrName(odsState.name), metadata);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void ShuffleAndRepeatDatasetV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type handle, ::mlir::Value input_dataset, ::mlir::Value buffer_size, ::mlir::Value seed, ::mlir::Value seed2, ::mlir::Value count, ::mlir::Value seed_generator, bool reshuffle_each_iteration, ::mlir::ArrayAttr output_types, ::mlir::ArrayAttr output_shapes, ::llvm::StringRef metadata) {
  odsState.addOperands(input_dataset);
  odsState.addOperands(buffer_size);
  odsState.addOperands(seed);
  odsState.addOperands(seed2);
  odsState.addOperands(count);
  odsState.addOperands(seed_generator);
  odsState.addAttribute(reshuffle_each_iterationAttrName(odsState.name), odsBuilder.getBoolAttr(reshuffle_each_iteration));
  odsState.addAttribute(output_typesAttrName(odsState.name), output_types);
  odsState.addAttribute(output_shapesAttrName(odsState.name), output_shapes);
  odsState.addAttribute(metadataAttrName(odsState.name), odsBuilder.getStringAttr(metadata));
  odsState.addTypes(handle);
}

void ShuffleAndRepeatDatasetV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input_dataset, ::mlir::Value buffer_size, ::mlir::Value seed, ::mlir::Value seed2, ::mlir::Value count, ::mlir::Value seed_generator, bool reshuffle_each_iteration, ::mlir::ArrayAttr output_types, ::mlir::ArrayAttr output_shapes, ::llvm::StringRef metadata) {
  odsState.addOperands(input_dataset);
  odsState.addOperands(buffer_size);
  odsState.addOperands(seed);
  odsState.addOperands(seed2);
  odsState.addOperands(count);
  odsState.addOperands(seed_generator);
  odsState.addAttribute(reshuffle_each_iterationAttrName(odsState.name), odsBuilder.getBoolAttr(reshuffle_each_iteration));
  odsState.addAttribute(output_typesAttrName(odsState.name), output_types);
  odsState.addAttribute(output_shapesAttrName(odsState.name), output_shapes);
  odsState.addAttribute(metadataAttrName(odsState.name), odsBuilder.getStringAttr(metadata));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void ShuffleAndRepeatDatasetV2Op::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 6u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult ShuffleAndRepeatDatasetV2Op::verify() {
  {
    auto tblgen_reshuffle_each_iteration = (*this)->getAttr(reshuffle_each_iterationAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_reshuffle_each_iteration, "reshuffle_each_iteration")))
      return ::mlir::failure();
  }
  {
    auto tblgen_output_types = (*this)->getAttr(output_typesAttrName());
    if (!tblgen_output_types)
      return emitOpError("requires attribute 'output_types'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops2(*this, tblgen_output_types, "output_types")))
      return ::mlir::failure();
  }
  {
    auto tblgen_output_shapes = (*this)->getAttr(output_shapesAttrName());
    if (!tblgen_output_shapes)
      return emitOpError("requires attribute 'output_shapes'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops3(*this, tblgen_output_shapes, "output_shapes")))
      return ::mlir::failure();
  }
  {
    auto tblgen_metadata = (*this)->getAttr(metadataAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_metadata, "metadata")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops15(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops16(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops16(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup3 = getODSOperands(3);

    for (auto v : valueGroup3) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops16(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup4 = getODSOperands(4);

    for (auto v : valueGroup4) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops16(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup5 = getODSOperands(5);

    for (auto v : valueGroup5) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops15(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void ShuffleAndRepeatDatasetV2Op::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  for (::mlir::Value value : getODSOperands(5))
    effects.emplace_back(::mlir::MemoryEffects::Read::get(), value, ::mlir::TF::ResourceEffects::DatasetSeedGenerator::get());
  for (::mlir::Value value : getODSOperands(5))
    effects.emplace_back(::mlir::MemoryEffects::Write::get(), value, ::mlir::TF::ResourceEffects::DatasetSeedGenerator::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::ShuffleAndRepeatDatasetV2Op)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::ShuffleDatasetV2Op definitions
//===----------------------------------------------------------------------===//

ShuffleDatasetV2OpAdaptor::ShuffleDatasetV2OpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

ShuffleDatasetV2OpAdaptor::ShuffleDatasetV2OpAdaptor(ShuffleDatasetV2Op &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange ShuffleDatasetV2OpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> ShuffleDatasetV2OpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange ShuffleDatasetV2OpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ShuffleDatasetV2OpAdaptor::input_dataset() {
  return *getODSOperands(0).begin();
}

::mlir::Value ShuffleDatasetV2OpAdaptor::buffer_size() {
  return *getODSOperands(1).begin();
}

::mlir::Value ShuffleDatasetV2OpAdaptor::seed_generator() {
  return *getODSOperands(2).begin();
}

::mlir::DictionaryAttr ShuffleDatasetV2OpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::ArrayAttr ShuffleDatasetV2OpAdaptor::output_types() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("output_types").cast<::mlir::ArrayAttr>();
  return attr;
}

::mlir::ArrayAttr ShuffleDatasetV2OpAdaptor::output_shapes() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("output_shapes").cast<::mlir::ArrayAttr>();
  return attr;
}

::mlir::StringAttr ShuffleDatasetV2OpAdaptor::metadata() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("metadata").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("");
  return attr;
}

::mlir::LogicalResult ShuffleDatasetV2OpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_output_types = odsAttrs.get("output_types");
    if (!tblgen_output_types)
      return emitError(loc, "'tf.ShuffleDatasetV2' op ""requires attribute 'output_types'");

    if (tblgen_output_types && !((((tblgen_output_types.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_output_types.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return ((attr.isa<::mlir::TypeAttr>())) && ((attr.cast<::mlir::TypeAttr>().getValue().isa<::mlir::Type>())); }))) && ((tblgen_output_types.cast<::mlir::ArrayAttr>().size() >= 1))))
      return emitError(loc, "'tf.ShuffleDatasetV2' op ""attribute 'output_types' failed to satisfy constraint: type array attribute with at least 1 elements");
  }
  {
    auto tblgen_output_shapes = odsAttrs.get("output_shapes");
    if (!tblgen_output_shapes)
      return emitError(loc, "'tf.ShuffleDatasetV2' op ""requires attribute 'output_shapes'");

    if (tblgen_output_shapes && !((((tblgen_output_shapes.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_output_shapes.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return (attr.isa<mlir::TF::ShapeAttr>()); }))) && ((tblgen_output_shapes.cast<::mlir::ArrayAttr>().size() >= 1))))
      return emitError(loc, "'tf.ShuffleDatasetV2' op ""attribute 'output_shapes' failed to satisfy constraint: tensorflow shape attribute array with at least 1 elements");
  }
  {
    auto tblgen_metadata = odsAttrs.get("metadata");
    if (tblgen_metadata && !((tblgen_metadata.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.ShuffleDatasetV2' op ""attribute 'metadata' failed to satisfy constraint: string attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> ShuffleDatasetV2Op::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range ShuffleDatasetV2Op::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ShuffleDatasetV2Op::input_dataset() {
  return *getODSOperands(0).begin();
}

::mlir::Value ShuffleDatasetV2Op::buffer_size() {
  return *getODSOperands(1).begin();
}

::mlir::Value ShuffleDatasetV2Op::seed_generator() {
  return *getODSOperands(2).begin();
}

::mlir::MutableOperandRange ShuffleDatasetV2Op::input_datasetMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ShuffleDatasetV2Op::buffer_sizeMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ShuffleDatasetV2Op::seed_generatorMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> ShuffleDatasetV2Op::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range ShuffleDatasetV2Op::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ShuffleDatasetV2Op::handle() {
  return *getODSResults(0).begin();
}

::mlir::ArrayAttr ShuffleDatasetV2Op::output_typesAttr() {
  return (*this)->getAttr(output_typesAttrName()).cast<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr ShuffleDatasetV2Op::output_types() {
  auto attr = output_typesAttr();
  return attr;
}

::mlir::ArrayAttr ShuffleDatasetV2Op::output_shapesAttr() {
  return (*this)->getAttr(output_shapesAttrName()).cast<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr ShuffleDatasetV2Op::output_shapes() {
  auto attr = output_shapesAttr();
  return attr;
}

::mlir::StringAttr ShuffleDatasetV2Op::metadataAttr() {
  return (*this)->getAttr(metadataAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef ShuffleDatasetV2Op::metadata() {
  auto attr = metadataAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("").getValue();
  return attr.getValue();
}

void ShuffleDatasetV2Op::output_typesAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(output_typesAttrName(), attr);
}

void ShuffleDatasetV2Op::output_shapesAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(output_shapesAttrName(), attr);
}

void ShuffleDatasetV2Op::metadataAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(metadataAttrName(), attr);
}

void ShuffleDatasetV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type handle, ::mlir::Value input_dataset, ::mlir::Value buffer_size, ::mlir::Value seed_generator, ::mlir::ArrayAttr output_types, ::mlir::ArrayAttr output_shapes, ::mlir::StringAttr metadata) {
  odsState.addOperands(input_dataset);
  odsState.addOperands(buffer_size);
  odsState.addOperands(seed_generator);
  odsState.addAttribute(output_typesAttrName(odsState.name), output_types);
  odsState.addAttribute(output_shapesAttrName(odsState.name), output_shapes);
  odsState.addAttribute(metadataAttrName(odsState.name), metadata);
  odsState.addTypes(handle);
}

void ShuffleDatasetV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input_dataset, ::mlir::Value buffer_size, ::mlir::Value seed_generator, ::mlir::ArrayAttr output_types, ::mlir::ArrayAttr output_shapes, ::mlir::StringAttr metadata) {
  odsState.addOperands(input_dataset);
  odsState.addOperands(buffer_size);
  odsState.addOperands(seed_generator);
  odsState.addAttribute(output_typesAttrName(odsState.name), output_types);
  odsState.addAttribute(output_shapesAttrName(odsState.name), output_shapes);
  odsState.addAttribute(metadataAttrName(odsState.name), metadata);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void ShuffleDatasetV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type handle, ::mlir::Value input_dataset, ::mlir::Value buffer_size, ::mlir::Value seed_generator, ::mlir::ArrayAttr output_types, ::mlir::ArrayAttr output_shapes, ::llvm::StringRef metadata) {
  odsState.addOperands(input_dataset);
  odsState.addOperands(buffer_size);
  odsState.addOperands(seed_generator);
  odsState.addAttribute(output_typesAttrName(odsState.name), output_types);
  odsState.addAttribute(output_shapesAttrName(odsState.name), output_shapes);
  odsState.addAttribute(metadataAttrName(odsState.name), odsBuilder.getStringAttr(metadata));
  odsState.addTypes(handle);
}

void ShuffleDatasetV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input_dataset, ::mlir::Value buffer_size, ::mlir::Value seed_generator, ::mlir::ArrayAttr output_types, ::mlir::ArrayAttr output_shapes, ::llvm::StringRef metadata) {
  odsState.addOperands(input_dataset);
  odsState.addOperands(buffer_size);
  odsState.addOperands(seed_generator);
  odsState.addAttribute(output_typesAttrName(odsState.name), output_types);
  odsState.addAttribute(output_shapesAttrName(odsState.name), output_shapes);
  odsState.addAttribute(metadataAttrName(odsState.name), odsBuilder.getStringAttr(metadata));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void ShuffleDatasetV2Op::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 3u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult ShuffleDatasetV2Op::verify() {
  {
    auto tblgen_output_types = (*this)->getAttr(output_typesAttrName());
    if (!tblgen_output_types)
      return emitOpError("requires attribute 'output_types'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops2(*this, tblgen_output_types, "output_types")))
      return ::mlir::failure();
  }
  {
    auto tblgen_output_shapes = (*this)->getAttr(output_shapesAttrName());
    if (!tblgen_output_shapes)
      return emitOpError("requires attribute 'output_shapes'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops3(*this, tblgen_output_shapes, "output_shapes")))
      return ::mlir::failure();
  }
  {
    auto tblgen_metadata = (*this)->getAttr(metadataAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_metadata, "metadata")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops15(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops16(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops15(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void ShuffleDatasetV2Op::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  for (::mlir::Value value : getODSOperands(2))
    effects.emplace_back(::mlir::MemoryEffects::Read::get(), value, ::mlir::TF::ResourceEffects::DatasetSeedGenerator::get());
  for (::mlir::Value value : getODSOperands(2))
    effects.emplace_back(::mlir::MemoryEffects::Write::get(), value, ::mlir::TF::ResourceEffects::DatasetSeedGenerator::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::ShuffleDatasetV2Op)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::ShuffleDatasetV3Op definitions
//===----------------------------------------------------------------------===//

ShuffleDatasetV3OpAdaptor::ShuffleDatasetV3OpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

ShuffleDatasetV3OpAdaptor::ShuffleDatasetV3OpAdaptor(ShuffleDatasetV3Op &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange ShuffleDatasetV3OpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> ShuffleDatasetV3OpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange ShuffleDatasetV3OpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ShuffleDatasetV3OpAdaptor::input_dataset() {
  return *getODSOperands(0).begin();
}

::mlir::Value ShuffleDatasetV3OpAdaptor::buffer_size() {
  return *getODSOperands(1).begin();
}

::mlir::Value ShuffleDatasetV3OpAdaptor::seed() {
  return *getODSOperands(2).begin();
}

::mlir::Value ShuffleDatasetV3OpAdaptor::seed2() {
  return *getODSOperands(3).begin();
}

::mlir::Value ShuffleDatasetV3OpAdaptor::seed_generator() {
  return *getODSOperands(4).begin();
}

::mlir::DictionaryAttr ShuffleDatasetV3OpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::BoolAttr ShuffleDatasetV3OpAdaptor::reshuffle_each_iteration() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("reshuffle_each_iteration").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(true);
  return attr;
}

::mlir::ArrayAttr ShuffleDatasetV3OpAdaptor::output_types() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("output_types").cast<::mlir::ArrayAttr>();
  return attr;
}

::mlir::ArrayAttr ShuffleDatasetV3OpAdaptor::output_shapes() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("output_shapes").cast<::mlir::ArrayAttr>();
  return attr;
}

::mlir::StringAttr ShuffleDatasetV3OpAdaptor::metadata() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("metadata").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("");
  return attr;
}

::mlir::LogicalResult ShuffleDatasetV3OpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_reshuffle_each_iteration = odsAttrs.get("reshuffle_each_iteration");
    if (tblgen_reshuffle_each_iteration && !((tblgen_reshuffle_each_iteration.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.ShuffleDatasetV3' op ""attribute 'reshuffle_each_iteration' failed to satisfy constraint: bool attribute");
  }
  {
    auto tblgen_output_types = odsAttrs.get("output_types");
    if (!tblgen_output_types)
      return emitError(loc, "'tf.ShuffleDatasetV3' op ""requires attribute 'output_types'");

    if (tblgen_output_types && !((((tblgen_output_types.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_output_types.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return ((attr.isa<::mlir::TypeAttr>())) && ((attr.cast<::mlir::TypeAttr>().getValue().isa<::mlir::Type>())); }))) && ((tblgen_output_types.cast<::mlir::ArrayAttr>().size() >= 1))))
      return emitError(loc, "'tf.ShuffleDatasetV3' op ""attribute 'output_types' failed to satisfy constraint: type array attribute with at least 1 elements");
  }
  {
    auto tblgen_output_shapes = odsAttrs.get("output_shapes");
    if (!tblgen_output_shapes)
      return emitError(loc, "'tf.ShuffleDatasetV3' op ""requires attribute 'output_shapes'");

    if (tblgen_output_shapes && !((((tblgen_output_shapes.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_output_shapes.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return (attr.isa<mlir::TF::ShapeAttr>()); }))) && ((tblgen_output_shapes.cast<::mlir::ArrayAttr>().size() >= 1))))
      return emitError(loc, "'tf.ShuffleDatasetV3' op ""attribute 'output_shapes' failed to satisfy constraint: tensorflow shape attribute array with at least 1 elements");
  }
  {
    auto tblgen_metadata = odsAttrs.get("metadata");
    if (tblgen_metadata && !((tblgen_metadata.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.ShuffleDatasetV3' op ""attribute 'metadata' failed to satisfy constraint: string attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> ShuffleDatasetV3Op::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range ShuffleDatasetV3Op::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ShuffleDatasetV3Op::input_dataset() {
  return *getODSOperands(0).begin();
}

::mlir::Value ShuffleDatasetV3Op::buffer_size() {
  return *getODSOperands(1).begin();
}

::mlir::Value ShuffleDatasetV3Op::seed() {
  return *getODSOperands(2).begin();
}

::mlir::Value ShuffleDatasetV3Op::seed2() {
  return *getODSOperands(3).begin();
}

::mlir::Value ShuffleDatasetV3Op::seed_generator() {
  return *getODSOperands(4).begin();
}

::mlir::MutableOperandRange ShuffleDatasetV3Op::input_datasetMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ShuffleDatasetV3Op::buffer_sizeMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ShuffleDatasetV3Op::seedMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ShuffleDatasetV3Op::seed2Mutable() {
  auto range = getODSOperandIndexAndLength(3);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ShuffleDatasetV3Op::seed_generatorMutable() {
  auto range = getODSOperandIndexAndLength(4);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> ShuffleDatasetV3Op::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range ShuffleDatasetV3Op::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ShuffleDatasetV3Op::handle() {
  return *getODSResults(0).begin();
}

::mlir::BoolAttr ShuffleDatasetV3Op::reshuffle_each_iterationAttr() {
  return (*this)->getAttr(reshuffle_each_iterationAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool ShuffleDatasetV3Op::reshuffle_each_iteration() {
  auto attr = reshuffle_each_iterationAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(true).getValue();
  return attr.getValue();
}

::mlir::ArrayAttr ShuffleDatasetV3Op::output_typesAttr() {
  return (*this)->getAttr(output_typesAttrName()).cast<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr ShuffleDatasetV3Op::output_types() {
  auto attr = output_typesAttr();
  return attr;
}

::mlir::ArrayAttr ShuffleDatasetV3Op::output_shapesAttr() {
  return (*this)->getAttr(output_shapesAttrName()).cast<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr ShuffleDatasetV3Op::output_shapes() {
  auto attr = output_shapesAttr();
  return attr;
}

::mlir::StringAttr ShuffleDatasetV3Op::metadataAttr() {
  return (*this)->getAttr(metadataAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef ShuffleDatasetV3Op::metadata() {
  auto attr = metadataAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("").getValue();
  return attr.getValue();
}

void ShuffleDatasetV3Op::reshuffle_each_iterationAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(reshuffle_each_iterationAttrName(), attr);
}

void ShuffleDatasetV3Op::output_typesAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(output_typesAttrName(), attr);
}

void ShuffleDatasetV3Op::output_shapesAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(output_shapesAttrName(), attr);
}

void ShuffleDatasetV3Op::metadataAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(metadataAttrName(), attr);
}

void ShuffleDatasetV3Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type handle, ::mlir::Value input_dataset, ::mlir::Value buffer_size, ::mlir::Value seed, ::mlir::Value seed2, ::mlir::Value seed_generator, ::mlir::BoolAttr reshuffle_each_iteration, ::mlir::ArrayAttr output_types, ::mlir::ArrayAttr output_shapes, ::mlir::StringAttr metadata) {
  odsState.addOperands(input_dataset);
  odsState.addOperands(buffer_size);
  odsState.addOperands(seed);
  odsState.addOperands(seed2);
  odsState.addOperands(seed_generator);
  odsState.addAttribute(reshuffle_each_iterationAttrName(odsState.name), reshuffle_each_iteration);
  odsState.addAttribute(output_typesAttrName(odsState.name), output_types);
  odsState.addAttribute(output_shapesAttrName(odsState.name), output_shapes);
  odsState.addAttribute(metadataAttrName(odsState.name), metadata);
  odsState.addTypes(handle);
}

void ShuffleDatasetV3Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input_dataset, ::mlir::Value buffer_size, ::mlir::Value seed, ::mlir::Value seed2, ::mlir::Value seed_generator, ::mlir::BoolAttr reshuffle_each_iteration, ::mlir::ArrayAttr output_types, ::mlir::ArrayAttr output_shapes, ::mlir::StringAttr metadata) {
  odsState.addOperands(input_dataset);
  odsState.addOperands(buffer_size);
  odsState.addOperands(seed);
  odsState.addOperands(seed2);
  odsState.addOperands(seed_generator);
  odsState.addAttribute(reshuffle_each_iterationAttrName(odsState.name), reshuffle_each_iteration);
  odsState.addAttribute(output_typesAttrName(odsState.name), output_types);
  odsState.addAttribute(output_shapesAttrName(odsState.name), output_shapes);
  odsState.addAttribute(metadataAttrName(odsState.name), metadata);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void ShuffleDatasetV3Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type handle, ::mlir::Value input_dataset, ::mlir::Value buffer_size, ::mlir::Value seed, ::mlir::Value seed2, ::mlir::Value seed_generator, bool reshuffle_each_iteration, ::mlir::ArrayAttr output_types, ::mlir::ArrayAttr output_shapes, ::llvm::StringRef metadata) {
  odsState.addOperands(input_dataset);
  odsState.addOperands(buffer_size);
  odsState.addOperands(seed);
  odsState.addOperands(seed2);
  odsState.addOperands(seed_generator);
  odsState.addAttribute(reshuffle_each_iterationAttrName(odsState.name), odsBuilder.getBoolAttr(reshuffle_each_iteration));
  odsState.addAttribute(output_typesAttrName(odsState.name), output_types);
  odsState.addAttribute(output_shapesAttrName(odsState.name), output_shapes);
  odsState.addAttribute(metadataAttrName(odsState.name), odsBuilder.getStringAttr(metadata));
  odsState.addTypes(handle);
}

void ShuffleDatasetV3Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input_dataset, ::mlir::Value buffer_size, ::mlir::Value seed, ::mlir::Value seed2, ::mlir::Value seed_generator, bool reshuffle_each_iteration, ::mlir::ArrayAttr output_types, ::mlir::ArrayAttr output_shapes, ::llvm::StringRef metadata) {
  odsState.addOperands(input_dataset);
  odsState.addOperands(buffer_size);
  odsState.addOperands(seed);
  odsState.addOperands(seed2);
  odsState.addOperands(seed_generator);
  odsState.addAttribute(reshuffle_each_iterationAttrName(odsState.name), odsBuilder.getBoolAttr(reshuffle_each_iteration));
  odsState.addAttribute(output_typesAttrName(odsState.name), output_types);
  odsState.addAttribute(output_shapesAttrName(odsState.name), output_shapes);
  odsState.addAttribute(metadataAttrName(odsState.name), odsBuilder.getStringAttr(metadata));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void ShuffleDatasetV3Op::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 5u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult ShuffleDatasetV3Op::verify() {
  {
    auto tblgen_reshuffle_each_iteration = (*this)->getAttr(reshuffle_each_iterationAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_reshuffle_each_iteration, "reshuffle_each_iteration")))
      return ::mlir::failure();
  }
  {
    auto tblgen_output_types = (*this)->getAttr(output_typesAttrName());
    if (!tblgen_output_types)
      return emitOpError("requires attribute 'output_types'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops2(*this, tblgen_output_types, "output_types")))
      return ::mlir::failure();
  }
  {
    auto tblgen_output_shapes = (*this)->getAttr(output_shapesAttrName());
    if (!tblgen_output_shapes)
      return emitOpError("requires attribute 'output_shapes'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops3(*this, tblgen_output_shapes, "output_shapes")))
      return ::mlir::failure();
  }
  {
    auto tblgen_metadata = (*this)->getAttr(metadataAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_metadata, "metadata")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops15(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops16(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops16(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup3 = getODSOperands(3);

    for (auto v : valueGroup3) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops16(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup4 = getODSOperands(4);

    for (auto v : valueGroup4) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops15(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void ShuffleDatasetV3Op::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  for (::mlir::Value value : getODSOperands(4))
    effects.emplace_back(::mlir::MemoryEffects::Read::get(), value, ::mlir::TF::ResourceEffects::DatasetSeedGenerator::get());
  for (::mlir::Value value : getODSOperands(4))
    effects.emplace_back(::mlir::MemoryEffects::Write::get(), value, ::mlir::TF::ResourceEffects::DatasetSeedGenerator::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::ShuffleDatasetV3Op)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::ShutdownDistributedTPUOp definitions
//===----------------------------------------------------------------------===//

ShutdownDistributedTPUOpAdaptor::ShutdownDistributedTPUOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

ShutdownDistributedTPUOpAdaptor::ShutdownDistributedTPUOpAdaptor(ShutdownDistributedTPUOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange ShutdownDistributedTPUOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> ShutdownDistributedTPUOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange ShutdownDistributedTPUOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::DictionaryAttr ShutdownDistributedTPUOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult ShutdownDistributedTPUOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> ShutdownDistributedTPUOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range ShutdownDistributedTPUOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

std::pair<unsigned, unsigned> ShutdownDistributedTPUOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range ShutdownDistributedTPUOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

void ShutdownDistributedTPUOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState) {
}

void ShutdownDistributedTPUOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes) {
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void ShutdownDistributedTPUOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 0u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 0u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult ShutdownDistributedTPUOp::verify() {
  return ::mlir::success();
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::ShutdownDistributedTPUOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::ShutdownTPUSystemOp definitions
//===----------------------------------------------------------------------===//

ShutdownTPUSystemOpAdaptor::ShutdownTPUSystemOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

ShutdownTPUSystemOpAdaptor::ShutdownTPUSystemOpAdaptor(ShutdownTPUSystemOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange ShutdownTPUSystemOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> ShutdownTPUSystemOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange ShutdownTPUSystemOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::DictionaryAttr ShutdownTPUSystemOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult ShutdownTPUSystemOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> ShutdownTPUSystemOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range ShutdownTPUSystemOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

std::pair<unsigned, unsigned> ShutdownTPUSystemOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range ShutdownTPUSystemOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ShutdownTPUSystemOp::success() {
  return *getODSResults(0).begin();
}

void ShutdownTPUSystemOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type success) {
  odsState.addTypes(success);
}

void ShutdownTPUSystemOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes) {
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void ShutdownTPUSystemOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 0u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult ShutdownTPUSystemOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops8(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::ShutdownTPUSystemOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::SigmoidGradOp definitions
//===----------------------------------------------------------------------===//

SigmoidGradOpAdaptor::SigmoidGradOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

SigmoidGradOpAdaptor::SigmoidGradOpAdaptor(SigmoidGradOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange SigmoidGradOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> SigmoidGradOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange SigmoidGradOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SigmoidGradOpAdaptor::y() {
  return *getODSOperands(0).begin();
}

::mlir::Value SigmoidGradOpAdaptor::dy() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr SigmoidGradOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult SigmoidGradOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> SigmoidGradOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range SigmoidGradOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SigmoidGradOp::y() {
  return *getODSOperands(0).begin();
}

::mlir::Value SigmoidGradOp::dy() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange SigmoidGradOp::yMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange SigmoidGradOp::dyMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> SigmoidGradOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range SigmoidGradOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SigmoidGradOp::z() {
  return *getODSResults(0).begin();
}

::mlir::Type SigmoidGradOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool SigmoidGradOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr SigmoidGradOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void SigmoidGradOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type z, ::mlir::Value y, ::mlir::Value dy) {
  odsState.addOperands(y);
  odsState.addOperands(dy);
  odsState.addTypes(z);
}

void SigmoidGradOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value y, ::mlir::Value dy) {
  odsState.addOperands(y);
  odsState.addOperands(dy);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void SigmoidGradOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult SigmoidGradOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops2(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops2(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops2(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void SigmoidGradOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::SigmoidGradOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::SigmoidOp definitions
//===----------------------------------------------------------------------===//

SigmoidOpAdaptor::SigmoidOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

SigmoidOpAdaptor::SigmoidOpAdaptor(SigmoidOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange SigmoidOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> SigmoidOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange SigmoidOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SigmoidOpAdaptor::x() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr SigmoidOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult SigmoidOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> SigmoidOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range SigmoidOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SigmoidOp::x() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange SigmoidOp::xMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> SigmoidOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range SigmoidOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SigmoidOp::y() {
  return *getODSResults(0).begin();
}

::mlir::Type SigmoidOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool SigmoidOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr SigmoidOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void SigmoidOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type y, ::mlir::Value x) {
  odsState.addOperands(x);
  odsState.addTypes(y);
}

void SigmoidOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value x) {
  odsState.addOperands(x);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void SigmoidOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult SigmoidOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops2(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops2(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void SigmoidOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::SigmoidOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::SignOp definitions
//===----------------------------------------------------------------------===//

SignOpAdaptor::SignOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

SignOpAdaptor::SignOpAdaptor(SignOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange SignOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> SignOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange SignOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SignOpAdaptor::x() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr SignOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult SignOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> SignOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range SignOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SignOp::x() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange SignOp::xMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> SignOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range SignOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SignOp::y() {
  return *getODSResults(0).begin();
}

::mlir::Type SignOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool SignOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr SignOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void SignOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type y, ::mlir::Value x) {
  odsState.addOperands(x);
  odsState.addTypes(y);
}

void SignOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value x) {
  odsState.addOperands(x);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void SignOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

void SignOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value x) {
  odsState.addOperands(x);
  odsState.addTypes({x.getType()});

}

void SignOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  odsState.addTypes({operands[0].getType()});

}

::mlir::LogicalResult SignOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops1(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops1(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void SignOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::SignOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::SinOp definitions
//===----------------------------------------------------------------------===//

SinOpAdaptor::SinOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

SinOpAdaptor::SinOpAdaptor(SinOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange SinOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> SinOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange SinOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SinOpAdaptor::x() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr SinOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult SinOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> SinOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range SinOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SinOp::x() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange SinOp::xMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> SinOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range SinOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SinOp::y() {
  return *getODSResults(0).begin();
}

::mlir::Type SinOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool SinOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr SinOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void SinOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type y, ::mlir::Value x) {
  odsState.addOperands(x);
  odsState.addTypes(y);
}

void SinOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value x) {
  odsState.addOperands(x);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void SinOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

void SinOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value x) {
  odsState.addOperands(x);
  odsState.addTypes({x.getType()});

}

void SinOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  odsState.addTypes({operands[0].getType()});

}

::mlir::LogicalResult SinOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops2(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops2(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void SinOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::SinOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::SinhOp definitions
//===----------------------------------------------------------------------===//

SinhOpAdaptor::SinhOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

SinhOpAdaptor::SinhOpAdaptor(SinhOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange SinhOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> SinhOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange SinhOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SinhOpAdaptor::x() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr SinhOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult SinhOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> SinhOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range SinhOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SinhOp::x() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange SinhOp::xMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> SinhOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range SinhOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SinhOp::y() {
  return *getODSResults(0).begin();
}

::mlir::Type SinhOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool SinhOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr SinhOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void SinhOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type y, ::mlir::Value x) {
  odsState.addOperands(x);
  odsState.addTypes(y);
}

void SinhOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value x) {
  odsState.addOperands(x);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void SinhOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult SinhOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops2(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops2(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void SinhOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::SinhOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::SizeOp definitions
//===----------------------------------------------------------------------===//

SizeOpAdaptor::SizeOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

SizeOpAdaptor::SizeOpAdaptor(SizeOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange SizeOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> SizeOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange SizeOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SizeOpAdaptor::input() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr SizeOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult SizeOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> SizeOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range SizeOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SizeOp::input() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange SizeOp::inputMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> SizeOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range SizeOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SizeOp::output() {
  return *getODSResults(0).begin();
}

::mlir::Type SizeOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

::mlir::Type SizeOp::out_type() {
  return mlir::getElementTypeOrSelf(*getODSResults(0).begin());
}

bool SizeOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
  if (name == "out_type") return true;
 return false;
}

::mlir::DictionaryAttr SizeOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())},
    {out_typeAttrName(),
::mlir::TypeAttr::get(out_type())}});
}

void SizeOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input) {
  odsState.addOperands(input);
  odsState.addTypes(output);
}

void SizeOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input) {
  odsState.addOperands(input);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void SizeOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult SizeOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return Verify(*this);
}

void SizeOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::SizeOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::SliceOp definitions
//===----------------------------------------------------------------------===//

SliceOpAdaptor::SliceOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

SliceOpAdaptor::SliceOpAdaptor(SliceOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange SliceOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> SliceOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange SliceOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SliceOpAdaptor::input() {
  return *getODSOperands(0).begin();
}

::mlir::Value SliceOpAdaptor::begin() {
  return *getODSOperands(1).begin();
}

::mlir::Value SliceOpAdaptor::size() {
  return *getODSOperands(2).begin();
}

::mlir::DictionaryAttr SliceOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult SliceOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> SliceOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range SliceOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SliceOp::input() {
  return *getODSOperands(0).begin();
}

::mlir::Value SliceOp::begin() {
  return *getODSOperands(1).begin();
}

::mlir::Value SliceOp::size() {
  return *getODSOperands(2).begin();
}

::mlir::MutableOperandRange SliceOp::inputMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange SliceOp::beginMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange SliceOp::sizeMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> SliceOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range SliceOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SliceOp::output() {
  return *getODSResults(0).begin();
}

::mlir::Type SliceOp::Index() {
  return mlir::getElementTypeOrSelf(*getODSOperands(1).begin());
}

::mlir::Type SliceOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool SliceOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "Index") return true;
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr SliceOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {IndexAttrName(),
::mlir::TypeAttr::get(Index())},
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void SliceOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input, ::mlir::Value begin, ::mlir::Value size) {
  odsState.addOperands(input);
  odsState.addOperands(begin);
  odsState.addOperands(size);
  odsState.addTypes(output);
}

void SliceOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::Value begin, ::mlir::Value size) {
  odsState.addOperands(input);
  odsState.addOperands(begin);
  odsState.addOperands(size);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void SliceOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 3u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult SliceOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  if (!(((((*this->getOperation()).getNumResults() > 0)) && (((*this->getOperation()).getNumOperands() > 0)) && (((*this->getOperation()).getResult(0).getType().isa<::mlir::ShapedType>())) && (((*this->getOperation()).getOperand(0).getType().isa<::mlir::ShapedType>()))) && ((getElementTypeOrSelf((*this->getOperation()).getResult(0)) == getElementTypeOrSelf((*this->getOperation()).getOperand(0))))))
    return emitOpError("failed to verify that input and output must have same element type");
  return Verify(*this);
}

void SliceOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::SliceOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::SnapshotOp definitions
//===----------------------------------------------------------------------===//

SnapshotOpAdaptor::SnapshotOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

SnapshotOpAdaptor::SnapshotOpAdaptor(SnapshotOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange SnapshotOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> SnapshotOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange SnapshotOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SnapshotOpAdaptor::input() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr SnapshotOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult SnapshotOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> SnapshotOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range SnapshotOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SnapshotOp::input() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange SnapshotOp::inputMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> SnapshotOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range SnapshotOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SnapshotOp::output() {
  return *getODSResults(0).begin();
}

::mlir::Type SnapshotOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool SnapshotOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr SnapshotOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void SnapshotOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input) {
  odsState.addOperands(input);
  odsState.addTypes(output);
}

void SnapshotOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input) {
  odsState.addOperands(input);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void SnapshotOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult SnapshotOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void SnapshotOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::SnapshotOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::SoftmaxCrossEntropyWithLogitsOp definitions
//===----------------------------------------------------------------------===//

SoftmaxCrossEntropyWithLogitsOpAdaptor::SoftmaxCrossEntropyWithLogitsOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

SoftmaxCrossEntropyWithLogitsOpAdaptor::SoftmaxCrossEntropyWithLogitsOpAdaptor(SoftmaxCrossEntropyWithLogitsOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange SoftmaxCrossEntropyWithLogitsOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> SoftmaxCrossEntropyWithLogitsOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange SoftmaxCrossEntropyWithLogitsOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SoftmaxCrossEntropyWithLogitsOpAdaptor::features() {
  return *getODSOperands(0).begin();
}

::mlir::Value SoftmaxCrossEntropyWithLogitsOpAdaptor::labels() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr SoftmaxCrossEntropyWithLogitsOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult SoftmaxCrossEntropyWithLogitsOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

void SoftmaxCrossEntropyWithLogitsOp::getAsmResultNames(::mlir::OpAsmSetValueNameFn setNameFn) {
  auto resultGroup0 = getODSResults(0);
  if (!llvm::empty(resultGroup0))
    setNameFn(*resultGroup0.begin(), "loss");
  auto resultGroup1 = getODSResults(1);
  if (!llvm::empty(resultGroup1))
    setNameFn(*resultGroup1.begin(), "backprop");
}

std::pair<unsigned, unsigned> SoftmaxCrossEntropyWithLogitsOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range SoftmaxCrossEntropyWithLogitsOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SoftmaxCrossEntropyWithLogitsOp::features() {
  return *getODSOperands(0).begin();
}

::mlir::Value SoftmaxCrossEntropyWithLogitsOp::labels() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange SoftmaxCrossEntropyWithLogitsOp::featuresMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange SoftmaxCrossEntropyWithLogitsOp::labelsMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> SoftmaxCrossEntropyWithLogitsOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range SoftmaxCrossEntropyWithLogitsOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SoftmaxCrossEntropyWithLogitsOp::loss() {
  return *getODSResults(0).begin();
}

::mlir::Value SoftmaxCrossEntropyWithLogitsOp::backprop() {
  return *getODSResults(1).begin();
}

::mlir::Type SoftmaxCrossEntropyWithLogitsOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool SoftmaxCrossEntropyWithLogitsOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr SoftmaxCrossEntropyWithLogitsOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void SoftmaxCrossEntropyWithLogitsOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type loss, ::mlir::Type backprop, ::mlir::Value features, ::mlir::Value labels) {
  odsState.addOperands(features);
  odsState.addOperands(labels);
  odsState.addTypes(loss);
  odsState.addTypes(backprop);
}

void SoftmaxCrossEntropyWithLogitsOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value features, ::mlir::Value labels) {
  odsState.addOperands(features);
  odsState.addOperands(labels);
  assert(resultTypes.size() == 2u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void SoftmaxCrossEntropyWithLogitsOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 2u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult SoftmaxCrossEntropyWithLogitsOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSResults(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return Verify(*this);
}

void SoftmaxCrossEntropyWithLogitsOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::SoftmaxCrossEntropyWithLogitsOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::SoftmaxOp definitions
//===----------------------------------------------------------------------===//

SoftmaxOpAdaptor::SoftmaxOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

SoftmaxOpAdaptor::SoftmaxOpAdaptor(SoftmaxOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange SoftmaxOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> SoftmaxOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange SoftmaxOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SoftmaxOpAdaptor::logits() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr SoftmaxOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult SoftmaxOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> SoftmaxOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range SoftmaxOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SoftmaxOp::logits() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange SoftmaxOp::logitsMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> SoftmaxOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range SoftmaxOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SoftmaxOp::softmax() {
  return *getODSResults(0).begin();
}

::mlir::Type SoftmaxOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool SoftmaxOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr SoftmaxOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void SoftmaxOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type softmax, ::mlir::Value logits) {
  odsState.addOperands(logits);
  odsState.addTypes(softmax);
}

void SoftmaxOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value logits) {
  odsState.addOperands(logits);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void SoftmaxOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

void SoftmaxOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value logits) {
  odsState.addOperands(logits);
  odsState.addTypes({logits.getType()});

}

void SoftmaxOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  odsState.addTypes({operands[0].getType()});

}

::mlir::LogicalResult SoftmaxOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return Verify(*this);
}

void SoftmaxOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::SoftmaxOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::SoftplusGradOp definitions
//===----------------------------------------------------------------------===//

SoftplusGradOpAdaptor::SoftplusGradOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

SoftplusGradOpAdaptor::SoftplusGradOpAdaptor(SoftplusGradOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange SoftplusGradOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> SoftplusGradOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange SoftplusGradOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SoftplusGradOpAdaptor::gradients() {
  return *getODSOperands(0).begin();
}

::mlir::Value SoftplusGradOpAdaptor::features() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr SoftplusGradOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult SoftplusGradOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> SoftplusGradOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range SoftplusGradOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SoftplusGradOp::gradients() {
  return *getODSOperands(0).begin();
}

::mlir::Value SoftplusGradOp::features() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange SoftplusGradOp::gradientsMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange SoftplusGradOp::featuresMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> SoftplusGradOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range SoftplusGradOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SoftplusGradOp::backprops() {
  return *getODSResults(0).begin();
}

::mlir::Type SoftplusGradOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool SoftplusGradOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr SoftplusGradOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void SoftplusGradOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type backprops, ::mlir::Value gradients, ::mlir::Value features) {
  odsState.addOperands(gradients);
  odsState.addOperands(features);
  odsState.addTypes(backprops);
}

void SoftplusGradOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value gradients, ::mlir::Value features) {
  odsState.addOperands(gradients);
  odsState.addOperands(features);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void SoftplusGradOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult SoftplusGradOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void SoftplusGradOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::SoftplusGradOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::SoftplusOp definitions
//===----------------------------------------------------------------------===//

SoftplusOpAdaptor::SoftplusOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

SoftplusOpAdaptor::SoftplusOpAdaptor(SoftplusOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange SoftplusOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> SoftplusOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange SoftplusOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SoftplusOpAdaptor::features() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr SoftplusOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult SoftplusOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> SoftplusOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range SoftplusOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SoftplusOp::features() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange SoftplusOp::featuresMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> SoftplusOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range SoftplusOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SoftplusOp::activations() {
  return *getODSResults(0).begin();
}

::mlir::Type SoftplusOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool SoftplusOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr SoftplusOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void SoftplusOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type activations, ::mlir::Value features) {
  odsState.addOperands(features);
  odsState.addTypes(activations);
}

void SoftplusOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value features) {
  odsState.addOperands(features);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void SoftplusOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult SoftplusOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void SoftplusOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::SoftplusOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::SoftsignGradOp definitions
//===----------------------------------------------------------------------===//

SoftsignGradOpAdaptor::SoftsignGradOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

SoftsignGradOpAdaptor::SoftsignGradOpAdaptor(SoftsignGradOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange SoftsignGradOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> SoftsignGradOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange SoftsignGradOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SoftsignGradOpAdaptor::gradients() {
  return *getODSOperands(0).begin();
}

::mlir::Value SoftsignGradOpAdaptor::features() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr SoftsignGradOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult SoftsignGradOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> SoftsignGradOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range SoftsignGradOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SoftsignGradOp::gradients() {
  return *getODSOperands(0).begin();
}

::mlir::Value SoftsignGradOp::features() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange SoftsignGradOp::gradientsMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange SoftsignGradOp::featuresMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> SoftsignGradOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range SoftsignGradOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SoftsignGradOp::backprops() {
  return *getODSResults(0).begin();
}

::mlir::Type SoftsignGradOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool SoftsignGradOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr SoftsignGradOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void SoftsignGradOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type backprops, ::mlir::Value gradients, ::mlir::Value features) {
  odsState.addOperands(gradients);
  odsState.addOperands(features);
  odsState.addTypes(backprops);
}

void SoftsignGradOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value gradients, ::mlir::Value features) {
  odsState.addOperands(gradients);
  odsState.addOperands(features);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void SoftsignGradOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult SoftsignGradOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void SoftsignGradOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::SoftsignGradOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::SoftsignOp definitions
//===----------------------------------------------------------------------===//

SoftsignOpAdaptor::SoftsignOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

SoftsignOpAdaptor::SoftsignOpAdaptor(SoftsignOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange SoftsignOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> SoftsignOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange SoftsignOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SoftsignOpAdaptor::features() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr SoftsignOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult SoftsignOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> SoftsignOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range SoftsignOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SoftsignOp::features() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange SoftsignOp::featuresMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> SoftsignOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range SoftsignOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SoftsignOp::activations() {
  return *getODSResults(0).begin();
}

::mlir::Type SoftsignOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool SoftsignOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr SoftsignOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void SoftsignOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type activations, ::mlir::Value features) {
  odsState.addOperands(features);
  odsState.addTypes(activations);
}

void SoftsignOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value features) {
  odsState.addOperands(features);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void SoftsignOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult SoftsignOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void SoftsignOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::SoftsignOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::SpaceToBatchNDOp definitions
//===----------------------------------------------------------------------===//

SpaceToBatchNDOpAdaptor::SpaceToBatchNDOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

SpaceToBatchNDOpAdaptor::SpaceToBatchNDOpAdaptor(SpaceToBatchNDOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange SpaceToBatchNDOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> SpaceToBatchNDOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange SpaceToBatchNDOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SpaceToBatchNDOpAdaptor::input() {
  return *getODSOperands(0).begin();
}

::mlir::Value SpaceToBatchNDOpAdaptor::block_shape() {
  return *getODSOperands(1).begin();
}

::mlir::Value SpaceToBatchNDOpAdaptor::paddings() {
  return *getODSOperands(2).begin();
}

::mlir::DictionaryAttr SpaceToBatchNDOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult SpaceToBatchNDOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> SpaceToBatchNDOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range SpaceToBatchNDOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SpaceToBatchNDOp::input() {
  return *getODSOperands(0).begin();
}

::mlir::Value SpaceToBatchNDOp::block_shape() {
  return *getODSOperands(1).begin();
}

::mlir::Value SpaceToBatchNDOp::paddings() {
  return *getODSOperands(2).begin();
}

::mlir::MutableOperandRange SpaceToBatchNDOp::inputMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange SpaceToBatchNDOp::block_shapeMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange SpaceToBatchNDOp::paddingsMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> SpaceToBatchNDOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range SpaceToBatchNDOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SpaceToBatchNDOp::output() {
  return *getODSResults(0).begin();
}

::mlir::Type SpaceToBatchNDOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

::mlir::Type SpaceToBatchNDOp::Tblock_shape() {
  return mlir::getElementTypeOrSelf(*getODSOperands(1).begin());
}

::mlir::Type SpaceToBatchNDOp::Tpaddings() {
  return mlir::getElementTypeOrSelf(*getODSOperands(2).begin());
}

bool SpaceToBatchNDOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
  if (name == "Tblock_shape") return true;
  if (name == "Tpaddings") return true;
 return false;
}

::mlir::DictionaryAttr SpaceToBatchNDOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())},
    {Tblock_shapeAttrName(),
::mlir::TypeAttr::get(Tblock_shape())},
    {TpaddingsAttrName(),
::mlir::TypeAttr::get(Tpaddings())}});
}

void SpaceToBatchNDOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input, ::mlir::Value block_shape, ::mlir::Value paddings) {
  odsState.addOperands(input);
  odsState.addOperands(block_shape);
  odsState.addOperands(paddings);
  odsState.addTypes(output);
}

void SpaceToBatchNDOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::Value block_shape, ::mlir::Value paddings) {
  odsState.addOperands(input);
  odsState.addOperands(block_shape);
  odsState.addOperands(paddings);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void SpaceToBatchNDOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 3u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult SpaceToBatchNDOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return Verify(*this);
}

void SpaceToBatchNDOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::SpaceToBatchNDOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::SpaceToBatchOp definitions
//===----------------------------------------------------------------------===//

SpaceToBatchOpAdaptor::SpaceToBatchOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

SpaceToBatchOpAdaptor::SpaceToBatchOpAdaptor(SpaceToBatchOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange SpaceToBatchOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> SpaceToBatchOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange SpaceToBatchOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SpaceToBatchOpAdaptor::input() {
  return *getODSOperands(0).begin();
}

::mlir::Value SpaceToBatchOpAdaptor::paddings() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr SpaceToBatchOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::IntegerAttr SpaceToBatchOpAdaptor::block_size() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("block_size").cast<::mlir::IntegerAttr>();
  return attr;
}

::mlir::LogicalResult SpaceToBatchOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_block_size = odsAttrs.get("block_size");
    if (!tblgen_block_size)
      return emitError(loc, "'tf.SpaceToBatch' op ""requires attribute 'block_size'");

    if (tblgen_block_size && !((((tblgen_block_size.isa<::mlir::IntegerAttr>())) && ((tblgen_block_size.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))) && ((tblgen_block_size.cast<::mlir::IntegerAttr>().getInt() >= 2))))
      return emitError(loc, "'tf.SpaceToBatch' op ""attribute 'block_size' failed to satisfy constraint: 64-bit signless integer attribute whose minimum value is 2");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> SpaceToBatchOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range SpaceToBatchOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SpaceToBatchOp::input() {
  return *getODSOperands(0).begin();
}

::mlir::Value SpaceToBatchOp::paddings() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange SpaceToBatchOp::inputMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange SpaceToBatchOp::paddingsMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> SpaceToBatchOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range SpaceToBatchOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SpaceToBatchOp::output() {
  return *getODSResults(0).begin();
}

::mlir::IntegerAttr SpaceToBatchOp::block_sizeAttr() {
  return (*this)->getAttr(block_sizeAttrName()).cast<::mlir::IntegerAttr>();
}

uint64_t SpaceToBatchOp::block_size() {
  auto attr = block_sizeAttr();
  return attr.getValue().getZExtValue();
}

::mlir::Type SpaceToBatchOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

::mlir::Type SpaceToBatchOp::Tpaddings() {
  return mlir::getElementTypeOrSelf(*getODSOperands(1).begin());
}

bool SpaceToBatchOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
  if (name == "Tpaddings") return true;
 return false;
}

::mlir::DictionaryAttr SpaceToBatchOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())},
    {TpaddingsAttrName(),
::mlir::TypeAttr::get(Tpaddings())}});
}

void SpaceToBatchOp::block_sizeAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(block_sizeAttrName(), attr);
}

void SpaceToBatchOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input, ::mlir::Value paddings, ::mlir::IntegerAttr block_size) {
  odsState.addOperands(input);
  odsState.addOperands(paddings);
  odsState.addAttribute(block_sizeAttrName(odsState.name), block_size);
  odsState.addTypes(output);
}

void SpaceToBatchOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::Value paddings, ::mlir::IntegerAttr block_size) {
  odsState.addOperands(input);
  odsState.addOperands(paddings);
  odsState.addAttribute(block_sizeAttrName(odsState.name), block_size);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void SpaceToBatchOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input, ::mlir::Value paddings, uint64_t block_size) {
  odsState.addOperands(input);
  odsState.addOperands(paddings);
  odsState.addAttribute(block_sizeAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), block_size));
  odsState.addTypes(output);
}

void SpaceToBatchOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::Value paddings, uint64_t block_size) {
  odsState.addOperands(input);
  odsState.addOperands(paddings);
  odsState.addAttribute(block_sizeAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), block_size));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void SpaceToBatchOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult SpaceToBatchOp::verify() {
  {
    auto tblgen_block_size = (*this)->getAttr(block_sizeAttrName());
    if (!tblgen_block_size)
      return emitOpError("requires attribute 'block_size'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops14(*this, tblgen_block_size, "block_size")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void SpaceToBatchOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::SpaceToBatchOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::SpaceToDepthOp definitions
//===----------------------------------------------------------------------===//

SpaceToDepthOpAdaptor::SpaceToDepthOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

SpaceToDepthOpAdaptor::SpaceToDepthOpAdaptor(SpaceToDepthOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange SpaceToDepthOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> SpaceToDepthOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange SpaceToDepthOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SpaceToDepthOpAdaptor::input() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr SpaceToDepthOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::IntegerAttr SpaceToDepthOpAdaptor::block_size() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("block_size").cast<::mlir::IntegerAttr>();
  return attr;
}

::mlir::StringAttr SpaceToDepthOpAdaptor::data_format() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("data_format").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("NHWC");
  return attr;
}

::mlir::LogicalResult SpaceToDepthOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_block_size = odsAttrs.get("block_size");
    if (!tblgen_block_size)
      return emitError(loc, "'tf.SpaceToDepth' op ""requires attribute 'block_size'");

    if (tblgen_block_size && !((((tblgen_block_size.isa<::mlir::IntegerAttr>())) && ((tblgen_block_size.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))) && ((tblgen_block_size.cast<::mlir::IntegerAttr>().getInt() >= 2))))
      return emitError(loc, "'tf.SpaceToDepth' op ""attribute 'block_size' failed to satisfy constraint: 64-bit signless integer attribute whose minimum value is 2");
  }
  {
    auto tblgen_data_format = odsAttrs.get("data_format");
    if (tblgen_data_format && !((tblgen_data_format.cast<StringAttr>().getValue() == "NHWC" || tblgen_data_format.cast<StringAttr>().getValue() == "NCHW" || tblgen_data_format.cast<StringAttr>().getValue() == "NCHW_VECT_C")))
      return emitError(loc, "'tf.SpaceToDepth' op ""attribute 'data_format' failed to satisfy constraint: string attribute whose value is NHWC, or NCHW, or NCHW_VECT_C");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> SpaceToDepthOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range SpaceToDepthOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SpaceToDepthOp::input() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange SpaceToDepthOp::inputMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> SpaceToDepthOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range SpaceToDepthOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SpaceToDepthOp::output() {
  return *getODSResults(0).begin();
}

::mlir::IntegerAttr SpaceToDepthOp::block_sizeAttr() {
  return (*this)->getAttr(block_sizeAttrName()).cast<::mlir::IntegerAttr>();
}

uint64_t SpaceToDepthOp::block_size() {
  auto attr = block_sizeAttr();
  return attr.getValue().getZExtValue();
}

::mlir::StringAttr SpaceToDepthOp::data_formatAttr() {
  return (*this)->getAttr(data_formatAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef SpaceToDepthOp::data_format() {
  auto attr = data_formatAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("NHWC").getValue();
  return attr.getValue();
}

::mlir::Type SpaceToDepthOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool SpaceToDepthOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr SpaceToDepthOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void SpaceToDepthOp::block_sizeAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(block_sizeAttrName(), attr);
}

void SpaceToDepthOp::data_formatAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(data_formatAttrName(), attr);
}

void SpaceToDepthOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input, ::mlir::IntegerAttr block_size, ::mlir::StringAttr data_format) {
  odsState.addOperands(input);
  odsState.addAttribute(block_sizeAttrName(odsState.name), block_size);
  odsState.addAttribute(data_formatAttrName(odsState.name), data_format);
  odsState.addTypes(output);
}

void SpaceToDepthOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::IntegerAttr block_size, ::mlir::StringAttr data_format) {
  odsState.addOperands(input);
  odsState.addAttribute(block_sizeAttrName(odsState.name), block_size);
  odsState.addAttribute(data_formatAttrName(odsState.name), data_format);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void SpaceToDepthOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input, uint64_t block_size, ::llvm::StringRef data_format) {
  odsState.addOperands(input);
  odsState.addAttribute(block_sizeAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), block_size));
  odsState.addAttribute(data_formatAttrName(odsState.name), odsBuilder.getStringAttr(data_format));
  odsState.addTypes(output);
}

void SpaceToDepthOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, uint64_t block_size, ::llvm::StringRef data_format) {
  odsState.addOperands(input);
  odsState.addAttribute(block_sizeAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), block_size));
  odsState.addAttribute(data_formatAttrName(odsState.name), odsBuilder.getStringAttr(data_format));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void SpaceToDepthOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult SpaceToDepthOp::verify() {
  {
    auto tblgen_block_size = (*this)->getAttr(block_sizeAttrName());
    if (!tblgen_block_size)
      return emitOpError("requires attribute 'block_size'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops14(*this, tblgen_block_size, "block_size")))
      return ::mlir::failure();
  }
  {
    auto tblgen_data_format = (*this)->getAttr(data_formatAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops23(*this, tblgen_data_format, "data_format")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void SpaceToDepthOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::SpaceToDepthOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::SparseAddOp definitions
//===----------------------------------------------------------------------===//

SparseAddOpAdaptor::SparseAddOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

SparseAddOpAdaptor::SparseAddOpAdaptor(SparseAddOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange SparseAddOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> SparseAddOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange SparseAddOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SparseAddOpAdaptor::a_indices() {
  return *getODSOperands(0).begin();
}

::mlir::Value SparseAddOpAdaptor::a_values() {
  return *getODSOperands(1).begin();
}

::mlir::Value SparseAddOpAdaptor::a_shape() {
  return *getODSOperands(2).begin();
}

::mlir::Value SparseAddOpAdaptor::b_indices() {
  return *getODSOperands(3).begin();
}

::mlir::Value SparseAddOpAdaptor::b_values() {
  return *getODSOperands(4).begin();
}

::mlir::Value SparseAddOpAdaptor::b_shape() {
  return *getODSOperands(5).begin();
}

::mlir::Value SparseAddOpAdaptor::thresh() {
  return *getODSOperands(6).begin();
}

::mlir::DictionaryAttr SparseAddOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult SparseAddOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

void SparseAddOp::getAsmResultNames(::mlir::OpAsmSetValueNameFn setNameFn) {
  auto resultGroup0 = getODSResults(0);
  if (!llvm::empty(resultGroup0))
    setNameFn(*resultGroup0.begin(), "sum_indices");
  auto resultGroup1 = getODSResults(1);
  if (!llvm::empty(resultGroup1))
    setNameFn(*resultGroup1.begin(), "sum_values");
  auto resultGroup2 = getODSResults(2);
  if (!llvm::empty(resultGroup2))
    setNameFn(*resultGroup2.begin(), "sum_shape");
}

std::pair<unsigned, unsigned> SparseAddOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range SparseAddOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SparseAddOp::a_indices() {
  return *getODSOperands(0).begin();
}

::mlir::Value SparseAddOp::a_values() {
  return *getODSOperands(1).begin();
}

::mlir::Value SparseAddOp::a_shape() {
  return *getODSOperands(2).begin();
}

::mlir::Value SparseAddOp::b_indices() {
  return *getODSOperands(3).begin();
}

::mlir::Value SparseAddOp::b_values() {
  return *getODSOperands(4).begin();
}

::mlir::Value SparseAddOp::b_shape() {
  return *getODSOperands(5).begin();
}

::mlir::Value SparseAddOp::thresh() {
  return *getODSOperands(6).begin();
}

::mlir::MutableOperandRange SparseAddOp::a_indicesMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange SparseAddOp::a_valuesMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange SparseAddOp::a_shapeMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange SparseAddOp::b_indicesMutable() {
  auto range = getODSOperandIndexAndLength(3);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange SparseAddOp::b_valuesMutable() {
  auto range = getODSOperandIndexAndLength(4);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange SparseAddOp::b_shapeMutable() {
  auto range = getODSOperandIndexAndLength(5);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange SparseAddOp::threshMutable() {
  auto range = getODSOperandIndexAndLength(6);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> SparseAddOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range SparseAddOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SparseAddOp::sum_indices() {
  return *getODSResults(0).begin();
}

::mlir::Value SparseAddOp::sum_values() {
  return *getODSResults(1).begin();
}

::mlir::Value SparseAddOp::sum_shape() {
  return *getODSResults(2).begin();
}

::mlir::Type SparseAddOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(1).begin());
}

::mlir::Type SparseAddOp::Treal() {
  return mlir::getElementTypeOrSelf(*getODSOperands(6).begin());
}

bool SparseAddOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
  if (name == "Treal") return true;
 return false;
}

::mlir::DictionaryAttr SparseAddOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())},
    {TrealAttrName(),
::mlir::TypeAttr::get(Treal())}});
}

void SparseAddOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type sum_indices, ::mlir::Type sum_values, ::mlir::Type sum_shape, ::mlir::Value a_indices, ::mlir::Value a_values, ::mlir::Value a_shape, ::mlir::Value b_indices, ::mlir::Value b_values, ::mlir::Value b_shape, ::mlir::Value thresh) {
  odsState.addOperands(a_indices);
  odsState.addOperands(a_values);
  odsState.addOperands(a_shape);
  odsState.addOperands(b_indices);
  odsState.addOperands(b_values);
  odsState.addOperands(b_shape);
  odsState.addOperands(thresh);
  odsState.addTypes(sum_indices);
  odsState.addTypes(sum_values);
  odsState.addTypes(sum_shape);
}

void SparseAddOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value a_indices, ::mlir::Value a_values, ::mlir::Value a_shape, ::mlir::Value b_indices, ::mlir::Value b_values, ::mlir::Value b_shape, ::mlir::Value thresh) {
  odsState.addOperands(a_indices);
  odsState.addOperands(a_values);
  odsState.addOperands(a_shape);
  odsState.addOperands(b_indices);
  odsState.addOperands(b_values);
  odsState.addOperands(b_shape);
  odsState.addOperands(thresh);
  assert(resultTypes.size() == 3u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void SparseAddOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 7u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 3u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult SparseAddOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops16(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops16(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup3 = getODSOperands(3);

    for (auto v : valueGroup3) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops16(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup4 = getODSOperands(4);

    for (auto v : valueGroup4) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup5 = getODSOperands(5);

    for (auto v : valueGroup5) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops16(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup6 = getODSOperands(6);

    for (auto v : valueGroup6) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops35(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops16(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSResults(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSResults(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops16(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void SparseAddOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::SparseAddOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::SparseFillEmptyRowsOp definitions
//===----------------------------------------------------------------------===//

SparseFillEmptyRowsOpAdaptor::SparseFillEmptyRowsOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

SparseFillEmptyRowsOpAdaptor::SparseFillEmptyRowsOpAdaptor(SparseFillEmptyRowsOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange SparseFillEmptyRowsOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> SparseFillEmptyRowsOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange SparseFillEmptyRowsOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SparseFillEmptyRowsOpAdaptor::indices() {
  return *getODSOperands(0).begin();
}

::mlir::Value SparseFillEmptyRowsOpAdaptor::values() {
  return *getODSOperands(1).begin();
}

::mlir::Value SparseFillEmptyRowsOpAdaptor::dense_shape() {
  return *getODSOperands(2).begin();
}

::mlir::Value SparseFillEmptyRowsOpAdaptor::default_value() {
  return *getODSOperands(3).begin();
}

::mlir::DictionaryAttr SparseFillEmptyRowsOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult SparseFillEmptyRowsOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

void SparseFillEmptyRowsOp::getAsmResultNames(::mlir::OpAsmSetValueNameFn setNameFn) {
  auto resultGroup0 = getODSResults(0);
  if (!llvm::empty(resultGroup0))
    setNameFn(*resultGroup0.begin(), "output_indices");
  auto resultGroup1 = getODSResults(1);
  if (!llvm::empty(resultGroup1))
    setNameFn(*resultGroup1.begin(), "output_values");
  auto resultGroup2 = getODSResults(2);
  if (!llvm::empty(resultGroup2))
    setNameFn(*resultGroup2.begin(), "empty_row_indicator");
  auto resultGroup3 = getODSResults(3);
  if (!llvm::empty(resultGroup3))
    setNameFn(*resultGroup3.begin(), "reverse_index_map");
}

std::pair<unsigned, unsigned> SparseFillEmptyRowsOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range SparseFillEmptyRowsOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SparseFillEmptyRowsOp::indices() {
  return *getODSOperands(0).begin();
}

::mlir::Value SparseFillEmptyRowsOp::values() {
  return *getODSOperands(1).begin();
}

::mlir::Value SparseFillEmptyRowsOp::dense_shape() {
  return *getODSOperands(2).begin();
}

::mlir::Value SparseFillEmptyRowsOp::default_value() {
  return *getODSOperands(3).begin();
}

::mlir::MutableOperandRange SparseFillEmptyRowsOp::indicesMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange SparseFillEmptyRowsOp::valuesMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange SparseFillEmptyRowsOp::dense_shapeMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange SparseFillEmptyRowsOp::default_valueMutable() {
  auto range = getODSOperandIndexAndLength(3);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> SparseFillEmptyRowsOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range SparseFillEmptyRowsOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SparseFillEmptyRowsOp::output_indices() {
  return *getODSResults(0).begin();
}

::mlir::Value SparseFillEmptyRowsOp::output_values() {
  return *getODSResults(1).begin();
}

::mlir::Value SparseFillEmptyRowsOp::empty_row_indicator() {
  return *getODSResults(2).begin();
}

::mlir::Value SparseFillEmptyRowsOp::reverse_index_map() {
  return *getODSResults(3).begin();
}

::mlir::Type SparseFillEmptyRowsOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(1).begin());
}

bool SparseFillEmptyRowsOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr SparseFillEmptyRowsOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void SparseFillEmptyRowsOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output_indices, ::mlir::Type output_values, ::mlir::Type empty_row_indicator, ::mlir::Type reverse_index_map, ::mlir::Value indices, ::mlir::Value values, ::mlir::Value dense_shape, ::mlir::Value default_value) {
  odsState.addOperands(indices);
  odsState.addOperands(values);
  odsState.addOperands(dense_shape);
  odsState.addOperands(default_value);
  odsState.addTypes(output_indices);
  odsState.addTypes(output_values);
  odsState.addTypes(empty_row_indicator);
  odsState.addTypes(reverse_index_map);
}

void SparseFillEmptyRowsOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value indices, ::mlir::Value values, ::mlir::Value dense_shape, ::mlir::Value default_value) {
  odsState.addOperands(indices);
  odsState.addOperands(values);
  odsState.addOperands(dense_shape);
  odsState.addOperands(default_value);
  assert(resultTypes.size() == 4u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void SparseFillEmptyRowsOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 4u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 4u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult SparseFillEmptyRowsOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops16(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops16(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup3 = getODSOperands(3);

    for (auto v : valueGroup3) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops16(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSResults(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSResults(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops8(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
    auto valueGroup3 = getODSResults(3);

    for (auto v : valueGroup3) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops16(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void SparseFillEmptyRowsOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::SparseFillEmptyRowsOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::SparseMatMulOp definitions
//===----------------------------------------------------------------------===//

SparseMatMulOpAdaptor::SparseMatMulOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

SparseMatMulOpAdaptor::SparseMatMulOpAdaptor(SparseMatMulOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange SparseMatMulOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> SparseMatMulOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange SparseMatMulOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SparseMatMulOpAdaptor::a() {
  return *getODSOperands(0).begin();
}

::mlir::Value SparseMatMulOpAdaptor::b() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr SparseMatMulOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::BoolAttr SparseMatMulOpAdaptor::transpose_a() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("transpose_a").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(false);
  return attr;
}

::mlir::BoolAttr SparseMatMulOpAdaptor::transpose_b() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("transpose_b").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(false);
  return attr;
}

::mlir::BoolAttr SparseMatMulOpAdaptor::a_is_sparse() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("a_is_sparse").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(false);
  return attr;
}

::mlir::BoolAttr SparseMatMulOpAdaptor::b_is_sparse() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("b_is_sparse").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(false);
  return attr;
}

::mlir::LogicalResult SparseMatMulOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_transpose_a = odsAttrs.get("transpose_a");
    if (tblgen_transpose_a && !((tblgen_transpose_a.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.SparseMatMul' op ""attribute 'transpose_a' failed to satisfy constraint: bool attribute");
  }
  {
    auto tblgen_transpose_b = odsAttrs.get("transpose_b");
    if (tblgen_transpose_b && !((tblgen_transpose_b.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.SparseMatMul' op ""attribute 'transpose_b' failed to satisfy constraint: bool attribute");
  }
  {
    auto tblgen_a_is_sparse = odsAttrs.get("a_is_sparse");
    if (tblgen_a_is_sparse && !((tblgen_a_is_sparse.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.SparseMatMul' op ""attribute 'a_is_sparse' failed to satisfy constraint: bool attribute");
  }
  {
    auto tblgen_b_is_sparse = odsAttrs.get("b_is_sparse");
    if (tblgen_b_is_sparse && !((tblgen_b_is_sparse.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.SparseMatMul' op ""attribute 'b_is_sparse' failed to satisfy constraint: bool attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> SparseMatMulOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range SparseMatMulOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SparseMatMulOp::a() {
  return *getODSOperands(0).begin();
}

::mlir::Value SparseMatMulOp::b() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange SparseMatMulOp::aMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange SparseMatMulOp::bMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> SparseMatMulOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range SparseMatMulOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SparseMatMulOp::product() {
  return *getODSResults(0).begin();
}

::mlir::BoolAttr SparseMatMulOp::transpose_aAttr() {
  return (*this)->getAttr(transpose_aAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool SparseMatMulOp::transpose_a() {
  auto attr = transpose_aAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(false).getValue();
  return attr.getValue();
}

::mlir::BoolAttr SparseMatMulOp::transpose_bAttr() {
  return (*this)->getAttr(transpose_bAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool SparseMatMulOp::transpose_b() {
  auto attr = transpose_bAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(false).getValue();
  return attr.getValue();
}

::mlir::BoolAttr SparseMatMulOp::a_is_sparseAttr() {
  return (*this)->getAttr(a_is_sparseAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool SparseMatMulOp::a_is_sparse() {
  auto attr = a_is_sparseAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(false).getValue();
  return attr.getValue();
}

::mlir::BoolAttr SparseMatMulOp::b_is_sparseAttr() {
  return (*this)->getAttr(b_is_sparseAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool SparseMatMulOp::b_is_sparse() {
  auto attr = b_is_sparseAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(false).getValue();
  return attr.getValue();
}

::mlir::Type SparseMatMulOp::Ta() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

::mlir::Type SparseMatMulOp::Tb() {
  return mlir::getElementTypeOrSelf(*getODSOperands(1).begin());
}

bool SparseMatMulOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "Ta") return true;
  if (name == "Tb") return true;
 return false;
}

::mlir::DictionaryAttr SparseMatMulOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TaAttrName(),
::mlir::TypeAttr::get(Ta())},
    {TbAttrName(),
::mlir::TypeAttr::get(Tb())}});
}

void SparseMatMulOp::transpose_aAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(transpose_aAttrName(), attr);
}

void SparseMatMulOp::transpose_bAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(transpose_bAttrName(), attr);
}

void SparseMatMulOp::a_is_sparseAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(a_is_sparseAttrName(), attr);
}

void SparseMatMulOp::b_is_sparseAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(b_is_sparseAttrName(), attr);
}

void SparseMatMulOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type product, ::mlir::Value a, ::mlir::Value b, ::mlir::BoolAttr transpose_a, ::mlir::BoolAttr transpose_b, ::mlir::BoolAttr a_is_sparse, ::mlir::BoolAttr b_is_sparse) {
  odsState.addOperands(a);
  odsState.addOperands(b);
  odsState.addAttribute(transpose_aAttrName(odsState.name), transpose_a);
  odsState.addAttribute(transpose_bAttrName(odsState.name), transpose_b);
  odsState.addAttribute(a_is_sparseAttrName(odsState.name), a_is_sparse);
  odsState.addAttribute(b_is_sparseAttrName(odsState.name), b_is_sparse);
  odsState.addTypes(product);
}

void SparseMatMulOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value a, ::mlir::Value b, ::mlir::BoolAttr transpose_a, ::mlir::BoolAttr transpose_b, ::mlir::BoolAttr a_is_sparse, ::mlir::BoolAttr b_is_sparse) {
  odsState.addOperands(a);
  odsState.addOperands(b);
  odsState.addAttribute(transpose_aAttrName(odsState.name), transpose_a);
  odsState.addAttribute(transpose_bAttrName(odsState.name), transpose_b);
  odsState.addAttribute(a_is_sparseAttrName(odsState.name), a_is_sparse);
  odsState.addAttribute(b_is_sparseAttrName(odsState.name), b_is_sparse);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void SparseMatMulOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type product, ::mlir::Value a, ::mlir::Value b, bool transpose_a, bool transpose_b, bool a_is_sparse, bool b_is_sparse) {
  odsState.addOperands(a);
  odsState.addOperands(b);
  odsState.addAttribute(transpose_aAttrName(odsState.name), odsBuilder.getBoolAttr(transpose_a));
  odsState.addAttribute(transpose_bAttrName(odsState.name), odsBuilder.getBoolAttr(transpose_b));
  odsState.addAttribute(a_is_sparseAttrName(odsState.name), odsBuilder.getBoolAttr(a_is_sparse));
  odsState.addAttribute(b_is_sparseAttrName(odsState.name), odsBuilder.getBoolAttr(b_is_sparse));
  odsState.addTypes(product);
}

void SparseMatMulOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value a, ::mlir::Value b, bool transpose_a, bool transpose_b, bool a_is_sparse, bool b_is_sparse) {
  odsState.addOperands(a);
  odsState.addOperands(b);
  odsState.addAttribute(transpose_aAttrName(odsState.name), odsBuilder.getBoolAttr(transpose_a));
  odsState.addAttribute(transpose_bAttrName(odsState.name), odsBuilder.getBoolAttr(transpose_b));
  odsState.addAttribute(a_is_sparseAttrName(odsState.name), odsBuilder.getBoolAttr(a_is_sparse));
  odsState.addAttribute(b_is_sparseAttrName(odsState.name), odsBuilder.getBoolAttr(b_is_sparse));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void SparseMatMulOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult SparseMatMulOp::verify() {
  {
    auto tblgen_transpose_a = (*this)->getAttr(transpose_aAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_transpose_a, "transpose_a")))
      return ::mlir::failure();
  }
  {
    auto tblgen_transpose_b = (*this)->getAttr(transpose_bAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_transpose_b, "transpose_b")))
      return ::mlir::failure();
  }
  {
    auto tblgen_a_is_sparse = (*this)->getAttr(a_is_sparseAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_a_is_sparse, "a_is_sparse")))
      return ::mlir::failure();
  }
  {
    auto tblgen_b_is_sparse = (*this)->getAttr(b_is_sparseAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_b_is_sparse, "b_is_sparse")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops41(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops41(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void SparseMatMulOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::SparseMatMulOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::SparseReduceSumOp definitions
//===----------------------------------------------------------------------===//

SparseReduceSumOpAdaptor::SparseReduceSumOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

SparseReduceSumOpAdaptor::SparseReduceSumOpAdaptor(SparseReduceSumOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange SparseReduceSumOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> SparseReduceSumOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange SparseReduceSumOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SparseReduceSumOpAdaptor::input_indices() {
  return *getODSOperands(0).begin();
}

::mlir::Value SparseReduceSumOpAdaptor::input_values() {
  return *getODSOperands(1).begin();
}

::mlir::Value SparseReduceSumOpAdaptor::input_shape() {
  return *getODSOperands(2).begin();
}

::mlir::Value SparseReduceSumOpAdaptor::reduction_axes() {
  return *getODSOperands(3).begin();
}

::mlir::DictionaryAttr SparseReduceSumOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::BoolAttr SparseReduceSumOpAdaptor::keep_dims() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("keep_dims").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(false);
  return attr;
}

::mlir::LogicalResult SparseReduceSumOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_keep_dims = odsAttrs.get("keep_dims");
    if (tblgen_keep_dims && !((tblgen_keep_dims.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.SparseReduceSum' op ""attribute 'keep_dims' failed to satisfy constraint: bool attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> SparseReduceSumOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range SparseReduceSumOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SparseReduceSumOp::input_indices() {
  return *getODSOperands(0).begin();
}

::mlir::Value SparseReduceSumOp::input_values() {
  return *getODSOperands(1).begin();
}

::mlir::Value SparseReduceSumOp::input_shape() {
  return *getODSOperands(2).begin();
}

::mlir::Value SparseReduceSumOp::reduction_axes() {
  return *getODSOperands(3).begin();
}

::mlir::MutableOperandRange SparseReduceSumOp::input_indicesMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange SparseReduceSumOp::input_valuesMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange SparseReduceSumOp::input_shapeMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange SparseReduceSumOp::reduction_axesMutable() {
  auto range = getODSOperandIndexAndLength(3);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> SparseReduceSumOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range SparseReduceSumOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SparseReduceSumOp::output() {
  return *getODSResults(0).begin();
}

::mlir::BoolAttr SparseReduceSumOp::keep_dimsAttr() {
  return (*this)->getAttr(keep_dimsAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool SparseReduceSumOp::keep_dims() {
  auto attr = keep_dimsAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(false).getValue();
  return attr.getValue();
}

::mlir::Type SparseReduceSumOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(1).begin());
}

bool SparseReduceSumOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr SparseReduceSumOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void SparseReduceSumOp::keep_dimsAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(keep_dimsAttrName(), attr);
}

void SparseReduceSumOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input_indices, ::mlir::Value input_values, ::mlir::Value input_shape, ::mlir::Value reduction_axes, ::mlir::BoolAttr keep_dims) {
  odsState.addOperands(input_indices);
  odsState.addOperands(input_values);
  odsState.addOperands(input_shape);
  odsState.addOperands(reduction_axes);
  odsState.addAttribute(keep_dimsAttrName(odsState.name), keep_dims);
  odsState.addTypes(output);
}

void SparseReduceSumOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input_indices, ::mlir::Value input_values, ::mlir::Value input_shape, ::mlir::Value reduction_axes, ::mlir::BoolAttr keep_dims) {
  odsState.addOperands(input_indices);
  odsState.addOperands(input_values);
  odsState.addOperands(input_shape);
  odsState.addOperands(reduction_axes);
  odsState.addAttribute(keep_dimsAttrName(odsState.name), keep_dims);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void SparseReduceSumOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input_indices, ::mlir::Value input_values, ::mlir::Value input_shape, ::mlir::Value reduction_axes, bool keep_dims) {
  odsState.addOperands(input_indices);
  odsState.addOperands(input_values);
  odsState.addOperands(input_shape);
  odsState.addOperands(reduction_axes);
  odsState.addAttribute(keep_dimsAttrName(odsState.name), odsBuilder.getBoolAttr(keep_dims));
  odsState.addTypes(output);
}

void SparseReduceSumOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input_indices, ::mlir::Value input_values, ::mlir::Value input_shape, ::mlir::Value reduction_axes, bool keep_dims) {
  odsState.addOperands(input_indices);
  odsState.addOperands(input_values);
  odsState.addOperands(input_shape);
  odsState.addOperands(reduction_axes);
  odsState.addAttribute(keep_dimsAttrName(odsState.name), odsBuilder.getBoolAttr(keep_dims));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void SparseReduceSumOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 4u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult SparseReduceSumOp::verify() {
  {
    auto tblgen_keep_dims = (*this)->getAttr(keep_dimsAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_keep_dims, "keep_dims")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops16(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops16(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup3 = getODSOperands(3);

    for (auto v : valueGroup3) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops11(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void SparseReduceSumOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::SparseReduceSumOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::SparseReshapeOp definitions
//===----------------------------------------------------------------------===//

SparseReshapeOpAdaptor::SparseReshapeOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

SparseReshapeOpAdaptor::SparseReshapeOpAdaptor(SparseReshapeOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange SparseReshapeOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> SparseReshapeOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange SparseReshapeOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SparseReshapeOpAdaptor::input_indices() {
  return *getODSOperands(0).begin();
}

::mlir::Value SparseReshapeOpAdaptor::input_shape() {
  return *getODSOperands(1).begin();
}

::mlir::Value SparseReshapeOpAdaptor::new_shape() {
  return *getODSOperands(2).begin();
}

::mlir::DictionaryAttr SparseReshapeOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult SparseReshapeOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

void SparseReshapeOp::getAsmResultNames(::mlir::OpAsmSetValueNameFn setNameFn) {
  auto resultGroup0 = getODSResults(0);
  if (!llvm::empty(resultGroup0))
    setNameFn(*resultGroup0.begin(), "output_indices");
  auto resultGroup1 = getODSResults(1);
  if (!llvm::empty(resultGroup1))
    setNameFn(*resultGroup1.begin(), "output_shape");
}

std::pair<unsigned, unsigned> SparseReshapeOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range SparseReshapeOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SparseReshapeOp::input_indices() {
  return *getODSOperands(0).begin();
}

::mlir::Value SparseReshapeOp::input_shape() {
  return *getODSOperands(1).begin();
}

::mlir::Value SparseReshapeOp::new_shape() {
  return *getODSOperands(2).begin();
}

::mlir::MutableOperandRange SparseReshapeOp::input_indicesMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange SparseReshapeOp::input_shapeMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange SparseReshapeOp::new_shapeMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> SparseReshapeOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range SparseReshapeOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SparseReshapeOp::output_indices() {
  return *getODSResults(0).begin();
}

::mlir::Value SparseReshapeOp::output_shape() {
  return *getODSResults(1).begin();
}

void SparseReshapeOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output_indices, ::mlir::Type output_shape, ::mlir::Value input_indices, ::mlir::Value input_shape, ::mlir::Value new_shape) {
  odsState.addOperands(input_indices);
  odsState.addOperands(input_shape);
  odsState.addOperands(new_shape);
  odsState.addTypes(output_indices);
  odsState.addTypes(output_shape);
}

void SparseReshapeOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input_indices, ::mlir::Value input_shape, ::mlir::Value new_shape) {
  odsState.addOperands(input_indices);
  odsState.addOperands(input_shape);
  odsState.addOperands(new_shape);
  assert(resultTypes.size() == 2u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void SparseReshapeOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 3u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 2u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult SparseReshapeOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops16(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops16(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops16(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops16(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSResults(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops16(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void SparseReshapeOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::SparseReshapeOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::SparseSegmentMeanGradOp definitions
//===----------------------------------------------------------------------===//

SparseSegmentMeanGradOpAdaptor::SparseSegmentMeanGradOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

SparseSegmentMeanGradOpAdaptor::SparseSegmentMeanGradOpAdaptor(SparseSegmentMeanGradOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange SparseSegmentMeanGradOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> SparseSegmentMeanGradOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange SparseSegmentMeanGradOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SparseSegmentMeanGradOpAdaptor::grad() {
  return *getODSOperands(0).begin();
}

::mlir::Value SparseSegmentMeanGradOpAdaptor::indices() {
  return *getODSOperands(1).begin();
}

::mlir::Value SparseSegmentMeanGradOpAdaptor::segment_ids() {
  return *getODSOperands(2).begin();
}

::mlir::Value SparseSegmentMeanGradOpAdaptor::output_dim0() {
  return *getODSOperands(3).begin();
}

::mlir::DictionaryAttr SparseSegmentMeanGradOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult SparseSegmentMeanGradOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> SparseSegmentMeanGradOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range SparseSegmentMeanGradOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SparseSegmentMeanGradOp::grad() {
  return *getODSOperands(0).begin();
}

::mlir::Value SparseSegmentMeanGradOp::indices() {
  return *getODSOperands(1).begin();
}

::mlir::Value SparseSegmentMeanGradOp::segment_ids() {
  return *getODSOperands(2).begin();
}

::mlir::Value SparseSegmentMeanGradOp::output_dim0() {
  return *getODSOperands(3).begin();
}

::mlir::MutableOperandRange SparseSegmentMeanGradOp::gradMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange SparseSegmentMeanGradOp::indicesMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange SparseSegmentMeanGradOp::segment_idsMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange SparseSegmentMeanGradOp::output_dim0Mutable() {
  auto range = getODSOperandIndexAndLength(3);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> SparseSegmentMeanGradOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range SparseSegmentMeanGradOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SparseSegmentMeanGradOp::output() {
  return *getODSResults(0).begin();
}

::mlir::Type SparseSegmentMeanGradOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

::mlir::Type SparseSegmentMeanGradOp::Tidx() {
  return mlir::getElementTypeOrSelf(*getODSOperands(1).begin());
}

::mlir::Type SparseSegmentMeanGradOp::Tsegmentids() {
  return mlir::getElementTypeOrSelf(*getODSOperands(2).begin());
}

bool SparseSegmentMeanGradOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
  if (name == "Tidx") return true;
  if (name == "Tsegmentids") return true;
 return false;
}

::mlir::DictionaryAttr SparseSegmentMeanGradOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())},
    {TidxAttrName(),
::mlir::TypeAttr::get(Tidx())},
    {TsegmentidsAttrName(),
::mlir::TypeAttr::get(Tsegmentids())}});
}

void SparseSegmentMeanGradOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value grad, ::mlir::Value indices, ::mlir::Value segment_ids, ::mlir::Value output_dim0) {
  odsState.addOperands(grad);
  odsState.addOperands(indices);
  odsState.addOperands(segment_ids);
  odsState.addOperands(output_dim0);
  odsState.addTypes(output);
}

void SparseSegmentMeanGradOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value grad, ::mlir::Value indices, ::mlir::Value segment_ids, ::mlir::Value output_dim0) {
  odsState.addOperands(grad);
  odsState.addOperands(indices);
  odsState.addOperands(segment_ids);
  odsState.addOperands(output_dim0);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void SparseSegmentMeanGradOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 4u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult SparseSegmentMeanGradOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup3 = getODSOperands(3);

    for (auto v : valueGroup3) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops11(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void SparseSegmentMeanGradOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::SparseSegmentMeanGradOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::SparseSegmentMeanOp definitions
//===----------------------------------------------------------------------===//

SparseSegmentMeanOpAdaptor::SparseSegmentMeanOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

SparseSegmentMeanOpAdaptor::SparseSegmentMeanOpAdaptor(SparseSegmentMeanOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange SparseSegmentMeanOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> SparseSegmentMeanOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange SparseSegmentMeanOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SparseSegmentMeanOpAdaptor::data() {
  return *getODSOperands(0).begin();
}

::mlir::Value SparseSegmentMeanOpAdaptor::indices() {
  return *getODSOperands(1).begin();
}

::mlir::Value SparseSegmentMeanOpAdaptor::segment_ids() {
  return *getODSOperands(2).begin();
}

::mlir::DictionaryAttr SparseSegmentMeanOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult SparseSegmentMeanOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> SparseSegmentMeanOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range SparseSegmentMeanOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SparseSegmentMeanOp::data() {
  return *getODSOperands(0).begin();
}

::mlir::Value SparseSegmentMeanOp::indices() {
  return *getODSOperands(1).begin();
}

::mlir::Value SparseSegmentMeanOp::segment_ids() {
  return *getODSOperands(2).begin();
}

::mlir::MutableOperandRange SparseSegmentMeanOp::dataMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange SparseSegmentMeanOp::indicesMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange SparseSegmentMeanOp::segment_idsMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> SparseSegmentMeanOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range SparseSegmentMeanOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SparseSegmentMeanOp::output() {
  return *getODSResults(0).begin();
}

::mlir::Type SparseSegmentMeanOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

::mlir::Type SparseSegmentMeanOp::Tidx() {
  return mlir::getElementTypeOrSelf(*getODSOperands(1).begin());
}

::mlir::Type SparseSegmentMeanOp::Tsegmentids() {
  return mlir::getElementTypeOrSelf(*getODSOperands(2).begin());
}

bool SparseSegmentMeanOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
  if (name == "Tidx") return true;
  if (name == "Tsegmentids") return true;
 return false;
}

::mlir::DictionaryAttr SparseSegmentMeanOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())},
    {TidxAttrName(),
::mlir::TypeAttr::get(Tidx())},
    {TsegmentidsAttrName(),
::mlir::TypeAttr::get(Tsegmentids())}});
}

void SparseSegmentMeanOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value data, ::mlir::Value indices, ::mlir::Value segment_ids) {
  odsState.addOperands(data);
  odsState.addOperands(indices);
  odsState.addOperands(segment_ids);
  odsState.addTypes(output);
}

void SparseSegmentMeanOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value data, ::mlir::Value indices, ::mlir::Value segment_ids) {
  odsState.addOperands(data);
  odsState.addOperands(indices);
  odsState.addOperands(segment_ids);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void SparseSegmentMeanOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 3u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult SparseSegmentMeanOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void SparseSegmentMeanOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::SparseSegmentMeanOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::SparseSegmentMeanWithNumSegmentsOp definitions
//===----------------------------------------------------------------------===//

SparseSegmentMeanWithNumSegmentsOpAdaptor::SparseSegmentMeanWithNumSegmentsOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

SparseSegmentMeanWithNumSegmentsOpAdaptor::SparseSegmentMeanWithNumSegmentsOpAdaptor(SparseSegmentMeanWithNumSegmentsOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange SparseSegmentMeanWithNumSegmentsOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> SparseSegmentMeanWithNumSegmentsOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange SparseSegmentMeanWithNumSegmentsOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SparseSegmentMeanWithNumSegmentsOpAdaptor::data() {
  return *getODSOperands(0).begin();
}

::mlir::Value SparseSegmentMeanWithNumSegmentsOpAdaptor::indices() {
  return *getODSOperands(1).begin();
}

::mlir::Value SparseSegmentMeanWithNumSegmentsOpAdaptor::segment_ids() {
  return *getODSOperands(2).begin();
}

::mlir::Value SparseSegmentMeanWithNumSegmentsOpAdaptor::num_segments() {
  return *getODSOperands(3).begin();
}

::mlir::DictionaryAttr SparseSegmentMeanWithNumSegmentsOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult SparseSegmentMeanWithNumSegmentsOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> SparseSegmentMeanWithNumSegmentsOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range SparseSegmentMeanWithNumSegmentsOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SparseSegmentMeanWithNumSegmentsOp::data() {
  return *getODSOperands(0).begin();
}

::mlir::Value SparseSegmentMeanWithNumSegmentsOp::indices() {
  return *getODSOperands(1).begin();
}

::mlir::Value SparseSegmentMeanWithNumSegmentsOp::segment_ids() {
  return *getODSOperands(2).begin();
}

::mlir::Value SparseSegmentMeanWithNumSegmentsOp::num_segments() {
  return *getODSOperands(3).begin();
}

::mlir::MutableOperandRange SparseSegmentMeanWithNumSegmentsOp::dataMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange SparseSegmentMeanWithNumSegmentsOp::indicesMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange SparseSegmentMeanWithNumSegmentsOp::segment_idsMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange SparseSegmentMeanWithNumSegmentsOp::num_segmentsMutable() {
  auto range = getODSOperandIndexAndLength(3);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> SparseSegmentMeanWithNumSegmentsOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range SparseSegmentMeanWithNumSegmentsOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SparseSegmentMeanWithNumSegmentsOp::output() {
  return *getODSResults(0).begin();
}

::mlir::Type SparseSegmentMeanWithNumSegmentsOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

::mlir::Type SparseSegmentMeanWithNumSegmentsOp::Tidx() {
  return mlir::getElementTypeOrSelf(*getODSOperands(1).begin());
}

::mlir::Type SparseSegmentMeanWithNumSegmentsOp::Tnumsegments() {
  return mlir::getElementTypeOrSelf(*getODSOperands(3).begin());
}

::mlir::Type SparseSegmentMeanWithNumSegmentsOp::Tsegmentids() {
  return mlir::getElementTypeOrSelf(*getODSOperands(2).begin());
}

bool SparseSegmentMeanWithNumSegmentsOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
  if (name == "Tidx") return true;
  if (name == "Tnumsegments") return true;
  if (name == "Tsegmentids") return true;
 return false;
}

::mlir::DictionaryAttr SparseSegmentMeanWithNumSegmentsOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())},
    {TidxAttrName(),
::mlir::TypeAttr::get(Tidx())},
    {TnumsegmentsAttrName(),
::mlir::TypeAttr::get(Tnumsegments())},
    {TsegmentidsAttrName(),
::mlir::TypeAttr::get(Tsegmentids())}});
}

void SparseSegmentMeanWithNumSegmentsOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value data, ::mlir::Value indices, ::mlir::Value segment_ids, ::mlir::Value num_segments) {
  odsState.addOperands(data);
  odsState.addOperands(indices);
  odsState.addOperands(segment_ids);
  odsState.addOperands(num_segments);
  odsState.addTypes(output);
}

void SparseSegmentMeanWithNumSegmentsOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value data, ::mlir::Value indices, ::mlir::Value segment_ids, ::mlir::Value num_segments) {
  odsState.addOperands(data);
  odsState.addOperands(indices);
  odsState.addOperands(segment_ids);
  odsState.addOperands(num_segments);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void SparseSegmentMeanWithNumSegmentsOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 4u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult SparseSegmentMeanWithNumSegmentsOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup3 = getODSOperands(3);

    for (auto v : valueGroup3) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void SparseSegmentMeanWithNumSegmentsOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::SparseSegmentMeanWithNumSegmentsOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::SparseSegmentSqrtNGradOp definitions
//===----------------------------------------------------------------------===//

SparseSegmentSqrtNGradOpAdaptor::SparseSegmentSqrtNGradOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

SparseSegmentSqrtNGradOpAdaptor::SparseSegmentSqrtNGradOpAdaptor(SparseSegmentSqrtNGradOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange SparseSegmentSqrtNGradOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> SparseSegmentSqrtNGradOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange SparseSegmentSqrtNGradOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SparseSegmentSqrtNGradOpAdaptor::grad() {
  return *getODSOperands(0).begin();
}

::mlir::Value SparseSegmentSqrtNGradOpAdaptor::indices() {
  return *getODSOperands(1).begin();
}

::mlir::Value SparseSegmentSqrtNGradOpAdaptor::segment_ids() {
  return *getODSOperands(2).begin();
}

::mlir::Value SparseSegmentSqrtNGradOpAdaptor::output_dim0() {
  return *getODSOperands(3).begin();
}

::mlir::DictionaryAttr SparseSegmentSqrtNGradOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult SparseSegmentSqrtNGradOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> SparseSegmentSqrtNGradOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range SparseSegmentSqrtNGradOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SparseSegmentSqrtNGradOp::grad() {
  return *getODSOperands(0).begin();
}

::mlir::Value SparseSegmentSqrtNGradOp::indices() {
  return *getODSOperands(1).begin();
}

::mlir::Value SparseSegmentSqrtNGradOp::segment_ids() {
  return *getODSOperands(2).begin();
}

::mlir::Value SparseSegmentSqrtNGradOp::output_dim0() {
  return *getODSOperands(3).begin();
}

::mlir::MutableOperandRange SparseSegmentSqrtNGradOp::gradMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange SparseSegmentSqrtNGradOp::indicesMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange SparseSegmentSqrtNGradOp::segment_idsMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange SparseSegmentSqrtNGradOp::output_dim0Mutable() {
  auto range = getODSOperandIndexAndLength(3);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> SparseSegmentSqrtNGradOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range SparseSegmentSqrtNGradOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SparseSegmentSqrtNGradOp::output() {
  return *getODSResults(0).begin();
}

::mlir::Type SparseSegmentSqrtNGradOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

::mlir::Type SparseSegmentSqrtNGradOp::Tidx() {
  return mlir::getElementTypeOrSelf(*getODSOperands(1).begin());
}

::mlir::Type SparseSegmentSqrtNGradOp::Tsegmentids() {
  return mlir::getElementTypeOrSelf(*getODSOperands(2).begin());
}

bool SparseSegmentSqrtNGradOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
  if (name == "Tidx") return true;
  if (name == "Tsegmentids") return true;
 return false;
}

::mlir::DictionaryAttr SparseSegmentSqrtNGradOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())},
    {TidxAttrName(),
::mlir::TypeAttr::get(Tidx())},
    {TsegmentidsAttrName(),
::mlir::TypeAttr::get(Tsegmentids())}});
}

void SparseSegmentSqrtNGradOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value grad, ::mlir::Value indices, ::mlir::Value segment_ids, ::mlir::Value output_dim0) {
  odsState.addOperands(grad);
  odsState.addOperands(indices);
  odsState.addOperands(segment_ids);
  odsState.addOperands(output_dim0);
  odsState.addTypes(output);
}

void SparseSegmentSqrtNGradOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value grad, ::mlir::Value indices, ::mlir::Value segment_ids, ::mlir::Value output_dim0) {
  odsState.addOperands(grad);
  odsState.addOperands(indices);
  odsState.addOperands(segment_ids);
  odsState.addOperands(output_dim0);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void SparseSegmentSqrtNGradOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 4u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult SparseSegmentSqrtNGradOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup3 = getODSOperands(3);

    for (auto v : valueGroup3) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops11(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void SparseSegmentSqrtNGradOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::SparseSegmentSqrtNGradOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::SparseSegmentSqrtNOp definitions
//===----------------------------------------------------------------------===//

SparseSegmentSqrtNOpAdaptor::SparseSegmentSqrtNOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

SparseSegmentSqrtNOpAdaptor::SparseSegmentSqrtNOpAdaptor(SparseSegmentSqrtNOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange SparseSegmentSqrtNOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> SparseSegmentSqrtNOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange SparseSegmentSqrtNOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SparseSegmentSqrtNOpAdaptor::data() {
  return *getODSOperands(0).begin();
}

::mlir::Value SparseSegmentSqrtNOpAdaptor::indices() {
  return *getODSOperands(1).begin();
}

::mlir::Value SparseSegmentSqrtNOpAdaptor::segment_ids() {
  return *getODSOperands(2).begin();
}

::mlir::DictionaryAttr SparseSegmentSqrtNOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult SparseSegmentSqrtNOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> SparseSegmentSqrtNOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range SparseSegmentSqrtNOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SparseSegmentSqrtNOp::data() {
  return *getODSOperands(0).begin();
}

::mlir::Value SparseSegmentSqrtNOp::indices() {
  return *getODSOperands(1).begin();
}

::mlir::Value SparseSegmentSqrtNOp::segment_ids() {
  return *getODSOperands(2).begin();
}

::mlir::MutableOperandRange SparseSegmentSqrtNOp::dataMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange SparseSegmentSqrtNOp::indicesMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange SparseSegmentSqrtNOp::segment_idsMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> SparseSegmentSqrtNOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range SparseSegmentSqrtNOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SparseSegmentSqrtNOp::output() {
  return *getODSResults(0).begin();
}

::mlir::Type SparseSegmentSqrtNOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

::mlir::Type SparseSegmentSqrtNOp::Tidx() {
  return mlir::getElementTypeOrSelf(*getODSOperands(1).begin());
}

::mlir::Type SparseSegmentSqrtNOp::Tsegmentids() {
  return mlir::getElementTypeOrSelf(*getODSOperands(2).begin());
}

bool SparseSegmentSqrtNOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
  if (name == "Tidx") return true;
  if (name == "Tsegmentids") return true;
 return false;
}

::mlir::DictionaryAttr SparseSegmentSqrtNOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())},
    {TidxAttrName(),
::mlir::TypeAttr::get(Tidx())},
    {TsegmentidsAttrName(),
::mlir::TypeAttr::get(Tsegmentids())}});
}

void SparseSegmentSqrtNOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value data, ::mlir::Value indices, ::mlir::Value segment_ids) {
  odsState.addOperands(data);
  odsState.addOperands(indices);
  odsState.addOperands(segment_ids);
  odsState.addTypes(output);
}

void SparseSegmentSqrtNOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value data, ::mlir::Value indices, ::mlir::Value segment_ids) {
  odsState.addOperands(data);
  odsState.addOperands(indices);
  odsState.addOperands(segment_ids);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void SparseSegmentSqrtNOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 3u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult SparseSegmentSqrtNOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void SparseSegmentSqrtNOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::SparseSegmentSqrtNOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::SparseSegmentSqrtNWithNumSegmentsOp definitions
//===----------------------------------------------------------------------===//

SparseSegmentSqrtNWithNumSegmentsOpAdaptor::SparseSegmentSqrtNWithNumSegmentsOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

SparseSegmentSqrtNWithNumSegmentsOpAdaptor::SparseSegmentSqrtNWithNumSegmentsOpAdaptor(SparseSegmentSqrtNWithNumSegmentsOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange SparseSegmentSqrtNWithNumSegmentsOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> SparseSegmentSqrtNWithNumSegmentsOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange SparseSegmentSqrtNWithNumSegmentsOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SparseSegmentSqrtNWithNumSegmentsOpAdaptor::data() {
  return *getODSOperands(0).begin();
}

::mlir::Value SparseSegmentSqrtNWithNumSegmentsOpAdaptor::indices() {
  return *getODSOperands(1).begin();
}

::mlir::Value SparseSegmentSqrtNWithNumSegmentsOpAdaptor::segment_ids() {
  return *getODSOperands(2).begin();
}

::mlir::Value SparseSegmentSqrtNWithNumSegmentsOpAdaptor::num_segments() {
  return *getODSOperands(3).begin();
}

::mlir::DictionaryAttr SparseSegmentSqrtNWithNumSegmentsOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult SparseSegmentSqrtNWithNumSegmentsOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> SparseSegmentSqrtNWithNumSegmentsOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range SparseSegmentSqrtNWithNumSegmentsOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SparseSegmentSqrtNWithNumSegmentsOp::data() {
  return *getODSOperands(0).begin();
}

::mlir::Value SparseSegmentSqrtNWithNumSegmentsOp::indices() {
  return *getODSOperands(1).begin();
}

::mlir::Value SparseSegmentSqrtNWithNumSegmentsOp::segment_ids() {
  return *getODSOperands(2).begin();
}

::mlir::Value SparseSegmentSqrtNWithNumSegmentsOp::num_segments() {
  return *getODSOperands(3).begin();
}

::mlir::MutableOperandRange SparseSegmentSqrtNWithNumSegmentsOp::dataMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange SparseSegmentSqrtNWithNumSegmentsOp::indicesMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange SparseSegmentSqrtNWithNumSegmentsOp::segment_idsMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange SparseSegmentSqrtNWithNumSegmentsOp::num_segmentsMutable() {
  auto range = getODSOperandIndexAndLength(3);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> SparseSegmentSqrtNWithNumSegmentsOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range SparseSegmentSqrtNWithNumSegmentsOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SparseSegmentSqrtNWithNumSegmentsOp::output() {
  return *getODSResults(0).begin();
}

::mlir::Type SparseSegmentSqrtNWithNumSegmentsOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

::mlir::Type SparseSegmentSqrtNWithNumSegmentsOp::Tidx() {
  return mlir::getElementTypeOrSelf(*getODSOperands(1).begin());
}

::mlir::Type SparseSegmentSqrtNWithNumSegmentsOp::Tnumsegments() {
  return mlir::getElementTypeOrSelf(*getODSOperands(3).begin());
}

::mlir::Type SparseSegmentSqrtNWithNumSegmentsOp::Tsegmentids() {
  return mlir::getElementTypeOrSelf(*getODSOperands(2).begin());
}

bool SparseSegmentSqrtNWithNumSegmentsOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
  if (name == "Tidx") return true;
  if (name == "Tnumsegments") return true;
  if (name == "Tsegmentids") return true;
 return false;
}

::mlir::DictionaryAttr SparseSegmentSqrtNWithNumSegmentsOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())},
    {TidxAttrName(),
::mlir::TypeAttr::get(Tidx())},
    {TnumsegmentsAttrName(),
::mlir::TypeAttr::get(Tnumsegments())},
    {TsegmentidsAttrName(),
::mlir::TypeAttr::get(Tsegmentids())}});
}

void SparseSegmentSqrtNWithNumSegmentsOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value data, ::mlir::Value indices, ::mlir::Value segment_ids, ::mlir::Value num_segments) {
  odsState.addOperands(data);
  odsState.addOperands(indices);
  odsState.addOperands(segment_ids);
  odsState.addOperands(num_segments);
  odsState.addTypes(output);
}

void SparseSegmentSqrtNWithNumSegmentsOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value data, ::mlir::Value indices, ::mlir::Value segment_ids, ::mlir::Value num_segments) {
  odsState.addOperands(data);
  odsState.addOperands(indices);
  odsState.addOperands(segment_ids);
  odsState.addOperands(num_segments);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void SparseSegmentSqrtNWithNumSegmentsOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 4u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult SparseSegmentSqrtNWithNumSegmentsOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup3 = getODSOperands(3);

    for (auto v : valueGroup3) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void SparseSegmentSqrtNWithNumSegmentsOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::SparseSegmentSqrtNWithNumSegmentsOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::SparseSegmentSumOp definitions
//===----------------------------------------------------------------------===//

SparseSegmentSumOpAdaptor::SparseSegmentSumOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

SparseSegmentSumOpAdaptor::SparseSegmentSumOpAdaptor(SparseSegmentSumOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange SparseSegmentSumOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> SparseSegmentSumOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange SparseSegmentSumOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SparseSegmentSumOpAdaptor::data() {
  return *getODSOperands(0).begin();
}

::mlir::Value SparseSegmentSumOpAdaptor::indices() {
  return *getODSOperands(1).begin();
}

::mlir::Value SparseSegmentSumOpAdaptor::segment_ids() {
  return *getODSOperands(2).begin();
}

::mlir::DictionaryAttr SparseSegmentSumOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult SparseSegmentSumOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> SparseSegmentSumOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range SparseSegmentSumOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SparseSegmentSumOp::data() {
  return *getODSOperands(0).begin();
}

::mlir::Value SparseSegmentSumOp::indices() {
  return *getODSOperands(1).begin();
}

::mlir::Value SparseSegmentSumOp::segment_ids() {
  return *getODSOperands(2).begin();
}

::mlir::MutableOperandRange SparseSegmentSumOp::dataMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange SparseSegmentSumOp::indicesMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange SparseSegmentSumOp::segment_idsMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> SparseSegmentSumOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range SparseSegmentSumOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SparseSegmentSumOp::output() {
  return *getODSResults(0).begin();
}

::mlir::Type SparseSegmentSumOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

::mlir::Type SparseSegmentSumOp::Tidx() {
  return mlir::getElementTypeOrSelf(*getODSOperands(1).begin());
}

::mlir::Type SparseSegmentSumOp::Tsegmentids() {
  return mlir::getElementTypeOrSelf(*getODSOperands(2).begin());
}

bool SparseSegmentSumOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
  if (name == "Tidx") return true;
  if (name == "Tsegmentids") return true;
 return false;
}

::mlir::DictionaryAttr SparseSegmentSumOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())},
    {TidxAttrName(),
::mlir::TypeAttr::get(Tidx())},
    {TsegmentidsAttrName(),
::mlir::TypeAttr::get(Tsegmentids())}});
}

void SparseSegmentSumOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value data, ::mlir::Value indices, ::mlir::Value segment_ids) {
  odsState.addOperands(data);
  odsState.addOperands(indices);
  odsState.addOperands(segment_ids);
  odsState.addTypes(output);
}

void SparseSegmentSumOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value data, ::mlir::Value indices, ::mlir::Value segment_ids) {
  odsState.addOperands(data);
  odsState.addOperands(indices);
  odsState.addOperands(segment_ids);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void SparseSegmentSumOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 3u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult SparseSegmentSumOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops35(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops35(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void SparseSegmentSumOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::SparseSegmentSumOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::SparseSoftmaxCrossEntropyWithLogitsOp definitions
//===----------------------------------------------------------------------===//

SparseSoftmaxCrossEntropyWithLogitsOpAdaptor::SparseSoftmaxCrossEntropyWithLogitsOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

SparseSoftmaxCrossEntropyWithLogitsOpAdaptor::SparseSoftmaxCrossEntropyWithLogitsOpAdaptor(SparseSoftmaxCrossEntropyWithLogitsOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange SparseSoftmaxCrossEntropyWithLogitsOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> SparseSoftmaxCrossEntropyWithLogitsOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange SparseSoftmaxCrossEntropyWithLogitsOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SparseSoftmaxCrossEntropyWithLogitsOpAdaptor::features() {
  return *getODSOperands(0).begin();
}

::mlir::Value SparseSoftmaxCrossEntropyWithLogitsOpAdaptor::labels() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr SparseSoftmaxCrossEntropyWithLogitsOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult SparseSoftmaxCrossEntropyWithLogitsOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

void SparseSoftmaxCrossEntropyWithLogitsOp::getAsmResultNames(::mlir::OpAsmSetValueNameFn setNameFn) {
  auto resultGroup0 = getODSResults(0);
  if (!llvm::empty(resultGroup0))
    setNameFn(*resultGroup0.begin(), "loss");
  auto resultGroup1 = getODSResults(1);
  if (!llvm::empty(resultGroup1))
    setNameFn(*resultGroup1.begin(), "backprop");
}

std::pair<unsigned, unsigned> SparseSoftmaxCrossEntropyWithLogitsOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range SparseSoftmaxCrossEntropyWithLogitsOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SparseSoftmaxCrossEntropyWithLogitsOp::features() {
  return *getODSOperands(0).begin();
}

::mlir::Value SparseSoftmaxCrossEntropyWithLogitsOp::labels() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange SparseSoftmaxCrossEntropyWithLogitsOp::featuresMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange SparseSoftmaxCrossEntropyWithLogitsOp::labelsMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> SparseSoftmaxCrossEntropyWithLogitsOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range SparseSoftmaxCrossEntropyWithLogitsOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SparseSoftmaxCrossEntropyWithLogitsOp::loss() {
  return *getODSResults(0).begin();
}

::mlir::Value SparseSoftmaxCrossEntropyWithLogitsOp::backprop() {
  return *getODSResults(1).begin();
}

::mlir::Type SparseSoftmaxCrossEntropyWithLogitsOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

::mlir::Type SparseSoftmaxCrossEntropyWithLogitsOp::Tlabels() {
  return mlir::getElementTypeOrSelf(*getODSOperands(1).begin());
}

bool SparseSoftmaxCrossEntropyWithLogitsOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
  if (name == "Tlabels") return true;
 return false;
}

::mlir::DictionaryAttr SparseSoftmaxCrossEntropyWithLogitsOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())},
    {TlabelsAttrName(),
::mlir::TypeAttr::get(Tlabels())}});
}

void SparseSoftmaxCrossEntropyWithLogitsOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type loss, ::mlir::Type backprop, ::mlir::Value features, ::mlir::Value labels) {
  odsState.addOperands(features);
  odsState.addOperands(labels);
  odsState.addTypes(loss);
  odsState.addTypes(backprop);
}

void SparseSoftmaxCrossEntropyWithLogitsOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value features, ::mlir::Value labels) {
  odsState.addOperands(features);
  odsState.addOperands(labels);
  assert(resultTypes.size() == 2u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void SparseSoftmaxCrossEntropyWithLogitsOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 2u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult SparseSoftmaxCrossEntropyWithLogitsOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSResults(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return Verify(*this);
}

void SparseSoftmaxCrossEntropyWithLogitsOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::SparseSoftmaxCrossEntropyWithLogitsOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::SparseTensorDenseMatMulOp definitions
//===----------------------------------------------------------------------===//

SparseTensorDenseMatMulOpAdaptor::SparseTensorDenseMatMulOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

SparseTensorDenseMatMulOpAdaptor::SparseTensorDenseMatMulOpAdaptor(SparseTensorDenseMatMulOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange SparseTensorDenseMatMulOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> SparseTensorDenseMatMulOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange SparseTensorDenseMatMulOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SparseTensorDenseMatMulOpAdaptor::a_indices() {
  return *getODSOperands(0).begin();
}

::mlir::Value SparseTensorDenseMatMulOpAdaptor::a_values() {
  return *getODSOperands(1).begin();
}

::mlir::Value SparseTensorDenseMatMulOpAdaptor::a_shape() {
  return *getODSOperands(2).begin();
}

::mlir::Value SparseTensorDenseMatMulOpAdaptor::b() {
  return *getODSOperands(3).begin();
}

::mlir::DictionaryAttr SparseTensorDenseMatMulOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::BoolAttr SparseTensorDenseMatMulOpAdaptor::adjoint_a() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("adjoint_a").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(false);
  return attr;
}

::mlir::BoolAttr SparseTensorDenseMatMulOpAdaptor::adjoint_b() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("adjoint_b").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(false);
  return attr;
}

::mlir::LogicalResult SparseTensorDenseMatMulOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_adjoint_a = odsAttrs.get("adjoint_a");
    if (tblgen_adjoint_a && !((tblgen_adjoint_a.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.SparseTensorDenseMatMul' op ""attribute 'adjoint_a' failed to satisfy constraint: bool attribute");
  }
  {
    auto tblgen_adjoint_b = odsAttrs.get("adjoint_b");
    if (tblgen_adjoint_b && !((tblgen_adjoint_b.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.SparseTensorDenseMatMul' op ""attribute 'adjoint_b' failed to satisfy constraint: bool attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> SparseTensorDenseMatMulOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range SparseTensorDenseMatMulOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SparseTensorDenseMatMulOp::a_indices() {
  return *getODSOperands(0).begin();
}

::mlir::Value SparseTensorDenseMatMulOp::a_values() {
  return *getODSOperands(1).begin();
}

::mlir::Value SparseTensorDenseMatMulOp::a_shape() {
  return *getODSOperands(2).begin();
}

::mlir::Value SparseTensorDenseMatMulOp::b() {
  return *getODSOperands(3).begin();
}

::mlir::MutableOperandRange SparseTensorDenseMatMulOp::a_indicesMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange SparseTensorDenseMatMulOp::a_valuesMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange SparseTensorDenseMatMulOp::a_shapeMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange SparseTensorDenseMatMulOp::bMutable() {
  auto range = getODSOperandIndexAndLength(3);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> SparseTensorDenseMatMulOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range SparseTensorDenseMatMulOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SparseTensorDenseMatMulOp::product() {
  return *getODSResults(0).begin();
}

::mlir::BoolAttr SparseTensorDenseMatMulOp::adjoint_aAttr() {
  return (*this)->getAttr(adjoint_aAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool SparseTensorDenseMatMulOp::adjoint_a() {
  auto attr = adjoint_aAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(false).getValue();
  return attr.getValue();
}

::mlir::BoolAttr SparseTensorDenseMatMulOp::adjoint_bAttr() {
  return (*this)->getAttr(adjoint_bAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool SparseTensorDenseMatMulOp::adjoint_b() {
  auto attr = adjoint_bAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(false).getValue();
  return attr.getValue();
}

::mlir::Type SparseTensorDenseMatMulOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(1).begin());
}

::mlir::Type SparseTensorDenseMatMulOp::Tindices() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool SparseTensorDenseMatMulOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
  if (name == "Tindices") return true;
 return false;
}

::mlir::DictionaryAttr SparseTensorDenseMatMulOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())},
    {TindicesAttrName(),
::mlir::TypeAttr::get(Tindices())}});
}

void SparseTensorDenseMatMulOp::adjoint_aAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(adjoint_aAttrName(), attr);
}

void SparseTensorDenseMatMulOp::adjoint_bAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(adjoint_bAttrName(), attr);
}

void SparseTensorDenseMatMulOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type product, ::mlir::Value a_indices, ::mlir::Value a_values, ::mlir::Value a_shape, ::mlir::Value b, ::mlir::BoolAttr adjoint_a, ::mlir::BoolAttr adjoint_b) {
  odsState.addOperands(a_indices);
  odsState.addOperands(a_values);
  odsState.addOperands(a_shape);
  odsState.addOperands(b);
  odsState.addAttribute(adjoint_aAttrName(odsState.name), adjoint_a);
  odsState.addAttribute(adjoint_bAttrName(odsState.name), adjoint_b);
  odsState.addTypes(product);
}

void SparseTensorDenseMatMulOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value a_indices, ::mlir::Value a_values, ::mlir::Value a_shape, ::mlir::Value b, ::mlir::BoolAttr adjoint_a, ::mlir::BoolAttr adjoint_b) {
  odsState.addOperands(a_indices);
  odsState.addOperands(a_values);
  odsState.addOperands(a_shape);
  odsState.addOperands(b);
  odsState.addAttribute(adjoint_aAttrName(odsState.name), adjoint_a);
  odsState.addAttribute(adjoint_bAttrName(odsState.name), adjoint_b);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void SparseTensorDenseMatMulOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type product, ::mlir::Value a_indices, ::mlir::Value a_values, ::mlir::Value a_shape, ::mlir::Value b, bool adjoint_a, bool adjoint_b) {
  odsState.addOperands(a_indices);
  odsState.addOperands(a_values);
  odsState.addOperands(a_shape);
  odsState.addOperands(b);
  odsState.addAttribute(adjoint_aAttrName(odsState.name), odsBuilder.getBoolAttr(adjoint_a));
  odsState.addAttribute(adjoint_bAttrName(odsState.name), odsBuilder.getBoolAttr(adjoint_b));
  odsState.addTypes(product);
}

void SparseTensorDenseMatMulOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value a_indices, ::mlir::Value a_values, ::mlir::Value a_shape, ::mlir::Value b, bool adjoint_a, bool adjoint_b) {
  odsState.addOperands(a_indices);
  odsState.addOperands(a_values);
  odsState.addOperands(a_shape);
  odsState.addOperands(b);
  odsState.addAttribute(adjoint_aAttrName(odsState.name), odsBuilder.getBoolAttr(adjoint_a));
  odsState.addAttribute(adjoint_bAttrName(odsState.name), odsBuilder.getBoolAttr(adjoint_b));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void SparseTensorDenseMatMulOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 4u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult SparseTensorDenseMatMulOp::verify() {
  {
    auto tblgen_adjoint_a = (*this)->getAttr(adjoint_aAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_adjoint_a, "adjoint_a")))
      return ::mlir::failure();
  }
  {
    auto tblgen_adjoint_b = (*this)->getAttr(adjoint_bAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_adjoint_b, "adjoint_b")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops16(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup3 = getODSOperands(3);

    for (auto v : valueGroup3) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void SparseTensorDenseMatMulOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::SparseTensorDenseMatMulOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::SparseToDenseOp definitions
//===----------------------------------------------------------------------===//

SparseToDenseOpAdaptor::SparseToDenseOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

SparseToDenseOpAdaptor::SparseToDenseOpAdaptor(SparseToDenseOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange SparseToDenseOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> SparseToDenseOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange SparseToDenseOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SparseToDenseOpAdaptor::sparse_indices() {
  return *getODSOperands(0).begin();
}

::mlir::Value SparseToDenseOpAdaptor::output_shape() {
  return *getODSOperands(1).begin();
}

::mlir::Value SparseToDenseOpAdaptor::sparse_values() {
  return *getODSOperands(2).begin();
}

::mlir::Value SparseToDenseOpAdaptor::default_value() {
  return *getODSOperands(3).begin();
}

::mlir::DictionaryAttr SparseToDenseOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::BoolAttr SparseToDenseOpAdaptor::validate_indices() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("validate_indices").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(true);
  return attr;
}

::mlir::LogicalResult SparseToDenseOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_validate_indices = odsAttrs.get("validate_indices");
    if (tblgen_validate_indices && !((tblgen_validate_indices.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.SparseToDense' op ""attribute 'validate_indices' failed to satisfy constraint: bool attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> SparseToDenseOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range SparseToDenseOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SparseToDenseOp::sparse_indices() {
  return *getODSOperands(0).begin();
}

::mlir::Value SparseToDenseOp::output_shape() {
  return *getODSOperands(1).begin();
}

::mlir::Value SparseToDenseOp::sparse_values() {
  return *getODSOperands(2).begin();
}

::mlir::Value SparseToDenseOp::default_value() {
  return *getODSOperands(3).begin();
}

::mlir::MutableOperandRange SparseToDenseOp::sparse_indicesMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange SparseToDenseOp::output_shapeMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange SparseToDenseOp::sparse_valuesMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange SparseToDenseOp::default_valueMutable() {
  auto range = getODSOperandIndexAndLength(3);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> SparseToDenseOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range SparseToDenseOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SparseToDenseOp::dense() {
  return *getODSResults(0).begin();
}

::mlir::BoolAttr SparseToDenseOp::validate_indicesAttr() {
  return (*this)->getAttr(validate_indicesAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool SparseToDenseOp::validate_indices() {
  auto attr = validate_indicesAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(true).getValue();
  return attr.getValue();
}

::mlir::Type SparseToDenseOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(2).begin());
}

::mlir::Type SparseToDenseOp::Tindices() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool SparseToDenseOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
  if (name == "Tindices") return true;
 return false;
}

::mlir::DictionaryAttr SparseToDenseOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())},
    {TindicesAttrName(),
::mlir::TypeAttr::get(Tindices())}});
}

void SparseToDenseOp::validate_indicesAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(validate_indicesAttrName(), attr);
}

void SparseToDenseOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type dense, ::mlir::Value sparse_indices, ::mlir::Value output_shape, ::mlir::Value sparse_values, ::mlir::Value default_value, ::mlir::BoolAttr validate_indices) {
  odsState.addOperands(sparse_indices);
  odsState.addOperands(output_shape);
  odsState.addOperands(sparse_values);
  odsState.addOperands(default_value);
  odsState.addAttribute(validate_indicesAttrName(odsState.name), validate_indices);
  odsState.addTypes(dense);
}

void SparseToDenseOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value sparse_indices, ::mlir::Value output_shape, ::mlir::Value sparse_values, ::mlir::Value default_value, ::mlir::BoolAttr validate_indices) {
  odsState.addOperands(sparse_indices);
  odsState.addOperands(output_shape);
  odsState.addOperands(sparse_values);
  odsState.addOperands(default_value);
  odsState.addAttribute(validate_indicesAttrName(odsState.name), validate_indices);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void SparseToDenseOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type dense, ::mlir::Value sparse_indices, ::mlir::Value output_shape, ::mlir::Value sparse_values, ::mlir::Value default_value, bool validate_indices) {
  odsState.addOperands(sparse_indices);
  odsState.addOperands(output_shape);
  odsState.addOperands(sparse_values);
  odsState.addOperands(default_value);
  odsState.addAttribute(validate_indicesAttrName(odsState.name), odsBuilder.getBoolAttr(validate_indices));
  odsState.addTypes(dense);
}

void SparseToDenseOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value sparse_indices, ::mlir::Value output_shape, ::mlir::Value sparse_values, ::mlir::Value default_value, bool validate_indices) {
  odsState.addOperands(sparse_indices);
  odsState.addOperands(output_shape);
  odsState.addOperands(sparse_values);
  odsState.addOperands(default_value);
  odsState.addAttribute(validate_indicesAttrName(odsState.name), odsBuilder.getBoolAttr(validate_indices));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void SparseToDenseOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 4u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult SparseToDenseOp::verify() {
  {
    auto tblgen_validate_indices = (*this)->getAttr(validate_indicesAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_validate_indices, "validate_indices")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup3 = getODSOperands(3);

    for (auto v : valueGroup3) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void SparseToDenseOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::SparseToDenseOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::SplitOp definitions
//===----------------------------------------------------------------------===//

SplitOpAdaptor::SplitOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

SplitOpAdaptor::SplitOpAdaptor(SplitOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange SplitOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> SplitOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange SplitOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SplitOpAdaptor::split_dim() {
  return *getODSOperands(0).begin();
}

::mlir::Value SplitOpAdaptor::value() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr SplitOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult SplitOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> SplitOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range SplitOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SplitOp::split_dim() {
  return *getODSOperands(0).begin();
}

::mlir::Value SplitOp::value() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange SplitOp::split_dimMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange SplitOp::valueMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> SplitOp::getODSResultIndexAndLength(unsigned index) {
  bool isVariadic[] = {true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (getOperation()->getNumResults() - 0) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::Operation::result_range SplitOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Operation::result_range SplitOp::output() {
  return getODSResults(0);
}

::mlir::Type SplitOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(1).begin());
}

size_t SplitOp::num_split() {
  auto range = getODSResults(0);
return std::distance(range.begin(), range.end());
}

bool SplitOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
  if (name == "num_split") return true;
 return false;
}

::mlir::DictionaryAttr SplitOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())},
    {num_splitAttrName(),
odsBuilder.getI64IntegerAttr(num_split())}});
}

void SplitOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange output, ::mlir::Value split_dim, ::mlir::Value value) {
  odsState.addOperands(split_dim);
  odsState.addOperands(value);
  odsState.addTypes(output);
}

void SplitOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult SplitOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops11(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return Verify(*this);
}

void SplitOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::SplitOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::SplitVOp definitions
//===----------------------------------------------------------------------===//

SplitVOpAdaptor::SplitVOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

SplitVOpAdaptor::SplitVOpAdaptor(SplitVOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange SplitVOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> SplitVOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange SplitVOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SplitVOpAdaptor::value() {
  return *getODSOperands(0).begin();
}

::mlir::Value SplitVOpAdaptor::size_splits() {
  return *getODSOperands(1).begin();
}

::mlir::Value SplitVOpAdaptor::split_dim() {
  return *getODSOperands(2).begin();
}

::mlir::DictionaryAttr SplitVOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult SplitVOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> SplitVOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range SplitVOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SplitVOp::value() {
  return *getODSOperands(0).begin();
}

::mlir::Value SplitVOp::size_splits() {
  return *getODSOperands(1).begin();
}

::mlir::Value SplitVOp::split_dim() {
  return *getODSOperands(2).begin();
}

::mlir::MutableOperandRange SplitVOp::valueMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange SplitVOp::size_splitsMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange SplitVOp::split_dimMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> SplitVOp::getODSResultIndexAndLength(unsigned index) {
  bool isVariadic[] = {true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (getOperation()->getNumResults() - 0) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::Operation::result_range SplitVOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Operation::result_range SplitVOp::output() {
  return getODSResults(0);
}

::mlir::Type SplitVOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

::mlir::Type SplitVOp::Tlen() {
  return mlir::getElementTypeOrSelf(*getODSOperands(1).begin());
}

size_t SplitVOp::num_split() {
  auto range = getODSResults(0);
return std::distance(range.begin(), range.end());
}

bool SplitVOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
  if (name == "Tlen") return true;
  if (name == "num_split") return true;
 return false;
}

::mlir::DictionaryAttr SplitVOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())},
    {TlenAttrName(),
::mlir::TypeAttr::get(Tlen())},
    {num_splitAttrName(),
odsBuilder.getI64IntegerAttr(num_split())}});
}

void SplitVOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange output, ::mlir::Value value, ::mlir::Value size_splits, ::mlir::Value split_dim) {
  odsState.addOperands(value);
  odsState.addOperands(size_splits);
  odsState.addOperands(split_dim);
  odsState.addTypes(output);
}

void SplitVOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 3u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult SplitVOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops11(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return Verify(*this);
}

void SplitVOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::SplitVOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::SqrtGradOp definitions
//===----------------------------------------------------------------------===//

SqrtGradOpAdaptor::SqrtGradOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

SqrtGradOpAdaptor::SqrtGradOpAdaptor(SqrtGradOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange SqrtGradOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> SqrtGradOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange SqrtGradOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SqrtGradOpAdaptor::y() {
  return *getODSOperands(0).begin();
}

::mlir::Value SqrtGradOpAdaptor::dy() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr SqrtGradOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult SqrtGradOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> SqrtGradOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range SqrtGradOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SqrtGradOp::y() {
  return *getODSOperands(0).begin();
}

::mlir::Value SqrtGradOp::dy() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange SqrtGradOp::yMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange SqrtGradOp::dyMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> SqrtGradOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range SqrtGradOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SqrtGradOp::z() {
  return *getODSResults(0).begin();
}

::mlir::Type SqrtGradOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool SqrtGradOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr SqrtGradOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void SqrtGradOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type z, ::mlir::Value y, ::mlir::Value dy) {
  odsState.addOperands(y);
  odsState.addOperands(dy);
  odsState.addTypes(z);
}

void SqrtGradOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value y, ::mlir::Value dy) {
  odsState.addOperands(y);
  odsState.addOperands(dy);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void SqrtGradOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult SqrtGradOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops2(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops2(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops2(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void SqrtGradOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::SqrtGradOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::SqrtOp definitions
//===----------------------------------------------------------------------===//

SqrtOpAdaptor::SqrtOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

SqrtOpAdaptor::SqrtOpAdaptor(SqrtOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange SqrtOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> SqrtOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange SqrtOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SqrtOpAdaptor::x() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr SqrtOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult SqrtOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> SqrtOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range SqrtOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SqrtOp::x() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange SqrtOp::xMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> SqrtOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range SqrtOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SqrtOp::y() {
  return *getODSResults(0).begin();
}

::mlir::Type SqrtOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool SqrtOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr SqrtOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void SqrtOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type y, ::mlir::Value x) {
  odsState.addOperands(x);
  odsState.addTypes(y);
}

void SqrtOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value x) {
  odsState.addOperands(x);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void SqrtOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

void SqrtOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value x) {
  odsState.addOperands(x);
  odsState.addTypes({x.getType()});

}

void SqrtOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  odsState.addTypes({operands[0].getType()});

}

::mlir::LogicalResult SqrtOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops2(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops2(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void SqrtOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::SqrtOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::SquareOp definitions
//===----------------------------------------------------------------------===//

SquareOpAdaptor::SquareOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

SquareOpAdaptor::SquareOpAdaptor(SquareOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange SquareOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> SquareOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange SquareOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SquareOpAdaptor::x() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr SquareOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult SquareOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> SquareOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range SquareOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SquareOp::x() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange SquareOp::xMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> SquareOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range SquareOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SquareOp::y() {
  return *getODSResults(0).begin();
}

::mlir::Type SquareOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool SquareOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr SquareOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void SquareOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type y, ::mlir::Value x) {
  odsState.addOperands(x);
  odsState.addTypes(y);
}

void SquareOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value x) {
  odsState.addOperands(x);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void SquareOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

void SquareOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value x) {
  odsState.addOperands(x);
  odsState.addTypes({x.getType()});

}

void SquareOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  odsState.addTypes({operands[0].getType()});

}

::mlir::LogicalResult SquareOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops5(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops5(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void SquareOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::SquareOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::SquaredDifferenceOp definitions
//===----------------------------------------------------------------------===//

SquaredDifferenceOpAdaptor::SquaredDifferenceOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

SquaredDifferenceOpAdaptor::SquaredDifferenceOpAdaptor(SquaredDifferenceOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange SquaredDifferenceOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> SquaredDifferenceOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange SquaredDifferenceOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SquaredDifferenceOpAdaptor::x() {
  return *getODSOperands(0).begin();
}

::mlir::Value SquaredDifferenceOpAdaptor::y() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr SquaredDifferenceOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult SquaredDifferenceOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> SquaredDifferenceOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range SquaredDifferenceOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SquaredDifferenceOp::x() {
  return *getODSOperands(0).begin();
}

::mlir::Value SquaredDifferenceOp::y() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange SquaredDifferenceOp::xMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange SquaredDifferenceOp::yMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> SquaredDifferenceOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range SquaredDifferenceOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SquaredDifferenceOp::z() {
  return *getODSResults(0).begin();
}

::mlir::Type SquaredDifferenceOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool SquaredDifferenceOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr SquaredDifferenceOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void SquaredDifferenceOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, Value x, Value y) {
  auto resultType =
      OpTrait::util::getBroadcastedType(x.getType(), y.getType());
  if (!resultType)
    mlir::emitError(odsState.location, "non-broadcastable operands");
  return build(odsBuilder, odsState, resultType, x, y);
}

void SquaredDifferenceOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type z, ::mlir::Value x, ::mlir::Value y) {
  odsState.addOperands(x);
  odsState.addOperands(y);
  odsState.addTypes(z);
}

void SquaredDifferenceOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value x, ::mlir::Value y) {
  odsState.addOperands(x);
  odsState.addOperands(y);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void SquaredDifferenceOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult SquaredDifferenceOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops22(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops22(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops22(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void SquaredDifferenceOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::SquaredDifferenceOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::SqueezeOp definitions
//===----------------------------------------------------------------------===//

SqueezeOpAdaptor::SqueezeOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

SqueezeOpAdaptor::SqueezeOpAdaptor(SqueezeOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange SqueezeOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> SqueezeOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange SqueezeOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SqueezeOpAdaptor::input() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr SqueezeOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::ArrayAttr SqueezeOpAdaptor::squeeze_dims() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("squeeze_dims").dyn_cast_or_null<::mlir::ArrayAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getI64ArrayAttr({});
  return attr;
}

::mlir::LogicalResult SqueezeOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_squeeze_dims = odsAttrs.get("squeeze_dims");
    if (tblgen_squeeze_dims && !(((tblgen_squeeze_dims.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_squeeze_dims.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return ((attr.isa<::mlir::IntegerAttr>())) && ((attr.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64))); }))))
      return emitError(loc, "'tf.Squeeze' op ""attribute 'squeeze_dims' failed to satisfy constraint: 64-bit integer array attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> SqueezeOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range SqueezeOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SqueezeOp::input() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange SqueezeOp::inputMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> SqueezeOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range SqueezeOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SqueezeOp::output() {
  return *getODSResults(0).begin();
}

::mlir::ArrayAttr SqueezeOp::squeeze_dimsAttr() {
  return (*this)->getAttr(squeeze_dimsAttrName()).dyn_cast_or_null<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr SqueezeOp::squeeze_dims() {
  auto attr = squeeze_dimsAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getI64ArrayAttr({});
  return attr;
}

::mlir::Type SqueezeOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool SqueezeOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr SqueezeOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void SqueezeOp::squeeze_dimsAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(squeeze_dimsAttrName(), attr);
}

void SqueezeOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input, ::mlir::ArrayAttr squeeze_dims) {
  odsState.addOperands(input);
  odsState.addAttribute(squeeze_dimsAttrName(odsState.name), squeeze_dims);
  odsState.addTypes(output);
}

void SqueezeOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::ArrayAttr squeeze_dims) {
  odsState.addOperands(input);
  odsState.addAttribute(squeeze_dimsAttrName(odsState.name), squeeze_dims);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void SqueezeOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult SqueezeOp::verify() {
  {
    auto tblgen_squeeze_dims = (*this)->getAttr(squeeze_dimsAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops13(*this, tblgen_squeeze_dims, "squeeze_dims")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return Verify(*this);
}

void SqueezeOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::SqueezeOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::StackCloseV2Op definitions
//===----------------------------------------------------------------------===//

StackCloseV2OpAdaptor::StackCloseV2OpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

StackCloseV2OpAdaptor::StackCloseV2OpAdaptor(StackCloseV2Op &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange StackCloseV2OpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> StackCloseV2OpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange StackCloseV2OpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value StackCloseV2OpAdaptor::handle() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr StackCloseV2OpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult StackCloseV2OpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> StackCloseV2Op::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range StackCloseV2Op::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value StackCloseV2Op::handle() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange StackCloseV2Op::handleMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> StackCloseV2Op::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range StackCloseV2Op::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

void StackCloseV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value handle) {
  odsState.addOperands(handle);
}

void StackCloseV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value handle) {
  odsState.addOperands(handle);
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void StackCloseV2Op::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 0u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult StackCloseV2Op::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void StackCloseV2Op::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  for (::mlir::Value value : getODSOperands(0))
    effects.emplace_back(::mlir::MemoryEffects::Free::get(), value, ::mlir::TF::ResourceEffects::Stack::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::StackCloseV2Op)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::StackPopV2Op definitions
//===----------------------------------------------------------------------===//

StackPopV2OpAdaptor::StackPopV2OpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

StackPopV2OpAdaptor::StackPopV2OpAdaptor(StackPopV2Op &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange StackPopV2OpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> StackPopV2OpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange StackPopV2OpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value StackPopV2OpAdaptor::handle() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr StackPopV2OpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult StackPopV2OpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> StackPopV2Op::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range StackPopV2Op::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value StackPopV2Op::handle() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange StackPopV2Op::handleMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> StackPopV2Op::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range StackPopV2Op::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value StackPopV2Op::elem() {
  return *getODSResults(0).begin();
}

::mlir::Type StackPopV2Op::elem_type() {
  return mlir::getElementTypeOrSelf(*getODSResults(0).begin());
}

bool StackPopV2Op::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "elem_type") return true;
 return false;
}

::mlir::DictionaryAttr StackPopV2Op::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {elem_typeAttrName(),
::mlir::TypeAttr::get(elem_type())}});
}

void StackPopV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type elem, ::mlir::Value handle) {
  odsState.addOperands(handle);
  odsState.addTypes(elem);
}

void StackPopV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value handle) {
  odsState.addOperands(handle);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void StackPopV2Op::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult StackPopV2Op::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void StackPopV2Op::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  for (::mlir::Value value : getODSOperands(0))
    effects.emplace_back(::mlir::MemoryEffects::Read::get(), value, ::mlir::TF::ResourceEffects::Stack::get());
  for (::mlir::Value value : getODSOperands(0))
    effects.emplace_back(::mlir::MemoryEffects::Write::get(), value, ::mlir::TF::ResourceEffects::Stack::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::StackPopV2Op)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::StackPushV2Op definitions
//===----------------------------------------------------------------------===//

StackPushV2OpAdaptor::StackPushV2OpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

StackPushV2OpAdaptor::StackPushV2OpAdaptor(StackPushV2Op &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange StackPushV2OpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> StackPushV2OpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange StackPushV2OpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value StackPushV2OpAdaptor::handle() {
  return *getODSOperands(0).begin();
}

::mlir::Value StackPushV2OpAdaptor::elem() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr StackPushV2OpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::BoolAttr StackPushV2OpAdaptor::swap_memory() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("swap_memory").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(false);
  return attr;
}

::mlir::LogicalResult StackPushV2OpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_swap_memory = odsAttrs.get("swap_memory");
    if (tblgen_swap_memory && !((tblgen_swap_memory.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.StackPushV2' op ""attribute 'swap_memory' failed to satisfy constraint: bool attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> StackPushV2Op::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range StackPushV2Op::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value StackPushV2Op::handle() {
  return *getODSOperands(0).begin();
}

::mlir::Value StackPushV2Op::elem() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange StackPushV2Op::handleMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange StackPushV2Op::elemMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> StackPushV2Op::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range StackPushV2Op::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value StackPushV2Op::output() {
  return *getODSResults(0).begin();
}

::mlir::BoolAttr StackPushV2Op::swap_memoryAttr() {
  return (*this)->getAttr(swap_memoryAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool StackPushV2Op::swap_memory() {
  auto attr = swap_memoryAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(false).getValue();
  return attr.getValue();
}

::mlir::Type StackPushV2Op::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(1).begin());
}

bool StackPushV2Op::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr StackPushV2Op::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void StackPushV2Op::swap_memoryAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(swap_memoryAttrName(), attr);
}

void StackPushV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value handle, ::mlir::Value elem, ::mlir::BoolAttr swap_memory) {
  odsState.addOperands(handle);
  odsState.addOperands(elem);
  odsState.addAttribute(swap_memoryAttrName(odsState.name), swap_memory);
  odsState.addTypes(output);
}

void StackPushV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value handle, ::mlir::Value elem, ::mlir::BoolAttr swap_memory) {
  odsState.addOperands(handle);
  odsState.addOperands(elem);
  odsState.addAttribute(swap_memoryAttrName(odsState.name), swap_memory);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void StackPushV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value handle, ::mlir::Value elem, bool swap_memory) {
  odsState.addOperands(handle);
  odsState.addOperands(elem);
  odsState.addAttribute(swap_memoryAttrName(odsState.name), odsBuilder.getBoolAttr(swap_memory));
  odsState.addTypes(output);
}

void StackPushV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value handle, ::mlir::Value elem, bool swap_memory) {
  odsState.addOperands(handle);
  odsState.addOperands(elem);
  odsState.addAttribute(swap_memoryAttrName(odsState.name), odsBuilder.getBoolAttr(swap_memory));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void StackPushV2Op::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult StackPushV2Op::verify() {
  {
    auto tblgen_swap_memory = (*this)->getAttr(swap_memoryAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_swap_memory, "swap_memory")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void StackPushV2Op::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  for (::mlir::Value value : getODSOperands(0))
    effects.emplace_back(::mlir::MemoryEffects::Read::get(), value, ::mlir::TF::ResourceEffects::Stack::get());
  for (::mlir::Value value : getODSOperands(0))
    effects.emplace_back(::mlir::MemoryEffects::Write::get(), value, ::mlir::TF::ResourceEffects::Stack::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::StackPushV2Op)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::StackV2Op definitions
//===----------------------------------------------------------------------===//

StackV2OpAdaptor::StackV2OpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

StackV2OpAdaptor::StackV2OpAdaptor(StackV2Op &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange StackV2OpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> StackV2OpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange StackV2OpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value StackV2OpAdaptor::max_size() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr StackV2OpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::TypeAttr StackV2OpAdaptor::elem_type() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::TypeAttr attr = odsAttrs.get("elem_type").cast<::mlir::TypeAttr>();
  return attr;
}

::mlir::StringAttr StackV2OpAdaptor::stack_name() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("stack_name").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("");
  return attr;
}

::mlir::LogicalResult StackV2OpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_elem_type = odsAttrs.get("elem_type");
    if (!tblgen_elem_type)
      return emitError(loc, "'tf.StackV2' op ""requires attribute 'elem_type'");

    if (tblgen_elem_type && !(((tblgen_elem_type.isa<::mlir::TypeAttr>())) && ((tblgen_elem_type.cast<::mlir::TypeAttr>().getValue().isa<::mlir::Type>()))))
      return emitError(loc, "'tf.StackV2' op ""attribute 'elem_type' failed to satisfy constraint: any type attribute");
  }
  {
    auto tblgen_stack_name = odsAttrs.get("stack_name");
    if (tblgen_stack_name && !((tblgen_stack_name.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.StackV2' op ""attribute 'stack_name' failed to satisfy constraint: string attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> StackV2Op::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range StackV2Op::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value StackV2Op::max_size() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange StackV2Op::max_sizeMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> StackV2Op::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range StackV2Op::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value StackV2Op::handle() {
  return *getODSResults(0).begin();
}

::mlir::TypeAttr StackV2Op::elem_typeAttr() {
  return (*this)->getAttr(elem_typeAttrName()).cast<::mlir::TypeAttr>();
}

::mlir::Type StackV2Op::elem_type() {
  auto attr = elem_typeAttr();
  return attr.getValue().cast<::mlir::Type>();
}

::mlir::StringAttr StackV2Op::stack_nameAttr() {
  return (*this)->getAttr(stack_nameAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef StackV2Op::stack_name() {
  auto attr = stack_nameAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("").getValue();
  return attr.getValue();
}

void StackV2Op::elem_typeAttr(::mlir::TypeAttr attr) {
  (*this)->setAttr(elem_typeAttrName(), attr);
}

void StackV2Op::stack_nameAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(stack_nameAttrName(), attr);
}

void StackV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type handle, ::mlir::Value max_size, ::mlir::TypeAttr elem_type, ::mlir::StringAttr stack_name) {
  odsState.addOperands(max_size);
  odsState.addAttribute(elem_typeAttrName(odsState.name), elem_type);
  odsState.addAttribute(stack_nameAttrName(odsState.name), stack_name);
  odsState.addTypes(handle);
}

void StackV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value max_size, ::mlir::TypeAttr elem_type, ::mlir::StringAttr stack_name) {
  odsState.addOperands(max_size);
  odsState.addAttribute(elem_typeAttrName(odsState.name), elem_type);
  odsState.addAttribute(stack_nameAttrName(odsState.name), stack_name);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void StackV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type handle, ::mlir::Value max_size, ::mlir::Type elem_type, ::llvm::StringRef stack_name) {
  odsState.addOperands(max_size);
  odsState.addAttribute(elem_typeAttrName(odsState.name), ::mlir::TypeAttr::get(elem_type));
  odsState.addAttribute(stack_nameAttrName(odsState.name), odsBuilder.getStringAttr(stack_name));
  odsState.addTypes(handle);
}

void StackV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value max_size, ::mlir::Type elem_type, ::llvm::StringRef stack_name) {
  odsState.addOperands(max_size);
  odsState.addAttribute(elem_typeAttrName(odsState.name), ::mlir::TypeAttr::get(elem_type));
  odsState.addAttribute(stack_nameAttrName(odsState.name), odsBuilder.getStringAttr(stack_name));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void StackV2Op::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult StackV2Op::verify() {
  {
    auto tblgen_elem_type = (*this)->getAttr(elem_typeAttrName());
    if (!tblgen_elem_type)
      return emitOpError("requires attribute 'elem_type'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops26(*this, tblgen_elem_type, "elem_type")))
      return ::mlir::failure();
  }
  {
    auto tblgen_stack_name = (*this)->getAttr(stack_nameAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_stack_name, "stack_name")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops11(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void StackV2Op::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  for (::mlir::Value value : getODSResults(0))
    effects.emplace_back(::mlir::MemoryEffects::Allocate::get(), value, ::mlir::TF::ResourceEffects::Stack::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::StackV2Op)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::StatefulPartitionedCallOp definitions
//===----------------------------------------------------------------------===//

StatefulPartitionedCallOpAdaptor::StatefulPartitionedCallOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

StatefulPartitionedCallOpAdaptor::StatefulPartitionedCallOpAdaptor(StatefulPartitionedCallOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange StatefulPartitionedCallOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> StatefulPartitionedCallOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  bool isVariadic[] = {true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (odsOperands.size() - 0) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::ValueRange StatefulPartitionedCallOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::ValueRange StatefulPartitionedCallOpAdaptor::args() {
  return getODSOperands(0);
}

::mlir::DictionaryAttr StatefulPartitionedCallOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::FlatSymbolRefAttr StatefulPartitionedCallOpAdaptor::f() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::FlatSymbolRefAttr attr = odsAttrs.get("f").cast<::mlir::FlatSymbolRefAttr>();
  return attr;
}

::mlir::StringAttr StatefulPartitionedCallOpAdaptor::config() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("config").cast<::mlir::StringAttr>();
  return attr;
}

::mlir::StringAttr StatefulPartitionedCallOpAdaptor::config_proto() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("config_proto").cast<::mlir::StringAttr>();
  return attr;
}

::mlir::StringAttr StatefulPartitionedCallOpAdaptor::executor_type() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("executor_type").cast<::mlir::StringAttr>();
  return attr;
}

::mlir::LogicalResult StatefulPartitionedCallOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_f = odsAttrs.get("f");
    if (!tblgen_f)
      return emitError(loc, "'tf.StatefulPartitionedCall' op ""requires attribute 'f'");

    if (tblgen_f && !((tblgen_f.isa<::mlir::FlatSymbolRefAttr>())))
      return emitError(loc, "'tf.StatefulPartitionedCall' op ""attribute 'f' failed to satisfy constraint: flat symbol reference attribute");
  }
  {
    auto tblgen_config = odsAttrs.get("config");
    if (!tblgen_config)
      return emitError(loc, "'tf.StatefulPartitionedCall' op ""requires attribute 'config'");

    if (tblgen_config && !((tblgen_config.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.StatefulPartitionedCall' op ""attribute 'config' failed to satisfy constraint: string attribute");
  }
  {
    auto tblgen_config_proto = odsAttrs.get("config_proto");
    if (!tblgen_config_proto)
      return emitError(loc, "'tf.StatefulPartitionedCall' op ""requires attribute 'config_proto'");

    if (tblgen_config_proto && !((tblgen_config_proto.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.StatefulPartitionedCall' op ""attribute 'config_proto' failed to satisfy constraint: string attribute");
  }
  {
    auto tblgen_executor_type = odsAttrs.get("executor_type");
    if (!tblgen_executor_type)
      return emitError(loc, "'tf.StatefulPartitionedCall' op ""requires attribute 'executor_type'");

    if (tblgen_executor_type && !((tblgen_executor_type.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.StatefulPartitionedCall' op ""attribute 'executor_type' failed to satisfy constraint: string attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> StatefulPartitionedCallOp::getODSOperandIndexAndLength(unsigned index) {
  bool isVariadic[] = {true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (getOperation()->getNumOperands() - 0) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::Operation::operand_range StatefulPartitionedCallOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Operation::operand_range StatefulPartitionedCallOp::args() {
  return getODSOperands(0);
}

::mlir::MutableOperandRange StatefulPartitionedCallOp::argsMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> StatefulPartitionedCallOp::getODSResultIndexAndLength(unsigned index) {
  bool isVariadic[] = {true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (getOperation()->getNumResults() - 0) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::Operation::result_range StatefulPartitionedCallOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Operation::result_range StatefulPartitionedCallOp::output() {
  return getODSResults(0);
}

::mlir::FlatSymbolRefAttr StatefulPartitionedCallOp::fAttr() {
  return (*this)->getAttr(fAttrName()).cast<::mlir::FlatSymbolRefAttr>();
}

::llvm::StringRef StatefulPartitionedCallOp::f() {
  auto attr = fAttr();
  return attr.getValue();
}

::mlir::StringAttr StatefulPartitionedCallOp::configAttr() {
  return (*this)->getAttr(configAttrName()).cast<::mlir::StringAttr>();
}

::llvm::StringRef StatefulPartitionedCallOp::config() {
  auto attr = configAttr();
  return attr.getValue();
}

::mlir::StringAttr StatefulPartitionedCallOp::config_protoAttr() {
  return (*this)->getAttr(config_protoAttrName()).cast<::mlir::StringAttr>();
}

::llvm::StringRef StatefulPartitionedCallOp::config_proto() {
  auto attr = config_protoAttr();
  return attr.getValue();
}

::mlir::StringAttr StatefulPartitionedCallOp::executor_typeAttr() {
  return (*this)->getAttr(executor_typeAttrName()).cast<::mlir::StringAttr>();
}

::llvm::StringRef StatefulPartitionedCallOp::executor_type() {
  auto attr = executor_typeAttr();
  return attr.getValue();
}

mlir::OperandElementTypeRange StatefulPartitionedCallOp::Tin() {
  auto values = getODSOperands(0);
return {mlir::OperandElementTypeIterator(values.begin()), mlir::OperandElementTypeIterator(values.end())};
}

mlir::ResultElementTypeRange StatefulPartitionedCallOp::Tout() {
  auto values = getODSResults(0);
return {mlir::ResultElementTypeIterator(values.begin()), mlir::ResultElementTypeIterator(values.end())};
}

bool StatefulPartitionedCallOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "Tin") return true;
  if (name == "Tout") return true;
 return false;
}

::mlir::DictionaryAttr StatefulPartitionedCallOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TinAttrName(),
ArrayAttr::get(ctx, 
    [&]() {
      llvm::SmallVector<Attribute, 4> ret;
      for (auto t : Tin())
        ret.push_back(TypeAttr::get(t));
      return ret;
    }())},
    {ToutAttrName(),
ArrayAttr::get(ctx, 
    [&]() {
      llvm::SmallVector<Attribute, 4> ret;
      for (auto t : Tout())
        ret.push_back(TypeAttr::get(t));
      return ret;
    }())}});
}

void StatefulPartitionedCallOp::fAttr(::mlir::FlatSymbolRefAttr attr) {
  (*this)->setAttr(fAttrName(), attr);
}

void StatefulPartitionedCallOp::configAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(configAttrName(), attr);
}

void StatefulPartitionedCallOp::config_protoAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(config_protoAttrName(), attr);
}

void StatefulPartitionedCallOp::executor_typeAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(executor_typeAttrName(), attr);
}

void StatefulPartitionedCallOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange output, ::mlir::ValueRange args, ::mlir::FlatSymbolRefAttr f, ::mlir::StringAttr config, ::mlir::StringAttr config_proto, ::mlir::StringAttr executor_type) {
  odsState.addOperands(args);
  odsState.addAttribute(fAttrName(odsState.name), f);
  odsState.addAttribute(configAttrName(odsState.name), config);
  odsState.addAttribute(config_protoAttrName(odsState.name), config_proto);
  odsState.addAttribute(executor_typeAttrName(odsState.name), executor_type);
  odsState.addTypes(output);
}

void StatefulPartitionedCallOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange output, ::mlir::ValueRange args, ::llvm::StringRef f, ::llvm::StringRef config, ::llvm::StringRef config_proto, ::llvm::StringRef executor_type) {
  odsState.addOperands(args);
  odsState.addAttribute(fAttrName(odsState.name), ::mlir::SymbolRefAttr::get(odsBuilder.getContext(), f));
  odsState.addAttribute(configAttrName(odsState.name), odsBuilder.getStringAttr(config));
  odsState.addAttribute(config_protoAttrName(odsState.name), odsBuilder.getStringAttr(config_proto));
  odsState.addAttribute(executor_typeAttrName(odsState.name), odsBuilder.getStringAttr(executor_type));
  odsState.addTypes(output);
}

void StatefulPartitionedCallOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult StatefulPartitionedCallOp::verify() {
  {
    auto tblgen_f = (*this)->getAttr(fAttrName());
    if (!tblgen_f)
      return emitOpError("requires attribute 'f'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops27(*this, tblgen_f, "f")))
      return ::mlir::failure();
  }
  {
    auto tblgen_config = (*this)->getAttr(configAttrName());
    if (!tblgen_config)
      return emitOpError("requires attribute 'config'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_config, "config")))
      return ::mlir::failure();
  }
  {
    auto tblgen_config_proto = (*this)->getAttr(config_protoAttrName());
    if (!tblgen_config_proto)
      return emitOpError("requires attribute 'config_proto'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_config_proto, "config_proto")))
      return ::mlir::failure();
  }
  {
    auto tblgen_executor_type = (*this)->getAttr(executor_typeAttrName());
    if (!tblgen_executor_type)
      return emitOpError("requires attribute 'executor_type'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_executor_type, "executor_type")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return VerifyPartitionedCall(*this);
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::StatefulPartitionedCallOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::StatefulStandardNormalV2Op definitions
//===----------------------------------------------------------------------===//

StatefulStandardNormalV2OpAdaptor::StatefulStandardNormalV2OpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

StatefulStandardNormalV2OpAdaptor::StatefulStandardNormalV2OpAdaptor(StatefulStandardNormalV2Op &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange StatefulStandardNormalV2OpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> StatefulStandardNormalV2OpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange StatefulStandardNormalV2OpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value StatefulStandardNormalV2OpAdaptor::resource() {
  return *getODSOperands(0).begin();
}

::mlir::Value StatefulStandardNormalV2OpAdaptor::algorithm() {
  return *getODSOperands(1).begin();
}

::mlir::Value StatefulStandardNormalV2OpAdaptor::shape() {
  return *getODSOperands(2).begin();
}

::mlir::DictionaryAttr StatefulStandardNormalV2OpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult StatefulStandardNormalV2OpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> StatefulStandardNormalV2Op::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range StatefulStandardNormalV2Op::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value StatefulStandardNormalV2Op::resource() {
  return *getODSOperands(0).begin();
}

::mlir::Value StatefulStandardNormalV2Op::algorithm() {
  return *getODSOperands(1).begin();
}

::mlir::Value StatefulStandardNormalV2Op::shape() {
  return *getODSOperands(2).begin();
}

::mlir::MutableOperandRange StatefulStandardNormalV2Op::resourceMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange StatefulStandardNormalV2Op::algorithmMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange StatefulStandardNormalV2Op::shapeMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> StatefulStandardNormalV2Op::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range StatefulStandardNormalV2Op::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value StatefulStandardNormalV2Op::output() {
  return *getODSResults(0).begin();
}

::mlir::Type StatefulStandardNormalV2Op::shape_dtype() {
  return mlir::getElementTypeOrSelf(*getODSOperands(2).begin());
}

::mlir::Type StatefulStandardNormalV2Op::dtype() {
  return mlir::getElementTypeOrSelf(*getODSResults(0).begin());
}

bool StatefulStandardNormalV2Op::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "shape_dtype") return true;
  if (name == "dtype") return true;
 return false;
}

::mlir::DictionaryAttr StatefulStandardNormalV2Op::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {shape_dtypeAttrName(),
::mlir::TypeAttr::get(shape_dtype())},
    {dtypeAttrName(),
::mlir::TypeAttr::get(dtype())}});
}

void StatefulStandardNormalV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value resource, ::mlir::Value algorithm, ::mlir::Value shape) {
  odsState.addOperands(resource);
  odsState.addOperands(algorithm);
  odsState.addOperands(shape);
  odsState.addTypes(output);
}

void StatefulStandardNormalV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value resource, ::mlir::Value algorithm, ::mlir::Value shape) {
  odsState.addOperands(resource);
  odsState.addOperands(algorithm);
  odsState.addOperands(shape);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void StatefulStandardNormalV2Op::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 3u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult StatefulStandardNormalV2Op::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops16(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void StatefulStandardNormalV2Op::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  for (::mlir::Value value : getODSOperands(0))
    effects.emplace_back(::mlir::MemoryEffects::Read::get(), value, ::mlir::TF::ResourceEffects::Variable::get());
  for (::mlir::Value value : getODSOperands(0))
    effects.emplace_back(::mlir::MemoryEffects::Write::get(), value, ::mlir::TF::ResourceEffects::Variable::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::StatefulStandardNormalV2Op)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::StatefulTruncatedNormalOp definitions
//===----------------------------------------------------------------------===//

StatefulTruncatedNormalOpAdaptor::StatefulTruncatedNormalOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

StatefulTruncatedNormalOpAdaptor::StatefulTruncatedNormalOpAdaptor(StatefulTruncatedNormalOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange StatefulTruncatedNormalOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> StatefulTruncatedNormalOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange StatefulTruncatedNormalOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value StatefulTruncatedNormalOpAdaptor::resource() {
  return *getODSOperands(0).begin();
}

::mlir::Value StatefulTruncatedNormalOpAdaptor::algorithm() {
  return *getODSOperands(1).begin();
}

::mlir::Value StatefulTruncatedNormalOpAdaptor::shape() {
  return *getODSOperands(2).begin();
}

::mlir::DictionaryAttr StatefulTruncatedNormalOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult StatefulTruncatedNormalOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> StatefulTruncatedNormalOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range StatefulTruncatedNormalOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value StatefulTruncatedNormalOp::resource() {
  return *getODSOperands(0).begin();
}

::mlir::Value StatefulTruncatedNormalOp::algorithm() {
  return *getODSOperands(1).begin();
}

::mlir::Value StatefulTruncatedNormalOp::shape() {
  return *getODSOperands(2).begin();
}

::mlir::MutableOperandRange StatefulTruncatedNormalOp::resourceMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange StatefulTruncatedNormalOp::algorithmMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange StatefulTruncatedNormalOp::shapeMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> StatefulTruncatedNormalOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range StatefulTruncatedNormalOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value StatefulTruncatedNormalOp::output() {
  return *getODSResults(0).begin();
}

::mlir::Type StatefulTruncatedNormalOp::shape_dtype() {
  return mlir::getElementTypeOrSelf(*getODSOperands(2).begin());
}

::mlir::Type StatefulTruncatedNormalOp::dtype() {
  return mlir::getElementTypeOrSelf(*getODSResults(0).begin());
}

bool StatefulTruncatedNormalOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "shape_dtype") return true;
  if (name == "dtype") return true;
 return false;
}

::mlir::DictionaryAttr StatefulTruncatedNormalOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {shape_dtypeAttrName(),
::mlir::TypeAttr::get(shape_dtype())},
    {dtypeAttrName(),
::mlir::TypeAttr::get(dtype())}});
}

void StatefulTruncatedNormalOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value resource, ::mlir::Value algorithm, ::mlir::Value shape) {
  odsState.addOperands(resource);
  odsState.addOperands(algorithm);
  odsState.addOperands(shape);
  odsState.addTypes(output);
}

void StatefulTruncatedNormalOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value resource, ::mlir::Value algorithm, ::mlir::Value shape) {
  odsState.addOperands(resource);
  odsState.addOperands(algorithm);
  odsState.addOperands(shape);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void StatefulTruncatedNormalOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 3u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult StatefulTruncatedNormalOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops16(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void StatefulTruncatedNormalOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  for (::mlir::Value value : getODSOperands(0))
    effects.emplace_back(::mlir::MemoryEffects::Read::get(), value, ::mlir::TF::ResourceEffects::Variable::get());
  for (::mlir::Value value : getODSOperands(0))
    effects.emplace_back(::mlir::MemoryEffects::Write::get(), value, ::mlir::TF::ResourceEffects::Variable::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::StatefulTruncatedNormalOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::StatefulUniformFullIntOp definitions
//===----------------------------------------------------------------------===//

StatefulUniformFullIntOpAdaptor::StatefulUniformFullIntOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

StatefulUniformFullIntOpAdaptor::StatefulUniformFullIntOpAdaptor(StatefulUniformFullIntOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange StatefulUniformFullIntOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> StatefulUniformFullIntOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange StatefulUniformFullIntOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value StatefulUniformFullIntOpAdaptor::resource() {
  return *getODSOperands(0).begin();
}

::mlir::Value StatefulUniformFullIntOpAdaptor::algorithm() {
  return *getODSOperands(1).begin();
}

::mlir::Value StatefulUniformFullIntOpAdaptor::shape() {
  return *getODSOperands(2).begin();
}

::mlir::DictionaryAttr StatefulUniformFullIntOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult StatefulUniformFullIntOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> StatefulUniformFullIntOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range StatefulUniformFullIntOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value StatefulUniformFullIntOp::resource() {
  return *getODSOperands(0).begin();
}

::mlir::Value StatefulUniformFullIntOp::algorithm() {
  return *getODSOperands(1).begin();
}

::mlir::Value StatefulUniformFullIntOp::shape() {
  return *getODSOperands(2).begin();
}

::mlir::MutableOperandRange StatefulUniformFullIntOp::resourceMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange StatefulUniformFullIntOp::algorithmMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange StatefulUniformFullIntOp::shapeMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> StatefulUniformFullIntOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range StatefulUniformFullIntOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value StatefulUniformFullIntOp::output() {
  return *getODSResults(0).begin();
}

::mlir::Type StatefulUniformFullIntOp::shape_dtype() {
  return mlir::getElementTypeOrSelf(*getODSOperands(2).begin());
}

::mlir::Type StatefulUniformFullIntOp::dtype() {
  return mlir::getElementTypeOrSelf(*getODSResults(0).begin());
}

bool StatefulUniformFullIntOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "shape_dtype") return true;
  if (name == "dtype") return true;
 return false;
}

::mlir::DictionaryAttr StatefulUniformFullIntOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {shape_dtypeAttrName(),
::mlir::TypeAttr::get(shape_dtype())},
    {dtypeAttrName(),
::mlir::TypeAttr::get(dtype())}});
}

void StatefulUniformFullIntOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value resource, ::mlir::Value algorithm, ::mlir::Value shape) {
  odsState.addOperands(resource);
  odsState.addOperands(algorithm);
  odsState.addOperands(shape);
  odsState.addTypes(output);
}

void StatefulUniformFullIntOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value resource, ::mlir::Value algorithm, ::mlir::Value shape) {
  odsState.addOperands(resource);
  odsState.addOperands(algorithm);
  odsState.addOperands(shape);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void StatefulUniformFullIntOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 3u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult StatefulUniformFullIntOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops16(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops58(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void StatefulUniformFullIntOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  for (::mlir::Value value : getODSOperands(0))
    effects.emplace_back(::mlir::MemoryEffects::Read::get(), value, ::mlir::TF::ResourceEffects::Variable::get());
  for (::mlir::Value value : getODSOperands(0))
    effects.emplace_back(::mlir::MemoryEffects::Write::get(), value, ::mlir::TF::ResourceEffects::Variable::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::StatefulUniformFullIntOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::StatefulUniformIntOp definitions
//===----------------------------------------------------------------------===//

StatefulUniformIntOpAdaptor::StatefulUniformIntOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

StatefulUniformIntOpAdaptor::StatefulUniformIntOpAdaptor(StatefulUniformIntOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange StatefulUniformIntOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> StatefulUniformIntOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange StatefulUniformIntOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value StatefulUniformIntOpAdaptor::resource() {
  return *getODSOperands(0).begin();
}

::mlir::Value StatefulUniformIntOpAdaptor::algorithm() {
  return *getODSOperands(1).begin();
}

::mlir::Value StatefulUniformIntOpAdaptor::shape() {
  return *getODSOperands(2).begin();
}

::mlir::Value StatefulUniformIntOpAdaptor::minval() {
  return *getODSOperands(3).begin();
}

::mlir::Value StatefulUniformIntOpAdaptor::maxval() {
  return *getODSOperands(4).begin();
}

::mlir::DictionaryAttr StatefulUniformIntOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult StatefulUniformIntOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> StatefulUniformIntOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range StatefulUniformIntOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value StatefulUniformIntOp::resource() {
  return *getODSOperands(0).begin();
}

::mlir::Value StatefulUniformIntOp::algorithm() {
  return *getODSOperands(1).begin();
}

::mlir::Value StatefulUniformIntOp::shape() {
  return *getODSOperands(2).begin();
}

::mlir::Value StatefulUniformIntOp::minval() {
  return *getODSOperands(3).begin();
}

::mlir::Value StatefulUniformIntOp::maxval() {
  return *getODSOperands(4).begin();
}

::mlir::MutableOperandRange StatefulUniformIntOp::resourceMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange StatefulUniformIntOp::algorithmMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange StatefulUniformIntOp::shapeMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange StatefulUniformIntOp::minvalMutable() {
  auto range = getODSOperandIndexAndLength(3);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange StatefulUniformIntOp::maxvalMutable() {
  auto range = getODSOperandIndexAndLength(4);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> StatefulUniformIntOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range StatefulUniformIntOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value StatefulUniformIntOp::output() {
  return *getODSResults(0).begin();
}

::mlir::Type StatefulUniformIntOp::shape_dtype() {
  return mlir::getElementTypeOrSelf(*getODSOperands(2).begin());
}

::mlir::Type StatefulUniformIntOp::dtype() {
  return mlir::getElementTypeOrSelf(*getODSOperands(3).begin());
}

bool StatefulUniformIntOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "shape_dtype") return true;
  if (name == "dtype") return true;
 return false;
}

::mlir::DictionaryAttr StatefulUniformIntOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {shape_dtypeAttrName(),
::mlir::TypeAttr::get(shape_dtype())},
    {dtypeAttrName(),
::mlir::TypeAttr::get(dtype())}});
}

void StatefulUniformIntOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value resource, ::mlir::Value algorithm, ::mlir::Value shape, ::mlir::Value minval, ::mlir::Value maxval) {
  odsState.addOperands(resource);
  odsState.addOperands(algorithm);
  odsState.addOperands(shape);
  odsState.addOperands(minval);
  odsState.addOperands(maxval);
  odsState.addTypes(output);
}

void StatefulUniformIntOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value resource, ::mlir::Value algorithm, ::mlir::Value shape, ::mlir::Value minval, ::mlir::Value maxval) {
  odsState.addOperands(resource);
  odsState.addOperands(algorithm);
  odsState.addOperands(shape);
  odsState.addOperands(minval);
  odsState.addOperands(maxval);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void StatefulUniformIntOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 5u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult StatefulUniformIntOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops16(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup3 = getODSOperands(3);

    for (auto v : valueGroup3) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops58(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup4 = getODSOperands(4);

    for (auto v : valueGroup4) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops58(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops58(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void StatefulUniformIntOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  for (::mlir::Value value : getODSOperands(0))
    effects.emplace_back(::mlir::MemoryEffects::Read::get(), value, ::mlir::TF::ResourceEffects::Variable::get());
  for (::mlir::Value value : getODSOperands(0))
    effects.emplace_back(::mlir::MemoryEffects::Write::get(), value, ::mlir::TF::ResourceEffects::Variable::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::StatefulUniformIntOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::StatefulUniformOp definitions
//===----------------------------------------------------------------------===//

StatefulUniformOpAdaptor::StatefulUniformOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

StatefulUniformOpAdaptor::StatefulUniformOpAdaptor(StatefulUniformOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange StatefulUniformOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> StatefulUniformOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange StatefulUniformOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value StatefulUniformOpAdaptor::resource() {
  return *getODSOperands(0).begin();
}

::mlir::Value StatefulUniformOpAdaptor::algorithm() {
  return *getODSOperands(1).begin();
}

::mlir::Value StatefulUniformOpAdaptor::shape() {
  return *getODSOperands(2).begin();
}

::mlir::DictionaryAttr StatefulUniformOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult StatefulUniformOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> StatefulUniformOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range StatefulUniformOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value StatefulUniformOp::resource() {
  return *getODSOperands(0).begin();
}

::mlir::Value StatefulUniformOp::algorithm() {
  return *getODSOperands(1).begin();
}

::mlir::Value StatefulUniformOp::shape() {
  return *getODSOperands(2).begin();
}

::mlir::MutableOperandRange StatefulUniformOp::resourceMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange StatefulUniformOp::algorithmMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange StatefulUniformOp::shapeMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> StatefulUniformOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range StatefulUniformOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value StatefulUniformOp::output() {
  return *getODSResults(0).begin();
}

::mlir::Type StatefulUniformOp::shape_dtype() {
  return mlir::getElementTypeOrSelf(*getODSOperands(2).begin());
}

::mlir::Type StatefulUniformOp::dtype() {
  return mlir::getElementTypeOrSelf(*getODSResults(0).begin());
}

bool StatefulUniformOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "shape_dtype") return true;
  if (name == "dtype") return true;
 return false;
}

::mlir::DictionaryAttr StatefulUniformOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {shape_dtypeAttrName(),
::mlir::TypeAttr::get(shape_dtype())},
    {dtypeAttrName(),
::mlir::TypeAttr::get(dtype())}});
}

void StatefulUniformOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value resource, ::mlir::Value algorithm, ::mlir::Value shape) {
  odsState.addOperands(resource);
  odsState.addOperands(algorithm);
  odsState.addOperands(shape);
  odsState.addTypes(output);
}

void StatefulUniformOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value resource, ::mlir::Value algorithm, ::mlir::Value shape) {
  odsState.addOperands(resource);
  odsState.addOperands(algorithm);
  odsState.addOperands(shape);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void StatefulUniformOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 3u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult StatefulUniformOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops16(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void StatefulUniformOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  for (::mlir::Value value : getODSOperands(0))
    effects.emplace_back(::mlir::MemoryEffects::Read::get(), value, ::mlir::TF::ResourceEffects::Variable::get());
  for (::mlir::Value value : getODSOperands(0))
    effects.emplace_back(::mlir::MemoryEffects::Write::get(), value, ::mlir::TF::ResourceEffects::Variable::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::StatefulUniformOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::StatelessMultinomialOp definitions
//===----------------------------------------------------------------------===//

StatelessMultinomialOpAdaptor::StatelessMultinomialOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

StatelessMultinomialOpAdaptor::StatelessMultinomialOpAdaptor(StatelessMultinomialOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange StatelessMultinomialOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> StatelessMultinomialOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange StatelessMultinomialOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value StatelessMultinomialOpAdaptor::logits() {
  return *getODSOperands(0).begin();
}

::mlir::Value StatelessMultinomialOpAdaptor::num_samples() {
  return *getODSOperands(1).begin();
}

::mlir::Value StatelessMultinomialOpAdaptor::seed() {
  return *getODSOperands(2).begin();
}

::mlir::DictionaryAttr StatelessMultinomialOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult StatelessMultinomialOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> StatelessMultinomialOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range StatelessMultinomialOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value StatelessMultinomialOp::logits() {
  return *getODSOperands(0).begin();
}

::mlir::Value StatelessMultinomialOp::num_samples() {
  return *getODSOperands(1).begin();
}

::mlir::Value StatelessMultinomialOp::seed() {
  return *getODSOperands(2).begin();
}

::mlir::MutableOperandRange StatelessMultinomialOp::logitsMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange StatelessMultinomialOp::num_samplesMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange StatelessMultinomialOp::seedMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> StatelessMultinomialOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range StatelessMultinomialOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value StatelessMultinomialOp::output() {
  return *getODSResults(0).begin();
}

::mlir::Type StatelessMultinomialOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

::mlir::Type StatelessMultinomialOp::Tseed() {
  return mlir::getElementTypeOrSelf(*getODSOperands(2).begin());
}

::mlir::Type StatelessMultinomialOp::output_dtype() {
  return mlir::getElementTypeOrSelf(*getODSResults(0).begin());
}

bool StatelessMultinomialOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
  if (name == "Tseed") return true;
  if (name == "output_dtype") return true;
 return false;
}

::mlir::DictionaryAttr StatelessMultinomialOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())},
    {TseedAttrName(),
::mlir::TypeAttr::get(Tseed())},
    {output_dtypeAttrName(),
::mlir::TypeAttr::get(output_dtype())}});
}

void StatelessMultinomialOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value logits, ::mlir::Value num_samples, ::mlir::Value seed) {
  odsState.addOperands(logits);
  odsState.addOperands(num_samples);
  odsState.addOperands(seed);
  odsState.addTypes(output);
}

void StatelessMultinomialOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value logits, ::mlir::Value num_samples, ::mlir::Value seed) {
  odsState.addOperands(logits);
  odsState.addOperands(num_samples);
  odsState.addOperands(seed);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void StatelessMultinomialOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 3u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult StatelessMultinomialOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops35(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops11(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void StatelessMultinomialOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::StatelessMultinomialOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::StatelessParameterizedTruncatedNormalOp definitions
//===----------------------------------------------------------------------===//

StatelessParameterizedTruncatedNormalOpAdaptor::StatelessParameterizedTruncatedNormalOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

StatelessParameterizedTruncatedNormalOpAdaptor::StatelessParameterizedTruncatedNormalOpAdaptor(StatelessParameterizedTruncatedNormalOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange StatelessParameterizedTruncatedNormalOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> StatelessParameterizedTruncatedNormalOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange StatelessParameterizedTruncatedNormalOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value StatelessParameterizedTruncatedNormalOpAdaptor::shape() {
  return *getODSOperands(0).begin();
}

::mlir::Value StatelessParameterizedTruncatedNormalOpAdaptor::seed() {
  return *getODSOperands(1).begin();
}

::mlir::Value StatelessParameterizedTruncatedNormalOpAdaptor::means() {
  return *getODSOperands(2).begin();
}

::mlir::Value StatelessParameterizedTruncatedNormalOpAdaptor::stddevs() {
  return *getODSOperands(3).begin();
}

::mlir::Value StatelessParameterizedTruncatedNormalOpAdaptor::minvals() {
  return *getODSOperands(4).begin();
}

::mlir::Value StatelessParameterizedTruncatedNormalOpAdaptor::maxvals() {
  return *getODSOperands(5).begin();
}

::mlir::DictionaryAttr StatelessParameterizedTruncatedNormalOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult StatelessParameterizedTruncatedNormalOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> StatelessParameterizedTruncatedNormalOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range StatelessParameterizedTruncatedNormalOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value StatelessParameterizedTruncatedNormalOp::shape() {
  return *getODSOperands(0).begin();
}

::mlir::Value StatelessParameterizedTruncatedNormalOp::seed() {
  return *getODSOperands(1).begin();
}

::mlir::Value StatelessParameterizedTruncatedNormalOp::means() {
  return *getODSOperands(2).begin();
}

::mlir::Value StatelessParameterizedTruncatedNormalOp::stddevs() {
  return *getODSOperands(3).begin();
}

::mlir::Value StatelessParameterizedTruncatedNormalOp::minvals() {
  return *getODSOperands(4).begin();
}

::mlir::Value StatelessParameterizedTruncatedNormalOp::maxvals() {
  return *getODSOperands(5).begin();
}

::mlir::MutableOperandRange StatelessParameterizedTruncatedNormalOp::shapeMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange StatelessParameterizedTruncatedNormalOp::seedMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange StatelessParameterizedTruncatedNormalOp::meansMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange StatelessParameterizedTruncatedNormalOp::stddevsMutable() {
  auto range = getODSOperandIndexAndLength(3);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange StatelessParameterizedTruncatedNormalOp::minvalsMutable() {
  auto range = getODSOperandIndexAndLength(4);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange StatelessParameterizedTruncatedNormalOp::maxvalsMutable() {
  auto range = getODSOperandIndexAndLength(5);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> StatelessParameterizedTruncatedNormalOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range StatelessParameterizedTruncatedNormalOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value StatelessParameterizedTruncatedNormalOp::output() {
  return *getODSResults(0).begin();
}

::mlir::Type StatelessParameterizedTruncatedNormalOp::S() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

::mlir::Type StatelessParameterizedTruncatedNormalOp::Tseed() {
  return mlir::getElementTypeOrSelf(*getODSOperands(1).begin());
}

::mlir::Type StatelessParameterizedTruncatedNormalOp::dtype() {
  return mlir::getElementTypeOrSelf(*getODSOperands(2).begin());
}

bool StatelessParameterizedTruncatedNormalOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "S") return true;
  if (name == "Tseed") return true;
  if (name == "dtype") return true;
 return false;
}

::mlir::DictionaryAttr StatelessParameterizedTruncatedNormalOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {SAttrName(),
::mlir::TypeAttr::get(S())},
    {TseedAttrName(),
::mlir::TypeAttr::get(Tseed())},
    {dtypeAttrName(),
::mlir::TypeAttr::get(dtype())}});
}

void StatelessParameterizedTruncatedNormalOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value shape, ::mlir::Value seed, ::mlir::Value means, ::mlir::Value stddevs, ::mlir::Value minvals, ::mlir::Value maxvals) {
  odsState.addOperands(shape);
  odsState.addOperands(seed);
  odsState.addOperands(means);
  odsState.addOperands(stddevs);
  odsState.addOperands(minvals);
  odsState.addOperands(maxvals);
  odsState.addTypes(output);
}

void StatelessParameterizedTruncatedNormalOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value shape, ::mlir::Value seed, ::mlir::Value means, ::mlir::Value stddevs, ::mlir::Value minvals, ::mlir::Value maxvals) {
  odsState.addOperands(shape);
  odsState.addOperands(seed);
  odsState.addOperands(means);
  odsState.addOperands(stddevs);
  odsState.addOperands(minvals);
  odsState.addOperands(maxvals);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void StatelessParameterizedTruncatedNormalOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 6u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult StatelessParameterizedTruncatedNormalOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops52(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup3 = getODSOperands(3);

    for (auto v : valueGroup3) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops52(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup4 = getODSOperands(4);

    for (auto v : valueGroup4) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops52(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup5 = getODSOperands(5);

    for (auto v : valueGroup5) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops52(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops52(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void StatelessParameterizedTruncatedNormalOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::StatelessParameterizedTruncatedNormalOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::StatelessRandomBinomialOp definitions
//===----------------------------------------------------------------------===//

StatelessRandomBinomialOpAdaptor::StatelessRandomBinomialOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

StatelessRandomBinomialOpAdaptor::StatelessRandomBinomialOpAdaptor(StatelessRandomBinomialOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange StatelessRandomBinomialOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> StatelessRandomBinomialOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange StatelessRandomBinomialOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value StatelessRandomBinomialOpAdaptor::shape() {
  return *getODSOperands(0).begin();
}

::mlir::Value StatelessRandomBinomialOpAdaptor::seed() {
  return *getODSOperands(1).begin();
}

::mlir::Value StatelessRandomBinomialOpAdaptor::counts() {
  return *getODSOperands(2).begin();
}

::mlir::Value StatelessRandomBinomialOpAdaptor::probs() {
  return *getODSOperands(3).begin();
}

::mlir::DictionaryAttr StatelessRandomBinomialOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult StatelessRandomBinomialOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> StatelessRandomBinomialOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range StatelessRandomBinomialOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value StatelessRandomBinomialOp::shape() {
  return *getODSOperands(0).begin();
}

::mlir::Value StatelessRandomBinomialOp::seed() {
  return *getODSOperands(1).begin();
}

::mlir::Value StatelessRandomBinomialOp::counts() {
  return *getODSOperands(2).begin();
}

::mlir::Value StatelessRandomBinomialOp::probs() {
  return *getODSOperands(3).begin();
}

::mlir::MutableOperandRange StatelessRandomBinomialOp::shapeMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange StatelessRandomBinomialOp::seedMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange StatelessRandomBinomialOp::countsMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange StatelessRandomBinomialOp::probsMutable() {
  auto range = getODSOperandIndexAndLength(3);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> StatelessRandomBinomialOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range StatelessRandomBinomialOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value StatelessRandomBinomialOp::output() {
  return *getODSResults(0).begin();
}

::mlir::Type StatelessRandomBinomialOp::S() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

::mlir::Type StatelessRandomBinomialOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(2).begin());
}

::mlir::Type StatelessRandomBinomialOp::Tseed() {
  return mlir::getElementTypeOrSelf(*getODSOperands(1).begin());
}

::mlir::Type StatelessRandomBinomialOp::dtype() {
  return mlir::getElementTypeOrSelf(*getODSResults(0).begin());
}

bool StatelessRandomBinomialOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "S") return true;
  if (name == "T") return true;
  if (name == "Tseed") return true;
  if (name == "dtype") return true;
 return false;
}

::mlir::DictionaryAttr StatelessRandomBinomialOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {SAttrName(),
::mlir::TypeAttr::get(S())},
    {TAttrName(),
::mlir::TypeAttr::get(T())},
    {TseedAttrName(),
::mlir::TypeAttr::get(Tseed())},
    {dtypeAttrName(),
::mlir::TypeAttr::get(dtype())}});
}

void StatelessRandomBinomialOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value shape, ::mlir::Value seed, ::mlir::Value counts, ::mlir::Value probs) {
  odsState.addOperands(shape);
  odsState.addOperands(seed);
  odsState.addOperands(counts);
  odsState.addOperands(probs);
  odsState.addTypes(output);
}

void StatelessRandomBinomialOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value shape, ::mlir::Value seed, ::mlir::Value counts, ::mlir::Value probs) {
  odsState.addOperands(shape);
  odsState.addOperands(seed);
  odsState.addOperands(counts);
  odsState.addOperands(probs);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void StatelessRandomBinomialOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 4u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult StatelessRandomBinomialOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops31(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup3 = getODSOperands(3);

    for (auto v : valueGroup3) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops31(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops31(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void StatelessRandomBinomialOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::StatelessRandomBinomialOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::StatelessRandomGammaV2Op definitions
//===----------------------------------------------------------------------===//

StatelessRandomGammaV2OpAdaptor::StatelessRandomGammaV2OpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

StatelessRandomGammaV2OpAdaptor::StatelessRandomGammaV2OpAdaptor(StatelessRandomGammaV2Op &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange StatelessRandomGammaV2OpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> StatelessRandomGammaV2OpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange StatelessRandomGammaV2OpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value StatelessRandomGammaV2OpAdaptor::shape() {
  return *getODSOperands(0).begin();
}

::mlir::Value StatelessRandomGammaV2OpAdaptor::seed() {
  return *getODSOperands(1).begin();
}

::mlir::Value StatelessRandomGammaV2OpAdaptor::alpha() {
  return *getODSOperands(2).begin();
}

::mlir::DictionaryAttr StatelessRandomGammaV2OpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult StatelessRandomGammaV2OpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> StatelessRandomGammaV2Op::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range StatelessRandomGammaV2Op::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value StatelessRandomGammaV2Op::shape() {
  return *getODSOperands(0).begin();
}

::mlir::Value StatelessRandomGammaV2Op::seed() {
  return *getODSOperands(1).begin();
}

::mlir::Value StatelessRandomGammaV2Op::alpha() {
  return *getODSOperands(2).begin();
}

::mlir::MutableOperandRange StatelessRandomGammaV2Op::shapeMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange StatelessRandomGammaV2Op::seedMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange StatelessRandomGammaV2Op::alphaMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> StatelessRandomGammaV2Op::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range StatelessRandomGammaV2Op::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value StatelessRandomGammaV2Op::output() {
  return *getODSResults(0).begin();
}

::mlir::Type StatelessRandomGammaV2Op::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

::mlir::Type StatelessRandomGammaV2Op::Tseed() {
  return mlir::getElementTypeOrSelf(*getODSOperands(1).begin());
}

::mlir::Type StatelessRandomGammaV2Op::dtype() {
  return mlir::getElementTypeOrSelf(*getODSOperands(2).begin());
}

bool StatelessRandomGammaV2Op::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
  if (name == "Tseed") return true;
  if (name == "dtype") return true;
 return false;
}

::mlir::DictionaryAttr StatelessRandomGammaV2Op::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())},
    {TseedAttrName(),
::mlir::TypeAttr::get(Tseed())},
    {dtypeAttrName(),
::mlir::TypeAttr::get(dtype())}});
}

void StatelessRandomGammaV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value shape, ::mlir::Value seed, ::mlir::Value alpha) {
  odsState.addOperands(shape);
  odsState.addOperands(seed);
  odsState.addOperands(alpha);
  odsState.addTypes(output);
}

void StatelessRandomGammaV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value shape, ::mlir::Value seed, ::mlir::Value alpha) {
  odsState.addOperands(shape);
  odsState.addOperands(seed);
  odsState.addOperands(alpha);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void StatelessRandomGammaV2Op::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 3u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult StatelessRandomGammaV2Op::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops52(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops52(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void StatelessRandomGammaV2Op::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::StatelessRandomGammaV2Op)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::StatelessRandomGetAlgOp definitions
//===----------------------------------------------------------------------===//

StatelessRandomGetAlgOpAdaptor::StatelessRandomGetAlgOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

StatelessRandomGetAlgOpAdaptor::StatelessRandomGetAlgOpAdaptor(StatelessRandomGetAlgOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange StatelessRandomGetAlgOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> StatelessRandomGetAlgOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange StatelessRandomGetAlgOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::DictionaryAttr StatelessRandomGetAlgOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult StatelessRandomGetAlgOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> StatelessRandomGetAlgOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range StatelessRandomGetAlgOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

std::pair<unsigned, unsigned> StatelessRandomGetAlgOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range StatelessRandomGetAlgOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value StatelessRandomGetAlgOp::alg() {
  return *getODSResults(0).begin();
}

void StatelessRandomGetAlgOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type alg) {
  odsState.addTypes(alg);
}

void StatelessRandomGetAlgOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes) {
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void StatelessRandomGetAlgOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 0u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult StatelessRandomGetAlgOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops11(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::StatelessRandomGetAlgOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::StatelessRandomGetKeyCounterAlgOp definitions
//===----------------------------------------------------------------------===//

StatelessRandomGetKeyCounterAlgOpAdaptor::StatelessRandomGetKeyCounterAlgOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

StatelessRandomGetKeyCounterAlgOpAdaptor::StatelessRandomGetKeyCounterAlgOpAdaptor(StatelessRandomGetKeyCounterAlgOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange StatelessRandomGetKeyCounterAlgOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> StatelessRandomGetKeyCounterAlgOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange StatelessRandomGetKeyCounterAlgOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value StatelessRandomGetKeyCounterAlgOpAdaptor::seed() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr StatelessRandomGetKeyCounterAlgOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult StatelessRandomGetKeyCounterAlgOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

void StatelessRandomGetKeyCounterAlgOp::getAsmResultNames(::mlir::OpAsmSetValueNameFn setNameFn) {
  auto resultGroup0 = getODSResults(0);
  if (!llvm::empty(resultGroup0))
    setNameFn(*resultGroup0.begin(), "key");
  auto resultGroup1 = getODSResults(1);
  if (!llvm::empty(resultGroup1))
    setNameFn(*resultGroup1.begin(), "counter");
  auto resultGroup2 = getODSResults(2);
  if (!llvm::empty(resultGroup2))
    setNameFn(*resultGroup2.begin(), "alg");
}

std::pair<unsigned, unsigned> StatelessRandomGetKeyCounterAlgOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range StatelessRandomGetKeyCounterAlgOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value StatelessRandomGetKeyCounterAlgOp::seed() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange StatelessRandomGetKeyCounterAlgOp::seedMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> StatelessRandomGetKeyCounterAlgOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range StatelessRandomGetKeyCounterAlgOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value StatelessRandomGetKeyCounterAlgOp::key() {
  return *getODSResults(0).begin();
}

::mlir::Value StatelessRandomGetKeyCounterAlgOp::counter() {
  return *getODSResults(1).begin();
}

::mlir::Value StatelessRandomGetKeyCounterAlgOp::alg() {
  return *getODSResults(2).begin();
}

::mlir::Type StatelessRandomGetKeyCounterAlgOp::Tseed() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool StatelessRandomGetKeyCounterAlgOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "Tseed") return true;
 return false;
}

::mlir::DictionaryAttr StatelessRandomGetKeyCounterAlgOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TseedAttrName(),
::mlir::TypeAttr::get(Tseed())}});
}

void StatelessRandomGetKeyCounterAlgOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type key, ::mlir::Type counter, ::mlir::Type alg, ::mlir::Value seed) {
  odsState.addOperands(seed);
  odsState.addTypes(key);
  odsState.addTypes(counter);
  odsState.addTypes(alg);
}

void StatelessRandomGetKeyCounterAlgOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value seed) {
  odsState.addOperands(seed);
  assert(resultTypes.size() == 3u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void StatelessRandomGetKeyCounterAlgOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 3u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult StatelessRandomGetKeyCounterAlgOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops57(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSResults(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops57(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSResults(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops11(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void StatelessRandomGetKeyCounterAlgOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::StatelessRandomGetKeyCounterAlgOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::StatelessRandomGetKeyCounterOp definitions
//===----------------------------------------------------------------------===//

StatelessRandomGetKeyCounterOpAdaptor::StatelessRandomGetKeyCounterOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

StatelessRandomGetKeyCounterOpAdaptor::StatelessRandomGetKeyCounterOpAdaptor(StatelessRandomGetKeyCounterOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange StatelessRandomGetKeyCounterOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> StatelessRandomGetKeyCounterOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange StatelessRandomGetKeyCounterOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value StatelessRandomGetKeyCounterOpAdaptor::seed() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr StatelessRandomGetKeyCounterOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult StatelessRandomGetKeyCounterOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

void StatelessRandomGetKeyCounterOp::getAsmResultNames(::mlir::OpAsmSetValueNameFn setNameFn) {
  auto resultGroup0 = getODSResults(0);
  if (!llvm::empty(resultGroup0))
    setNameFn(*resultGroup0.begin(), "key");
  auto resultGroup1 = getODSResults(1);
  if (!llvm::empty(resultGroup1))
    setNameFn(*resultGroup1.begin(), "counter");
}

std::pair<unsigned, unsigned> StatelessRandomGetKeyCounterOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range StatelessRandomGetKeyCounterOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value StatelessRandomGetKeyCounterOp::seed() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange StatelessRandomGetKeyCounterOp::seedMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> StatelessRandomGetKeyCounterOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range StatelessRandomGetKeyCounterOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value StatelessRandomGetKeyCounterOp::key() {
  return *getODSResults(0).begin();
}

::mlir::Value StatelessRandomGetKeyCounterOp::counter() {
  return *getODSResults(1).begin();
}

::mlir::Type StatelessRandomGetKeyCounterOp::Tseed() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool StatelessRandomGetKeyCounterOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "Tseed") return true;
 return false;
}

::mlir::DictionaryAttr StatelessRandomGetKeyCounterOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TseedAttrName(),
::mlir::TypeAttr::get(Tseed())}});
}

void StatelessRandomGetKeyCounterOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type key, ::mlir::Type counter, ::mlir::Value seed) {
  odsState.addOperands(seed);
  odsState.addTypes(key);
  odsState.addTypes(counter);
}

void StatelessRandomGetKeyCounterOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value seed) {
  odsState.addOperands(seed);
  assert(resultTypes.size() == 2u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void StatelessRandomGetKeyCounterOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 2u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult StatelessRandomGetKeyCounterOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops57(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSResults(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops57(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void StatelessRandomGetKeyCounterOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::StatelessRandomGetKeyCounterOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::StatelessRandomNormalOp definitions
//===----------------------------------------------------------------------===//

StatelessRandomNormalOpAdaptor::StatelessRandomNormalOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

StatelessRandomNormalOpAdaptor::StatelessRandomNormalOpAdaptor(StatelessRandomNormalOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange StatelessRandomNormalOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> StatelessRandomNormalOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange StatelessRandomNormalOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value StatelessRandomNormalOpAdaptor::shape() {
  return *getODSOperands(0).begin();
}

::mlir::Value StatelessRandomNormalOpAdaptor::seed() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr StatelessRandomNormalOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult StatelessRandomNormalOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> StatelessRandomNormalOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range StatelessRandomNormalOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value StatelessRandomNormalOp::shape() {
  return *getODSOperands(0).begin();
}

::mlir::Value StatelessRandomNormalOp::seed() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange StatelessRandomNormalOp::shapeMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange StatelessRandomNormalOp::seedMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> StatelessRandomNormalOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range StatelessRandomNormalOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value StatelessRandomNormalOp::output() {
  return *getODSResults(0).begin();
}

::mlir::Type StatelessRandomNormalOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

::mlir::Type StatelessRandomNormalOp::Tseed() {
  return mlir::getElementTypeOrSelf(*getODSOperands(1).begin());
}

::mlir::Type StatelessRandomNormalOp::dtype() {
  return mlir::getElementTypeOrSelf(*getODSResults(0).begin());
}

bool StatelessRandomNormalOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
  if (name == "Tseed") return true;
  if (name == "dtype") return true;
 return false;
}

::mlir::DictionaryAttr StatelessRandomNormalOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())},
    {TseedAttrName(),
::mlir::TypeAttr::get(Tseed())},
    {dtypeAttrName(),
::mlir::TypeAttr::get(dtype())}});
}

void StatelessRandomNormalOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value shape, ::mlir::Value seed) {
  odsState.addOperands(shape);
  odsState.addOperands(seed);
  odsState.addTypes(output);
}

void StatelessRandomNormalOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value shape, ::mlir::Value seed) {
  odsState.addOperands(shape);
  odsState.addOperands(seed);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void StatelessRandomNormalOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult StatelessRandomNormalOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void StatelessRandomNormalOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::StatelessRandomNormalOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::StatelessRandomNormalV2Op definitions
//===----------------------------------------------------------------------===//

StatelessRandomNormalV2OpAdaptor::StatelessRandomNormalV2OpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

StatelessRandomNormalV2OpAdaptor::StatelessRandomNormalV2OpAdaptor(StatelessRandomNormalV2Op &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange StatelessRandomNormalV2OpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> StatelessRandomNormalV2OpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange StatelessRandomNormalV2OpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value StatelessRandomNormalV2OpAdaptor::shape() {
  return *getODSOperands(0).begin();
}

::mlir::Value StatelessRandomNormalV2OpAdaptor::key() {
  return *getODSOperands(1).begin();
}

::mlir::Value StatelessRandomNormalV2OpAdaptor::counter() {
  return *getODSOperands(2).begin();
}

::mlir::Value StatelessRandomNormalV2OpAdaptor::alg() {
  return *getODSOperands(3).begin();
}

::mlir::DictionaryAttr StatelessRandomNormalV2OpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult StatelessRandomNormalV2OpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> StatelessRandomNormalV2Op::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range StatelessRandomNormalV2Op::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value StatelessRandomNormalV2Op::shape() {
  return *getODSOperands(0).begin();
}

::mlir::Value StatelessRandomNormalV2Op::key() {
  return *getODSOperands(1).begin();
}

::mlir::Value StatelessRandomNormalV2Op::counter() {
  return *getODSOperands(2).begin();
}

::mlir::Value StatelessRandomNormalV2Op::alg() {
  return *getODSOperands(3).begin();
}

::mlir::MutableOperandRange StatelessRandomNormalV2Op::shapeMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange StatelessRandomNormalV2Op::keyMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange StatelessRandomNormalV2Op::counterMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange StatelessRandomNormalV2Op::algMutable() {
  auto range = getODSOperandIndexAndLength(3);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> StatelessRandomNormalV2Op::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range StatelessRandomNormalV2Op::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value StatelessRandomNormalV2Op::output() {
  return *getODSResults(0).begin();
}

::mlir::Type StatelessRandomNormalV2Op::Tshape() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

::mlir::Type StatelessRandomNormalV2Op::dtype() {
  return mlir::getElementTypeOrSelf(*getODSResults(0).begin());
}

bool StatelessRandomNormalV2Op::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "Tshape") return true;
  if (name == "dtype") return true;
 return false;
}

::mlir::DictionaryAttr StatelessRandomNormalV2Op::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TshapeAttrName(),
::mlir::TypeAttr::get(Tshape())},
    {dtypeAttrName(),
::mlir::TypeAttr::get(dtype())}});
}

void StatelessRandomNormalV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value shape, ::mlir::Value key, ::mlir::Value counter, ::mlir::Value alg) {
  odsState.addOperands(shape);
  odsState.addOperands(key);
  odsState.addOperands(counter);
  odsState.addOperands(alg);
  odsState.addTypes(output);
}

void StatelessRandomNormalV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value shape, ::mlir::Value key, ::mlir::Value counter, ::mlir::Value alg) {
  odsState.addOperands(shape);
  odsState.addOperands(key);
  odsState.addOperands(counter);
  odsState.addOperands(alg);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void StatelessRandomNormalV2Op::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 4u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult StatelessRandomNormalV2Op::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops57(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops57(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup3 = getODSOperands(3);

    for (auto v : valueGroup3) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops11(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void StatelessRandomNormalV2Op::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::StatelessRandomNormalV2Op)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::StatelessRandomPoissonOp definitions
//===----------------------------------------------------------------------===//

StatelessRandomPoissonOpAdaptor::StatelessRandomPoissonOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

StatelessRandomPoissonOpAdaptor::StatelessRandomPoissonOpAdaptor(StatelessRandomPoissonOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange StatelessRandomPoissonOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> StatelessRandomPoissonOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange StatelessRandomPoissonOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value StatelessRandomPoissonOpAdaptor::shape() {
  return *getODSOperands(0).begin();
}

::mlir::Value StatelessRandomPoissonOpAdaptor::seed() {
  return *getODSOperands(1).begin();
}

::mlir::Value StatelessRandomPoissonOpAdaptor::lam() {
  return *getODSOperands(2).begin();
}

::mlir::DictionaryAttr StatelessRandomPoissonOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult StatelessRandomPoissonOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> StatelessRandomPoissonOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range StatelessRandomPoissonOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value StatelessRandomPoissonOp::shape() {
  return *getODSOperands(0).begin();
}

::mlir::Value StatelessRandomPoissonOp::seed() {
  return *getODSOperands(1).begin();
}

::mlir::Value StatelessRandomPoissonOp::lam() {
  return *getODSOperands(2).begin();
}

::mlir::MutableOperandRange StatelessRandomPoissonOp::shapeMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange StatelessRandomPoissonOp::seedMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange StatelessRandomPoissonOp::lamMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> StatelessRandomPoissonOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range StatelessRandomPoissonOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value StatelessRandomPoissonOp::output() {
  return *getODSResults(0).begin();
}

::mlir::Type StatelessRandomPoissonOp::Rtype() {
  return mlir::getElementTypeOrSelf(*getODSOperands(2).begin());
}

::mlir::Type StatelessRandomPoissonOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

::mlir::Type StatelessRandomPoissonOp::Tseed() {
  return mlir::getElementTypeOrSelf(*getODSOperands(1).begin());
}

::mlir::Type StatelessRandomPoissonOp::dtype() {
  return mlir::getElementTypeOrSelf(*getODSResults(0).begin());
}

bool StatelessRandomPoissonOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "Rtype") return true;
  if (name == "T") return true;
  if (name == "Tseed") return true;
  if (name == "dtype") return true;
 return false;
}

::mlir::DictionaryAttr StatelessRandomPoissonOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {RtypeAttrName(),
::mlir::TypeAttr::get(Rtype())},
    {TAttrName(),
::mlir::TypeAttr::get(T())},
    {TseedAttrName(),
::mlir::TypeAttr::get(Tseed())},
    {dtypeAttrName(),
::mlir::TypeAttr::get(dtype())}});
}

void StatelessRandomPoissonOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value shape, ::mlir::Value seed, ::mlir::Value lam) {
  odsState.addOperands(shape);
  odsState.addOperands(seed);
  odsState.addOperands(lam);
  odsState.addTypes(output);
}

void StatelessRandomPoissonOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value shape, ::mlir::Value seed, ::mlir::Value lam) {
  odsState.addOperands(shape);
  odsState.addOperands(seed);
  odsState.addOperands(lam);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void StatelessRandomPoissonOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 3u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult StatelessRandomPoissonOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops31(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops31(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void StatelessRandomPoissonOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::StatelessRandomPoissonOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::StatelessRandomUniformFullIntOp definitions
//===----------------------------------------------------------------------===//

StatelessRandomUniformFullIntOpAdaptor::StatelessRandomUniformFullIntOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

StatelessRandomUniformFullIntOpAdaptor::StatelessRandomUniformFullIntOpAdaptor(StatelessRandomUniformFullIntOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange StatelessRandomUniformFullIntOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> StatelessRandomUniformFullIntOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange StatelessRandomUniformFullIntOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value StatelessRandomUniformFullIntOpAdaptor::shape() {
  return *getODSOperands(0).begin();
}

::mlir::Value StatelessRandomUniformFullIntOpAdaptor::seed() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr StatelessRandomUniformFullIntOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult StatelessRandomUniformFullIntOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> StatelessRandomUniformFullIntOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range StatelessRandomUniformFullIntOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value StatelessRandomUniformFullIntOp::shape() {
  return *getODSOperands(0).begin();
}

::mlir::Value StatelessRandomUniformFullIntOp::seed() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange StatelessRandomUniformFullIntOp::shapeMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange StatelessRandomUniformFullIntOp::seedMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> StatelessRandomUniformFullIntOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range StatelessRandomUniformFullIntOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value StatelessRandomUniformFullIntOp::output() {
  return *getODSResults(0).begin();
}

::mlir::Type StatelessRandomUniformFullIntOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

::mlir::Type StatelessRandomUniformFullIntOp::Tseed() {
  return mlir::getElementTypeOrSelf(*getODSOperands(1).begin());
}

::mlir::Type StatelessRandomUniformFullIntOp::dtype() {
  return mlir::getElementTypeOrSelf(*getODSResults(0).begin());
}

bool StatelessRandomUniformFullIntOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
  if (name == "Tseed") return true;
  if (name == "dtype") return true;
 return false;
}

::mlir::DictionaryAttr StatelessRandomUniformFullIntOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())},
    {TseedAttrName(),
::mlir::TypeAttr::get(Tseed())},
    {dtypeAttrName(),
::mlir::TypeAttr::get(dtype())}});
}

void StatelessRandomUniformFullIntOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value shape, ::mlir::Value seed) {
  odsState.addOperands(shape);
  odsState.addOperands(seed);
  odsState.addTypes(output);
}

void StatelessRandomUniformFullIntOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value shape, ::mlir::Value seed) {
  odsState.addOperands(shape);
  odsState.addOperands(seed);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void StatelessRandomUniformFullIntOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult StatelessRandomUniformFullIntOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops58(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops58(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void StatelessRandomUniformFullIntOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::StatelessRandomUniformFullIntOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::StatelessRandomUniformFullIntV2Op definitions
//===----------------------------------------------------------------------===//

StatelessRandomUniformFullIntV2OpAdaptor::StatelessRandomUniformFullIntV2OpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

StatelessRandomUniformFullIntV2OpAdaptor::StatelessRandomUniformFullIntV2OpAdaptor(StatelessRandomUniformFullIntV2Op &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange StatelessRandomUniformFullIntV2OpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> StatelessRandomUniformFullIntV2OpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange StatelessRandomUniformFullIntV2OpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value StatelessRandomUniformFullIntV2OpAdaptor::shape() {
  return *getODSOperands(0).begin();
}

::mlir::Value StatelessRandomUniformFullIntV2OpAdaptor::key() {
  return *getODSOperands(1).begin();
}

::mlir::Value StatelessRandomUniformFullIntV2OpAdaptor::counter() {
  return *getODSOperands(2).begin();
}

::mlir::Value StatelessRandomUniformFullIntV2OpAdaptor::alg() {
  return *getODSOperands(3).begin();
}

::mlir::DictionaryAttr StatelessRandomUniformFullIntV2OpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult StatelessRandomUniformFullIntV2OpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> StatelessRandomUniformFullIntV2Op::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range StatelessRandomUniformFullIntV2Op::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value StatelessRandomUniformFullIntV2Op::shape() {
  return *getODSOperands(0).begin();
}

::mlir::Value StatelessRandomUniformFullIntV2Op::key() {
  return *getODSOperands(1).begin();
}

::mlir::Value StatelessRandomUniformFullIntV2Op::counter() {
  return *getODSOperands(2).begin();
}

::mlir::Value StatelessRandomUniformFullIntV2Op::alg() {
  return *getODSOperands(3).begin();
}

::mlir::MutableOperandRange StatelessRandomUniformFullIntV2Op::shapeMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange StatelessRandomUniformFullIntV2Op::keyMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange StatelessRandomUniformFullIntV2Op::counterMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange StatelessRandomUniformFullIntV2Op::algMutable() {
  auto range = getODSOperandIndexAndLength(3);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> StatelessRandomUniformFullIntV2Op::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range StatelessRandomUniformFullIntV2Op::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value StatelessRandomUniformFullIntV2Op::output() {
  return *getODSResults(0).begin();
}

::mlir::Type StatelessRandomUniformFullIntV2Op::Tshape() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

::mlir::Type StatelessRandomUniformFullIntV2Op::dtype() {
  return mlir::getElementTypeOrSelf(*getODSResults(0).begin());
}

bool StatelessRandomUniformFullIntV2Op::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "Tshape") return true;
  if (name == "dtype") return true;
 return false;
}

::mlir::DictionaryAttr StatelessRandomUniformFullIntV2Op::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TshapeAttrName(),
::mlir::TypeAttr::get(Tshape())},
    {dtypeAttrName(),
::mlir::TypeAttr::get(dtype())}});
}

void StatelessRandomUniformFullIntV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value shape, ::mlir::Value key, ::mlir::Value counter, ::mlir::Value alg) {
  odsState.addOperands(shape);
  odsState.addOperands(key);
  odsState.addOperands(counter);
  odsState.addOperands(alg);
  odsState.addTypes(output);
}

void StatelessRandomUniformFullIntV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value shape, ::mlir::Value key, ::mlir::Value counter, ::mlir::Value alg) {
  odsState.addOperands(shape);
  odsState.addOperands(key);
  odsState.addOperands(counter);
  odsState.addOperands(alg);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void StatelessRandomUniformFullIntV2Op::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 4u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult StatelessRandomUniformFullIntV2Op::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops57(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops57(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup3 = getODSOperands(3);

    for (auto v : valueGroup3) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops11(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops58(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void StatelessRandomUniformFullIntV2Op::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::StatelessRandomUniformFullIntV2Op)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::StatelessRandomUniformIntOp definitions
//===----------------------------------------------------------------------===//

StatelessRandomUniformIntOpAdaptor::StatelessRandomUniformIntOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

StatelessRandomUniformIntOpAdaptor::StatelessRandomUniformIntOpAdaptor(StatelessRandomUniformIntOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange StatelessRandomUniformIntOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> StatelessRandomUniformIntOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange StatelessRandomUniformIntOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value StatelessRandomUniformIntOpAdaptor::shape() {
  return *getODSOperands(0).begin();
}

::mlir::Value StatelessRandomUniformIntOpAdaptor::seed() {
  return *getODSOperands(1).begin();
}

::mlir::Value StatelessRandomUniformIntOpAdaptor::minval() {
  return *getODSOperands(2).begin();
}

::mlir::Value StatelessRandomUniformIntOpAdaptor::maxval() {
  return *getODSOperands(3).begin();
}

::mlir::DictionaryAttr StatelessRandomUniformIntOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult StatelessRandomUniformIntOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> StatelessRandomUniformIntOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range StatelessRandomUniformIntOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value StatelessRandomUniformIntOp::shape() {
  return *getODSOperands(0).begin();
}

::mlir::Value StatelessRandomUniformIntOp::seed() {
  return *getODSOperands(1).begin();
}

::mlir::Value StatelessRandomUniformIntOp::minval() {
  return *getODSOperands(2).begin();
}

::mlir::Value StatelessRandomUniformIntOp::maxval() {
  return *getODSOperands(3).begin();
}

::mlir::MutableOperandRange StatelessRandomUniformIntOp::shapeMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange StatelessRandomUniformIntOp::seedMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange StatelessRandomUniformIntOp::minvalMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange StatelessRandomUniformIntOp::maxvalMutable() {
  auto range = getODSOperandIndexAndLength(3);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> StatelessRandomUniformIntOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range StatelessRandomUniformIntOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value StatelessRandomUniformIntOp::output() {
  return *getODSResults(0).begin();
}

::mlir::Type StatelessRandomUniformIntOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

::mlir::Type StatelessRandomUniformIntOp::Tseed() {
  return mlir::getElementTypeOrSelf(*getODSOperands(1).begin());
}

::mlir::Type StatelessRandomUniformIntOp::dtype() {
  return mlir::getElementTypeOrSelf(*getODSOperands(2).begin());
}

bool StatelessRandomUniformIntOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
  if (name == "Tseed") return true;
  if (name == "dtype") return true;
 return false;
}

::mlir::DictionaryAttr StatelessRandomUniformIntOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())},
    {TseedAttrName(),
::mlir::TypeAttr::get(Tseed())},
    {dtypeAttrName(),
::mlir::TypeAttr::get(dtype())}});
}

void StatelessRandomUniformIntOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value shape, ::mlir::Value seed, ::mlir::Value minval, ::mlir::Value maxval) {
  odsState.addOperands(shape);
  odsState.addOperands(seed);
  odsState.addOperands(minval);
  odsState.addOperands(maxval);
  odsState.addTypes(output);
}

void StatelessRandomUniformIntOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value shape, ::mlir::Value seed, ::mlir::Value minval, ::mlir::Value maxval) {
  odsState.addOperands(shape);
  odsState.addOperands(seed);
  odsState.addOperands(minval);
  odsState.addOperands(maxval);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void StatelessRandomUniformIntOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 4u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult StatelessRandomUniformIntOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup3 = getODSOperands(3);

    for (auto v : valueGroup3) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void StatelessRandomUniformIntOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::StatelessRandomUniformIntOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::StatelessRandomUniformIntV2Op definitions
//===----------------------------------------------------------------------===//

StatelessRandomUniformIntV2OpAdaptor::StatelessRandomUniformIntV2OpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

StatelessRandomUniformIntV2OpAdaptor::StatelessRandomUniformIntV2OpAdaptor(StatelessRandomUniformIntV2Op &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange StatelessRandomUniformIntV2OpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> StatelessRandomUniformIntV2OpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange StatelessRandomUniformIntV2OpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value StatelessRandomUniformIntV2OpAdaptor::shape() {
  return *getODSOperands(0).begin();
}

::mlir::Value StatelessRandomUniformIntV2OpAdaptor::key() {
  return *getODSOperands(1).begin();
}

::mlir::Value StatelessRandomUniformIntV2OpAdaptor::counter() {
  return *getODSOperands(2).begin();
}

::mlir::Value StatelessRandomUniformIntV2OpAdaptor::alg() {
  return *getODSOperands(3).begin();
}

::mlir::Value StatelessRandomUniformIntV2OpAdaptor::minval() {
  return *getODSOperands(4).begin();
}

::mlir::Value StatelessRandomUniformIntV2OpAdaptor::maxval() {
  return *getODSOperands(5).begin();
}

::mlir::DictionaryAttr StatelessRandomUniformIntV2OpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult StatelessRandomUniformIntV2OpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> StatelessRandomUniformIntV2Op::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range StatelessRandomUniformIntV2Op::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value StatelessRandomUniformIntV2Op::shape() {
  return *getODSOperands(0).begin();
}

::mlir::Value StatelessRandomUniformIntV2Op::key() {
  return *getODSOperands(1).begin();
}

::mlir::Value StatelessRandomUniformIntV2Op::counter() {
  return *getODSOperands(2).begin();
}

::mlir::Value StatelessRandomUniformIntV2Op::alg() {
  return *getODSOperands(3).begin();
}

::mlir::Value StatelessRandomUniformIntV2Op::minval() {
  return *getODSOperands(4).begin();
}

::mlir::Value StatelessRandomUniformIntV2Op::maxval() {
  return *getODSOperands(5).begin();
}

::mlir::MutableOperandRange StatelessRandomUniformIntV2Op::shapeMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange StatelessRandomUniformIntV2Op::keyMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange StatelessRandomUniformIntV2Op::counterMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange StatelessRandomUniformIntV2Op::algMutable() {
  auto range = getODSOperandIndexAndLength(3);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange StatelessRandomUniformIntV2Op::minvalMutable() {
  auto range = getODSOperandIndexAndLength(4);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange StatelessRandomUniformIntV2Op::maxvalMutable() {
  auto range = getODSOperandIndexAndLength(5);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> StatelessRandomUniformIntV2Op::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range StatelessRandomUniformIntV2Op::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value StatelessRandomUniformIntV2Op::output() {
  return *getODSResults(0).begin();
}

::mlir::Type StatelessRandomUniformIntV2Op::Tshape() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

::mlir::Type StatelessRandomUniformIntV2Op::dtype() {
  return mlir::getElementTypeOrSelf(*getODSOperands(4).begin());
}

bool StatelessRandomUniformIntV2Op::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "Tshape") return true;
  if (name == "dtype") return true;
 return false;
}

::mlir::DictionaryAttr StatelessRandomUniformIntV2Op::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TshapeAttrName(),
::mlir::TypeAttr::get(Tshape())},
    {dtypeAttrName(),
::mlir::TypeAttr::get(dtype())}});
}

void StatelessRandomUniformIntV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value shape, ::mlir::Value key, ::mlir::Value counter, ::mlir::Value alg, ::mlir::Value minval, ::mlir::Value maxval) {
  odsState.addOperands(shape);
  odsState.addOperands(key);
  odsState.addOperands(counter);
  odsState.addOperands(alg);
  odsState.addOperands(minval);
  odsState.addOperands(maxval);
  odsState.addTypes(output);
}

void StatelessRandomUniformIntV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value shape, ::mlir::Value key, ::mlir::Value counter, ::mlir::Value alg, ::mlir::Value minval, ::mlir::Value maxval) {
  odsState.addOperands(shape);
  odsState.addOperands(key);
  odsState.addOperands(counter);
  odsState.addOperands(alg);
  odsState.addOperands(minval);
  odsState.addOperands(maxval);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void StatelessRandomUniformIntV2Op::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 6u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult StatelessRandomUniformIntV2Op::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops57(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops57(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup3 = getODSOperands(3);

    for (auto v : valueGroup3) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops11(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup4 = getODSOperands(4);

    for (auto v : valueGroup4) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops58(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup5 = getODSOperands(5);

    for (auto v : valueGroup5) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops58(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops58(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void StatelessRandomUniformIntV2Op::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::StatelessRandomUniformIntV2Op)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::StatelessRandomUniformOp definitions
//===----------------------------------------------------------------------===//

StatelessRandomUniformOpAdaptor::StatelessRandomUniformOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

StatelessRandomUniformOpAdaptor::StatelessRandomUniformOpAdaptor(StatelessRandomUniformOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange StatelessRandomUniformOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> StatelessRandomUniformOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange StatelessRandomUniformOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value StatelessRandomUniformOpAdaptor::shape() {
  return *getODSOperands(0).begin();
}

::mlir::Value StatelessRandomUniformOpAdaptor::seed() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr StatelessRandomUniformOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult StatelessRandomUniformOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> StatelessRandomUniformOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range StatelessRandomUniformOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value StatelessRandomUniformOp::shape() {
  return *getODSOperands(0).begin();
}

::mlir::Value StatelessRandomUniformOp::seed() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange StatelessRandomUniformOp::shapeMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange StatelessRandomUniformOp::seedMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> StatelessRandomUniformOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range StatelessRandomUniformOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value StatelessRandomUniformOp::output() {
  return *getODSResults(0).begin();
}

::mlir::Type StatelessRandomUniformOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

::mlir::Type StatelessRandomUniformOp::Tseed() {
  return mlir::getElementTypeOrSelf(*getODSOperands(1).begin());
}

::mlir::Type StatelessRandomUniformOp::dtype() {
  return mlir::getElementTypeOrSelf(*getODSResults(0).begin());
}

bool StatelessRandomUniformOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
  if (name == "Tseed") return true;
  if (name == "dtype") return true;
 return false;
}

::mlir::DictionaryAttr StatelessRandomUniformOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())},
    {TseedAttrName(),
::mlir::TypeAttr::get(Tseed())},
    {dtypeAttrName(),
::mlir::TypeAttr::get(dtype())}});
}

void StatelessRandomUniformOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value shape, ::mlir::Value seed) {
  odsState.addOperands(shape);
  odsState.addOperands(seed);
  odsState.addTypes(output);
}

void StatelessRandomUniformOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value shape, ::mlir::Value seed) {
  odsState.addOperands(shape);
  odsState.addOperands(seed);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void StatelessRandomUniformOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult StatelessRandomUniformOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void StatelessRandomUniformOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::StatelessRandomUniformOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::StatelessRandomUniformV2Op definitions
//===----------------------------------------------------------------------===//

StatelessRandomUniformV2OpAdaptor::StatelessRandomUniformV2OpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

StatelessRandomUniformV2OpAdaptor::StatelessRandomUniformV2OpAdaptor(StatelessRandomUniformV2Op &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange StatelessRandomUniformV2OpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> StatelessRandomUniformV2OpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange StatelessRandomUniformV2OpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value StatelessRandomUniformV2OpAdaptor::shape() {
  return *getODSOperands(0).begin();
}

::mlir::Value StatelessRandomUniformV2OpAdaptor::key() {
  return *getODSOperands(1).begin();
}

::mlir::Value StatelessRandomUniformV2OpAdaptor::counter() {
  return *getODSOperands(2).begin();
}

::mlir::Value StatelessRandomUniformV2OpAdaptor::alg() {
  return *getODSOperands(3).begin();
}

::mlir::DictionaryAttr StatelessRandomUniformV2OpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult StatelessRandomUniformV2OpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> StatelessRandomUniformV2Op::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range StatelessRandomUniformV2Op::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value StatelessRandomUniformV2Op::shape() {
  return *getODSOperands(0).begin();
}

::mlir::Value StatelessRandomUniformV2Op::key() {
  return *getODSOperands(1).begin();
}

::mlir::Value StatelessRandomUniformV2Op::counter() {
  return *getODSOperands(2).begin();
}

::mlir::Value StatelessRandomUniformV2Op::alg() {
  return *getODSOperands(3).begin();
}

::mlir::MutableOperandRange StatelessRandomUniformV2Op::shapeMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange StatelessRandomUniformV2Op::keyMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange StatelessRandomUniformV2Op::counterMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange StatelessRandomUniformV2Op::algMutable() {
  auto range = getODSOperandIndexAndLength(3);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> StatelessRandomUniformV2Op::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range StatelessRandomUniformV2Op::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value StatelessRandomUniformV2Op::output() {
  return *getODSResults(0).begin();
}

::mlir::Type StatelessRandomUniformV2Op::Tshape() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

::mlir::Type StatelessRandomUniformV2Op::dtype() {
  return mlir::getElementTypeOrSelf(*getODSResults(0).begin());
}

bool StatelessRandomUniformV2Op::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "Tshape") return true;
  if (name == "dtype") return true;
 return false;
}

::mlir::DictionaryAttr StatelessRandomUniformV2Op::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TshapeAttrName(),
::mlir::TypeAttr::get(Tshape())},
    {dtypeAttrName(),
::mlir::TypeAttr::get(dtype())}});
}

void StatelessRandomUniformV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value shape, ::mlir::Value key, ::mlir::Value counter, ::mlir::Value alg) {
  odsState.addOperands(shape);
  odsState.addOperands(key);
  odsState.addOperands(counter);
  odsState.addOperands(alg);
  odsState.addTypes(output);
}

void StatelessRandomUniformV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value shape, ::mlir::Value key, ::mlir::Value counter, ::mlir::Value alg) {
  odsState.addOperands(shape);
  odsState.addOperands(key);
  odsState.addOperands(counter);
  odsState.addOperands(alg);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void StatelessRandomUniformV2Op::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 4u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult StatelessRandomUniformV2Op::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops57(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops57(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup3 = getODSOperands(3);

    for (auto v : valueGroup3) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops11(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void StatelessRandomUniformV2Op::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::StatelessRandomUniformV2Op)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::StatelessTruncatedNormalOp definitions
//===----------------------------------------------------------------------===//

StatelessTruncatedNormalOpAdaptor::StatelessTruncatedNormalOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

StatelessTruncatedNormalOpAdaptor::StatelessTruncatedNormalOpAdaptor(StatelessTruncatedNormalOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange StatelessTruncatedNormalOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> StatelessTruncatedNormalOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange StatelessTruncatedNormalOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value StatelessTruncatedNormalOpAdaptor::shape() {
  return *getODSOperands(0).begin();
}

::mlir::Value StatelessTruncatedNormalOpAdaptor::seed() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr StatelessTruncatedNormalOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult StatelessTruncatedNormalOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> StatelessTruncatedNormalOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range StatelessTruncatedNormalOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value StatelessTruncatedNormalOp::shape() {
  return *getODSOperands(0).begin();
}

::mlir::Value StatelessTruncatedNormalOp::seed() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange StatelessTruncatedNormalOp::shapeMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange StatelessTruncatedNormalOp::seedMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> StatelessTruncatedNormalOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range StatelessTruncatedNormalOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value StatelessTruncatedNormalOp::output() {
  return *getODSResults(0).begin();
}

::mlir::Type StatelessTruncatedNormalOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

::mlir::Type StatelessTruncatedNormalOp::Tseed() {
  return mlir::getElementTypeOrSelf(*getODSOperands(1).begin());
}

::mlir::Type StatelessTruncatedNormalOp::dtype() {
  return mlir::getElementTypeOrSelf(*getODSResults(0).begin());
}

bool StatelessTruncatedNormalOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
  if (name == "Tseed") return true;
  if (name == "dtype") return true;
 return false;
}

::mlir::DictionaryAttr StatelessTruncatedNormalOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())},
    {TseedAttrName(),
::mlir::TypeAttr::get(Tseed())},
    {dtypeAttrName(),
::mlir::TypeAttr::get(dtype())}});
}

void StatelessTruncatedNormalOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value shape, ::mlir::Value seed) {
  odsState.addOperands(shape);
  odsState.addOperands(seed);
  odsState.addTypes(output);
}

void StatelessTruncatedNormalOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value shape, ::mlir::Value seed) {
  odsState.addOperands(shape);
  odsState.addOperands(seed);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void StatelessTruncatedNormalOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult StatelessTruncatedNormalOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void StatelessTruncatedNormalOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::StatelessTruncatedNormalOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::StatelessTruncatedNormalV2Op definitions
//===----------------------------------------------------------------------===//

StatelessTruncatedNormalV2OpAdaptor::StatelessTruncatedNormalV2OpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

StatelessTruncatedNormalV2OpAdaptor::StatelessTruncatedNormalV2OpAdaptor(StatelessTruncatedNormalV2Op &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange StatelessTruncatedNormalV2OpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> StatelessTruncatedNormalV2OpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange StatelessTruncatedNormalV2OpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value StatelessTruncatedNormalV2OpAdaptor::shape() {
  return *getODSOperands(0).begin();
}

::mlir::Value StatelessTruncatedNormalV2OpAdaptor::key() {
  return *getODSOperands(1).begin();
}

::mlir::Value StatelessTruncatedNormalV2OpAdaptor::counter() {
  return *getODSOperands(2).begin();
}

::mlir::Value StatelessTruncatedNormalV2OpAdaptor::alg() {
  return *getODSOperands(3).begin();
}

::mlir::DictionaryAttr StatelessTruncatedNormalV2OpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult StatelessTruncatedNormalV2OpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> StatelessTruncatedNormalV2Op::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range StatelessTruncatedNormalV2Op::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value StatelessTruncatedNormalV2Op::shape() {
  return *getODSOperands(0).begin();
}

::mlir::Value StatelessTruncatedNormalV2Op::key() {
  return *getODSOperands(1).begin();
}

::mlir::Value StatelessTruncatedNormalV2Op::counter() {
  return *getODSOperands(2).begin();
}

::mlir::Value StatelessTruncatedNormalV2Op::alg() {
  return *getODSOperands(3).begin();
}

::mlir::MutableOperandRange StatelessTruncatedNormalV2Op::shapeMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange StatelessTruncatedNormalV2Op::keyMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange StatelessTruncatedNormalV2Op::counterMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange StatelessTruncatedNormalV2Op::algMutable() {
  auto range = getODSOperandIndexAndLength(3);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> StatelessTruncatedNormalV2Op::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range StatelessTruncatedNormalV2Op::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value StatelessTruncatedNormalV2Op::output() {
  return *getODSResults(0).begin();
}

::mlir::Type StatelessTruncatedNormalV2Op::Tshape() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

::mlir::Type StatelessTruncatedNormalV2Op::dtype() {
  return mlir::getElementTypeOrSelf(*getODSResults(0).begin());
}

bool StatelessTruncatedNormalV2Op::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "Tshape") return true;
  if (name == "dtype") return true;
 return false;
}

::mlir::DictionaryAttr StatelessTruncatedNormalV2Op::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TshapeAttrName(),
::mlir::TypeAttr::get(Tshape())},
    {dtypeAttrName(),
::mlir::TypeAttr::get(dtype())}});
}

void StatelessTruncatedNormalV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value shape, ::mlir::Value key, ::mlir::Value counter, ::mlir::Value alg) {
  odsState.addOperands(shape);
  odsState.addOperands(key);
  odsState.addOperands(counter);
  odsState.addOperands(alg);
  odsState.addTypes(output);
}

void StatelessTruncatedNormalV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value shape, ::mlir::Value key, ::mlir::Value counter, ::mlir::Value alg) {
  odsState.addOperands(shape);
  odsState.addOperands(key);
  odsState.addOperands(counter);
  odsState.addOperands(alg);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void StatelessTruncatedNormalV2Op::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 4u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult StatelessTruncatedNormalV2Op::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops57(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops57(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup3 = getODSOperands(3);

    for (auto v : valueGroup3) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops11(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void StatelessTruncatedNormalV2Op::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::StatelessTruncatedNormalV2Op)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::StaticRegexFullMatchOp definitions
//===----------------------------------------------------------------------===//

StaticRegexFullMatchOpAdaptor::StaticRegexFullMatchOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

StaticRegexFullMatchOpAdaptor::StaticRegexFullMatchOpAdaptor(StaticRegexFullMatchOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange StaticRegexFullMatchOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> StaticRegexFullMatchOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange StaticRegexFullMatchOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value StaticRegexFullMatchOpAdaptor::input() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr StaticRegexFullMatchOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::StringAttr StaticRegexFullMatchOpAdaptor::pattern() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("pattern").cast<::mlir::StringAttr>();
  return attr;
}

::mlir::LogicalResult StaticRegexFullMatchOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_pattern = odsAttrs.get("pattern");
    if (!tblgen_pattern)
      return emitError(loc, "'tf.StaticRegexFullMatch' op ""requires attribute 'pattern'");

    if (tblgen_pattern && !((tblgen_pattern.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.StaticRegexFullMatch' op ""attribute 'pattern' failed to satisfy constraint: string attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> StaticRegexFullMatchOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range StaticRegexFullMatchOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value StaticRegexFullMatchOp::input() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange StaticRegexFullMatchOp::inputMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> StaticRegexFullMatchOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range StaticRegexFullMatchOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value StaticRegexFullMatchOp::output() {
  return *getODSResults(0).begin();
}

::mlir::StringAttr StaticRegexFullMatchOp::patternAttr() {
  return (*this)->getAttr(patternAttrName()).cast<::mlir::StringAttr>();
}

::llvm::StringRef StaticRegexFullMatchOp::pattern() {
  auto attr = patternAttr();
  return attr.getValue();
}

void StaticRegexFullMatchOp::patternAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(patternAttrName(), attr);
}

void StaticRegexFullMatchOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input, ::mlir::StringAttr pattern) {
  odsState.addOperands(input);
  odsState.addAttribute(patternAttrName(odsState.name), pattern);
  odsState.addTypes(output);
}

void StaticRegexFullMatchOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::StringAttr pattern) {
  odsState.addOperands(input);
  odsState.addAttribute(patternAttrName(odsState.name), pattern);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void StaticRegexFullMatchOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input, ::llvm::StringRef pattern) {
  odsState.addOperands(input);
  odsState.addAttribute(patternAttrName(odsState.name), odsBuilder.getStringAttr(pattern));
  odsState.addTypes(output);
}

void StaticRegexFullMatchOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::llvm::StringRef pattern) {
  odsState.addOperands(input);
  odsState.addAttribute(patternAttrName(odsState.name), odsBuilder.getStringAttr(pattern));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void StaticRegexFullMatchOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult StaticRegexFullMatchOp::verify() {
  {
    auto tblgen_pattern = (*this)->getAttr(patternAttrName());
    if (!tblgen_pattern)
      return emitOpError("requires attribute 'pattern'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_pattern, "pattern")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops19(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops8(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void StaticRegexFullMatchOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::StaticRegexFullMatchOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::StopGradientOp definitions
//===----------------------------------------------------------------------===//

StopGradientOpAdaptor::StopGradientOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

StopGradientOpAdaptor::StopGradientOpAdaptor(StopGradientOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange StopGradientOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> StopGradientOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange StopGradientOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value StopGradientOpAdaptor::input() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr StopGradientOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult StopGradientOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> StopGradientOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range StopGradientOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value StopGradientOp::input() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange StopGradientOp::inputMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> StopGradientOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range StopGradientOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value StopGradientOp::output() {
  return *getODSResults(0).begin();
}

::mlir::Type StopGradientOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool StopGradientOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr StopGradientOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void StopGradientOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input) {
  odsState.addOperands(input);
  odsState.addTypes(output);
}

void StopGradientOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input) {
  odsState.addOperands(input);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void StopGradientOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult StopGradientOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  if (!((tf_type::AreCastCompatible(llvm::makeArrayRef({(*this->getODSOperands(0).begin()).getType(), (*this->getODSResults(0).begin()).getType()})))))
    return emitOpError("failed to verify that all of {input, output} have dynamically equal types ");
  return ::mlir::success();
}

void StopGradientOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::StopGradientOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::StridedSliceGradOp definitions
//===----------------------------------------------------------------------===//

StridedSliceGradOpAdaptor::StridedSliceGradOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

StridedSliceGradOpAdaptor::StridedSliceGradOpAdaptor(StridedSliceGradOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange StridedSliceGradOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> StridedSliceGradOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange StridedSliceGradOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value StridedSliceGradOpAdaptor::shape() {
  return *getODSOperands(0).begin();
}

::mlir::Value StridedSliceGradOpAdaptor::begin() {
  return *getODSOperands(1).begin();
}

::mlir::Value StridedSliceGradOpAdaptor::end() {
  return *getODSOperands(2).begin();
}

::mlir::Value StridedSliceGradOpAdaptor::strides() {
  return *getODSOperands(3).begin();
}

::mlir::Value StridedSliceGradOpAdaptor::dy() {
  return *getODSOperands(4).begin();
}

::mlir::DictionaryAttr StridedSliceGradOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::IntegerAttr StridedSliceGradOpAdaptor::begin_mask() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("begin_mask").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), 0);
  return attr;
}

::mlir::IntegerAttr StridedSliceGradOpAdaptor::end_mask() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("end_mask").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), 0);
  return attr;
}

::mlir::IntegerAttr StridedSliceGradOpAdaptor::ellipsis_mask() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("ellipsis_mask").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), 0);
  return attr;
}

::mlir::IntegerAttr StridedSliceGradOpAdaptor::new_axis_mask() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("new_axis_mask").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), 0);
  return attr;
}

::mlir::IntegerAttr StridedSliceGradOpAdaptor::shrink_axis_mask() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("shrink_axis_mask").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), 0);
  return attr;
}

::mlir::LogicalResult StridedSliceGradOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_begin_mask = odsAttrs.get("begin_mask");
    if (tblgen_begin_mask && !(((tblgen_begin_mask.isa<::mlir::IntegerAttr>())) && ((tblgen_begin_mask.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.StridedSliceGrad' op ""attribute 'begin_mask' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_end_mask = odsAttrs.get("end_mask");
    if (tblgen_end_mask && !(((tblgen_end_mask.isa<::mlir::IntegerAttr>())) && ((tblgen_end_mask.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.StridedSliceGrad' op ""attribute 'end_mask' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_ellipsis_mask = odsAttrs.get("ellipsis_mask");
    if (tblgen_ellipsis_mask && !(((tblgen_ellipsis_mask.isa<::mlir::IntegerAttr>())) && ((tblgen_ellipsis_mask.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.StridedSliceGrad' op ""attribute 'ellipsis_mask' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_new_axis_mask = odsAttrs.get("new_axis_mask");
    if (tblgen_new_axis_mask && !(((tblgen_new_axis_mask.isa<::mlir::IntegerAttr>())) && ((tblgen_new_axis_mask.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.StridedSliceGrad' op ""attribute 'new_axis_mask' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_shrink_axis_mask = odsAttrs.get("shrink_axis_mask");
    if (tblgen_shrink_axis_mask && !(((tblgen_shrink_axis_mask.isa<::mlir::IntegerAttr>())) && ((tblgen_shrink_axis_mask.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.StridedSliceGrad' op ""attribute 'shrink_axis_mask' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> StridedSliceGradOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range StridedSliceGradOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value StridedSliceGradOp::shape() {
  return *getODSOperands(0).begin();
}

::mlir::Value StridedSliceGradOp::begin() {
  return *getODSOperands(1).begin();
}

::mlir::Value StridedSliceGradOp::end() {
  return *getODSOperands(2).begin();
}

::mlir::Value StridedSliceGradOp::strides() {
  return *getODSOperands(3).begin();
}

::mlir::Value StridedSliceGradOp::dy() {
  return *getODSOperands(4).begin();
}

::mlir::MutableOperandRange StridedSliceGradOp::shapeMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange StridedSliceGradOp::beginMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange StridedSliceGradOp::endMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange StridedSliceGradOp::stridesMutable() {
  auto range = getODSOperandIndexAndLength(3);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange StridedSliceGradOp::dyMutable() {
  auto range = getODSOperandIndexAndLength(4);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> StridedSliceGradOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range StridedSliceGradOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value StridedSliceGradOp::output() {
  return *getODSResults(0).begin();
}

::mlir::IntegerAttr StridedSliceGradOp::begin_maskAttr() {
  return (*this)->getAttr(begin_maskAttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t StridedSliceGradOp::begin_mask() {
  auto attr = begin_maskAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), 0).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

::mlir::IntegerAttr StridedSliceGradOp::end_maskAttr() {
  return (*this)->getAttr(end_maskAttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t StridedSliceGradOp::end_mask() {
  auto attr = end_maskAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), 0).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

::mlir::IntegerAttr StridedSliceGradOp::ellipsis_maskAttr() {
  return (*this)->getAttr(ellipsis_maskAttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t StridedSliceGradOp::ellipsis_mask() {
  auto attr = ellipsis_maskAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), 0).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

::mlir::IntegerAttr StridedSliceGradOp::new_axis_maskAttr() {
  return (*this)->getAttr(new_axis_maskAttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t StridedSliceGradOp::new_axis_mask() {
  auto attr = new_axis_maskAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), 0).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

::mlir::IntegerAttr StridedSliceGradOp::shrink_axis_maskAttr() {
  return (*this)->getAttr(shrink_axis_maskAttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t StridedSliceGradOp::shrink_axis_mask() {
  auto attr = shrink_axis_maskAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), 0).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

::mlir::Type StridedSliceGradOp::Index() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

::mlir::Type StridedSliceGradOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(4).begin());
}

bool StridedSliceGradOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "Index") return true;
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr StridedSliceGradOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {IndexAttrName(),
::mlir::TypeAttr::get(Index())},
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void StridedSliceGradOp::begin_maskAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(begin_maskAttrName(), attr);
}

void StridedSliceGradOp::end_maskAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(end_maskAttrName(), attr);
}

void StridedSliceGradOp::ellipsis_maskAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(ellipsis_maskAttrName(), attr);
}

void StridedSliceGradOp::new_axis_maskAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(new_axis_maskAttrName(), attr);
}

void StridedSliceGradOp::shrink_axis_maskAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(shrink_axis_maskAttrName(), attr);
}

void StridedSliceGradOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value shape, ::mlir::Value begin, ::mlir::Value end, ::mlir::Value strides, ::mlir::Value dy, ::mlir::IntegerAttr begin_mask, ::mlir::IntegerAttr end_mask, ::mlir::IntegerAttr ellipsis_mask, ::mlir::IntegerAttr new_axis_mask, ::mlir::IntegerAttr shrink_axis_mask) {
  odsState.addOperands(shape);
  odsState.addOperands(begin);
  odsState.addOperands(end);
  odsState.addOperands(strides);
  odsState.addOperands(dy);
  odsState.addAttribute(begin_maskAttrName(odsState.name), begin_mask);
  odsState.addAttribute(end_maskAttrName(odsState.name), end_mask);
  odsState.addAttribute(ellipsis_maskAttrName(odsState.name), ellipsis_mask);
  odsState.addAttribute(new_axis_maskAttrName(odsState.name), new_axis_mask);
  odsState.addAttribute(shrink_axis_maskAttrName(odsState.name), shrink_axis_mask);
  odsState.addTypes(output);
}

void StridedSliceGradOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value shape, ::mlir::Value begin, ::mlir::Value end, ::mlir::Value strides, ::mlir::Value dy, ::mlir::IntegerAttr begin_mask, ::mlir::IntegerAttr end_mask, ::mlir::IntegerAttr ellipsis_mask, ::mlir::IntegerAttr new_axis_mask, ::mlir::IntegerAttr shrink_axis_mask) {
  odsState.addOperands(shape);
  odsState.addOperands(begin);
  odsState.addOperands(end);
  odsState.addOperands(strides);
  odsState.addOperands(dy);
  odsState.addAttribute(begin_maskAttrName(odsState.name), begin_mask);
  odsState.addAttribute(end_maskAttrName(odsState.name), end_mask);
  odsState.addAttribute(ellipsis_maskAttrName(odsState.name), ellipsis_mask);
  odsState.addAttribute(new_axis_maskAttrName(odsState.name), new_axis_mask);
  odsState.addAttribute(shrink_axis_maskAttrName(odsState.name), shrink_axis_mask);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void StridedSliceGradOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value shape, ::mlir::Value begin, ::mlir::Value end, ::mlir::Value strides, ::mlir::Value dy, uint64_t begin_mask, uint64_t end_mask, uint64_t ellipsis_mask, uint64_t new_axis_mask, uint64_t shrink_axis_mask) {
  odsState.addOperands(shape);
  odsState.addOperands(begin);
  odsState.addOperands(end);
  odsState.addOperands(strides);
  odsState.addOperands(dy);
  odsState.addAttribute(begin_maskAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), begin_mask));
  odsState.addAttribute(end_maskAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), end_mask));
  odsState.addAttribute(ellipsis_maskAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), ellipsis_mask));
  odsState.addAttribute(new_axis_maskAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), new_axis_mask));
  odsState.addAttribute(shrink_axis_maskAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), shrink_axis_mask));
  odsState.addTypes(output);
}

void StridedSliceGradOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value shape, ::mlir::Value begin, ::mlir::Value end, ::mlir::Value strides, ::mlir::Value dy, uint64_t begin_mask, uint64_t end_mask, uint64_t ellipsis_mask, uint64_t new_axis_mask, uint64_t shrink_axis_mask) {
  odsState.addOperands(shape);
  odsState.addOperands(begin);
  odsState.addOperands(end);
  odsState.addOperands(strides);
  odsState.addOperands(dy);
  odsState.addAttribute(begin_maskAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), begin_mask));
  odsState.addAttribute(end_maskAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), end_mask));
  odsState.addAttribute(ellipsis_maskAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), ellipsis_mask));
  odsState.addAttribute(new_axis_maskAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), new_axis_mask));
  odsState.addAttribute(shrink_axis_maskAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), shrink_axis_mask));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void StridedSliceGradOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 5u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult StridedSliceGradOp::verify() {
  {
    auto tblgen_begin_mask = (*this)->getAttr(begin_maskAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_begin_mask, "begin_mask")))
      return ::mlir::failure();
  }
  {
    auto tblgen_end_mask = (*this)->getAttr(end_maskAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_end_mask, "end_mask")))
      return ::mlir::failure();
  }
  {
    auto tblgen_ellipsis_mask = (*this)->getAttr(ellipsis_maskAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_ellipsis_mask, "ellipsis_mask")))
      return ::mlir::failure();
  }
  {
    auto tblgen_new_axis_mask = (*this)->getAttr(new_axis_maskAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_new_axis_mask, "new_axis_mask")))
      return ::mlir::failure();
  }
  {
    auto tblgen_shrink_axis_mask = (*this)->getAttr(shrink_axis_maskAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_shrink_axis_mask, "shrink_axis_mask")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup3 = getODSOperands(3);

    for (auto v : valueGroup3) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup4 = getODSOperands(4);

    for (auto v : valueGroup4) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return Verify(*this);
}

void StridedSliceGradOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::StridedSliceGradOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::StridedSliceOp definitions
//===----------------------------------------------------------------------===//

StridedSliceOpAdaptor::StridedSliceOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

StridedSliceOpAdaptor::StridedSliceOpAdaptor(StridedSliceOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange StridedSliceOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> StridedSliceOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange StridedSliceOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value StridedSliceOpAdaptor::input() {
  return *getODSOperands(0).begin();
}

::mlir::Value StridedSliceOpAdaptor::begin() {
  return *getODSOperands(1).begin();
}

::mlir::Value StridedSliceOpAdaptor::end() {
  return *getODSOperands(2).begin();
}

::mlir::Value StridedSliceOpAdaptor::strides() {
  return *getODSOperands(3).begin();
}

::mlir::DictionaryAttr StridedSliceOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::IntegerAttr StridedSliceOpAdaptor::begin_mask() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("begin_mask").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), 0);
  return attr;
}

::mlir::IntegerAttr StridedSliceOpAdaptor::end_mask() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("end_mask").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), 0);
  return attr;
}

::mlir::IntegerAttr StridedSliceOpAdaptor::ellipsis_mask() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("ellipsis_mask").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), 0);
  return attr;
}

::mlir::IntegerAttr StridedSliceOpAdaptor::new_axis_mask() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("new_axis_mask").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), 0);
  return attr;
}

::mlir::IntegerAttr StridedSliceOpAdaptor::shrink_axis_mask() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("shrink_axis_mask").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), 0);
  return attr;
}

::mlir::LogicalResult StridedSliceOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_begin_mask = odsAttrs.get("begin_mask");
    if (tblgen_begin_mask && !(((tblgen_begin_mask.isa<::mlir::IntegerAttr>())) && ((tblgen_begin_mask.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.StridedSlice' op ""attribute 'begin_mask' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_end_mask = odsAttrs.get("end_mask");
    if (tblgen_end_mask && !(((tblgen_end_mask.isa<::mlir::IntegerAttr>())) && ((tblgen_end_mask.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.StridedSlice' op ""attribute 'end_mask' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_ellipsis_mask = odsAttrs.get("ellipsis_mask");
    if (tblgen_ellipsis_mask && !(((tblgen_ellipsis_mask.isa<::mlir::IntegerAttr>())) && ((tblgen_ellipsis_mask.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.StridedSlice' op ""attribute 'ellipsis_mask' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_new_axis_mask = odsAttrs.get("new_axis_mask");
    if (tblgen_new_axis_mask && !(((tblgen_new_axis_mask.isa<::mlir::IntegerAttr>())) && ((tblgen_new_axis_mask.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.StridedSlice' op ""attribute 'new_axis_mask' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_shrink_axis_mask = odsAttrs.get("shrink_axis_mask");
    if (tblgen_shrink_axis_mask && !(((tblgen_shrink_axis_mask.isa<::mlir::IntegerAttr>())) && ((tblgen_shrink_axis_mask.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.StridedSlice' op ""attribute 'shrink_axis_mask' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> StridedSliceOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range StridedSliceOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value StridedSliceOp::input() {
  return *getODSOperands(0).begin();
}

::mlir::Value StridedSliceOp::begin() {
  return *getODSOperands(1).begin();
}

::mlir::Value StridedSliceOp::end() {
  return *getODSOperands(2).begin();
}

::mlir::Value StridedSliceOp::strides() {
  return *getODSOperands(3).begin();
}

::mlir::MutableOperandRange StridedSliceOp::inputMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange StridedSliceOp::beginMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange StridedSliceOp::endMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange StridedSliceOp::stridesMutable() {
  auto range = getODSOperandIndexAndLength(3);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> StridedSliceOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range StridedSliceOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value StridedSliceOp::output() {
  return *getODSResults(0).begin();
}

::mlir::IntegerAttr StridedSliceOp::begin_maskAttr() {
  return (*this)->getAttr(begin_maskAttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t StridedSliceOp::begin_mask() {
  auto attr = begin_maskAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), 0).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

::mlir::IntegerAttr StridedSliceOp::end_maskAttr() {
  return (*this)->getAttr(end_maskAttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t StridedSliceOp::end_mask() {
  auto attr = end_maskAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), 0).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

::mlir::IntegerAttr StridedSliceOp::ellipsis_maskAttr() {
  return (*this)->getAttr(ellipsis_maskAttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t StridedSliceOp::ellipsis_mask() {
  auto attr = ellipsis_maskAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), 0).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

::mlir::IntegerAttr StridedSliceOp::new_axis_maskAttr() {
  return (*this)->getAttr(new_axis_maskAttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t StridedSliceOp::new_axis_mask() {
  auto attr = new_axis_maskAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), 0).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

::mlir::IntegerAttr StridedSliceOp::shrink_axis_maskAttr() {
  return (*this)->getAttr(shrink_axis_maskAttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t StridedSliceOp::shrink_axis_mask() {
  auto attr = shrink_axis_maskAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), 0).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

::mlir::Type StridedSliceOp::Index() {
  return mlir::getElementTypeOrSelf(*getODSOperands(1).begin());
}

::mlir::Type StridedSliceOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool StridedSliceOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "Index") return true;
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr StridedSliceOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {IndexAttrName(),
::mlir::TypeAttr::get(Index())},
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void StridedSliceOp::begin_maskAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(begin_maskAttrName(), attr);
}

void StridedSliceOp::end_maskAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(end_maskAttrName(), attr);
}

void StridedSliceOp::ellipsis_maskAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(ellipsis_maskAttrName(), attr);
}

void StridedSliceOp::new_axis_maskAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(new_axis_maskAttrName(), attr);
}

void StridedSliceOp::shrink_axis_maskAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(shrink_axis_maskAttrName(), attr);
}

void StridedSliceOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input, ::mlir::Value begin, ::mlir::Value end, ::mlir::Value strides, ::mlir::IntegerAttr begin_mask, ::mlir::IntegerAttr end_mask, ::mlir::IntegerAttr ellipsis_mask, ::mlir::IntegerAttr new_axis_mask, ::mlir::IntegerAttr shrink_axis_mask) {
  odsState.addOperands(input);
  odsState.addOperands(begin);
  odsState.addOperands(end);
  odsState.addOperands(strides);
  odsState.addAttribute(begin_maskAttrName(odsState.name), begin_mask);
  odsState.addAttribute(end_maskAttrName(odsState.name), end_mask);
  odsState.addAttribute(ellipsis_maskAttrName(odsState.name), ellipsis_mask);
  odsState.addAttribute(new_axis_maskAttrName(odsState.name), new_axis_mask);
  odsState.addAttribute(shrink_axis_maskAttrName(odsState.name), shrink_axis_mask);
  odsState.addTypes(output);
}

void StridedSliceOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::Value begin, ::mlir::Value end, ::mlir::Value strides, ::mlir::IntegerAttr begin_mask, ::mlir::IntegerAttr end_mask, ::mlir::IntegerAttr ellipsis_mask, ::mlir::IntegerAttr new_axis_mask, ::mlir::IntegerAttr shrink_axis_mask) {
  odsState.addOperands(input);
  odsState.addOperands(begin);
  odsState.addOperands(end);
  odsState.addOperands(strides);
  odsState.addAttribute(begin_maskAttrName(odsState.name), begin_mask);
  odsState.addAttribute(end_maskAttrName(odsState.name), end_mask);
  odsState.addAttribute(ellipsis_maskAttrName(odsState.name), ellipsis_mask);
  odsState.addAttribute(new_axis_maskAttrName(odsState.name), new_axis_mask);
  odsState.addAttribute(shrink_axis_maskAttrName(odsState.name), shrink_axis_mask);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void StridedSliceOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input, ::mlir::Value begin, ::mlir::Value end, ::mlir::Value strides, uint64_t begin_mask, uint64_t end_mask, uint64_t ellipsis_mask, uint64_t new_axis_mask, uint64_t shrink_axis_mask) {
  odsState.addOperands(input);
  odsState.addOperands(begin);
  odsState.addOperands(end);
  odsState.addOperands(strides);
  odsState.addAttribute(begin_maskAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), begin_mask));
  odsState.addAttribute(end_maskAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), end_mask));
  odsState.addAttribute(ellipsis_maskAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), ellipsis_mask));
  odsState.addAttribute(new_axis_maskAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), new_axis_mask));
  odsState.addAttribute(shrink_axis_maskAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), shrink_axis_mask));
  odsState.addTypes(output);
}

void StridedSliceOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::Value begin, ::mlir::Value end, ::mlir::Value strides, uint64_t begin_mask, uint64_t end_mask, uint64_t ellipsis_mask, uint64_t new_axis_mask, uint64_t shrink_axis_mask) {
  odsState.addOperands(input);
  odsState.addOperands(begin);
  odsState.addOperands(end);
  odsState.addOperands(strides);
  odsState.addAttribute(begin_maskAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), begin_mask));
  odsState.addAttribute(end_maskAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), end_mask));
  odsState.addAttribute(ellipsis_maskAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), ellipsis_mask));
  odsState.addAttribute(new_axis_maskAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), new_axis_mask));
  odsState.addAttribute(shrink_axis_maskAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), shrink_axis_mask));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void StridedSliceOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 4u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult StridedSliceOp::verify() {
  {
    auto tblgen_begin_mask = (*this)->getAttr(begin_maskAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_begin_mask, "begin_mask")))
      return ::mlir::failure();
  }
  {
    auto tblgen_end_mask = (*this)->getAttr(end_maskAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_end_mask, "end_mask")))
      return ::mlir::failure();
  }
  {
    auto tblgen_ellipsis_mask = (*this)->getAttr(ellipsis_maskAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_ellipsis_mask, "ellipsis_mask")))
      return ::mlir::failure();
  }
  {
    auto tblgen_new_axis_mask = (*this)->getAttr(new_axis_maskAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_new_axis_mask, "new_axis_mask")))
      return ::mlir::failure();
  }
  {
    auto tblgen_shrink_axis_mask = (*this)->getAttr(shrink_axis_maskAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_shrink_axis_mask, "shrink_axis_mask")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup3 = getODSOperands(3);

    for (auto v : valueGroup3) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return VerifyStridedSliceBase(*this);
}

void StridedSliceOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::StridedSliceOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::StringFormatOp definitions
//===----------------------------------------------------------------------===//

StringFormatOpAdaptor::StringFormatOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

StringFormatOpAdaptor::StringFormatOpAdaptor(StringFormatOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange StringFormatOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> StringFormatOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  bool isVariadic[] = {true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (odsOperands.size() - 0) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::ValueRange StringFormatOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::ValueRange StringFormatOpAdaptor::inputs() {
  return getODSOperands(0);
}

::mlir::DictionaryAttr StringFormatOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::StringAttr StringFormatOpAdaptor::strtemplate() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("strtemplate").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("%s");
  return attr;
}

::mlir::StringAttr StringFormatOpAdaptor::placeholder() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("placeholder").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("%s");
  return attr;
}

::mlir::IntegerAttr StringFormatOpAdaptor::summarize() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("summarize").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), 3);
  return attr;
}

::mlir::LogicalResult StringFormatOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_strtemplate = odsAttrs.get("strtemplate");
    if (tblgen_strtemplate && !((tblgen_strtemplate.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.StringFormat' op ""attribute 'strtemplate' failed to satisfy constraint: string attribute");
  }
  {
    auto tblgen_placeholder = odsAttrs.get("placeholder");
    if (tblgen_placeholder && !((tblgen_placeholder.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.StringFormat' op ""attribute 'placeholder' failed to satisfy constraint: string attribute");
  }
  {
    auto tblgen_summarize = odsAttrs.get("summarize");
    if (tblgen_summarize && !(((tblgen_summarize.isa<::mlir::IntegerAttr>())) && ((tblgen_summarize.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.StringFormat' op ""attribute 'summarize' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> StringFormatOp::getODSOperandIndexAndLength(unsigned index) {
  bool isVariadic[] = {true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (getOperation()->getNumOperands() - 0) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::Operation::operand_range StringFormatOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Operation::operand_range StringFormatOp::inputs() {
  return getODSOperands(0);
}

::mlir::MutableOperandRange StringFormatOp::inputsMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> StringFormatOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range StringFormatOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value StringFormatOp::output() {
  return *getODSResults(0).begin();
}

::mlir::StringAttr StringFormatOp::strtemplateAttr() {
  return (*this)->getAttr(strtemplateAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef StringFormatOp::strtemplate() {
  auto attr = strtemplateAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("%s").getValue();
  return attr.getValue();
}

::mlir::StringAttr StringFormatOp::placeholderAttr() {
  return (*this)->getAttr(placeholderAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef StringFormatOp::placeholder() {
  auto attr = placeholderAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("%s").getValue();
  return attr.getValue();
}

::mlir::IntegerAttr StringFormatOp::summarizeAttr() {
  return (*this)->getAttr(summarizeAttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t StringFormatOp::summarize() {
  auto attr = summarizeAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), 3).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

mlir::OperandElementTypeRange StringFormatOp::T() {
  auto values = getODSOperands(0);
return {mlir::OperandElementTypeIterator(values.begin()), mlir::OperandElementTypeIterator(values.end())};
}

bool StringFormatOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr StringFormatOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
ArrayAttr::get(ctx, 
    [&]() {
      llvm::SmallVector<Attribute, 4> ret;
      for (auto t : T())
        ret.push_back(TypeAttr::get(t));
      return ret;
    }())}});
}

void StringFormatOp::strtemplateAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(strtemplateAttrName(), attr);
}

void StringFormatOp::placeholderAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(placeholderAttrName(), attr);
}

void StringFormatOp::summarizeAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(summarizeAttrName(), attr);
}

void StringFormatOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::ValueRange inputs, ::mlir::StringAttr strtemplate, ::mlir::StringAttr placeholder, ::mlir::IntegerAttr summarize) {
  odsState.addOperands(inputs);
  odsState.addAttribute(strtemplateAttrName(odsState.name), strtemplate);
  odsState.addAttribute(placeholderAttrName(odsState.name), placeholder);
  odsState.addAttribute(summarizeAttrName(odsState.name), summarize);
  odsState.addTypes(output);
}

void StringFormatOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange inputs, ::mlir::StringAttr strtemplate, ::mlir::StringAttr placeholder, ::mlir::IntegerAttr summarize) {
  odsState.addOperands(inputs);
  odsState.addAttribute(strtemplateAttrName(odsState.name), strtemplate);
  odsState.addAttribute(placeholderAttrName(odsState.name), placeholder);
  odsState.addAttribute(summarizeAttrName(odsState.name), summarize);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void StringFormatOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::ValueRange inputs, ::llvm::StringRef strtemplate, ::llvm::StringRef placeholder, uint64_t summarize) {
  odsState.addOperands(inputs);
  odsState.addAttribute(strtemplateAttrName(odsState.name), odsBuilder.getStringAttr(strtemplate));
  odsState.addAttribute(placeholderAttrName(odsState.name), odsBuilder.getStringAttr(placeholder));
  odsState.addAttribute(summarizeAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), summarize));
  odsState.addTypes(output);
}

void StringFormatOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange inputs, ::llvm::StringRef strtemplate, ::llvm::StringRef placeholder, uint64_t summarize) {
  odsState.addOperands(inputs);
  odsState.addAttribute(strtemplateAttrName(odsState.name), odsBuilder.getStringAttr(strtemplate));
  odsState.addAttribute(placeholderAttrName(odsState.name), odsBuilder.getStringAttr(placeholder));
  odsState.addAttribute(summarizeAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), summarize));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void StringFormatOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult StringFormatOp::verify() {
  {
    auto tblgen_strtemplate = (*this)->getAttr(strtemplateAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_strtemplate, "strtemplate")))
      return ::mlir::failure();
  }
  {
    auto tblgen_placeholder = (*this)->getAttr(placeholderAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_placeholder, "placeholder")))
      return ::mlir::failure();
  }
  {
    auto tblgen_summarize = (*this)->getAttr(summarizeAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_summarize, "summarize")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops19(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void StringFormatOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::StringFormatOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::StringJoinOp definitions
//===----------------------------------------------------------------------===//

StringJoinOpAdaptor::StringJoinOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

StringJoinOpAdaptor::StringJoinOpAdaptor(StringJoinOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange StringJoinOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> StringJoinOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  bool isVariadic[] = {true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (odsOperands.size() - 0) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::ValueRange StringJoinOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::ValueRange StringJoinOpAdaptor::inputs() {
  return getODSOperands(0);
}

::mlir::DictionaryAttr StringJoinOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::StringAttr StringJoinOpAdaptor::separator() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("separator").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("");
  return attr;
}

::mlir::LogicalResult StringJoinOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_separator = odsAttrs.get("separator");
    if (tblgen_separator && !((tblgen_separator.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.StringJoin' op ""attribute 'separator' failed to satisfy constraint: string attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> StringJoinOp::getODSOperandIndexAndLength(unsigned index) {
  bool isVariadic[] = {true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (getOperation()->getNumOperands() - 0) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::Operation::operand_range StringJoinOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Operation::operand_range StringJoinOp::inputs() {
  return getODSOperands(0);
}

::mlir::MutableOperandRange StringJoinOp::inputsMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> StringJoinOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range StringJoinOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value StringJoinOp::output() {
  return *getODSResults(0).begin();
}

::mlir::StringAttr StringJoinOp::separatorAttr() {
  return (*this)->getAttr(separatorAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef StringJoinOp::separator() {
  auto attr = separatorAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("").getValue();
  return attr.getValue();
}

size_t StringJoinOp::N() {
  auto range = getODSOperands(0);
return std::distance(range.begin(), range.end());
}

bool StringJoinOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "N") return true;
 return false;
}

::mlir::DictionaryAttr StringJoinOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {NAttrName(),
odsBuilder.getI64IntegerAttr(N())}});
}

void StringJoinOp::separatorAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(separatorAttrName(), attr);
}

void StringJoinOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::ValueRange inputs, ::mlir::StringAttr separator) {
  odsState.addOperands(inputs);
  odsState.addAttribute(separatorAttrName(odsState.name), separator);
  odsState.addTypes(output);
}

void StringJoinOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange inputs, ::mlir::StringAttr separator) {
  odsState.addOperands(inputs);
  odsState.addAttribute(separatorAttrName(odsState.name), separator);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void StringJoinOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::ValueRange inputs, ::llvm::StringRef separator) {
  odsState.addOperands(inputs);
  odsState.addAttribute(separatorAttrName(odsState.name), odsBuilder.getStringAttr(separator));
  odsState.addTypes(output);
}

void StringJoinOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange inputs, ::llvm::StringRef separator) {
  odsState.addOperands(inputs);
  odsState.addAttribute(separatorAttrName(odsState.name), odsBuilder.getStringAttr(separator));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void StringJoinOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult StringJoinOp::verify() {
  {
    auto tblgen_separator = (*this)->getAttr(separatorAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_separator, "separator")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops19(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops19(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void StringJoinOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::StringJoinOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::StringStripOp definitions
//===----------------------------------------------------------------------===//

StringStripOpAdaptor::StringStripOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

StringStripOpAdaptor::StringStripOpAdaptor(StringStripOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange StringStripOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> StringStripOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange StringStripOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value StringStripOpAdaptor::input() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr StringStripOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult StringStripOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> StringStripOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range StringStripOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value StringStripOp::input() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange StringStripOp::inputMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> StringStripOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range StringStripOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value StringStripOp::output() {
  return *getODSResults(0).begin();
}

void StringStripOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input) {
  odsState.addOperands(input);
  odsState.addTypes(output);
}

void StringStripOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input) {
  odsState.addOperands(input);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void StringStripOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult StringStripOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops19(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops19(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void StringStripOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::StringStripOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::StringToHashBucketFastOp definitions
//===----------------------------------------------------------------------===//

StringToHashBucketFastOpAdaptor::StringToHashBucketFastOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

StringToHashBucketFastOpAdaptor::StringToHashBucketFastOpAdaptor(StringToHashBucketFastOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange StringToHashBucketFastOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> StringToHashBucketFastOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange StringToHashBucketFastOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value StringToHashBucketFastOpAdaptor::input() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr StringToHashBucketFastOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::IntegerAttr StringToHashBucketFastOpAdaptor::num_buckets() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("num_buckets").cast<::mlir::IntegerAttr>();
  return attr;
}

::mlir::LogicalResult StringToHashBucketFastOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_num_buckets = odsAttrs.get("num_buckets");
    if (!tblgen_num_buckets)
      return emitError(loc, "'tf.StringToHashBucketFast' op ""requires attribute 'num_buckets'");

    if (tblgen_num_buckets && !((((tblgen_num_buckets.isa<::mlir::IntegerAttr>())) && ((tblgen_num_buckets.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))) && ((tblgen_num_buckets.cast<::mlir::IntegerAttr>().getInt() >= 1))))
      return emitError(loc, "'tf.StringToHashBucketFast' op ""attribute 'num_buckets' failed to satisfy constraint: 64-bit signless integer attribute whose minimum value is 1");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> StringToHashBucketFastOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range StringToHashBucketFastOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value StringToHashBucketFastOp::input() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange StringToHashBucketFastOp::inputMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> StringToHashBucketFastOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range StringToHashBucketFastOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value StringToHashBucketFastOp::output() {
  return *getODSResults(0).begin();
}

::mlir::IntegerAttr StringToHashBucketFastOp::num_bucketsAttr() {
  return (*this)->getAttr(num_bucketsAttrName()).cast<::mlir::IntegerAttr>();
}

uint64_t StringToHashBucketFastOp::num_buckets() {
  auto attr = num_bucketsAttr();
  return attr.getValue().getZExtValue();
}

void StringToHashBucketFastOp::num_bucketsAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(num_bucketsAttrName(), attr);
}

void StringToHashBucketFastOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input, ::mlir::IntegerAttr num_buckets) {
  odsState.addOperands(input);
  odsState.addAttribute(num_bucketsAttrName(odsState.name), num_buckets);
  odsState.addTypes(output);
}

void StringToHashBucketFastOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::IntegerAttr num_buckets) {
  odsState.addOperands(input);
  odsState.addAttribute(num_bucketsAttrName(odsState.name), num_buckets);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void StringToHashBucketFastOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input, uint64_t num_buckets) {
  odsState.addOperands(input);
  odsState.addAttribute(num_bucketsAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), num_buckets));
  odsState.addTypes(output);
}

void StringToHashBucketFastOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, uint64_t num_buckets) {
  odsState.addOperands(input);
  odsState.addAttribute(num_bucketsAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), num_buckets));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void StringToHashBucketFastOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult StringToHashBucketFastOp::verify() {
  {
    auto tblgen_num_buckets = (*this)->getAttr(num_bucketsAttrName());
    if (!tblgen_num_buckets)
      return emitOpError("requires attribute 'num_buckets'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops38(*this, tblgen_num_buckets, "num_buckets")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops19(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops16(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void StringToHashBucketFastOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::StringToHashBucketFastOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::SubOp definitions
//===----------------------------------------------------------------------===//

SubOpAdaptor::SubOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

SubOpAdaptor::SubOpAdaptor(SubOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange SubOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> SubOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange SubOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SubOpAdaptor::x() {
  return *getODSOperands(0).begin();
}

::mlir::Value SubOpAdaptor::y() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr SubOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult SubOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> SubOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range SubOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SubOp::x() {
  return *getODSOperands(0).begin();
}

::mlir::Value SubOp::y() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange SubOp::xMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange SubOp::yMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> SubOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range SubOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SubOp::z() {
  return *getODSResults(0).begin();
}

::mlir::Type SubOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool SubOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr SubOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void SubOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, Value x, Value y) {
  auto resultType =
      OpTrait::util::getBroadcastedType(x.getType(), y.getType());
  if (!resultType)
    mlir::emitError(odsState.location, "non-broadcastable operands");
  return build(odsBuilder, odsState, resultType, x, y);
}

void SubOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type z, ::mlir::Value x, ::mlir::Value y) {
  odsState.addOperands(x);
  odsState.addOperands(y);
  odsState.addTypes(z);
}

void SubOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value x, ::mlir::Value y) {
  odsState.addOperands(x);
  odsState.addOperands(y);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void SubOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult SubOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops5(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops5(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops5(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void SubOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::SubOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::SumOp definitions
//===----------------------------------------------------------------------===//

SumOpAdaptor::SumOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

SumOpAdaptor::SumOpAdaptor(SumOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange SumOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> SumOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange SumOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SumOpAdaptor::input() {
  return *getODSOperands(0).begin();
}

::mlir::Value SumOpAdaptor::reduction_indices() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr SumOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::BoolAttr SumOpAdaptor::keep_dims() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("keep_dims").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(false);
  return attr;
}

::mlir::LogicalResult SumOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_keep_dims = odsAttrs.get("keep_dims");
    if (tblgen_keep_dims && !((tblgen_keep_dims.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.Sum' op ""attribute 'keep_dims' failed to satisfy constraint: bool attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> SumOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range SumOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SumOp::input() {
  return *getODSOperands(0).begin();
}

::mlir::Value SumOp::reduction_indices() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange SumOp::inputMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange SumOp::reduction_indicesMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> SumOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range SumOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SumOp::output() {
  return *getODSResults(0).begin();
}

::mlir::BoolAttr SumOp::keep_dimsAttr() {
  return (*this)->getAttr(keep_dimsAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool SumOp::keep_dims() {
  auto attr = keep_dimsAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(false).getValue();
  return attr.getValue();
}

::mlir::Type SumOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

::mlir::Type SumOp::Tidx() {
  return mlir::getElementTypeOrSelf(*getODSOperands(1).begin());
}

bool SumOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
  if (name == "Tidx") return true;
 return false;
}

::mlir::DictionaryAttr SumOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())},
    {TidxAttrName(),
::mlir::TypeAttr::get(Tidx())}});
}

void SumOp::keep_dimsAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(keep_dimsAttrName(), attr);
}

void SumOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input, ::mlir::Value reduction_indices, ::mlir::BoolAttr keep_dims) {
  odsState.addOperands(input);
  odsState.addOperands(reduction_indices);
  odsState.addAttribute(keep_dimsAttrName(odsState.name), keep_dims);
  odsState.addTypes(output);
}

void SumOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::Value reduction_indices, ::mlir::BoolAttr keep_dims) {
  odsState.addOperands(input);
  odsState.addOperands(reduction_indices);
  odsState.addAttribute(keep_dimsAttrName(odsState.name), keep_dims);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void SumOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input, ::mlir::Value reduction_indices, bool keep_dims) {
  odsState.addOperands(input);
  odsState.addOperands(reduction_indices);
  odsState.addAttribute(keep_dimsAttrName(odsState.name), odsBuilder.getBoolAttr(keep_dims));
  odsState.addTypes(output);
}

void SumOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::Value reduction_indices, bool keep_dims) {
  odsState.addOperands(input);
  odsState.addOperands(reduction_indices);
  odsState.addAttribute(keep_dimsAttrName(odsState.name), odsBuilder.getBoolAttr(keep_dims));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void SumOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult SumOp::verify() {
  {
    auto tblgen_keep_dims = (*this)->getAttr(keep_dimsAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_keep_dims, "keep_dims")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void SumOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::SumOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::SummaryWriterOp definitions
//===----------------------------------------------------------------------===//

SummaryWriterOpAdaptor::SummaryWriterOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

SummaryWriterOpAdaptor::SummaryWriterOpAdaptor(SummaryWriterOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange SummaryWriterOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> SummaryWriterOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange SummaryWriterOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::DictionaryAttr SummaryWriterOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::StringAttr SummaryWriterOpAdaptor::shared_name() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("shared_name").cast<::mlir::StringAttr>();
  return attr;
}

::mlir::StringAttr SummaryWriterOpAdaptor::container() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("container").cast<::mlir::StringAttr>();
  return attr;
}

::mlir::LogicalResult SummaryWriterOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_shared_name = odsAttrs.get("shared_name");
    if (!tblgen_shared_name)
      return emitError(loc, "'tf.SummaryWriter' op ""requires attribute 'shared_name'");

    if (tblgen_shared_name && !((tblgen_shared_name.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.SummaryWriter' op ""attribute 'shared_name' failed to satisfy constraint: string attribute");
  }
  {
    auto tblgen_container = odsAttrs.get("container");
    if (!tblgen_container)
      return emitError(loc, "'tf.SummaryWriter' op ""requires attribute 'container'");

    if (tblgen_container && !((tblgen_container.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.SummaryWriter' op ""attribute 'container' failed to satisfy constraint: string attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> SummaryWriterOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range SummaryWriterOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

std::pair<unsigned, unsigned> SummaryWriterOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range SummaryWriterOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SummaryWriterOp::writer() {
  return *getODSResults(0).begin();
}

::mlir::StringAttr SummaryWriterOp::shared_nameAttr() {
  return (*this)->getAttr(shared_nameAttrName()).cast<::mlir::StringAttr>();
}

::llvm::StringRef SummaryWriterOp::shared_name() {
  auto attr = shared_nameAttr();
  return attr.getValue();
}

::mlir::StringAttr SummaryWriterOp::containerAttr() {
  return (*this)->getAttr(containerAttrName()).cast<::mlir::StringAttr>();
}

::llvm::StringRef SummaryWriterOp::container() {
  auto attr = containerAttr();
  return attr.getValue();
}

void SummaryWriterOp::shared_nameAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(shared_nameAttrName(), attr);
}

void SummaryWriterOp::containerAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(containerAttrName(), attr);
}

void SummaryWriterOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type writer, ::mlir::StringAttr shared_name, ::mlir::StringAttr container) {
  odsState.addAttribute(shared_nameAttrName(odsState.name), shared_name);
  odsState.addAttribute(containerAttrName(odsState.name), container);
  odsState.addTypes(writer);
}

void SummaryWriterOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::StringAttr shared_name, ::mlir::StringAttr container) {
  odsState.addAttribute(shared_nameAttrName(odsState.name), shared_name);
  odsState.addAttribute(containerAttrName(odsState.name), container);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void SummaryWriterOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type writer, ::llvm::StringRef shared_name, ::llvm::StringRef container) {
  odsState.addAttribute(shared_nameAttrName(odsState.name), odsBuilder.getStringAttr(shared_name));
  odsState.addAttribute(containerAttrName(odsState.name), odsBuilder.getStringAttr(container));
  odsState.addTypes(writer);
}

void SummaryWriterOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::llvm::StringRef shared_name, ::llvm::StringRef container) {
  odsState.addAttribute(shared_nameAttrName(odsState.name), odsBuilder.getStringAttr(shared_name));
  odsState.addAttribute(containerAttrName(odsState.name), odsBuilder.getStringAttr(container));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void SummaryWriterOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 0u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult SummaryWriterOp::verify() {
  {
    auto tblgen_shared_name = (*this)->getAttr(shared_nameAttrName());
    if (!tblgen_shared_name)
      return emitOpError("requires attribute 'shared_name'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_shared_name, "shared_name")))
      return ::mlir::failure();
  }
  {
    auto tblgen_container = (*this)->getAttr(containerAttrName());
    if (!tblgen_container)
      return emitOpError("requires attribute 'container'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_container, "container")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void SummaryWriterOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  for (::mlir::Value value : getODSResults(0))
    effects.emplace_back(::mlir::MemoryEffects::Allocate::get(), value, ::mlir::TF::ResourceEffects::Summary::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::SummaryWriterOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::SvdOp definitions
//===----------------------------------------------------------------------===//

SvdOpAdaptor::SvdOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

SvdOpAdaptor::SvdOpAdaptor(SvdOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange SvdOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> SvdOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange SvdOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SvdOpAdaptor::input() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr SvdOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::BoolAttr SvdOpAdaptor::compute_uv() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("compute_uv").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(true);
  return attr;
}

::mlir::BoolAttr SvdOpAdaptor::full_matrices() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("full_matrices").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(false);
  return attr;
}

::mlir::LogicalResult SvdOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_compute_uv = odsAttrs.get("compute_uv");
    if (tblgen_compute_uv && !((tblgen_compute_uv.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.Svd' op ""attribute 'compute_uv' failed to satisfy constraint: bool attribute");
  }
  {
    auto tblgen_full_matrices = odsAttrs.get("full_matrices");
    if (tblgen_full_matrices && !((tblgen_full_matrices.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.Svd' op ""attribute 'full_matrices' failed to satisfy constraint: bool attribute");
  }
  return ::mlir::success();
}

void SvdOp::getAsmResultNames(::mlir::OpAsmSetValueNameFn setNameFn) {
  auto resultGroup0 = getODSResults(0);
  if (!llvm::empty(resultGroup0))
    setNameFn(*resultGroup0.begin(), "s");
  auto resultGroup1 = getODSResults(1);
  if (!llvm::empty(resultGroup1))
    setNameFn(*resultGroup1.begin(), "u");
  auto resultGroup2 = getODSResults(2);
  if (!llvm::empty(resultGroup2))
    setNameFn(*resultGroup2.begin(), "v");
}

std::pair<unsigned, unsigned> SvdOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range SvdOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SvdOp::input() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange SvdOp::inputMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> SvdOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range SvdOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value SvdOp::s() {
  return *getODSResults(0).begin();
}

::mlir::Value SvdOp::u() {
  return *getODSResults(1).begin();
}

::mlir::Value SvdOp::v() {
  return *getODSResults(2).begin();
}

::mlir::BoolAttr SvdOp::compute_uvAttr() {
  return (*this)->getAttr(compute_uvAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool SvdOp::compute_uv() {
  auto attr = compute_uvAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(true).getValue();
  return attr.getValue();
}

::mlir::BoolAttr SvdOp::full_matricesAttr() {
  return (*this)->getAttr(full_matricesAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool SvdOp::full_matrices() {
  auto attr = full_matricesAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(false).getValue();
  return attr.getValue();
}

::mlir::Type SvdOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool SvdOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr SvdOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void SvdOp::compute_uvAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(compute_uvAttrName(), attr);
}

void SvdOp::full_matricesAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(full_matricesAttrName(), attr);
}

void SvdOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type s, ::mlir::Type u, ::mlir::Type v, ::mlir::Value input, ::mlir::BoolAttr compute_uv, ::mlir::BoolAttr full_matrices) {
  odsState.addOperands(input);
  odsState.addAttribute(compute_uvAttrName(odsState.name), compute_uv);
  odsState.addAttribute(full_matricesAttrName(odsState.name), full_matrices);
  odsState.addTypes(s);
  odsState.addTypes(u);
  odsState.addTypes(v);
}

void SvdOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::BoolAttr compute_uv, ::mlir::BoolAttr full_matrices) {
  odsState.addOperands(input);
  odsState.addAttribute(compute_uvAttrName(odsState.name), compute_uv);
  odsState.addAttribute(full_matricesAttrName(odsState.name), full_matrices);
  assert(resultTypes.size() == 3u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void SvdOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type s, ::mlir::Type u, ::mlir::Type v, ::mlir::Value input, bool compute_uv, bool full_matrices) {
  odsState.addOperands(input);
  odsState.addAttribute(compute_uvAttrName(odsState.name), odsBuilder.getBoolAttr(compute_uv));
  odsState.addAttribute(full_matricesAttrName(odsState.name), odsBuilder.getBoolAttr(full_matrices));
  odsState.addTypes(s);
  odsState.addTypes(u);
  odsState.addTypes(v);
}

void SvdOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, bool compute_uv, bool full_matrices) {
  odsState.addOperands(input);
  odsState.addAttribute(compute_uvAttrName(odsState.name), odsBuilder.getBoolAttr(compute_uv));
  odsState.addAttribute(full_matricesAttrName(odsState.name), odsBuilder.getBoolAttr(full_matrices));
  assert(resultTypes.size() == 3u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void SvdOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 3u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult SvdOp::verify() {
  {
    auto tblgen_compute_uv = (*this)->getAttr(compute_uvAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_compute_uv, "compute_uv")))
      return ::mlir::failure();
  }
  {
    auto tblgen_full_matrices = (*this)->getAttr(full_matricesAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_full_matrices, "full_matrices")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops29(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops29(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSResults(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops29(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSResults(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops29(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void SvdOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::SvdOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::SymbolicGradientOp definitions
//===----------------------------------------------------------------------===//

SymbolicGradientOpAdaptor::SymbolicGradientOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

SymbolicGradientOpAdaptor::SymbolicGradientOpAdaptor(SymbolicGradientOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange SymbolicGradientOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> SymbolicGradientOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  bool isVariadic[] = {true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (odsOperands.size() - 0) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::ValueRange SymbolicGradientOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::ValueRange SymbolicGradientOpAdaptor::input() {
  return getODSOperands(0);
}

::mlir::DictionaryAttr SymbolicGradientOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::SymbolRefAttr SymbolicGradientOpAdaptor::f() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::SymbolRefAttr attr = odsAttrs.get("f").cast<::mlir::SymbolRefAttr>();
  return attr;
}

::mlir::LogicalResult SymbolicGradientOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_f = odsAttrs.get("f");
    if (!tblgen_f)
      return emitError(loc, "'tf.SymbolicGradient' op ""requires attribute 'f'");

    if (tblgen_f && !((tblgen_f.isa<::mlir::SymbolRefAttr>())))
      return emitError(loc, "'tf.SymbolicGradient' op ""attribute 'f' failed to satisfy constraint: symbol reference attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> SymbolicGradientOp::getODSOperandIndexAndLength(unsigned index) {
  bool isVariadic[] = {true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (getOperation()->getNumOperands() - 0) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::Operation::operand_range SymbolicGradientOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Operation::operand_range SymbolicGradientOp::input() {
  return getODSOperands(0);
}

::mlir::MutableOperandRange SymbolicGradientOp::inputMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> SymbolicGradientOp::getODSResultIndexAndLength(unsigned index) {
  bool isVariadic[] = {true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (getOperation()->getNumResults() - 0) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::Operation::result_range SymbolicGradientOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Operation::result_range SymbolicGradientOp::output() {
  return getODSResults(0);
}

::mlir::SymbolRefAttr SymbolicGradientOp::fAttr() {
  return (*this)->getAttr(fAttrName()).cast<::mlir::SymbolRefAttr>();
}

::mlir::SymbolRefAttr SymbolicGradientOp::f() {
  auto attr = fAttr();
  return attr;
}

mlir::OperandElementTypeRange SymbolicGradientOp::Tin() {
  auto values = getODSOperands(0);
return {mlir::OperandElementTypeIterator(values.begin()), mlir::OperandElementTypeIterator(values.end())};
}

mlir::ResultElementTypeRange SymbolicGradientOp::Tout() {
  auto values = getODSResults(0);
return {mlir::ResultElementTypeIterator(values.begin()), mlir::ResultElementTypeIterator(values.end())};
}

bool SymbolicGradientOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "Tin") return true;
  if (name == "Tout") return true;
 return false;
}

::mlir::DictionaryAttr SymbolicGradientOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TinAttrName(),
ArrayAttr::get(ctx, 
    [&]() {
      llvm::SmallVector<Attribute, 4> ret;
      for (auto t : Tin())
        ret.push_back(TypeAttr::get(t));
      return ret;
    }())},
    {ToutAttrName(),
ArrayAttr::get(ctx, 
    [&]() {
      llvm::SmallVector<Attribute, 4> ret;
      for (auto t : Tout())
        ret.push_back(TypeAttr::get(t));
      return ret;
    }())}});
}

void SymbolicGradientOp::fAttr(::mlir::SymbolRefAttr attr) {
  (*this)->setAttr(fAttrName(), attr);
}

void SymbolicGradientOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange output, ::mlir::ValueRange input, ::mlir::SymbolRefAttr f) {
  odsState.addOperands(input);
  odsState.addAttribute(fAttrName(odsState.name), f);
  odsState.addTypes(output);
}

void SymbolicGradientOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult SymbolicGradientOp::verify() {
  {
    auto tblgen_f = (*this)->getAttr(fAttrName());
    if (!tblgen_f)
      return emitOpError("requires attribute 'f'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops12(*this, tblgen_f, "f")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void SymbolicGradientOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::SymbolicGradientOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::TPUCompilationResultOp definitions
//===----------------------------------------------------------------------===//

TPUCompilationResultOpAdaptor::TPUCompilationResultOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

TPUCompilationResultOpAdaptor::TPUCompilationResultOpAdaptor(TPUCompilationResultOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange TPUCompilationResultOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> TPUCompilationResultOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange TPUCompilationResultOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::DictionaryAttr TPUCompilationResultOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult TPUCompilationResultOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> TPUCompilationResultOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range TPUCompilationResultOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

std::pair<unsigned, unsigned> TPUCompilationResultOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range TPUCompilationResultOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TPUCompilationResultOp::output() {
  return *getODSResults(0).begin();
}

void TPUCompilationResultOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output) {
  odsState.addTypes(output);
}

void TPUCompilationResultOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes) {
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void TPUCompilationResultOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 0u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult TPUCompilationResultOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops19(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void TPUCompilationResultOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  effects.emplace_back(::mlir::MemoryEffects::Write::get(), ::mlir::TF::ResourceEffects::TPUCompileExecute::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::TPUCompilationResultOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::TPUCompileMlirAndExecuteOp definitions
//===----------------------------------------------------------------------===//

TPUCompileMlirAndExecuteOpAdaptor::TPUCompileMlirAndExecuteOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

TPUCompileMlirAndExecuteOpAdaptor::TPUCompileMlirAndExecuteOpAdaptor(TPUCompileMlirAndExecuteOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange TPUCompileMlirAndExecuteOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> TPUCompileMlirAndExecuteOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  assert(odsAttrs && "missing segment size attribute for op");
  auto sizeAttr = odsAttrs.get("operand_segment_sizes").cast<::mlir::DenseIntElementsAttr>();

  const uint32_t *sizeAttrValueIt = &*sizeAttr.value_begin<uint32_t>();
  if (sizeAttr.isSplat())
    return {*sizeAttrValueIt * index, *sizeAttrValueIt};

  unsigned start = 0;
  for (unsigned i = 0; i < index; ++i)
    start += sizeAttrValueIt[i];
  return {start, sizeAttrValueIt[index]};
}

::mlir::ValueRange TPUCompileMlirAndExecuteOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::ValueRange TPUCompileMlirAndExecuteOpAdaptor::args() {
  return getODSOperands(0);
}

::mlir::ValueRange TPUCompileMlirAndExecuteOpAdaptor::static_shapes() {
  return getODSOperands(1);
}

::mlir::DictionaryAttr TPUCompileMlirAndExecuteOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::ArrayAttr TPUCompileMlirAndExecuteOpAdaptor::operands_with_static_shape() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("operands_with_static_shape").dyn_cast_or_null<::mlir::ArrayAttr>();
  return attr;
}

::mlir::StringAttr TPUCompileMlirAndExecuteOpAdaptor::mlir_module() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("mlir_module").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("");
  return attr;
}

::mlir::StringAttr TPUCompileMlirAndExecuteOpAdaptor::metadata() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("metadata").cast<::mlir::StringAttr>();
  return attr;
}

::mlir::LogicalResult TPUCompileMlirAndExecuteOpAdaptor::verify(::mlir::Location loc) {
  {
    auto sizeAttr = odsAttrs.get("operand_segment_sizes").dyn_cast<::mlir::DenseIntElementsAttr>();
    if (!sizeAttr)
      return emitError(loc, "'tf.TPUCompileMlirAndExecute' op ""missing segment sizes attribute 'operand_segment_sizes'");
    auto numElements =
        sizeAttr.getType().cast<::mlir::ShapedType>().getNumElements();
    if (numElements != 2)
      return emitError(loc, "'tf.TPUCompileMlirAndExecute' op ""'operand_segment_sizes' attribute for specifying operand segments must have 2 "
                "elements, but got ") << numElements;
  }
    {
    auto tblgen_operands_with_static_shape = odsAttrs.get("operands_with_static_shape");
    if (tblgen_operands_with_static_shape && !(((tblgen_operands_with_static_shape.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_operands_with_static_shape.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return ((attr.isa<::mlir::IntegerAttr>())) && ((attr.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(32))); }))))
      return emitError(loc, "'tf.TPUCompileMlirAndExecute' op ""attribute 'operands_with_static_shape' failed to satisfy constraint: 32-bit integer array attribute");
  }
  {
    auto tblgen_mlir_module = odsAttrs.get("mlir_module");
    if (tblgen_mlir_module && !((tblgen_mlir_module.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.TPUCompileMlirAndExecute' op ""attribute 'mlir_module' failed to satisfy constraint: string attribute");
  }
  {
    auto tblgen_metadata = odsAttrs.get("metadata");
    if (!tblgen_metadata)
      return emitError(loc, "'tf.TPUCompileMlirAndExecute' op ""requires attribute 'metadata'");

    if (tblgen_metadata && !((tblgen_metadata.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.TPUCompileMlirAndExecute' op ""attribute 'metadata' failed to satisfy constraint: string attribute");
  }
  return ::mlir::success();
}

void TPUCompileMlirAndExecuteOp::getAsmResultNames(::mlir::OpAsmSetValueNameFn setNameFn) {
  auto resultGroup0 = getODSResults(0);
  if (!llvm::empty(resultGroup0))
    setNameFn(*resultGroup0.begin(), "rendezvous_key_base");
  auto resultGroup1 = getODSResults(1);
  if (!llvm::empty(resultGroup1))
    setNameFn(*resultGroup1.begin(), "results");
}

std::pair<unsigned, unsigned> TPUCompileMlirAndExecuteOp::getODSOperandIndexAndLength(unsigned index) {
  auto sizeAttr =
      (*this)->getAttr(operand_segment_sizesAttrName()).cast<::mlir::DenseIntElementsAttr>();

  const uint32_t *sizeAttrValueIt = &*sizeAttr.value_begin<uint32_t>();
  if (sizeAttr.isSplat())
    return {*sizeAttrValueIt * index, *sizeAttrValueIt};

  unsigned start = 0;
  for (unsigned i = 0; i < index; ++i)
    start += sizeAttrValueIt[i];
  return {start, sizeAttrValueIt[index]};
}

::mlir::Operation::operand_range TPUCompileMlirAndExecuteOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Operation::operand_range TPUCompileMlirAndExecuteOp::args() {
  return getODSOperands(0);
}

::mlir::Operation::operand_range TPUCompileMlirAndExecuteOp::static_shapes() {
  return getODSOperands(1);
}

::mlir::MutableOperandRange TPUCompileMlirAndExecuteOp::argsMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second, ::mlir::MutableOperandRange::OperandSegment(0u, *getOperation()->getAttrDictionary().getNamed(operand_segment_sizesAttrName())));
  return mutableRange;
}

::mlir::MutableOperandRange TPUCompileMlirAndExecuteOp::static_shapesMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second, ::mlir::MutableOperandRange::OperandSegment(1u, *getOperation()->getAttrDictionary().getNamed(operand_segment_sizesAttrName())));
  return mutableRange;
}

std::pair<unsigned, unsigned> TPUCompileMlirAndExecuteOp::getODSResultIndexAndLength(unsigned index) {
  bool isVariadic[] = {false, true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (getOperation()->getNumResults() - 1) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::Operation::result_range TPUCompileMlirAndExecuteOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TPUCompileMlirAndExecuteOp::rendezvous_key_base() {
  return *getODSResults(0).begin();
}

::mlir::Operation::result_range TPUCompileMlirAndExecuteOp::results() {
  return getODSResults(1);
}

::mlir::ArrayAttr TPUCompileMlirAndExecuteOp::operands_with_static_shapeAttr() {
  return (*this)->getAttr(operands_with_static_shapeAttrName()).dyn_cast_or_null<::mlir::ArrayAttr>();
}

::llvm::Optional< ::mlir::ArrayAttr > TPUCompileMlirAndExecuteOp::operands_with_static_shape() {
  auto attr = operands_with_static_shapeAttr();
  return attr ? ::llvm::Optional< ::mlir::ArrayAttr >(attr) : (::llvm::None);
}

::mlir::StringAttr TPUCompileMlirAndExecuteOp::mlir_moduleAttr() {
  return (*this)->getAttr(mlir_moduleAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef TPUCompileMlirAndExecuteOp::mlir_module() {
  auto attr = mlir_moduleAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("").getValue();
  return attr.getValue();
}

::mlir::StringAttr TPUCompileMlirAndExecuteOp::metadataAttr() {
  return (*this)->getAttr(metadataAttrName()).cast<::mlir::StringAttr>();
}

::llvm::StringRef TPUCompileMlirAndExecuteOp::metadata() {
  auto attr = metadataAttr();
  return attr.getValue();
}

mlir::OperandElementTypeRange TPUCompileMlirAndExecuteOp::Targs() {
  auto values = getODSOperands(0);
return {mlir::OperandElementTypeIterator(values.begin()), mlir::OperandElementTypeIterator(values.end())};
}

mlir::ResultElementTypeRange TPUCompileMlirAndExecuteOp::Tresults() {
  auto values = getODSResults(0);
return {mlir::ResultElementTypeIterator(values.begin()), mlir::ResultElementTypeIterator(values.end())};
}

bool TPUCompileMlirAndExecuteOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "Targs") return true;
  if (name == "Tresults") return true;
 return false;
}

::mlir::DictionaryAttr TPUCompileMlirAndExecuteOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TargsAttrName(),
ArrayAttr::get(ctx, 
    [&]() {
      llvm::SmallVector<Attribute, 4> ret;
      for (auto t : Targs())
        ret.push_back(TypeAttr::get(t));
      return ret;
    }())},
    {TresultsAttrName(),
ArrayAttr::get(ctx, 
    [&]() {
      llvm::SmallVector<Attribute, 4> ret;
      for (auto t : Tresults())
        ret.push_back(TypeAttr::get(t));
      return ret;
    }())}});
}

void TPUCompileMlirAndExecuteOp::operands_with_static_shapeAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(operands_with_static_shapeAttrName(), attr);
}

void TPUCompileMlirAndExecuteOp::mlir_moduleAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(mlir_moduleAttrName(), attr);
}

void TPUCompileMlirAndExecuteOp::metadataAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(metadataAttrName(), attr);
}

::mlir::Attribute TPUCompileMlirAndExecuteOp::removeOperands_with_static_shapeAttr() {
  return (*this)->removeAttr(operands_with_static_shapeAttrName());
}

void TPUCompileMlirAndExecuteOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type rendezvous_key_base, ::mlir::TypeRange results, ::mlir::ValueRange args, ::mlir::ValueRange static_shapes, /*optional*/::mlir::ArrayAttr operands_with_static_shape, ::mlir::StringAttr mlir_module, ::mlir::StringAttr metadata) {
  odsState.addOperands(args);
  odsState.addOperands(static_shapes);
  odsState.addAttribute(operand_segment_sizesAttrName(odsState.name), odsBuilder.getI32VectorAttr({static_cast<int32_t>(args.size()), static_cast<int32_t>(static_shapes.size())}));
  if (operands_with_static_shape) {
  odsState.addAttribute(operands_with_static_shapeAttrName(odsState.name), operands_with_static_shape);
  }
  odsState.addAttribute(mlir_moduleAttrName(odsState.name), mlir_module);
  odsState.addAttribute(metadataAttrName(odsState.name), metadata);
  odsState.addTypes(rendezvous_key_base);
  odsState.addTypes(results);
}

void TPUCompileMlirAndExecuteOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange args, ::mlir::ValueRange static_shapes, /*optional*/::mlir::ArrayAttr operands_with_static_shape, ::mlir::StringAttr mlir_module, ::mlir::StringAttr metadata) {
  odsState.addOperands(args);
  odsState.addOperands(static_shapes);
  odsState.addAttribute(operand_segment_sizesAttrName(odsState.name), odsBuilder.getI32VectorAttr({static_cast<int32_t>(args.size()), static_cast<int32_t>(static_shapes.size())}));
  if (operands_with_static_shape) {
  odsState.addAttribute(operands_with_static_shapeAttrName(odsState.name), operands_with_static_shape);
  }
  odsState.addAttribute(mlir_moduleAttrName(odsState.name), mlir_module);
  odsState.addAttribute(metadataAttrName(odsState.name), metadata);
  assert(resultTypes.size() >= 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void TPUCompileMlirAndExecuteOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type rendezvous_key_base, ::mlir::TypeRange results, ::mlir::ValueRange args, ::mlir::ValueRange static_shapes, /*optional*/::mlir::ArrayAttr operands_with_static_shape, ::llvm::StringRef mlir_module, ::llvm::StringRef metadata) {
  odsState.addOperands(args);
  odsState.addOperands(static_shapes);
  odsState.addAttribute(operand_segment_sizesAttrName(odsState.name), odsBuilder.getI32VectorAttr({static_cast<int32_t>(args.size()), static_cast<int32_t>(static_shapes.size())}));
  if (operands_with_static_shape) {
  odsState.addAttribute(operands_with_static_shapeAttrName(odsState.name), operands_with_static_shape);
  }
  odsState.addAttribute(mlir_moduleAttrName(odsState.name), odsBuilder.getStringAttr(mlir_module));
  odsState.addAttribute(metadataAttrName(odsState.name), odsBuilder.getStringAttr(metadata));
  odsState.addTypes(rendezvous_key_base);
  odsState.addTypes(results);
}

void TPUCompileMlirAndExecuteOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange args, ::mlir::ValueRange static_shapes, /*optional*/::mlir::ArrayAttr operands_with_static_shape, ::llvm::StringRef mlir_module, ::llvm::StringRef metadata) {
  odsState.addOperands(args);
  odsState.addOperands(static_shapes);
  odsState.addAttribute(operand_segment_sizesAttrName(odsState.name), odsBuilder.getI32VectorAttr({static_cast<int32_t>(args.size()), static_cast<int32_t>(static_shapes.size())}));
  if (operands_with_static_shape) {
  odsState.addAttribute(operands_with_static_shapeAttrName(odsState.name), operands_with_static_shape);
  }
  odsState.addAttribute(mlir_moduleAttrName(odsState.name), odsBuilder.getStringAttr(mlir_module));
  odsState.addAttribute(metadataAttrName(odsState.name), odsBuilder.getStringAttr(metadata));
  assert(resultTypes.size() >= 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void TPUCompileMlirAndExecuteOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() >= 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult TPUCompileMlirAndExecuteOp::verify() {
  {
    auto sizeAttr = (*this)->getAttr(operand_segment_sizesAttrName()).dyn_cast<::mlir::DenseIntElementsAttr>();
    if (!sizeAttr)
      return emitOpError("missing segment sizes attribute 'operand_segment_sizes'");
    auto numElements =
        sizeAttr.getType().cast<::mlir::ShapedType>().getNumElements();
    if (numElements != 2)
      return emitOpError("'operand_segment_sizes' attribute for specifying operand segments must have 2 "
                "elements, but got ") << numElements;
  }
    {
    auto tblgen_operands_with_static_shape = (*this)->getAttr(operands_with_static_shapeAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops39(*this, tblgen_operands_with_static_shape, "operands_with_static_shape")))
      return ::mlir::failure();
  }
  {
    auto tblgen_mlir_module = (*this)->getAttr(mlir_moduleAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_mlir_module, "mlir_module")))
      return ::mlir::failure();
  }
  {
    auto tblgen_metadata = (*this)->getAttr(metadataAttrName());
    if (!tblgen_metadata)
      return emitOpError("requires attribute 'metadata'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_metadata, "metadata")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSResults(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::TPUCompileMlirAndExecuteOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::TPUCompileSucceededAssertOp definitions
//===----------------------------------------------------------------------===//

TPUCompileSucceededAssertOpAdaptor::TPUCompileSucceededAssertOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

TPUCompileSucceededAssertOpAdaptor::TPUCompileSucceededAssertOpAdaptor(TPUCompileSucceededAssertOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange TPUCompileSucceededAssertOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> TPUCompileSucceededAssertOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange TPUCompileSucceededAssertOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TPUCompileSucceededAssertOpAdaptor::compilation_status() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr TPUCompileSucceededAssertOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult TPUCompileSucceededAssertOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> TPUCompileSucceededAssertOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range TPUCompileSucceededAssertOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TPUCompileSucceededAssertOp::compilation_status() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange TPUCompileSucceededAssertOp::compilation_statusMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> TPUCompileSucceededAssertOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range TPUCompileSucceededAssertOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

void TPUCompileSucceededAssertOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value compilation_status) {
  odsState.addOperands(compilation_status);
}

void TPUCompileSucceededAssertOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value compilation_status) {
  odsState.addOperands(compilation_status);
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void TPUCompileSucceededAssertOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 0u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult TPUCompileSucceededAssertOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops19(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void TPUCompileSucceededAssertOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  effects.emplace_back(::mlir::MemoryEffects::Write::get(), ::mlir::TF::ResourceEffects::TPUCompileExecute::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::TPUCompileSucceededAssertOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::TPUCopyWithLayoutOp definitions
//===----------------------------------------------------------------------===//

TPUCopyWithLayoutOpAdaptor::TPUCopyWithLayoutOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

TPUCopyWithLayoutOpAdaptor::TPUCopyWithLayoutOpAdaptor(TPUCopyWithLayoutOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange TPUCopyWithLayoutOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> TPUCopyWithLayoutOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange TPUCopyWithLayoutOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TPUCopyWithLayoutOpAdaptor::input() {
  return *getODSOperands(0).begin();
}

::mlir::Value TPUCopyWithLayoutOpAdaptor::layout() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr TPUCopyWithLayoutOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult TPUCopyWithLayoutOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> TPUCopyWithLayoutOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range TPUCopyWithLayoutOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TPUCopyWithLayoutOp::input() {
  return *getODSOperands(0).begin();
}

::mlir::Value TPUCopyWithLayoutOp::layout() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange TPUCopyWithLayoutOp::inputMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange TPUCopyWithLayoutOp::layoutMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> TPUCopyWithLayoutOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range TPUCopyWithLayoutOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TPUCopyWithLayoutOp::output() {
  return *getODSResults(0).begin();
}

::mlir::Type TPUCopyWithLayoutOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool TPUCopyWithLayoutOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr TPUCopyWithLayoutOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void TPUCopyWithLayoutOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input, ::mlir::Value layout) {
  odsState.addOperands(input);
  odsState.addOperands(layout);
  odsState.addTypes(output);
}

void TPUCopyWithLayoutOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::Value layout) {
  odsState.addOperands(input);
  odsState.addOperands(layout);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void TPUCopyWithLayoutOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult TPUCopyWithLayoutOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops16(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void TPUCopyWithLayoutOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::TPUCopyWithLayoutOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::TPUEmbeddingActivationsOp definitions
//===----------------------------------------------------------------------===//

TPUEmbeddingActivationsOpAdaptor::TPUEmbeddingActivationsOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

TPUEmbeddingActivationsOpAdaptor::TPUEmbeddingActivationsOpAdaptor(TPUEmbeddingActivationsOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange TPUEmbeddingActivationsOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> TPUEmbeddingActivationsOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange TPUEmbeddingActivationsOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TPUEmbeddingActivationsOpAdaptor::embedding_variable() {
  return *getODSOperands(0).begin();
}

::mlir::Value TPUEmbeddingActivationsOpAdaptor::sliced_activations() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr TPUEmbeddingActivationsOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::IntegerAttr TPUEmbeddingActivationsOpAdaptor::table_id() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("table_id").cast<::mlir::IntegerAttr>();
  return attr;
}

::mlir::IntegerAttr TPUEmbeddingActivationsOpAdaptor::lookup_id() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("lookup_id").cast<::mlir::IntegerAttr>();
  return attr;
}

::mlir::LogicalResult TPUEmbeddingActivationsOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_table_id = odsAttrs.get("table_id");
    if (!tblgen_table_id)
      return emitError(loc, "'tf.TPUEmbeddingActivations' op ""requires attribute 'table_id'");

    if (tblgen_table_id && !((((tblgen_table_id.isa<::mlir::IntegerAttr>())) && ((tblgen_table_id.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))) && ((tblgen_table_id.cast<::mlir::IntegerAttr>().getInt() >= 0))))
      return emitError(loc, "'tf.TPUEmbeddingActivations' op ""attribute 'table_id' failed to satisfy constraint: 64-bit signless integer attribute whose minimum value is 0");
  }
  {
    auto tblgen_lookup_id = odsAttrs.get("lookup_id");
    if (!tblgen_lookup_id)
      return emitError(loc, "'tf.TPUEmbeddingActivations' op ""requires attribute 'lookup_id'");

    if (tblgen_lookup_id && !((((tblgen_lookup_id.isa<::mlir::IntegerAttr>())) && ((tblgen_lookup_id.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))) && ((tblgen_lookup_id.cast<::mlir::IntegerAttr>().getInt() >= 0))))
      return emitError(loc, "'tf.TPUEmbeddingActivations' op ""attribute 'lookup_id' failed to satisfy constraint: 64-bit signless integer attribute whose minimum value is 0");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> TPUEmbeddingActivationsOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range TPUEmbeddingActivationsOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TPUEmbeddingActivationsOp::embedding_variable() {
  return *getODSOperands(0).begin();
}

::mlir::Value TPUEmbeddingActivationsOp::sliced_activations() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange TPUEmbeddingActivationsOp::embedding_variableMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange TPUEmbeddingActivationsOp::sliced_activationsMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> TPUEmbeddingActivationsOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range TPUEmbeddingActivationsOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TPUEmbeddingActivationsOp::output() {
  return *getODSResults(0).begin();
}

::mlir::IntegerAttr TPUEmbeddingActivationsOp::table_idAttr() {
  return (*this)->getAttr(table_idAttrName()).cast<::mlir::IntegerAttr>();
}

uint64_t TPUEmbeddingActivationsOp::table_id() {
  auto attr = table_idAttr();
  return attr.getValue().getZExtValue();
}

::mlir::IntegerAttr TPUEmbeddingActivationsOp::lookup_idAttr() {
  return (*this)->getAttr(lookup_idAttrName()).cast<::mlir::IntegerAttr>();
}

uint64_t TPUEmbeddingActivationsOp::lookup_id() {
  auto attr = lookup_idAttr();
  return attr.getValue().getZExtValue();
}

void TPUEmbeddingActivationsOp::table_idAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(table_idAttrName(), attr);
}

void TPUEmbeddingActivationsOp::lookup_idAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(lookup_idAttrName(), attr);
}

void TPUEmbeddingActivationsOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value embedding_variable, ::mlir::Value sliced_activations, ::mlir::IntegerAttr table_id, ::mlir::IntegerAttr lookup_id) {
  odsState.addOperands(embedding_variable);
  odsState.addOperands(sliced_activations);
  odsState.addAttribute(table_idAttrName(odsState.name), table_id);
  odsState.addAttribute(lookup_idAttrName(odsState.name), lookup_id);
  odsState.addTypes(output);
}

void TPUEmbeddingActivationsOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value embedding_variable, ::mlir::Value sliced_activations, ::mlir::IntegerAttr table_id, ::mlir::IntegerAttr lookup_id) {
  odsState.addOperands(embedding_variable);
  odsState.addOperands(sliced_activations);
  odsState.addAttribute(table_idAttrName(odsState.name), table_id);
  odsState.addAttribute(lookup_idAttrName(odsState.name), lookup_id);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void TPUEmbeddingActivationsOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value embedding_variable, ::mlir::Value sliced_activations, uint64_t table_id, uint64_t lookup_id) {
  odsState.addOperands(embedding_variable);
  odsState.addOperands(sliced_activations);
  odsState.addAttribute(table_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), table_id));
  odsState.addAttribute(lookup_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), lookup_id));
  odsState.addTypes(output);
}

void TPUEmbeddingActivationsOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value embedding_variable, ::mlir::Value sliced_activations, uint64_t table_id, uint64_t lookup_id) {
  odsState.addOperands(embedding_variable);
  odsState.addOperands(sliced_activations);
  odsState.addAttribute(table_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), table_id));
  odsState.addAttribute(lookup_idAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), lookup_id));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void TPUEmbeddingActivationsOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult TPUEmbeddingActivationsOp::verify() {
  {
    auto tblgen_table_id = (*this)->getAttr(table_idAttrName());
    if (!tblgen_table_id)
      return emitOpError("requires attribute 'table_id'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops35(*this, tblgen_table_id, "table_id")))
      return ::mlir::failure();
  }
  {
    auto tblgen_lookup_id = (*this)->getAttr(lookup_idAttrName());
    if (!tblgen_lookup_id)
      return emitOpError("requires attribute 'lookup_id'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops35(*this, tblgen_lookup_id, "lookup_id")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void TPUEmbeddingActivationsOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::TPUEmbeddingActivationsOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::TPUExecuteAndUpdateVariablesOp definitions
//===----------------------------------------------------------------------===//

TPUExecuteAndUpdateVariablesOpAdaptor::TPUExecuteAndUpdateVariablesOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

TPUExecuteAndUpdateVariablesOpAdaptor::TPUExecuteAndUpdateVariablesOpAdaptor(TPUExecuteAndUpdateVariablesOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange TPUExecuteAndUpdateVariablesOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> TPUExecuteAndUpdateVariablesOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  bool isVariadic[] = {true, false};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (odsOperands.size() - 1) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::ValueRange TPUExecuteAndUpdateVariablesOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::ValueRange TPUExecuteAndUpdateVariablesOpAdaptor::args() {
  return getODSOperands(0);
}

::mlir::Value TPUExecuteAndUpdateVariablesOpAdaptor::key() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr TPUExecuteAndUpdateVariablesOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::ArrayAttr TPUExecuteAndUpdateVariablesOpAdaptor::device_var_reads_indices() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("device_var_reads_indices").cast<::mlir::ArrayAttr>();
  return attr;
}

::mlir::ArrayAttr TPUExecuteAndUpdateVariablesOpAdaptor::device_var_updates_indices() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("device_var_updates_indices").cast<::mlir::ArrayAttr>();
  return attr;
}

::mlir::LogicalResult TPUExecuteAndUpdateVariablesOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_device_var_reads_indices = odsAttrs.get("device_var_reads_indices");
    if (!tblgen_device_var_reads_indices)
      return emitError(loc, "'tf.TPUExecuteAndUpdateVariables' op ""requires attribute 'device_var_reads_indices'");

    if (tblgen_device_var_reads_indices && !(((tblgen_device_var_reads_indices.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_device_var_reads_indices.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return ((attr.isa<::mlir::IntegerAttr>())) && ((attr.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64))); }))))
      return emitError(loc, "'tf.TPUExecuteAndUpdateVariables' op ""attribute 'device_var_reads_indices' failed to satisfy constraint: 64-bit integer array attribute");
  }
  {
    auto tblgen_device_var_updates_indices = odsAttrs.get("device_var_updates_indices");
    if (!tblgen_device_var_updates_indices)
      return emitError(loc, "'tf.TPUExecuteAndUpdateVariables' op ""requires attribute 'device_var_updates_indices'");

    if (tblgen_device_var_updates_indices && !(((tblgen_device_var_updates_indices.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_device_var_updates_indices.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return ((attr.isa<::mlir::IntegerAttr>())) && ((attr.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64))); }))))
      return emitError(loc, "'tf.TPUExecuteAndUpdateVariables' op ""attribute 'device_var_updates_indices' failed to satisfy constraint: 64-bit integer array attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> TPUExecuteAndUpdateVariablesOp::getODSOperandIndexAndLength(unsigned index) {
  bool isVariadic[] = {true, false};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (getOperation()->getNumOperands() - 1) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::Operation::operand_range TPUExecuteAndUpdateVariablesOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Operation::operand_range TPUExecuteAndUpdateVariablesOp::args() {
  return getODSOperands(0);
}

::mlir::Value TPUExecuteAndUpdateVariablesOp::key() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange TPUExecuteAndUpdateVariablesOp::argsMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange TPUExecuteAndUpdateVariablesOp::keyMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> TPUExecuteAndUpdateVariablesOp::getODSResultIndexAndLength(unsigned index) {
  bool isVariadic[] = {true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (getOperation()->getNumResults() - 0) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::Operation::result_range TPUExecuteAndUpdateVariablesOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Operation::result_range TPUExecuteAndUpdateVariablesOp::results() {
  return getODSResults(0);
}

::mlir::ArrayAttr TPUExecuteAndUpdateVariablesOp::device_var_reads_indicesAttr() {
  return (*this)->getAttr(device_var_reads_indicesAttrName()).cast<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr TPUExecuteAndUpdateVariablesOp::device_var_reads_indices() {
  auto attr = device_var_reads_indicesAttr();
  return attr;
}

::mlir::ArrayAttr TPUExecuteAndUpdateVariablesOp::device_var_updates_indicesAttr() {
  return (*this)->getAttr(device_var_updates_indicesAttrName()).cast<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr TPUExecuteAndUpdateVariablesOp::device_var_updates_indices() {
  auto attr = device_var_updates_indicesAttr();
  return attr;
}

mlir::OperandElementTypeRange TPUExecuteAndUpdateVariablesOp::Targs() {
  auto values = getODSOperands(0);
return {mlir::OperandElementTypeIterator(values.begin()), mlir::OperandElementTypeIterator(values.end())};
}

mlir::ResultElementTypeRange TPUExecuteAndUpdateVariablesOp::Tresults() {
  auto values = getODSResults(0);
return {mlir::ResultElementTypeIterator(values.begin()), mlir::ResultElementTypeIterator(values.end())};
}

bool TPUExecuteAndUpdateVariablesOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "Targs") return true;
  if (name == "Tresults") return true;
 return false;
}

::mlir::DictionaryAttr TPUExecuteAndUpdateVariablesOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TargsAttrName(),
ArrayAttr::get(ctx, 
    [&]() {
      llvm::SmallVector<Attribute, 4> ret;
      for (auto t : Targs())
        ret.push_back(TypeAttr::get(t));
      return ret;
    }())},
    {TresultsAttrName(),
ArrayAttr::get(ctx, 
    [&]() {
      llvm::SmallVector<Attribute, 4> ret;
      for (auto t : Tresults())
        ret.push_back(TypeAttr::get(t));
      return ret;
    }())}});
}

void TPUExecuteAndUpdateVariablesOp::device_var_reads_indicesAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(device_var_reads_indicesAttrName(), attr);
}

void TPUExecuteAndUpdateVariablesOp::device_var_updates_indicesAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(device_var_updates_indicesAttrName(), attr);
}

void TPUExecuteAndUpdateVariablesOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange results, ::mlir::ValueRange args, ::mlir::Value key, ::mlir::ArrayAttr device_var_reads_indices, ::mlir::ArrayAttr device_var_updates_indices) {
  odsState.addOperands(args);
  odsState.addOperands(key);
  odsState.addAttribute(device_var_reads_indicesAttrName(odsState.name), device_var_reads_indices);
  odsState.addAttribute(device_var_updates_indicesAttrName(odsState.name), device_var_updates_indices);
  odsState.addTypes(results);
}

void TPUExecuteAndUpdateVariablesOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() >= 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult TPUExecuteAndUpdateVariablesOp::verify() {
  {
    auto tblgen_device_var_reads_indices = (*this)->getAttr(device_var_reads_indicesAttrName());
    if (!tblgen_device_var_reads_indices)
      return emitOpError("requires attribute 'device_var_reads_indices'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops13(*this, tblgen_device_var_reads_indices, "device_var_reads_indices")))
      return ::mlir::failure();
  }
  {
    auto tblgen_device_var_updates_indices = (*this)->getAttr(device_var_updates_indicesAttrName());
    if (!tblgen_device_var_updates_indices)
      return emitOpError("requires attribute 'device_var_updates_indices'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops13(*this, tblgen_device_var_updates_indices, "device_var_updates_indices")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops19(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return Verify(*this);
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::TPUExecuteAndUpdateVariablesOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::TPUExecuteOp definitions
//===----------------------------------------------------------------------===//

TPUExecuteOpAdaptor::TPUExecuteOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

TPUExecuteOpAdaptor::TPUExecuteOpAdaptor(TPUExecuteOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange TPUExecuteOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> TPUExecuteOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  bool isVariadic[] = {true, false};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (odsOperands.size() - 1) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::ValueRange TPUExecuteOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::ValueRange TPUExecuteOpAdaptor::args() {
  return getODSOperands(0);
}

::mlir::Value TPUExecuteOpAdaptor::key() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr TPUExecuteOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult TPUExecuteOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> TPUExecuteOp::getODSOperandIndexAndLength(unsigned index) {
  bool isVariadic[] = {true, false};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (getOperation()->getNumOperands() - 1) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::Operation::operand_range TPUExecuteOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Operation::operand_range TPUExecuteOp::args() {
  return getODSOperands(0);
}

::mlir::Value TPUExecuteOp::key() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange TPUExecuteOp::argsMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange TPUExecuteOp::keyMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> TPUExecuteOp::getODSResultIndexAndLength(unsigned index) {
  bool isVariadic[] = {true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (getOperation()->getNumResults() - 0) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::Operation::result_range TPUExecuteOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Operation::result_range TPUExecuteOp::results() {
  return getODSResults(0);
}

mlir::OperandElementTypeRange TPUExecuteOp::Targs() {
  auto values = getODSOperands(0);
return {mlir::OperandElementTypeIterator(values.begin()), mlir::OperandElementTypeIterator(values.end())};
}

mlir::ResultElementTypeRange TPUExecuteOp::Tresults() {
  auto values = getODSResults(0);
return {mlir::ResultElementTypeIterator(values.begin()), mlir::ResultElementTypeIterator(values.end())};
}

bool TPUExecuteOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "Targs") return true;
  if (name == "Tresults") return true;
 return false;
}

::mlir::DictionaryAttr TPUExecuteOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TargsAttrName(),
ArrayAttr::get(ctx, 
    [&]() {
      llvm::SmallVector<Attribute, 4> ret;
      for (auto t : Targs())
        ret.push_back(TypeAttr::get(t));
      return ret;
    }())},
    {TresultsAttrName(),
ArrayAttr::get(ctx, 
    [&]() {
      llvm::SmallVector<Attribute, 4> ret;
      for (auto t : Tresults())
        ret.push_back(TypeAttr::get(t));
      return ret;
    }())}});
}

void TPUExecuteOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange results, ::mlir::ValueRange args, ::mlir::Value key) {
  odsState.addOperands(args);
  odsState.addOperands(key);
  odsState.addTypes(results);
}

void TPUExecuteOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() >= 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult TPUExecuteOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops19(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::TPUExecuteOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::TPUGetLayoutOp definitions
//===----------------------------------------------------------------------===//

TPUGetLayoutOpAdaptor::TPUGetLayoutOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

TPUGetLayoutOpAdaptor::TPUGetLayoutOpAdaptor(TPUGetLayoutOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange TPUGetLayoutOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> TPUGetLayoutOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange TPUGetLayoutOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TPUGetLayoutOpAdaptor::cache_key() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr TPUGetLayoutOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::IntegerAttr TPUGetLayoutOpAdaptor::index() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("index").cast<::mlir::IntegerAttr>();
  return attr;
}

::mlir::BoolAttr TPUGetLayoutOpAdaptor::is_output() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("is_output").cast<::mlir::BoolAttr>();
  return attr;
}

::mlir::LogicalResult TPUGetLayoutOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_index = odsAttrs.get("index");
    if (!tblgen_index)
      return emitError(loc, "'tf.TPUGetLayoutOp' op ""requires attribute 'index'");

    if (tblgen_index && !(((tblgen_index.isa<::mlir::IntegerAttr>())) && ((tblgen_index.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.TPUGetLayoutOp' op ""attribute 'index' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_is_output = odsAttrs.get("is_output");
    if (!tblgen_is_output)
      return emitError(loc, "'tf.TPUGetLayoutOp' op ""requires attribute 'is_output'");

    if (tblgen_is_output && !((tblgen_is_output.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.TPUGetLayoutOp' op ""attribute 'is_output' failed to satisfy constraint: bool attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> TPUGetLayoutOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range TPUGetLayoutOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TPUGetLayoutOp::cache_key() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange TPUGetLayoutOp::cache_keyMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> TPUGetLayoutOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range TPUGetLayoutOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TPUGetLayoutOp::layout() {
  return *getODSResults(0).begin();
}

::mlir::IntegerAttr TPUGetLayoutOp::indexAttr() {
  return (*this)->getAttr(indexAttrName()).cast<::mlir::IntegerAttr>();
}

uint64_t TPUGetLayoutOp::index() {
  auto attr = indexAttr();
  return attr.getValue().getZExtValue();
}

::mlir::BoolAttr TPUGetLayoutOp::is_outputAttr() {
  return (*this)->getAttr(is_outputAttrName()).cast<::mlir::BoolAttr>();
}

bool TPUGetLayoutOp::is_output() {
  auto attr = is_outputAttr();
  return attr.getValue();
}

void TPUGetLayoutOp::indexAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(indexAttrName(), attr);
}

void TPUGetLayoutOp::is_outputAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(is_outputAttrName(), attr);
}

void TPUGetLayoutOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type layout, ::mlir::Value cache_key, ::mlir::IntegerAttr index, ::mlir::BoolAttr is_output) {
  odsState.addOperands(cache_key);
  odsState.addAttribute(indexAttrName(odsState.name), index);
  odsState.addAttribute(is_outputAttrName(odsState.name), is_output);
  odsState.addTypes(layout);
}

void TPUGetLayoutOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value cache_key, ::mlir::IntegerAttr index, ::mlir::BoolAttr is_output) {
  odsState.addOperands(cache_key);
  odsState.addAttribute(indexAttrName(odsState.name), index);
  odsState.addAttribute(is_outputAttrName(odsState.name), is_output);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void TPUGetLayoutOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type layout, ::mlir::Value cache_key, uint64_t index, bool is_output) {
  odsState.addOperands(cache_key);
  odsState.addAttribute(indexAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), index));
  odsState.addAttribute(is_outputAttrName(odsState.name), odsBuilder.getBoolAttr(is_output));
  odsState.addTypes(layout);
}

void TPUGetLayoutOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value cache_key, uint64_t index, bool is_output) {
  odsState.addOperands(cache_key);
  odsState.addAttribute(indexAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), index));
  odsState.addAttribute(is_outputAttrName(odsState.name), odsBuilder.getBoolAttr(is_output));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void TPUGetLayoutOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult TPUGetLayoutOp::verify() {
  {
    auto tblgen_index = (*this)->getAttr(indexAttrName());
    if (!tblgen_index)
      return emitOpError("requires attribute 'index'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_index, "index")))
      return ::mlir::failure();
  }
  {
    auto tblgen_is_output = (*this)->getAttr(is_outputAttrName());
    if (!tblgen_is_output)
      return emitOpError("requires attribute 'is_output'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_is_output, "is_output")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops19(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops16(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void TPUGetLayoutOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::TPUGetLayoutOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::TPUOrdinalSelectorOp definitions
//===----------------------------------------------------------------------===//

TPUOrdinalSelectorOpAdaptor::TPUOrdinalSelectorOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

TPUOrdinalSelectorOpAdaptor::TPUOrdinalSelectorOpAdaptor(TPUOrdinalSelectorOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange TPUOrdinalSelectorOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> TPUOrdinalSelectorOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange TPUOrdinalSelectorOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::DictionaryAttr TPUOrdinalSelectorOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult TPUOrdinalSelectorOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> TPUOrdinalSelectorOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range TPUOrdinalSelectorOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

std::pair<unsigned, unsigned> TPUOrdinalSelectorOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range TPUOrdinalSelectorOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TPUOrdinalSelectorOp::device_ordinals() {
  return *getODSResults(0).begin();
}

void TPUOrdinalSelectorOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type device_ordinals) {
  odsState.addTypes(device_ordinals);
}

void TPUOrdinalSelectorOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes) {
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void TPUOrdinalSelectorOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 0u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult TPUOrdinalSelectorOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops11(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::TPUOrdinalSelectorOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::TPUPartitionedCallOp definitions
//===----------------------------------------------------------------------===//

TPUPartitionedCallOpAdaptor::TPUPartitionedCallOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

TPUPartitionedCallOpAdaptor::TPUPartitionedCallOpAdaptor(TPUPartitionedCallOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange TPUPartitionedCallOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> TPUPartitionedCallOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  bool isVariadic[] = {true, false};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (odsOperands.size() - 1) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::ValueRange TPUPartitionedCallOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::ValueRange TPUPartitionedCallOpAdaptor::args() {
  return getODSOperands(0);
}

::mlir::Value TPUPartitionedCallOpAdaptor::device_ordinal() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr TPUPartitionedCallOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::SymbolRefAttr TPUPartitionedCallOpAdaptor::f() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::SymbolRefAttr attr = odsAttrs.get("f").cast<::mlir::SymbolRefAttr>();
  return attr;
}

::mlir::IntegerAttr TPUPartitionedCallOpAdaptor::autotuner_thresh() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("autotuner_thresh").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), 0);
  return attr;
}

::mlir::LogicalResult TPUPartitionedCallOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_f = odsAttrs.get("f");
    if (!tblgen_f)
      return emitError(loc, "'tf.TPUPartitionedCall' op ""requires attribute 'f'");

    if (tblgen_f && !((tblgen_f.isa<::mlir::SymbolRefAttr>())))
      return emitError(loc, "'tf.TPUPartitionedCall' op ""attribute 'f' failed to satisfy constraint: symbol reference attribute");
  }
  {
    auto tblgen_autotuner_thresh = odsAttrs.get("autotuner_thresh");
    if (tblgen_autotuner_thresh && !(((tblgen_autotuner_thresh.isa<::mlir::IntegerAttr>())) && ((tblgen_autotuner_thresh.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.TPUPartitionedCall' op ""attribute 'autotuner_thresh' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> TPUPartitionedCallOp::getODSOperandIndexAndLength(unsigned index) {
  bool isVariadic[] = {true, false};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (getOperation()->getNumOperands() - 1) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::Operation::operand_range TPUPartitionedCallOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Operation::operand_range TPUPartitionedCallOp::args() {
  return getODSOperands(0);
}

::mlir::Value TPUPartitionedCallOp::device_ordinal() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange TPUPartitionedCallOp::argsMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange TPUPartitionedCallOp::device_ordinalMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> TPUPartitionedCallOp::getODSResultIndexAndLength(unsigned index) {
  bool isVariadic[] = {true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (getOperation()->getNumResults() - 0) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::Operation::result_range TPUPartitionedCallOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Operation::result_range TPUPartitionedCallOp::output() {
  return getODSResults(0);
}

::mlir::SymbolRefAttr TPUPartitionedCallOp::fAttr() {
  return (*this)->getAttr(fAttrName()).cast<::mlir::SymbolRefAttr>();
}

::mlir::SymbolRefAttr TPUPartitionedCallOp::f() {
  auto attr = fAttr();
  return attr;
}

::mlir::IntegerAttr TPUPartitionedCallOp::autotuner_threshAttr() {
  return (*this)->getAttr(autotuner_threshAttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t TPUPartitionedCallOp::autotuner_thresh() {
  auto attr = autotuner_threshAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), 0).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

mlir::OperandElementTypeRange TPUPartitionedCallOp::Tin() {
  auto values = getODSOperands(0);
return {mlir::OperandElementTypeIterator(values.begin()), mlir::OperandElementTypeIterator(values.end())};
}

mlir::ResultElementTypeRange TPUPartitionedCallOp::Tout() {
  auto values = getODSResults(0);
return {mlir::ResultElementTypeIterator(values.begin()), mlir::ResultElementTypeIterator(values.end())};
}

bool TPUPartitionedCallOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "Tin") return true;
  if (name == "Tout") return true;
 return false;
}

::mlir::DictionaryAttr TPUPartitionedCallOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TinAttrName(),
ArrayAttr::get(ctx, 
    [&]() {
      llvm::SmallVector<Attribute, 4> ret;
      for (auto t : Tin())
        ret.push_back(TypeAttr::get(t));
      return ret;
    }())},
    {ToutAttrName(),
ArrayAttr::get(ctx, 
    [&]() {
      llvm::SmallVector<Attribute, 4> ret;
      for (auto t : Tout())
        ret.push_back(TypeAttr::get(t));
      return ret;
    }())}});
}

void TPUPartitionedCallOp::fAttr(::mlir::SymbolRefAttr attr) {
  (*this)->setAttr(fAttrName(), attr);
}

void TPUPartitionedCallOp::autotuner_threshAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(autotuner_threshAttrName(), attr);
}

void TPUPartitionedCallOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange output, ::mlir::ValueRange args, ::mlir::Value device_ordinal, ::mlir::SymbolRefAttr f, ::mlir::IntegerAttr autotuner_thresh) {
  odsState.addOperands(args);
  odsState.addOperands(device_ordinal);
  odsState.addAttribute(fAttrName(odsState.name), f);
  odsState.addAttribute(autotuner_threshAttrName(odsState.name), autotuner_thresh);
  odsState.addTypes(output);
}

void TPUPartitionedCallOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange output, ::mlir::ValueRange args, ::mlir::Value device_ordinal, ::mlir::SymbolRefAttr f, uint64_t autotuner_thresh) {
  odsState.addOperands(args);
  odsState.addOperands(device_ordinal);
  odsState.addAttribute(fAttrName(odsState.name), f);
  odsState.addAttribute(autotuner_threshAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), autotuner_thresh));
  odsState.addTypes(output);
}

void TPUPartitionedCallOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() >= 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult TPUPartitionedCallOp::verify() {
  {
    auto tblgen_f = (*this)->getAttr(fAttrName());
    if (!tblgen_f)
      return emitOpError("requires attribute 'f'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops12(*this, tblgen_f, "f")))
      return ::mlir::failure();
  }
  {
    auto tblgen_autotuner_thresh = (*this)->getAttr(autotuner_threshAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_autotuner_thresh, "autotuner_thresh")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops11(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return VerifyPartitionedCall(*this);
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::TPUPartitionedCallOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::TPUPartitionedInputOp definitions
//===----------------------------------------------------------------------===//

TPUPartitionedInputOpAdaptor::TPUPartitionedInputOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

TPUPartitionedInputOpAdaptor::TPUPartitionedInputOpAdaptor(TPUPartitionedInputOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange TPUPartitionedInputOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> TPUPartitionedInputOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  bool isVariadic[] = {true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (odsOperands.size() - 0) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::ValueRange TPUPartitionedInputOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::ValueRange TPUPartitionedInputOpAdaptor::inputs() {
  return getODSOperands(0);
}

::mlir::DictionaryAttr TPUPartitionedInputOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::IntegerAttr TPUPartitionedInputOpAdaptor::partition_dim() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("partition_dim").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), 0);
  return attr;
}

::mlir::StringAttr TPUPartitionedInputOpAdaptor::_XlaSharding() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("_XlaSharding").dyn_cast_or_null<::mlir::StringAttr>();
  return attr;
}

::mlir::LogicalResult TPUPartitionedInputOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_partition_dim = odsAttrs.get("partition_dim");
    if (tblgen_partition_dim && !(((tblgen_partition_dim.isa<::mlir::IntegerAttr>())) && ((tblgen_partition_dim.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.TPUPartitionedInput' op ""attribute 'partition_dim' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen__XlaSharding = odsAttrs.get("_XlaSharding");
    if (tblgen__XlaSharding && !((tblgen__XlaSharding.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.TPUPartitionedInput' op ""attribute '_XlaSharding' failed to satisfy constraint: string attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> TPUPartitionedInputOp::getODSOperandIndexAndLength(unsigned index) {
  bool isVariadic[] = {true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (getOperation()->getNumOperands() - 0) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::Operation::operand_range TPUPartitionedInputOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Operation::operand_range TPUPartitionedInputOp::inputs() {
  return getODSOperands(0);
}

::mlir::MutableOperandRange TPUPartitionedInputOp::inputsMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> TPUPartitionedInputOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range TPUPartitionedInputOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TPUPartitionedInputOp::output() {
  return *getODSResults(0).begin();
}

::mlir::IntegerAttr TPUPartitionedInputOp::partition_dimAttr() {
  return (*this)->getAttr(partition_dimAttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t TPUPartitionedInputOp::partition_dim() {
  auto attr = partition_dimAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), 0).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

::mlir::StringAttr TPUPartitionedInputOp::_XlaShardingAttr() {
  return (*this)->getAttr(_XlaShardingAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::Optional< ::llvm::StringRef > TPUPartitionedInputOp::_XlaSharding() {
  auto attr = _XlaShardingAttr();
  return attr ? ::llvm::Optional< ::llvm::StringRef >(attr.getValue()) : (::llvm::None);
}

::mlir::Type TPUPartitionedInputOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

size_t TPUPartitionedInputOp::N() {
  auto range = getODSOperands(0);
return std::distance(range.begin(), range.end());
}

bool TPUPartitionedInputOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
  if (name == "N") return true;
 return false;
}

::mlir::DictionaryAttr TPUPartitionedInputOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())},
    {NAttrName(),
odsBuilder.getI64IntegerAttr(N())}});
}

void TPUPartitionedInputOp::partition_dimAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(partition_dimAttrName(), attr);
}

void TPUPartitionedInputOp::_XlaShardingAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(_XlaShardingAttrName(), attr);
}

::mlir::Attribute TPUPartitionedInputOp::remove_XlaShardingAttr() {
  return (*this)->removeAttr(_XlaShardingAttrName());
}

void TPUPartitionedInputOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::ValueRange inputs, ::mlir::IntegerAttr partition_dim, /*optional*/::mlir::StringAttr _XlaSharding) {
  odsState.addOperands(inputs);
  odsState.addAttribute(partition_dimAttrName(odsState.name), partition_dim);
  if (_XlaSharding) {
  odsState.addAttribute(_XlaShardingAttrName(odsState.name), _XlaSharding);
  }
  odsState.addTypes(output);
}

void TPUPartitionedInputOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange inputs, ::mlir::IntegerAttr partition_dim, /*optional*/::mlir::StringAttr _XlaSharding) {
  odsState.addOperands(inputs);
  odsState.addAttribute(partition_dimAttrName(odsState.name), partition_dim);
  if (_XlaSharding) {
  odsState.addAttribute(_XlaShardingAttrName(odsState.name), _XlaSharding);
  }
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void TPUPartitionedInputOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::ValueRange inputs, uint64_t partition_dim, /*optional*/::mlir::StringAttr _XlaSharding) {
  odsState.addOperands(inputs);
  odsState.addAttribute(partition_dimAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), partition_dim));
  if (_XlaSharding) {
  odsState.addAttribute(_XlaShardingAttrName(odsState.name), _XlaSharding);
  }
  odsState.addTypes(output);
}

void TPUPartitionedInputOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange inputs, uint64_t partition_dim, /*optional*/::mlir::StringAttr _XlaSharding) {
  odsState.addOperands(inputs);
  odsState.addAttribute(partition_dimAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), partition_dim));
  if (_XlaSharding) {
  odsState.addAttribute(_XlaShardingAttrName(odsState.name), _XlaSharding);
  }
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void TPUPartitionedInputOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult TPUPartitionedInputOp::verify() {
  {
    auto tblgen_partition_dim = (*this)->getAttr(partition_dimAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_partition_dim, "partition_dim")))
      return ::mlir::failure();
  }
  {
    auto tblgen__XlaSharding = (*this)->getAttr(_XlaShardingAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen__XlaSharding, "_XlaSharding")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void TPUPartitionedInputOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::TPUPartitionedInputOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::TPUPartitionedOutputOp definitions
//===----------------------------------------------------------------------===//

TPUPartitionedOutputOpAdaptor::TPUPartitionedOutputOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

TPUPartitionedOutputOpAdaptor::TPUPartitionedOutputOpAdaptor(TPUPartitionedOutputOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange TPUPartitionedOutputOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> TPUPartitionedOutputOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange TPUPartitionedOutputOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TPUPartitionedOutputOpAdaptor::inputs() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr TPUPartitionedOutputOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::IntegerAttr TPUPartitionedOutputOpAdaptor::partition_dim() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("partition_dim").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), 0);
  return attr;
}

::mlir::StringAttr TPUPartitionedOutputOpAdaptor::_XlaSharding() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("_XlaSharding").dyn_cast_or_null<::mlir::StringAttr>();
  return attr;
}

::mlir::LogicalResult TPUPartitionedOutputOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_partition_dim = odsAttrs.get("partition_dim");
    if (tblgen_partition_dim && !(((tblgen_partition_dim.isa<::mlir::IntegerAttr>())) && ((tblgen_partition_dim.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.TPUPartitionedOutput' op ""attribute 'partition_dim' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen__XlaSharding = odsAttrs.get("_XlaSharding");
    if (tblgen__XlaSharding && !((tblgen__XlaSharding.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.TPUPartitionedOutput' op ""attribute '_XlaSharding' failed to satisfy constraint: string attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> TPUPartitionedOutputOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range TPUPartitionedOutputOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TPUPartitionedOutputOp::inputs() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange TPUPartitionedOutputOp::inputsMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> TPUPartitionedOutputOp::getODSResultIndexAndLength(unsigned index) {
  bool isVariadic[] = {true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (getOperation()->getNumResults() - 0) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::Operation::result_range TPUPartitionedOutputOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Operation::result_range TPUPartitionedOutputOp::output() {
  return getODSResults(0);
}

::mlir::IntegerAttr TPUPartitionedOutputOp::partition_dimAttr() {
  return (*this)->getAttr(partition_dimAttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t TPUPartitionedOutputOp::partition_dim() {
  auto attr = partition_dimAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), 0).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

::mlir::StringAttr TPUPartitionedOutputOp::_XlaShardingAttr() {
  return (*this)->getAttr(_XlaShardingAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::Optional< ::llvm::StringRef > TPUPartitionedOutputOp::_XlaSharding() {
  auto attr = _XlaShardingAttr();
  return attr ? ::llvm::Optional< ::llvm::StringRef >(attr.getValue()) : (::llvm::None);
}

::mlir::Type TPUPartitionedOutputOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

size_t TPUPartitionedOutputOp::num_splits() {
  auto range = getODSResults(0);
return std::distance(range.begin(), range.end());
}

bool TPUPartitionedOutputOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
  if (name == "num_splits") return true;
 return false;
}

::mlir::DictionaryAttr TPUPartitionedOutputOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())},
    {num_splitsAttrName(),
odsBuilder.getI64IntegerAttr(num_splits())}});
}

void TPUPartitionedOutputOp::partition_dimAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(partition_dimAttrName(), attr);
}

void TPUPartitionedOutputOp::_XlaShardingAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(_XlaShardingAttrName(), attr);
}

::mlir::Attribute TPUPartitionedOutputOp::remove_XlaShardingAttr() {
  return (*this)->removeAttr(_XlaShardingAttrName());
}

void TPUPartitionedOutputOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange output, ::mlir::Value inputs, ::mlir::IntegerAttr partition_dim, /*optional*/::mlir::StringAttr _XlaSharding) {
  odsState.addOperands(inputs);
  odsState.addAttribute(partition_dimAttrName(odsState.name), partition_dim);
  if (_XlaSharding) {
  odsState.addAttribute(_XlaShardingAttrName(odsState.name), _XlaSharding);
  }
  odsState.addTypes(output);
}

void TPUPartitionedOutputOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange output, ::mlir::Value inputs, uint64_t partition_dim, /*optional*/::mlir::StringAttr _XlaSharding) {
  odsState.addOperands(inputs);
  odsState.addAttribute(partition_dimAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), partition_dim));
  if (_XlaSharding) {
  odsState.addAttribute(_XlaShardingAttrName(odsState.name), _XlaSharding);
  }
  odsState.addTypes(output);
}

void TPUPartitionedOutputOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult TPUPartitionedOutputOp::verify() {
  {
    auto tblgen_partition_dim = (*this)->getAttr(partition_dimAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_partition_dim, "partition_dim")))
      return ::mlir::failure();
  }
  {
    auto tblgen__XlaSharding = (*this)->getAttr(_XlaShardingAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen__XlaSharding, "_XlaSharding")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void TPUPartitionedOutputOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::TPUPartitionedOutputOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::TPUReplicateMetadataOp definitions
//===----------------------------------------------------------------------===//

TPUReplicateMetadataOpAdaptor::TPUReplicateMetadataOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

TPUReplicateMetadataOpAdaptor::TPUReplicateMetadataOpAdaptor(TPUReplicateMetadataOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange TPUReplicateMetadataOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> TPUReplicateMetadataOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange TPUReplicateMetadataOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::DictionaryAttr TPUReplicateMetadataOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::IntegerAttr TPUReplicateMetadataOpAdaptor::num_replicas() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("num_replicas").cast<::mlir::IntegerAttr>();
  return attr;
}

::mlir::IntegerAttr TPUReplicateMetadataOpAdaptor::num_cores_per_replica() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("num_cores_per_replica").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), 1);
  return attr;
}

::mlir::StringAttr TPUReplicateMetadataOpAdaptor::topology() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("topology").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("");
  return attr;
}

::mlir::BoolAttr TPUReplicateMetadataOpAdaptor::use_tpu() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("use_tpu").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(true);
  return attr;
}

::mlir::ArrayAttr TPUReplicateMetadataOpAdaptor::device_assignment() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("device_assignment").dyn_cast_or_null<::mlir::ArrayAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getI64ArrayAttr({});
  return attr;
}

::mlir::ArrayAttr TPUReplicateMetadataOpAdaptor::computation_shape() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("computation_shape").dyn_cast_or_null<::mlir::ArrayAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getI64ArrayAttr({});
  return attr;
}

::mlir::ArrayAttr TPUReplicateMetadataOpAdaptor::host_compute_core() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("host_compute_core").dyn_cast_or_null<::mlir::ArrayAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStrArrayAttr({});
  return attr;
}

::mlir::ArrayAttr TPUReplicateMetadataOpAdaptor::padding_map() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("padding_map").dyn_cast_or_null<::mlir::ArrayAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStrArrayAttr({});
  return attr;
}

::mlir::StringAttr TPUReplicateMetadataOpAdaptor::step_marker_location() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("step_marker_location").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("STEP_MARK_AT_ENTRY");
  return attr;
}

::mlir::BoolAttr TPUReplicateMetadataOpAdaptor::allow_soft_placement() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("allow_soft_placement").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(false);
  return attr;
}

::mlir::BoolAttr TPUReplicateMetadataOpAdaptor::use_spmd_for_xla_partitioning() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("use_spmd_for_xla_partitioning").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(false);
  return attr;
}

::mlir::LogicalResult TPUReplicateMetadataOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_num_replicas = odsAttrs.get("num_replicas");
    if (!tblgen_num_replicas)
      return emitError(loc, "'tf.TPUReplicateMetadata' op ""requires attribute 'num_replicas'");

    if (tblgen_num_replicas && !((((tblgen_num_replicas.isa<::mlir::IntegerAttr>())) && ((tblgen_num_replicas.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))) && ((tblgen_num_replicas.cast<::mlir::IntegerAttr>().getInt() >= 0))))
      return emitError(loc, "'tf.TPUReplicateMetadata' op ""attribute 'num_replicas' failed to satisfy constraint: 64-bit signless integer attribute whose minimum value is 0");
  }
  {
    auto tblgen_num_cores_per_replica = odsAttrs.get("num_cores_per_replica");
    if (tblgen_num_cores_per_replica && !(((tblgen_num_cores_per_replica.isa<::mlir::IntegerAttr>())) && ((tblgen_num_cores_per_replica.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.TPUReplicateMetadata' op ""attribute 'num_cores_per_replica' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_topology = odsAttrs.get("topology");
    if (tblgen_topology && !((tblgen_topology.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.TPUReplicateMetadata' op ""attribute 'topology' failed to satisfy constraint: string attribute");
  }
  {
    auto tblgen_use_tpu = odsAttrs.get("use_tpu");
    if (tblgen_use_tpu && !((tblgen_use_tpu.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.TPUReplicateMetadata' op ""attribute 'use_tpu' failed to satisfy constraint: bool attribute");
  }
  {
    auto tblgen_device_assignment = odsAttrs.get("device_assignment");
    if (tblgen_device_assignment && !(((tblgen_device_assignment.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_device_assignment.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return ((attr.isa<::mlir::IntegerAttr>())) && ((attr.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64))); }))))
      return emitError(loc, "'tf.TPUReplicateMetadata' op ""attribute 'device_assignment' failed to satisfy constraint: 64-bit integer array attribute");
  }
  {
    auto tblgen_computation_shape = odsAttrs.get("computation_shape");
    if (tblgen_computation_shape && !(((tblgen_computation_shape.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_computation_shape.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return ((attr.isa<::mlir::IntegerAttr>())) && ((attr.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64))); }))))
      return emitError(loc, "'tf.TPUReplicateMetadata' op ""attribute 'computation_shape' failed to satisfy constraint: 64-bit integer array attribute");
  }
  {
    auto tblgen_host_compute_core = odsAttrs.get("host_compute_core");
    if (tblgen_host_compute_core && !(((tblgen_host_compute_core.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_host_compute_core.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return (attr.isa<::mlir::StringAttr>()); }))))
      return emitError(loc, "'tf.TPUReplicateMetadata' op ""attribute 'host_compute_core' failed to satisfy constraint: string array attribute");
  }
  {
    auto tblgen_padding_map = odsAttrs.get("padding_map");
    if (tblgen_padding_map && !(((tblgen_padding_map.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_padding_map.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return (attr.isa<::mlir::StringAttr>()); }))))
      return emitError(loc, "'tf.TPUReplicateMetadata' op ""attribute 'padding_map' failed to satisfy constraint: string array attribute");
  }
  {
    auto tblgen_step_marker_location = odsAttrs.get("step_marker_location");
    if (tblgen_step_marker_location && !((tblgen_step_marker_location.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.TPUReplicateMetadata' op ""attribute 'step_marker_location' failed to satisfy constraint: string attribute");
  }
  {
    auto tblgen_allow_soft_placement = odsAttrs.get("allow_soft_placement");
    if (tblgen_allow_soft_placement && !((tblgen_allow_soft_placement.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.TPUReplicateMetadata' op ""attribute 'allow_soft_placement' failed to satisfy constraint: bool attribute");
  }
  {
    auto tblgen_use_spmd_for_xla_partitioning = odsAttrs.get("use_spmd_for_xla_partitioning");
    if (tblgen_use_spmd_for_xla_partitioning && !((tblgen_use_spmd_for_xla_partitioning.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.TPUReplicateMetadata' op ""attribute 'use_spmd_for_xla_partitioning' failed to satisfy constraint: bool attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> TPUReplicateMetadataOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range TPUReplicateMetadataOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

std::pair<unsigned, unsigned> TPUReplicateMetadataOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range TPUReplicateMetadataOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::IntegerAttr TPUReplicateMetadataOp::num_replicasAttr() {
  return (*this)->getAttr(num_replicasAttrName()).cast<::mlir::IntegerAttr>();
}

uint64_t TPUReplicateMetadataOp::num_replicas() {
  auto attr = num_replicasAttr();
  return attr.getValue().getZExtValue();
}

::mlir::IntegerAttr TPUReplicateMetadataOp::num_cores_per_replicaAttr() {
  return (*this)->getAttr(num_cores_per_replicaAttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t TPUReplicateMetadataOp::num_cores_per_replica() {
  auto attr = num_cores_per_replicaAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), 1).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

::mlir::StringAttr TPUReplicateMetadataOp::topologyAttr() {
  return (*this)->getAttr(topologyAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef TPUReplicateMetadataOp::topology() {
  auto attr = topologyAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("").getValue();
  return attr.getValue();
}

::mlir::BoolAttr TPUReplicateMetadataOp::use_tpuAttr() {
  return (*this)->getAttr(use_tpuAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool TPUReplicateMetadataOp::use_tpu() {
  auto attr = use_tpuAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(true).getValue();
  return attr.getValue();
}

::mlir::ArrayAttr TPUReplicateMetadataOp::device_assignmentAttr() {
  return (*this)->getAttr(device_assignmentAttrName()).dyn_cast_or_null<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr TPUReplicateMetadataOp::device_assignment() {
  auto attr = device_assignmentAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getI64ArrayAttr({});
  return attr;
}

::mlir::ArrayAttr TPUReplicateMetadataOp::computation_shapeAttr() {
  return (*this)->getAttr(computation_shapeAttrName()).dyn_cast_or_null<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr TPUReplicateMetadataOp::computation_shape() {
  auto attr = computation_shapeAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getI64ArrayAttr({});
  return attr;
}

::mlir::ArrayAttr TPUReplicateMetadataOp::host_compute_coreAttr() {
  return (*this)->getAttr(host_compute_coreAttrName()).dyn_cast_or_null<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr TPUReplicateMetadataOp::host_compute_core() {
  auto attr = host_compute_coreAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStrArrayAttr({});
  return attr;
}

::mlir::ArrayAttr TPUReplicateMetadataOp::padding_mapAttr() {
  return (*this)->getAttr(padding_mapAttrName()).dyn_cast_or_null<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr TPUReplicateMetadataOp::padding_map() {
  auto attr = padding_mapAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStrArrayAttr({});
  return attr;
}

::mlir::StringAttr TPUReplicateMetadataOp::step_marker_locationAttr() {
  return (*this)->getAttr(step_marker_locationAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef TPUReplicateMetadataOp::step_marker_location() {
  auto attr = step_marker_locationAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("STEP_MARK_AT_ENTRY").getValue();
  return attr.getValue();
}

::mlir::BoolAttr TPUReplicateMetadataOp::allow_soft_placementAttr() {
  return (*this)->getAttr(allow_soft_placementAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool TPUReplicateMetadataOp::allow_soft_placement() {
  auto attr = allow_soft_placementAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(false).getValue();
  return attr.getValue();
}

::mlir::BoolAttr TPUReplicateMetadataOp::use_spmd_for_xla_partitioningAttr() {
  return (*this)->getAttr(use_spmd_for_xla_partitioningAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool TPUReplicateMetadataOp::use_spmd_for_xla_partitioning() {
  auto attr = use_spmd_for_xla_partitioningAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(false).getValue();
  return attr.getValue();
}

void TPUReplicateMetadataOp::num_replicasAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(num_replicasAttrName(), attr);
}

void TPUReplicateMetadataOp::num_cores_per_replicaAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(num_cores_per_replicaAttrName(), attr);
}

void TPUReplicateMetadataOp::topologyAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(topologyAttrName(), attr);
}

void TPUReplicateMetadataOp::use_tpuAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(use_tpuAttrName(), attr);
}

void TPUReplicateMetadataOp::device_assignmentAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(device_assignmentAttrName(), attr);
}

void TPUReplicateMetadataOp::computation_shapeAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(computation_shapeAttrName(), attr);
}

void TPUReplicateMetadataOp::host_compute_coreAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(host_compute_coreAttrName(), attr);
}

void TPUReplicateMetadataOp::padding_mapAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(padding_mapAttrName(), attr);
}

void TPUReplicateMetadataOp::step_marker_locationAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(step_marker_locationAttrName(), attr);
}

void TPUReplicateMetadataOp::allow_soft_placementAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(allow_soft_placementAttrName(), attr);
}

void TPUReplicateMetadataOp::use_spmd_for_xla_partitioningAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(use_spmd_for_xla_partitioningAttrName(), attr);
}

void TPUReplicateMetadataOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::IntegerAttr num_replicas, ::mlir::IntegerAttr num_cores_per_replica, ::mlir::StringAttr topology, ::mlir::BoolAttr use_tpu, ::mlir::ArrayAttr device_assignment, ::mlir::ArrayAttr computation_shape, ::mlir::ArrayAttr host_compute_core, ::mlir::ArrayAttr padding_map, ::mlir::StringAttr step_marker_location, ::mlir::BoolAttr allow_soft_placement, ::mlir::BoolAttr use_spmd_for_xla_partitioning) {
  odsState.addAttribute(num_replicasAttrName(odsState.name), num_replicas);
  odsState.addAttribute(num_cores_per_replicaAttrName(odsState.name), num_cores_per_replica);
  odsState.addAttribute(topologyAttrName(odsState.name), topology);
  odsState.addAttribute(use_tpuAttrName(odsState.name), use_tpu);
  odsState.addAttribute(device_assignmentAttrName(odsState.name), device_assignment);
  odsState.addAttribute(computation_shapeAttrName(odsState.name), computation_shape);
  odsState.addAttribute(host_compute_coreAttrName(odsState.name), host_compute_core);
  odsState.addAttribute(padding_mapAttrName(odsState.name), padding_map);
  odsState.addAttribute(step_marker_locationAttrName(odsState.name), step_marker_location);
  odsState.addAttribute(allow_soft_placementAttrName(odsState.name), allow_soft_placement);
  odsState.addAttribute(use_spmd_for_xla_partitioningAttrName(odsState.name), use_spmd_for_xla_partitioning);
}

void TPUReplicateMetadataOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::IntegerAttr num_replicas, ::mlir::IntegerAttr num_cores_per_replica, ::mlir::StringAttr topology, ::mlir::BoolAttr use_tpu, ::mlir::ArrayAttr device_assignment, ::mlir::ArrayAttr computation_shape, ::mlir::ArrayAttr host_compute_core, ::mlir::ArrayAttr padding_map, ::mlir::StringAttr step_marker_location, ::mlir::BoolAttr allow_soft_placement, ::mlir::BoolAttr use_spmd_for_xla_partitioning) {
  odsState.addAttribute(num_replicasAttrName(odsState.name), num_replicas);
  odsState.addAttribute(num_cores_per_replicaAttrName(odsState.name), num_cores_per_replica);
  odsState.addAttribute(topologyAttrName(odsState.name), topology);
  odsState.addAttribute(use_tpuAttrName(odsState.name), use_tpu);
  odsState.addAttribute(device_assignmentAttrName(odsState.name), device_assignment);
  odsState.addAttribute(computation_shapeAttrName(odsState.name), computation_shape);
  odsState.addAttribute(host_compute_coreAttrName(odsState.name), host_compute_core);
  odsState.addAttribute(padding_mapAttrName(odsState.name), padding_map);
  odsState.addAttribute(step_marker_locationAttrName(odsState.name), step_marker_location);
  odsState.addAttribute(allow_soft_placementAttrName(odsState.name), allow_soft_placement);
  odsState.addAttribute(use_spmd_for_xla_partitioningAttrName(odsState.name), use_spmd_for_xla_partitioning);
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void TPUReplicateMetadataOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, uint64_t num_replicas, uint64_t num_cores_per_replica, ::llvm::StringRef topology, bool use_tpu, ::mlir::ArrayAttr device_assignment, ::mlir::ArrayAttr computation_shape, ::mlir::ArrayAttr host_compute_core, ::mlir::ArrayAttr padding_map, ::llvm::StringRef step_marker_location, bool allow_soft_placement, bool use_spmd_for_xla_partitioning) {
  odsState.addAttribute(num_replicasAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), num_replicas));
  odsState.addAttribute(num_cores_per_replicaAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), num_cores_per_replica));
  odsState.addAttribute(topologyAttrName(odsState.name), odsBuilder.getStringAttr(topology));
  odsState.addAttribute(use_tpuAttrName(odsState.name), odsBuilder.getBoolAttr(use_tpu));
  odsState.addAttribute(device_assignmentAttrName(odsState.name), device_assignment);
  odsState.addAttribute(computation_shapeAttrName(odsState.name), computation_shape);
  odsState.addAttribute(host_compute_coreAttrName(odsState.name), host_compute_core);
  odsState.addAttribute(padding_mapAttrName(odsState.name), padding_map);
  odsState.addAttribute(step_marker_locationAttrName(odsState.name), odsBuilder.getStringAttr(step_marker_location));
  odsState.addAttribute(allow_soft_placementAttrName(odsState.name), odsBuilder.getBoolAttr(allow_soft_placement));
  odsState.addAttribute(use_spmd_for_xla_partitioningAttrName(odsState.name), odsBuilder.getBoolAttr(use_spmd_for_xla_partitioning));
}

void TPUReplicateMetadataOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, uint64_t num_replicas, uint64_t num_cores_per_replica, ::llvm::StringRef topology, bool use_tpu, ::mlir::ArrayAttr device_assignment, ::mlir::ArrayAttr computation_shape, ::mlir::ArrayAttr host_compute_core, ::mlir::ArrayAttr padding_map, ::llvm::StringRef step_marker_location, bool allow_soft_placement, bool use_spmd_for_xla_partitioning) {
  odsState.addAttribute(num_replicasAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), num_replicas));
  odsState.addAttribute(num_cores_per_replicaAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), num_cores_per_replica));
  odsState.addAttribute(topologyAttrName(odsState.name), odsBuilder.getStringAttr(topology));
  odsState.addAttribute(use_tpuAttrName(odsState.name), odsBuilder.getBoolAttr(use_tpu));
  odsState.addAttribute(device_assignmentAttrName(odsState.name), device_assignment);
  odsState.addAttribute(computation_shapeAttrName(odsState.name), computation_shape);
  odsState.addAttribute(host_compute_coreAttrName(odsState.name), host_compute_core);
  odsState.addAttribute(padding_mapAttrName(odsState.name), padding_map);
  odsState.addAttribute(step_marker_locationAttrName(odsState.name), odsBuilder.getStringAttr(step_marker_location));
  odsState.addAttribute(allow_soft_placementAttrName(odsState.name), odsBuilder.getBoolAttr(allow_soft_placement));
  odsState.addAttribute(use_spmd_for_xla_partitioningAttrName(odsState.name), odsBuilder.getBoolAttr(use_spmd_for_xla_partitioning));
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void TPUReplicateMetadataOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 0u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 0u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult TPUReplicateMetadataOp::verify() {
  {
    auto tblgen_num_replicas = (*this)->getAttr(num_replicasAttrName());
    if (!tblgen_num_replicas)
      return emitOpError("requires attribute 'num_replicas'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops35(*this, tblgen_num_replicas, "num_replicas")))
      return ::mlir::failure();
  }
  {
    auto tblgen_num_cores_per_replica = (*this)->getAttr(num_cores_per_replicaAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_num_cores_per_replica, "num_cores_per_replica")))
      return ::mlir::failure();
  }
  {
    auto tblgen_topology = (*this)->getAttr(topologyAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_topology, "topology")))
      return ::mlir::failure();
  }
  {
    auto tblgen_use_tpu = (*this)->getAttr(use_tpuAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_use_tpu, "use_tpu")))
      return ::mlir::failure();
  }
  {
    auto tblgen_device_assignment = (*this)->getAttr(device_assignmentAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops13(*this, tblgen_device_assignment, "device_assignment")))
      return ::mlir::failure();
  }
  {
    auto tblgen_computation_shape = (*this)->getAttr(computation_shapeAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops13(*this, tblgen_computation_shape, "computation_shape")))
      return ::mlir::failure();
  }
  {
    auto tblgen_host_compute_core = (*this)->getAttr(host_compute_coreAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops22(*this, tblgen_host_compute_core, "host_compute_core")))
      return ::mlir::failure();
  }
  {
    auto tblgen_padding_map = (*this)->getAttr(padding_mapAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops22(*this, tblgen_padding_map, "padding_map")))
      return ::mlir::failure();
  }
  {
    auto tblgen_step_marker_location = (*this)->getAttr(step_marker_locationAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_step_marker_location, "step_marker_location")))
      return ::mlir::failure();
  }
  {
    auto tblgen_allow_soft_placement = (*this)->getAttr(allow_soft_placementAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_allow_soft_placement, "allow_soft_placement")))
      return ::mlir::failure();
  }
  {
    auto tblgen_use_spmd_for_xla_partitioning = (*this)->getAttr(use_spmd_for_xla_partitioningAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_use_spmd_for_xla_partitioning, "use_spmd_for_xla_partitioning")))
      return ::mlir::failure();
  }
  return ::mlir::success();
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::TPUReplicateMetadataOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::TPUReplicatedInputOp definitions
//===----------------------------------------------------------------------===//

TPUReplicatedInputOpAdaptor::TPUReplicatedInputOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

TPUReplicatedInputOpAdaptor::TPUReplicatedInputOpAdaptor(TPUReplicatedInputOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange TPUReplicatedInputOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> TPUReplicatedInputOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  bool isVariadic[] = {true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (odsOperands.size() - 0) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::ValueRange TPUReplicatedInputOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::ValueRange TPUReplicatedInputOpAdaptor::inputs() {
  return getODSOperands(0);
}

::mlir::DictionaryAttr TPUReplicatedInputOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::BoolAttr TPUReplicatedInputOpAdaptor::is_mirrored_variable() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("is_mirrored_variable").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(false);
  return attr;
}

::mlir::IntegerAttr TPUReplicatedInputOpAdaptor::index() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("index").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), -1);
  return attr;
}

::mlir::BoolAttr TPUReplicatedInputOpAdaptor::is_packed() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("is_packed").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(false);
  return attr;
}

::mlir::LogicalResult TPUReplicatedInputOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_is_mirrored_variable = odsAttrs.get("is_mirrored_variable");
    if (tblgen_is_mirrored_variable && !((tblgen_is_mirrored_variable.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.TPUReplicatedInput' op ""attribute 'is_mirrored_variable' failed to satisfy constraint: bool attribute");
  }
  {
    auto tblgen_index = odsAttrs.get("index");
    if (tblgen_index && !(((tblgen_index.isa<::mlir::IntegerAttr>())) && ((tblgen_index.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.TPUReplicatedInput' op ""attribute 'index' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_is_packed = odsAttrs.get("is_packed");
    if (tblgen_is_packed && !((tblgen_is_packed.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.TPUReplicatedInput' op ""attribute 'is_packed' failed to satisfy constraint: bool attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> TPUReplicatedInputOp::getODSOperandIndexAndLength(unsigned index) {
  bool isVariadic[] = {true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (getOperation()->getNumOperands() - 0) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::Operation::operand_range TPUReplicatedInputOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Operation::operand_range TPUReplicatedInputOp::inputs() {
  return getODSOperands(0);
}

::mlir::MutableOperandRange TPUReplicatedInputOp::inputsMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> TPUReplicatedInputOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range TPUReplicatedInputOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TPUReplicatedInputOp::output() {
  return *getODSResults(0).begin();
}

::mlir::BoolAttr TPUReplicatedInputOp::is_mirrored_variableAttr() {
  return (*this)->getAttr(is_mirrored_variableAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool TPUReplicatedInputOp::is_mirrored_variable() {
  auto attr = is_mirrored_variableAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(false).getValue();
  return attr.getValue();
}

::mlir::IntegerAttr TPUReplicatedInputOp::indexAttr() {
  return (*this)->getAttr(indexAttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t TPUReplicatedInputOp::index() {
  auto attr = indexAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), -1).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

::mlir::BoolAttr TPUReplicatedInputOp::is_packedAttr() {
  return (*this)->getAttr(is_packedAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool TPUReplicatedInputOp::is_packed() {
  auto attr = is_packedAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(false).getValue();
  return attr.getValue();
}

size_t TPUReplicatedInputOp::N() {
  auto range = getODSOperands(0);
return std::distance(range.begin(), range.end());
}

::mlir::Type TPUReplicatedInputOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool TPUReplicatedInputOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "N") return true;
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr TPUReplicatedInputOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {NAttrName(),
odsBuilder.getI64IntegerAttr(N())},
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void TPUReplicatedInputOp::is_mirrored_variableAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(is_mirrored_variableAttrName(), attr);
}

void TPUReplicatedInputOp::indexAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(indexAttrName(), attr);
}

void TPUReplicatedInputOp::is_packedAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(is_packedAttrName(), attr);
}

void TPUReplicatedInputOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::ValueRange inputs, ::mlir::BoolAttr is_mirrored_variable, ::mlir::IntegerAttr index, ::mlir::BoolAttr is_packed) {
  odsState.addOperands(inputs);
  odsState.addAttribute(is_mirrored_variableAttrName(odsState.name), is_mirrored_variable);
  odsState.addAttribute(indexAttrName(odsState.name), index);
  odsState.addAttribute(is_packedAttrName(odsState.name), is_packed);
  odsState.addTypes(output);
}

void TPUReplicatedInputOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange inputs, ::mlir::BoolAttr is_mirrored_variable, ::mlir::IntegerAttr index, ::mlir::BoolAttr is_packed) {
  odsState.addOperands(inputs);
  odsState.addAttribute(is_mirrored_variableAttrName(odsState.name), is_mirrored_variable);
  odsState.addAttribute(indexAttrName(odsState.name), index);
  odsState.addAttribute(is_packedAttrName(odsState.name), is_packed);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void TPUReplicatedInputOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::ValueRange inputs, bool is_mirrored_variable, uint64_t index, bool is_packed) {
  odsState.addOperands(inputs);
  odsState.addAttribute(is_mirrored_variableAttrName(odsState.name), odsBuilder.getBoolAttr(is_mirrored_variable));
  odsState.addAttribute(indexAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), index));
  odsState.addAttribute(is_packedAttrName(odsState.name), odsBuilder.getBoolAttr(is_packed));
  odsState.addTypes(output);
}

void TPUReplicatedInputOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange inputs, bool is_mirrored_variable, uint64_t index, bool is_packed) {
  odsState.addOperands(inputs);
  odsState.addAttribute(is_mirrored_variableAttrName(odsState.name), odsBuilder.getBoolAttr(is_mirrored_variable));
  odsState.addAttribute(indexAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), index));
  odsState.addAttribute(is_packedAttrName(odsState.name), odsBuilder.getBoolAttr(is_packed));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void TPUReplicatedInputOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult TPUReplicatedInputOp::verify() {
  {
    auto tblgen_is_mirrored_variable = (*this)->getAttr(is_mirrored_variableAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_is_mirrored_variable, "is_mirrored_variable")))
      return ::mlir::failure();
  }
  {
    auto tblgen_index = (*this)->getAttr(indexAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_index, "index")))
      return ::mlir::failure();
  }
  {
    auto tblgen_is_packed = (*this)->getAttr(is_packedAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_is_packed, "is_packed")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void TPUReplicatedInputOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::TPUReplicatedInputOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::TPUReplicatedOutputOp definitions
//===----------------------------------------------------------------------===//

TPUReplicatedOutputOpAdaptor::TPUReplicatedOutputOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

TPUReplicatedOutputOpAdaptor::TPUReplicatedOutputOpAdaptor(TPUReplicatedOutputOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange TPUReplicatedOutputOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> TPUReplicatedOutputOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange TPUReplicatedOutputOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TPUReplicatedOutputOpAdaptor::input() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr TPUReplicatedOutputOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult TPUReplicatedOutputOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> TPUReplicatedOutputOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range TPUReplicatedOutputOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TPUReplicatedOutputOp::input() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange TPUReplicatedOutputOp::inputMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> TPUReplicatedOutputOp::getODSResultIndexAndLength(unsigned index) {
  bool isVariadic[] = {true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (getOperation()->getNumResults() - 0) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::Operation::result_range TPUReplicatedOutputOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Operation::result_range TPUReplicatedOutputOp::outputs() {
  return getODSResults(0);
}

::mlir::Type TPUReplicatedOutputOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

size_t TPUReplicatedOutputOp::num_replicas() {
  auto range = getODSResults(0);
return std::distance(range.begin(), range.end());
}

bool TPUReplicatedOutputOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
  if (name == "num_replicas") return true;
 return false;
}

::mlir::DictionaryAttr TPUReplicatedOutputOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())},
    {num_replicasAttrName(),
odsBuilder.getI64IntegerAttr(num_replicas())}});
}

void TPUReplicatedOutputOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange outputs, ::mlir::Value input) {
  odsState.addOperands(input);
  odsState.addTypes(outputs);
}

void TPUReplicatedOutputOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult TPUReplicatedOutputOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void TPUReplicatedOutputOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::TPUReplicatedOutputOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::TPUReshardVariablesOp definitions
//===----------------------------------------------------------------------===//

TPUReshardVariablesOpAdaptor::TPUReshardVariablesOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

TPUReshardVariablesOpAdaptor::TPUReshardVariablesOpAdaptor(TPUReshardVariablesOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange TPUReshardVariablesOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> TPUReshardVariablesOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  bool isVariadic[] = {true, false, false};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (odsOperands.size() - 2) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::ValueRange TPUReshardVariablesOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::ValueRange TPUReshardVariablesOpAdaptor::vars() {
  return getODSOperands(0);
}

::mlir::Value TPUReshardVariablesOpAdaptor::new_format_key() {
  return *getODSOperands(1).begin();
}

::mlir::Value TPUReshardVariablesOpAdaptor::format_state_var() {
  return *getODSOperands(2).begin();
}

::mlir::DictionaryAttr TPUReshardVariablesOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult TPUReshardVariablesOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> TPUReshardVariablesOp::getODSOperandIndexAndLength(unsigned index) {
  bool isVariadic[] = {true, false, false};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (getOperation()->getNumOperands() - 2) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::Operation::operand_range TPUReshardVariablesOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Operation::operand_range TPUReshardVariablesOp::vars() {
  return getODSOperands(0);
}

::mlir::Value TPUReshardVariablesOp::new_format_key() {
  return *getODSOperands(1).begin();
}

::mlir::Value TPUReshardVariablesOp::format_state_var() {
  return *getODSOperands(2).begin();
}

::mlir::MutableOperandRange TPUReshardVariablesOp::varsMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange TPUReshardVariablesOp::new_format_keyMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange TPUReshardVariablesOp::format_state_varMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> TPUReshardVariablesOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range TPUReshardVariablesOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

size_t TPUReshardVariablesOp::N() {
  auto range = getODSOperands(0);
return std::distance(range.begin(), range.end());
}

bool TPUReshardVariablesOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "N") return true;
 return false;
}

::mlir::DictionaryAttr TPUReshardVariablesOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {NAttrName(),
odsBuilder.getI64IntegerAttr(N())}});
}

void TPUReshardVariablesOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange vars, ::mlir::Value new_format_key, ::mlir::Value format_state_var) {
  odsState.addOperands(vars);
  odsState.addOperands(new_format_key);
  odsState.addOperands(format_state_var);
}

void TPUReshardVariablesOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange vars, ::mlir::Value new_format_key, ::mlir::Value format_state_var) {
  odsState.addOperands(vars);
  odsState.addOperands(new_format_key);
  odsState.addOperands(format_state_var);
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void TPUReshardVariablesOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() >= 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 0u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult TPUReshardVariablesOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops19(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void TPUReshardVariablesOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  for (::mlir::Value value : getODSOperands(0))
    effects.emplace_back(::mlir::MemoryEffects::Read::get(), value, ::mlir::TF::ResourceEffects::Variable::get());
  for (::mlir::Value value : getODSOperands(0))
    effects.emplace_back(::mlir::MemoryEffects::Write::get(), value, ::mlir::TF::ResourceEffects::Variable::get());
  for (::mlir::Value value : getODSOperands(2))
    effects.emplace_back(::mlir::MemoryEffects::Read::get(), value, ::mlir::TF::ResourceEffects::Variable::get());
  for (::mlir::Value value : getODSOperands(2))
    effects.emplace_back(::mlir::MemoryEffects::Write::get(), value, ::mlir::TF::ResourceEffects::Variable::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::TPUReshardVariablesOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::TPURoundRobinOp definitions
//===----------------------------------------------------------------------===//

TPURoundRobinOpAdaptor::TPURoundRobinOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

TPURoundRobinOpAdaptor::TPURoundRobinOpAdaptor(TPURoundRobinOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange TPURoundRobinOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> TPURoundRobinOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange TPURoundRobinOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::DictionaryAttr TPURoundRobinOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult TPURoundRobinOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> TPURoundRobinOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range TPURoundRobinOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

std::pair<unsigned, unsigned> TPURoundRobinOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range TPURoundRobinOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TPURoundRobinOp::device_ordinal() {
  return *getODSResults(0).begin();
}

void TPURoundRobinOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type device_ordinal) {
  odsState.addTypes(device_ordinal);
}

void TPURoundRobinOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes) {
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void TPURoundRobinOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 0u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult TPURoundRobinOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops11(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::TPURoundRobinOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::TakeDatasetOp definitions
//===----------------------------------------------------------------------===//

TakeDatasetOpAdaptor::TakeDatasetOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

TakeDatasetOpAdaptor::TakeDatasetOpAdaptor(TakeDatasetOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange TakeDatasetOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> TakeDatasetOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange TakeDatasetOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TakeDatasetOpAdaptor::input_dataset() {
  return *getODSOperands(0).begin();
}

::mlir::Value TakeDatasetOpAdaptor::count() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr TakeDatasetOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::ArrayAttr TakeDatasetOpAdaptor::output_types() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("output_types").cast<::mlir::ArrayAttr>();
  return attr;
}

::mlir::ArrayAttr TakeDatasetOpAdaptor::output_shapes() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("output_shapes").cast<::mlir::ArrayAttr>();
  return attr;
}

::mlir::StringAttr TakeDatasetOpAdaptor::metadata() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("metadata").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("");
  return attr;
}

::mlir::LogicalResult TakeDatasetOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_output_types = odsAttrs.get("output_types");
    if (!tblgen_output_types)
      return emitError(loc, "'tf.TakeDataset' op ""requires attribute 'output_types'");

    if (tblgen_output_types && !((((tblgen_output_types.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_output_types.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return ((attr.isa<::mlir::TypeAttr>())) && ((attr.cast<::mlir::TypeAttr>().getValue().isa<::mlir::Type>())); }))) && ((tblgen_output_types.cast<::mlir::ArrayAttr>().size() >= 1))))
      return emitError(loc, "'tf.TakeDataset' op ""attribute 'output_types' failed to satisfy constraint: type array attribute with at least 1 elements");
  }
  {
    auto tblgen_output_shapes = odsAttrs.get("output_shapes");
    if (!tblgen_output_shapes)
      return emitError(loc, "'tf.TakeDataset' op ""requires attribute 'output_shapes'");

    if (tblgen_output_shapes && !((((tblgen_output_shapes.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_output_shapes.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return (attr.isa<mlir::TF::ShapeAttr>()); }))) && ((tblgen_output_shapes.cast<::mlir::ArrayAttr>().size() >= 1))))
      return emitError(loc, "'tf.TakeDataset' op ""attribute 'output_shapes' failed to satisfy constraint: tensorflow shape attribute array with at least 1 elements");
  }
  {
    auto tblgen_metadata = odsAttrs.get("metadata");
    if (tblgen_metadata && !((tblgen_metadata.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.TakeDataset' op ""attribute 'metadata' failed to satisfy constraint: string attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> TakeDatasetOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range TakeDatasetOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TakeDatasetOp::input_dataset() {
  return *getODSOperands(0).begin();
}

::mlir::Value TakeDatasetOp::count() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange TakeDatasetOp::input_datasetMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange TakeDatasetOp::countMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> TakeDatasetOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range TakeDatasetOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TakeDatasetOp::handle() {
  return *getODSResults(0).begin();
}

::mlir::ArrayAttr TakeDatasetOp::output_typesAttr() {
  return (*this)->getAttr(output_typesAttrName()).cast<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr TakeDatasetOp::output_types() {
  auto attr = output_typesAttr();
  return attr;
}

::mlir::ArrayAttr TakeDatasetOp::output_shapesAttr() {
  return (*this)->getAttr(output_shapesAttrName()).cast<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr TakeDatasetOp::output_shapes() {
  auto attr = output_shapesAttr();
  return attr;
}

::mlir::StringAttr TakeDatasetOp::metadataAttr() {
  return (*this)->getAttr(metadataAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef TakeDatasetOp::metadata() {
  auto attr = metadataAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("").getValue();
  return attr.getValue();
}

void TakeDatasetOp::output_typesAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(output_typesAttrName(), attr);
}

void TakeDatasetOp::output_shapesAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(output_shapesAttrName(), attr);
}

void TakeDatasetOp::metadataAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(metadataAttrName(), attr);
}

void TakeDatasetOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type handle, ::mlir::Value input_dataset, ::mlir::Value count, ::mlir::ArrayAttr output_types, ::mlir::ArrayAttr output_shapes, ::mlir::StringAttr metadata) {
  odsState.addOperands(input_dataset);
  odsState.addOperands(count);
  odsState.addAttribute(output_typesAttrName(odsState.name), output_types);
  odsState.addAttribute(output_shapesAttrName(odsState.name), output_shapes);
  odsState.addAttribute(metadataAttrName(odsState.name), metadata);
  odsState.addTypes(handle);
}

void TakeDatasetOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input_dataset, ::mlir::Value count, ::mlir::ArrayAttr output_types, ::mlir::ArrayAttr output_shapes, ::mlir::StringAttr metadata) {
  odsState.addOperands(input_dataset);
  odsState.addOperands(count);
  odsState.addAttribute(output_typesAttrName(odsState.name), output_types);
  odsState.addAttribute(output_shapesAttrName(odsState.name), output_shapes);
  odsState.addAttribute(metadataAttrName(odsState.name), metadata);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void TakeDatasetOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type handle, ::mlir::Value input_dataset, ::mlir::Value count, ::mlir::ArrayAttr output_types, ::mlir::ArrayAttr output_shapes, ::llvm::StringRef metadata) {
  odsState.addOperands(input_dataset);
  odsState.addOperands(count);
  odsState.addAttribute(output_typesAttrName(odsState.name), output_types);
  odsState.addAttribute(output_shapesAttrName(odsState.name), output_shapes);
  odsState.addAttribute(metadataAttrName(odsState.name), odsBuilder.getStringAttr(metadata));
  odsState.addTypes(handle);
}

void TakeDatasetOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input_dataset, ::mlir::Value count, ::mlir::ArrayAttr output_types, ::mlir::ArrayAttr output_shapes, ::llvm::StringRef metadata) {
  odsState.addOperands(input_dataset);
  odsState.addOperands(count);
  odsState.addAttribute(output_typesAttrName(odsState.name), output_types);
  odsState.addAttribute(output_shapesAttrName(odsState.name), output_shapes);
  odsState.addAttribute(metadataAttrName(odsState.name), odsBuilder.getStringAttr(metadata));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void TakeDatasetOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult TakeDatasetOp::verify() {
  {
    auto tblgen_output_types = (*this)->getAttr(output_typesAttrName());
    if (!tblgen_output_types)
      return emitOpError("requires attribute 'output_types'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops2(*this, tblgen_output_types, "output_types")))
      return ::mlir::failure();
  }
  {
    auto tblgen_output_shapes = (*this)->getAttr(output_shapesAttrName());
    if (!tblgen_output_shapes)
      return emitOpError("requires attribute 'output_shapes'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops3(*this, tblgen_output_shapes, "output_shapes")))
      return ::mlir::failure();
  }
  {
    auto tblgen_metadata = (*this)->getAttr(metadataAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_metadata, "metadata")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops15(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops16(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops15(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void TakeDatasetOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::TakeDatasetOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::TakeWhileDatasetOp definitions
//===----------------------------------------------------------------------===//

TakeWhileDatasetOpAdaptor::TakeWhileDatasetOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

TakeWhileDatasetOpAdaptor::TakeWhileDatasetOpAdaptor(TakeWhileDatasetOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange TakeWhileDatasetOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> TakeWhileDatasetOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  bool isVariadic[] = {false, true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (odsOperands.size() - 1) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::ValueRange TakeWhileDatasetOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TakeWhileDatasetOpAdaptor::input_dataset() {
  return *getODSOperands(0).begin();
}

::mlir::ValueRange TakeWhileDatasetOpAdaptor::other_arguments() {
  return getODSOperands(1);
}

::mlir::DictionaryAttr TakeWhileDatasetOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::SymbolRefAttr TakeWhileDatasetOpAdaptor::predicate() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::SymbolRefAttr attr = odsAttrs.get("predicate").cast<::mlir::SymbolRefAttr>();
  return attr;
}

::mlir::ArrayAttr TakeWhileDatasetOpAdaptor::output_types() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("output_types").cast<::mlir::ArrayAttr>();
  return attr;
}

::mlir::ArrayAttr TakeWhileDatasetOpAdaptor::output_shapes() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("output_shapes").cast<::mlir::ArrayAttr>();
  return attr;
}

::mlir::StringAttr TakeWhileDatasetOpAdaptor::metadata() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("metadata").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("");
  return attr;
}

::mlir::LogicalResult TakeWhileDatasetOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_predicate = odsAttrs.get("predicate");
    if (!tblgen_predicate)
      return emitError(loc, "'tf.TakeWhileDataset' op ""requires attribute 'predicate'");

    if (tblgen_predicate && !((tblgen_predicate.isa<::mlir::SymbolRefAttr>())))
      return emitError(loc, "'tf.TakeWhileDataset' op ""attribute 'predicate' failed to satisfy constraint: symbol reference attribute");
  }
  {
    auto tblgen_output_types = odsAttrs.get("output_types");
    if (!tblgen_output_types)
      return emitError(loc, "'tf.TakeWhileDataset' op ""requires attribute 'output_types'");

    if (tblgen_output_types && !((((tblgen_output_types.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_output_types.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return ((attr.isa<::mlir::TypeAttr>())) && ((attr.cast<::mlir::TypeAttr>().getValue().isa<::mlir::Type>())); }))) && ((tblgen_output_types.cast<::mlir::ArrayAttr>().size() >= 1))))
      return emitError(loc, "'tf.TakeWhileDataset' op ""attribute 'output_types' failed to satisfy constraint: type array attribute with at least 1 elements");
  }
  {
    auto tblgen_output_shapes = odsAttrs.get("output_shapes");
    if (!tblgen_output_shapes)
      return emitError(loc, "'tf.TakeWhileDataset' op ""requires attribute 'output_shapes'");

    if (tblgen_output_shapes && !((((tblgen_output_shapes.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_output_shapes.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return (attr.isa<mlir::TF::ShapeAttr>()); }))) && ((tblgen_output_shapes.cast<::mlir::ArrayAttr>().size() >= 1))))
      return emitError(loc, "'tf.TakeWhileDataset' op ""attribute 'output_shapes' failed to satisfy constraint: tensorflow shape attribute array with at least 1 elements");
  }
  {
    auto tblgen_metadata = odsAttrs.get("metadata");
    if (tblgen_metadata && !((tblgen_metadata.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.TakeWhileDataset' op ""attribute 'metadata' failed to satisfy constraint: string attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> TakeWhileDatasetOp::getODSOperandIndexAndLength(unsigned index) {
  bool isVariadic[] = {false, true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (getOperation()->getNumOperands() - 1) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::Operation::operand_range TakeWhileDatasetOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TakeWhileDatasetOp::input_dataset() {
  return *getODSOperands(0).begin();
}

::mlir::Operation::operand_range TakeWhileDatasetOp::other_arguments() {
  return getODSOperands(1);
}

::mlir::MutableOperandRange TakeWhileDatasetOp::input_datasetMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange TakeWhileDatasetOp::other_argumentsMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> TakeWhileDatasetOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range TakeWhileDatasetOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TakeWhileDatasetOp::handle() {
  return *getODSResults(0).begin();
}

::mlir::SymbolRefAttr TakeWhileDatasetOp::predicateAttr() {
  return (*this)->getAttr(predicateAttrName()).cast<::mlir::SymbolRefAttr>();
}

::mlir::SymbolRefAttr TakeWhileDatasetOp::predicate() {
  auto attr = predicateAttr();
  return attr;
}

::mlir::ArrayAttr TakeWhileDatasetOp::output_typesAttr() {
  return (*this)->getAttr(output_typesAttrName()).cast<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr TakeWhileDatasetOp::output_types() {
  auto attr = output_typesAttr();
  return attr;
}

::mlir::ArrayAttr TakeWhileDatasetOp::output_shapesAttr() {
  return (*this)->getAttr(output_shapesAttrName()).cast<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr TakeWhileDatasetOp::output_shapes() {
  auto attr = output_shapesAttr();
  return attr;
}

::mlir::StringAttr TakeWhileDatasetOp::metadataAttr() {
  return (*this)->getAttr(metadataAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef TakeWhileDatasetOp::metadata() {
  auto attr = metadataAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("").getValue();
  return attr.getValue();
}

mlir::OperandElementTypeRange TakeWhileDatasetOp::Targuments() {
  auto values = getODSOperands(1);
return {mlir::OperandElementTypeIterator(values.begin()), mlir::OperandElementTypeIterator(values.end())};
}

bool TakeWhileDatasetOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "Targuments") return true;
 return false;
}

::mlir::DictionaryAttr TakeWhileDatasetOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TargumentsAttrName(),
ArrayAttr::get(ctx, 
    [&]() {
      llvm::SmallVector<Attribute, 4> ret;
      for (auto t : Targuments())
        ret.push_back(TypeAttr::get(t));
      return ret;
    }())}});
}

void TakeWhileDatasetOp::predicateAttr(::mlir::SymbolRefAttr attr) {
  (*this)->setAttr(predicateAttrName(), attr);
}

void TakeWhileDatasetOp::output_typesAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(output_typesAttrName(), attr);
}

void TakeWhileDatasetOp::output_shapesAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(output_shapesAttrName(), attr);
}

void TakeWhileDatasetOp::metadataAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(metadataAttrName(), attr);
}

void TakeWhileDatasetOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type handle, ::mlir::Value input_dataset, ::mlir::ValueRange other_arguments, ::mlir::SymbolRefAttr predicate, ::mlir::ArrayAttr output_types, ::mlir::ArrayAttr output_shapes, ::mlir::StringAttr metadata) {
  odsState.addOperands(input_dataset);
  odsState.addOperands(other_arguments);
  odsState.addAttribute(predicateAttrName(odsState.name), predicate);
  odsState.addAttribute(output_typesAttrName(odsState.name), output_types);
  odsState.addAttribute(output_shapesAttrName(odsState.name), output_shapes);
  odsState.addAttribute(metadataAttrName(odsState.name), metadata);
  odsState.addTypes(handle);
}

void TakeWhileDatasetOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input_dataset, ::mlir::ValueRange other_arguments, ::mlir::SymbolRefAttr predicate, ::mlir::ArrayAttr output_types, ::mlir::ArrayAttr output_shapes, ::mlir::StringAttr metadata) {
  odsState.addOperands(input_dataset);
  odsState.addOperands(other_arguments);
  odsState.addAttribute(predicateAttrName(odsState.name), predicate);
  odsState.addAttribute(output_typesAttrName(odsState.name), output_types);
  odsState.addAttribute(output_shapesAttrName(odsState.name), output_shapes);
  odsState.addAttribute(metadataAttrName(odsState.name), metadata);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void TakeWhileDatasetOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type handle, ::mlir::Value input_dataset, ::mlir::ValueRange other_arguments, ::mlir::SymbolRefAttr predicate, ::mlir::ArrayAttr output_types, ::mlir::ArrayAttr output_shapes, ::llvm::StringRef metadata) {
  odsState.addOperands(input_dataset);
  odsState.addOperands(other_arguments);
  odsState.addAttribute(predicateAttrName(odsState.name), predicate);
  odsState.addAttribute(output_typesAttrName(odsState.name), output_types);
  odsState.addAttribute(output_shapesAttrName(odsState.name), output_shapes);
  odsState.addAttribute(metadataAttrName(odsState.name), odsBuilder.getStringAttr(metadata));
  odsState.addTypes(handle);
}

void TakeWhileDatasetOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input_dataset, ::mlir::ValueRange other_arguments, ::mlir::SymbolRefAttr predicate, ::mlir::ArrayAttr output_types, ::mlir::ArrayAttr output_shapes, ::llvm::StringRef metadata) {
  odsState.addOperands(input_dataset);
  odsState.addOperands(other_arguments);
  odsState.addAttribute(predicateAttrName(odsState.name), predicate);
  odsState.addAttribute(output_typesAttrName(odsState.name), output_types);
  odsState.addAttribute(output_shapesAttrName(odsState.name), output_shapes);
  odsState.addAttribute(metadataAttrName(odsState.name), odsBuilder.getStringAttr(metadata));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void TakeWhileDatasetOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() >= 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult TakeWhileDatasetOp::verify() {
  {
    auto tblgen_predicate = (*this)->getAttr(predicateAttrName());
    if (!tblgen_predicate)
      return emitOpError("requires attribute 'predicate'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops12(*this, tblgen_predicate, "predicate")))
      return ::mlir::failure();
  }
  {
    auto tblgen_output_types = (*this)->getAttr(output_typesAttrName());
    if (!tblgen_output_types)
      return emitOpError("requires attribute 'output_types'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops2(*this, tblgen_output_types, "output_types")))
      return ::mlir::failure();
  }
  {
    auto tblgen_output_shapes = (*this)->getAttr(output_shapesAttrName());
    if (!tblgen_output_shapes)
      return emitOpError("requires attribute 'output_shapes'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops3(*this, tblgen_output_shapes, "output_shapes")))
      return ::mlir::failure();
  }
  {
    auto tblgen_metadata = (*this)->getAttr(metadataAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_metadata, "metadata")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops15(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops15(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::TakeWhileDatasetOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::TanOp definitions
//===----------------------------------------------------------------------===//

TanOpAdaptor::TanOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

TanOpAdaptor::TanOpAdaptor(TanOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange TanOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> TanOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange TanOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TanOpAdaptor::x() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr TanOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult TanOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> TanOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range TanOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TanOp::x() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange TanOp::xMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> TanOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range TanOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TanOp::y() {
  return *getODSResults(0).begin();
}

::mlir::Type TanOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool TanOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr TanOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void TanOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type y, ::mlir::Value x) {
  odsState.addOperands(x);
  odsState.addTypes(y);
}

void TanOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value x) {
  odsState.addOperands(x);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void TanOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult TanOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops1(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops1(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void TanOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::TanOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::TanhGradOp definitions
//===----------------------------------------------------------------------===//

TanhGradOpAdaptor::TanhGradOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

TanhGradOpAdaptor::TanhGradOpAdaptor(TanhGradOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange TanhGradOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> TanhGradOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange TanhGradOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TanhGradOpAdaptor::y() {
  return *getODSOperands(0).begin();
}

::mlir::Value TanhGradOpAdaptor::dy() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr TanhGradOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult TanhGradOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> TanhGradOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range TanhGradOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TanhGradOp::y() {
  return *getODSOperands(0).begin();
}

::mlir::Value TanhGradOp::dy() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange TanhGradOp::yMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange TanhGradOp::dyMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> TanhGradOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range TanhGradOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TanhGradOp::z() {
  return *getODSResults(0).begin();
}

::mlir::Type TanhGradOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool TanhGradOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr TanhGradOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void TanhGradOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type z, ::mlir::Value y, ::mlir::Value dy) {
  odsState.addOperands(y);
  odsState.addOperands(dy);
  odsState.addTypes(z);
}

void TanhGradOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value y, ::mlir::Value dy) {
  odsState.addOperands(y);
  odsState.addOperands(dy);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void TanhGradOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult TanhGradOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops2(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops2(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops2(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void TanhGradOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::TanhGradOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::TanhOp definitions
//===----------------------------------------------------------------------===//

TanhOpAdaptor::TanhOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

TanhOpAdaptor::TanhOpAdaptor(TanhOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange TanhOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> TanhOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange TanhOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TanhOpAdaptor::x() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr TanhOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult TanhOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> TanhOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range TanhOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TanhOp::x() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange TanhOp::xMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> TanhOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range TanhOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TanhOp::y() {
  return *getODSResults(0).begin();
}

::mlir::Type TanhOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool TanhOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr TanhOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void TanhOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type y, ::mlir::Value x) {
  odsState.addOperands(x);
  odsState.addTypes(y);
}

void TanhOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value x) {
  odsState.addOperands(x);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void TanhOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult TanhOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops2(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops2(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void TanhOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::TanhOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::TensorArrayCloseV3Op definitions
//===----------------------------------------------------------------------===//

TensorArrayCloseV3OpAdaptor::TensorArrayCloseV3OpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

TensorArrayCloseV3OpAdaptor::TensorArrayCloseV3OpAdaptor(TensorArrayCloseV3Op &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange TensorArrayCloseV3OpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> TensorArrayCloseV3OpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange TensorArrayCloseV3OpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TensorArrayCloseV3OpAdaptor::handle() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr TensorArrayCloseV3OpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult TensorArrayCloseV3OpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> TensorArrayCloseV3Op::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range TensorArrayCloseV3Op::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TensorArrayCloseV3Op::handle() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange TensorArrayCloseV3Op::handleMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> TensorArrayCloseV3Op::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range TensorArrayCloseV3Op::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

void TensorArrayCloseV3Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value handle) {
  odsState.addOperands(handle);
}

void TensorArrayCloseV3Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value handle) {
  odsState.addOperands(handle);
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void TensorArrayCloseV3Op::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 0u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult TensorArrayCloseV3Op::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void TensorArrayCloseV3Op::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  for (::mlir::Value value : getODSOperands(0))
    effects.emplace_back(::mlir::MemoryEffects::Free::get(), value, ::mlir::TF::ResourceEffects::TensorArray::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::TensorArrayCloseV3Op)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::TensorArrayConcatV3Op definitions
//===----------------------------------------------------------------------===//

TensorArrayConcatV3OpAdaptor::TensorArrayConcatV3OpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

TensorArrayConcatV3OpAdaptor::TensorArrayConcatV3OpAdaptor(TensorArrayConcatV3Op &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange TensorArrayConcatV3OpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> TensorArrayConcatV3OpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange TensorArrayConcatV3OpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TensorArrayConcatV3OpAdaptor::handle() {
  return *getODSOperands(0).begin();
}

::mlir::Value TensorArrayConcatV3OpAdaptor::flow_in() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr TensorArrayConcatV3OpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::Attribute TensorArrayConcatV3OpAdaptor::element_shape_except0() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::Attribute attr = odsAttrs.get("element_shape_except0").dyn_cast_or_null<::mlir::Attribute>();
  if (!attr)
    attr = mlir::TF::ShapeAttr::get(::mlir::Builder(odsAttrs.getContext()).getContext(), llvm::None);
  return attr;
}

::mlir::LogicalResult TensorArrayConcatV3OpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_element_shape_except0 = odsAttrs.get("element_shape_except0");
    if (tblgen_element_shape_except0 && !((tblgen_element_shape_except0.isa<mlir::TF::ShapeAttr>())))
      return emitError(loc, "'tf.TensorArrayConcatV3' op ""attribute 'element_shape_except0' failed to satisfy constraint: TensorFlow shape attribute");
  }
  return ::mlir::success();
}

void TensorArrayConcatV3Op::getAsmResultNames(::mlir::OpAsmSetValueNameFn setNameFn) {
  auto resultGroup0 = getODSResults(0);
  if (!llvm::empty(resultGroup0))
    setNameFn(*resultGroup0.begin(), "value");
  auto resultGroup1 = getODSResults(1);
  if (!llvm::empty(resultGroup1))
    setNameFn(*resultGroup1.begin(), "lengths");
}

std::pair<unsigned, unsigned> TensorArrayConcatV3Op::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range TensorArrayConcatV3Op::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TensorArrayConcatV3Op::handle() {
  return *getODSOperands(0).begin();
}

::mlir::Value TensorArrayConcatV3Op::flow_in() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange TensorArrayConcatV3Op::handleMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange TensorArrayConcatV3Op::flow_inMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> TensorArrayConcatV3Op::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range TensorArrayConcatV3Op::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TensorArrayConcatV3Op::value() {
  return *getODSResults(0).begin();
}

::mlir::Value TensorArrayConcatV3Op::lengths() {
  return *getODSResults(1).begin();
}

::mlir::Attribute TensorArrayConcatV3Op::element_shape_except0Attr() {
  return (*this)->getAttr(element_shape_except0AttrName()).dyn_cast_or_null<::mlir::Attribute>();
}

llvm::Optional<llvm::ArrayRef<int64_t>> TensorArrayConcatV3Op::element_shape_except0() {
  auto attr = element_shape_except0Attr();
    if (!attr)
      return mlir::TF::ShapeAttr::get(::mlir::Builder((*this)->getContext()).getContext(), llvm::None).cast<mlir::TF::ShapeAttr>().getValue();
  return attr.cast<mlir::TF::ShapeAttr>().getValue();
}

::mlir::Type TensorArrayConcatV3Op::dtype() {
  return mlir::getElementTypeOrSelf(*getODSResults(0).begin());
}

bool TensorArrayConcatV3Op::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "dtype") return true;
 return false;
}

::mlir::DictionaryAttr TensorArrayConcatV3Op::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {dtypeAttrName(),
::mlir::TypeAttr::get(dtype())}});
}

void TensorArrayConcatV3Op::element_shape_except0Attr(::mlir::Attribute attr) {
  (*this)->setAttr(element_shape_except0AttrName(), attr);
}

void TensorArrayConcatV3Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type value, ::mlir::Type lengths, ::mlir::Value handle, ::mlir::Value flow_in, ::mlir::Attribute element_shape_except0) {
  odsState.addOperands(handle);
  odsState.addOperands(flow_in);
  odsState.addAttribute(element_shape_except0AttrName(odsState.name), element_shape_except0);
  odsState.addTypes(value);
  odsState.addTypes(lengths);
}

void TensorArrayConcatV3Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value handle, ::mlir::Value flow_in, ::mlir::Attribute element_shape_except0) {
  odsState.addOperands(handle);
  odsState.addOperands(flow_in);
  odsState.addAttribute(element_shape_except0AttrName(odsState.name), element_shape_except0);
  assert(resultTypes.size() == 2u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void TensorArrayConcatV3Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type value, ::mlir::Type lengths, ::mlir::Value handle, ::mlir::Value flow_in, llvm::Optional<llvm::ArrayRef<int64_t>> element_shape_except0) {
  odsState.addOperands(handle);
  odsState.addOperands(flow_in);
  odsState.addAttribute(element_shape_except0AttrName(odsState.name), mlir::TF::ShapeAttr::get(odsBuilder.getContext(), element_shape_except0));
  odsState.addTypes(value);
  odsState.addTypes(lengths);
}

void TensorArrayConcatV3Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value handle, ::mlir::Value flow_in, llvm::Optional<llvm::ArrayRef<int64_t>> element_shape_except0) {
  odsState.addOperands(handle);
  odsState.addOperands(flow_in);
  odsState.addAttribute(element_shape_except0AttrName(odsState.name), mlir::TF::ShapeAttr::get(odsBuilder.getContext(), element_shape_except0));
  assert(resultTypes.size() == 2u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void TensorArrayConcatV3Op::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 2u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult TensorArrayConcatV3Op::verify() {
  {
    auto tblgen_element_shape_except0 = (*this)->getAttr(element_shape_except0AttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops17(*this, tblgen_element_shape_except0, "element_shape_except0")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSResults(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops16(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void TensorArrayConcatV3Op::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  for (::mlir::Value value : getODSOperands(0))
    effects.emplace_back(::mlir::MemoryEffects::Read::get(), value, ::mlir::TF::ResourceEffects::TensorArray::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::TensorArrayConcatV3Op)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::TensorArrayGatherV3Op definitions
//===----------------------------------------------------------------------===//

TensorArrayGatherV3OpAdaptor::TensorArrayGatherV3OpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

TensorArrayGatherV3OpAdaptor::TensorArrayGatherV3OpAdaptor(TensorArrayGatherV3Op &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange TensorArrayGatherV3OpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> TensorArrayGatherV3OpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange TensorArrayGatherV3OpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TensorArrayGatherV3OpAdaptor::handle() {
  return *getODSOperands(0).begin();
}

::mlir::Value TensorArrayGatherV3OpAdaptor::indices() {
  return *getODSOperands(1).begin();
}

::mlir::Value TensorArrayGatherV3OpAdaptor::flow_in() {
  return *getODSOperands(2).begin();
}

::mlir::DictionaryAttr TensorArrayGatherV3OpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::Attribute TensorArrayGatherV3OpAdaptor::element_shape() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::Attribute attr = odsAttrs.get("element_shape").dyn_cast_or_null<::mlir::Attribute>();
  if (!attr)
    attr = mlir::TF::ShapeAttr::get(::mlir::Builder(odsAttrs.getContext()).getContext(), llvm::None);
  return attr;
}

::mlir::LogicalResult TensorArrayGatherV3OpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_element_shape = odsAttrs.get("element_shape");
    if (tblgen_element_shape && !((tblgen_element_shape.isa<mlir::TF::ShapeAttr>())))
      return emitError(loc, "'tf.TensorArrayGatherV3' op ""attribute 'element_shape' failed to satisfy constraint: TensorFlow shape attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> TensorArrayGatherV3Op::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range TensorArrayGatherV3Op::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TensorArrayGatherV3Op::handle() {
  return *getODSOperands(0).begin();
}

::mlir::Value TensorArrayGatherV3Op::indices() {
  return *getODSOperands(1).begin();
}

::mlir::Value TensorArrayGatherV3Op::flow_in() {
  return *getODSOperands(2).begin();
}

::mlir::MutableOperandRange TensorArrayGatherV3Op::handleMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange TensorArrayGatherV3Op::indicesMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange TensorArrayGatherV3Op::flow_inMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> TensorArrayGatherV3Op::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range TensorArrayGatherV3Op::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TensorArrayGatherV3Op::value() {
  return *getODSResults(0).begin();
}

::mlir::Attribute TensorArrayGatherV3Op::element_shapeAttr() {
  return (*this)->getAttr(element_shapeAttrName()).dyn_cast_or_null<::mlir::Attribute>();
}

llvm::Optional<llvm::ArrayRef<int64_t>> TensorArrayGatherV3Op::element_shape() {
  auto attr = element_shapeAttr();
    if (!attr)
      return mlir::TF::ShapeAttr::get(::mlir::Builder((*this)->getContext()).getContext(), llvm::None).cast<mlir::TF::ShapeAttr>().getValue();
  return attr.cast<mlir::TF::ShapeAttr>().getValue();
}

::mlir::Type TensorArrayGatherV3Op::dtype() {
  return mlir::getElementTypeOrSelf(*getODSResults(0).begin());
}

bool TensorArrayGatherV3Op::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "dtype") return true;
 return false;
}

::mlir::DictionaryAttr TensorArrayGatherV3Op::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {dtypeAttrName(),
::mlir::TypeAttr::get(dtype())}});
}

void TensorArrayGatherV3Op::element_shapeAttr(::mlir::Attribute attr) {
  (*this)->setAttr(element_shapeAttrName(), attr);
}

void TensorArrayGatherV3Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type value, ::mlir::Value handle, ::mlir::Value indices, ::mlir::Value flow_in, ::mlir::Attribute element_shape) {
  odsState.addOperands(handle);
  odsState.addOperands(indices);
  odsState.addOperands(flow_in);
  odsState.addAttribute(element_shapeAttrName(odsState.name), element_shape);
  odsState.addTypes(value);
}

void TensorArrayGatherV3Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value handle, ::mlir::Value indices, ::mlir::Value flow_in, ::mlir::Attribute element_shape) {
  odsState.addOperands(handle);
  odsState.addOperands(indices);
  odsState.addOperands(flow_in);
  odsState.addAttribute(element_shapeAttrName(odsState.name), element_shape);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void TensorArrayGatherV3Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type value, ::mlir::Value handle, ::mlir::Value indices, ::mlir::Value flow_in, llvm::Optional<llvm::ArrayRef<int64_t>> element_shape) {
  odsState.addOperands(handle);
  odsState.addOperands(indices);
  odsState.addOperands(flow_in);
  odsState.addAttribute(element_shapeAttrName(odsState.name), mlir::TF::ShapeAttr::get(odsBuilder.getContext(), element_shape));
  odsState.addTypes(value);
}

void TensorArrayGatherV3Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value handle, ::mlir::Value indices, ::mlir::Value flow_in, llvm::Optional<llvm::ArrayRef<int64_t>> element_shape) {
  odsState.addOperands(handle);
  odsState.addOperands(indices);
  odsState.addOperands(flow_in);
  odsState.addAttribute(element_shapeAttrName(odsState.name), mlir::TF::ShapeAttr::get(odsBuilder.getContext(), element_shape));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void TensorArrayGatherV3Op::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 3u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult TensorArrayGatherV3Op::verify() {
  {
    auto tblgen_element_shape = (*this)->getAttr(element_shapeAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops17(*this, tblgen_element_shape, "element_shape")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops11(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void TensorArrayGatherV3Op::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  for (::mlir::Value value : getODSOperands(0))
    effects.emplace_back(::mlir::MemoryEffects::Read::get(), value, ::mlir::TF::ResourceEffects::TensorArray::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::TensorArrayGatherV3Op)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::TensorArrayGradV3Op definitions
//===----------------------------------------------------------------------===//

TensorArrayGradV3OpAdaptor::TensorArrayGradV3OpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

TensorArrayGradV3OpAdaptor::TensorArrayGradV3OpAdaptor(TensorArrayGradV3Op &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange TensorArrayGradV3OpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> TensorArrayGradV3OpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange TensorArrayGradV3OpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TensorArrayGradV3OpAdaptor::handle() {
  return *getODSOperands(0).begin();
}

::mlir::Value TensorArrayGradV3OpAdaptor::flow_in() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr TensorArrayGradV3OpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::StringAttr TensorArrayGradV3OpAdaptor::source() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("source").cast<::mlir::StringAttr>();
  return attr;
}

::mlir::LogicalResult TensorArrayGradV3OpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_source = odsAttrs.get("source");
    if (!tblgen_source)
      return emitError(loc, "'tf.TensorArrayGradV3' op ""requires attribute 'source'");

    if (tblgen_source && !((tblgen_source.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.TensorArrayGradV3' op ""attribute 'source' failed to satisfy constraint: string attribute");
  }
  return ::mlir::success();
}

void TensorArrayGradV3Op::getAsmResultNames(::mlir::OpAsmSetValueNameFn setNameFn) {
  auto resultGroup0 = getODSResults(0);
  if (!llvm::empty(resultGroup0))
    setNameFn(*resultGroup0.begin(), "grad_handle");
  auto resultGroup1 = getODSResults(1);
  if (!llvm::empty(resultGroup1))
    setNameFn(*resultGroup1.begin(), "flow_out");
}

std::pair<unsigned, unsigned> TensorArrayGradV3Op::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range TensorArrayGradV3Op::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TensorArrayGradV3Op::handle() {
  return *getODSOperands(0).begin();
}

::mlir::Value TensorArrayGradV3Op::flow_in() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange TensorArrayGradV3Op::handleMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange TensorArrayGradV3Op::flow_inMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> TensorArrayGradV3Op::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range TensorArrayGradV3Op::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TensorArrayGradV3Op::grad_handle() {
  return *getODSResults(0).begin();
}

::mlir::Value TensorArrayGradV3Op::flow_out() {
  return *getODSResults(1).begin();
}

::mlir::StringAttr TensorArrayGradV3Op::sourceAttr() {
  return (*this)->getAttr(sourceAttrName()).cast<::mlir::StringAttr>();
}

::llvm::StringRef TensorArrayGradV3Op::source() {
  auto attr = sourceAttr();
  return attr.getValue();
}

void TensorArrayGradV3Op::sourceAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(sourceAttrName(), attr);
}

void TensorArrayGradV3Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type grad_handle, ::mlir::Type flow_out, ::mlir::Value handle, ::mlir::Value flow_in, ::mlir::StringAttr source) {
  odsState.addOperands(handle);
  odsState.addOperands(flow_in);
  odsState.addAttribute(sourceAttrName(odsState.name), source);
  odsState.addTypes(grad_handle);
  odsState.addTypes(flow_out);
}

void TensorArrayGradV3Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value handle, ::mlir::Value flow_in, ::mlir::StringAttr source) {
  odsState.addOperands(handle);
  odsState.addOperands(flow_in);
  odsState.addAttribute(sourceAttrName(odsState.name), source);
  assert(resultTypes.size() == 2u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void TensorArrayGradV3Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type grad_handle, ::mlir::Type flow_out, ::mlir::Value handle, ::mlir::Value flow_in, ::llvm::StringRef source) {
  odsState.addOperands(handle);
  odsState.addOperands(flow_in);
  odsState.addAttribute(sourceAttrName(odsState.name), odsBuilder.getStringAttr(source));
  odsState.addTypes(grad_handle);
  odsState.addTypes(flow_out);
}

void TensorArrayGradV3Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value handle, ::mlir::Value flow_in, ::llvm::StringRef source) {
  odsState.addOperands(handle);
  odsState.addOperands(flow_in);
  odsState.addAttribute(sourceAttrName(odsState.name), odsBuilder.getStringAttr(source));
  assert(resultTypes.size() == 2u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void TensorArrayGradV3Op::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 2u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult TensorArrayGradV3Op::verify() {
  {
    auto tblgen_source = (*this)->getAttr(sourceAttrName());
    if (!tblgen_source)
      return emitOpError("requires attribute 'source'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_source, "source")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSResults(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void TensorArrayGradV3Op::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  for (::mlir::Value value : getODSOperands(0))
    effects.emplace_back(::mlir::MemoryEffects::Read::get(), value, ::mlir::TF::ResourceEffects::TensorArray::get());
  for (::mlir::Value value : getODSOperands(0))
    effects.emplace_back(::mlir::MemoryEffects::Write::get(), value, ::mlir::TF::ResourceEffects::TensorArray::get());
  for (::mlir::Value value : getODSResults(0))
    effects.emplace_back(::mlir::MemoryEffects::Allocate::get(), value, ::mlir::TF::ResourceEffects::TensorArray::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::TensorArrayGradV3Op)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::TensorArrayReadV3Op definitions
//===----------------------------------------------------------------------===//

TensorArrayReadV3OpAdaptor::TensorArrayReadV3OpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

TensorArrayReadV3OpAdaptor::TensorArrayReadV3OpAdaptor(TensorArrayReadV3Op &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange TensorArrayReadV3OpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> TensorArrayReadV3OpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange TensorArrayReadV3OpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TensorArrayReadV3OpAdaptor::handle() {
  return *getODSOperands(0).begin();
}

::mlir::Value TensorArrayReadV3OpAdaptor::index() {
  return *getODSOperands(1).begin();
}

::mlir::Value TensorArrayReadV3OpAdaptor::flow_in() {
  return *getODSOperands(2).begin();
}

::mlir::DictionaryAttr TensorArrayReadV3OpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult TensorArrayReadV3OpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> TensorArrayReadV3Op::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range TensorArrayReadV3Op::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TensorArrayReadV3Op::handle() {
  return *getODSOperands(0).begin();
}

::mlir::Value TensorArrayReadV3Op::index() {
  return *getODSOperands(1).begin();
}

::mlir::Value TensorArrayReadV3Op::flow_in() {
  return *getODSOperands(2).begin();
}

::mlir::MutableOperandRange TensorArrayReadV3Op::handleMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange TensorArrayReadV3Op::indexMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange TensorArrayReadV3Op::flow_inMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> TensorArrayReadV3Op::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range TensorArrayReadV3Op::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TensorArrayReadV3Op::value() {
  return *getODSResults(0).begin();
}

::mlir::Type TensorArrayReadV3Op::dtype() {
  return mlir::getElementTypeOrSelf(*getODSResults(0).begin());
}

bool TensorArrayReadV3Op::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "dtype") return true;
 return false;
}

::mlir::DictionaryAttr TensorArrayReadV3Op::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {dtypeAttrName(),
::mlir::TypeAttr::get(dtype())}});
}

void TensorArrayReadV3Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type value, ::mlir::Value handle, ::mlir::Value index, ::mlir::Value flow_in) {
  odsState.addOperands(handle);
  odsState.addOperands(index);
  odsState.addOperands(flow_in);
  odsState.addTypes(value);
}

void TensorArrayReadV3Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value handle, ::mlir::Value index, ::mlir::Value flow_in) {
  odsState.addOperands(handle);
  odsState.addOperands(index);
  odsState.addOperands(flow_in);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void TensorArrayReadV3Op::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 3u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult TensorArrayReadV3Op::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops11(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void TensorArrayReadV3Op::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  for (::mlir::Value value : getODSOperands(0))
    effects.emplace_back(::mlir::MemoryEffects::Read::get(), value, ::mlir::TF::ResourceEffects::TensorArray::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::TensorArrayReadV3Op)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::TensorArrayScatterV3Op definitions
//===----------------------------------------------------------------------===//

TensorArrayScatterV3OpAdaptor::TensorArrayScatterV3OpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

TensorArrayScatterV3OpAdaptor::TensorArrayScatterV3OpAdaptor(TensorArrayScatterV3Op &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange TensorArrayScatterV3OpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> TensorArrayScatterV3OpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange TensorArrayScatterV3OpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TensorArrayScatterV3OpAdaptor::handle() {
  return *getODSOperands(0).begin();
}

::mlir::Value TensorArrayScatterV3OpAdaptor::indices() {
  return *getODSOperands(1).begin();
}

::mlir::Value TensorArrayScatterV3OpAdaptor::value() {
  return *getODSOperands(2).begin();
}

::mlir::Value TensorArrayScatterV3OpAdaptor::flow_in() {
  return *getODSOperands(3).begin();
}

::mlir::DictionaryAttr TensorArrayScatterV3OpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult TensorArrayScatterV3OpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> TensorArrayScatterV3Op::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range TensorArrayScatterV3Op::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TensorArrayScatterV3Op::handle() {
  return *getODSOperands(0).begin();
}

::mlir::Value TensorArrayScatterV3Op::indices() {
  return *getODSOperands(1).begin();
}

::mlir::Value TensorArrayScatterV3Op::value() {
  return *getODSOperands(2).begin();
}

::mlir::Value TensorArrayScatterV3Op::flow_in() {
  return *getODSOperands(3).begin();
}

::mlir::MutableOperandRange TensorArrayScatterV3Op::handleMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange TensorArrayScatterV3Op::indicesMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange TensorArrayScatterV3Op::valueMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange TensorArrayScatterV3Op::flow_inMutable() {
  auto range = getODSOperandIndexAndLength(3);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> TensorArrayScatterV3Op::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range TensorArrayScatterV3Op::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TensorArrayScatterV3Op::flow_out() {
  return *getODSResults(0).begin();
}

::mlir::Type TensorArrayScatterV3Op::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(2).begin());
}

bool TensorArrayScatterV3Op::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr TensorArrayScatterV3Op::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void TensorArrayScatterV3Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type flow_out, ::mlir::Value handle, ::mlir::Value indices, ::mlir::Value value, ::mlir::Value flow_in) {
  odsState.addOperands(handle);
  odsState.addOperands(indices);
  odsState.addOperands(value);
  odsState.addOperands(flow_in);
  odsState.addTypes(flow_out);
}

void TensorArrayScatterV3Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value handle, ::mlir::Value indices, ::mlir::Value value, ::mlir::Value flow_in) {
  odsState.addOperands(handle);
  odsState.addOperands(indices);
  odsState.addOperands(value);
  odsState.addOperands(flow_in);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void TensorArrayScatterV3Op::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 4u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult TensorArrayScatterV3Op::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops11(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup3 = getODSOperands(3);

    for (auto v : valueGroup3) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void TensorArrayScatterV3Op::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  for (::mlir::Value value : getODSOperands(0))
    effects.emplace_back(::mlir::MemoryEffects::Read::get(), value, ::mlir::TF::ResourceEffects::TensorArray::get());
  for (::mlir::Value value : getODSOperands(0))
    effects.emplace_back(::mlir::MemoryEffects::Write::get(), value, ::mlir::TF::ResourceEffects::TensorArray::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::TensorArrayScatterV3Op)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::TensorArraySizeV3Op definitions
//===----------------------------------------------------------------------===//

TensorArraySizeV3OpAdaptor::TensorArraySizeV3OpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

TensorArraySizeV3OpAdaptor::TensorArraySizeV3OpAdaptor(TensorArraySizeV3Op &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange TensorArraySizeV3OpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> TensorArraySizeV3OpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange TensorArraySizeV3OpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TensorArraySizeV3OpAdaptor::handle() {
  return *getODSOperands(0).begin();
}

::mlir::Value TensorArraySizeV3OpAdaptor::flow_in() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr TensorArraySizeV3OpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult TensorArraySizeV3OpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> TensorArraySizeV3Op::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range TensorArraySizeV3Op::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TensorArraySizeV3Op::handle() {
  return *getODSOperands(0).begin();
}

::mlir::Value TensorArraySizeV3Op::flow_in() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange TensorArraySizeV3Op::handleMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange TensorArraySizeV3Op::flow_inMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> TensorArraySizeV3Op::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range TensorArraySizeV3Op::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TensorArraySizeV3Op::size() {
  return *getODSResults(0).begin();
}

void TensorArraySizeV3Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type size, ::mlir::Value handle, ::mlir::Value flow_in) {
  odsState.addOperands(handle);
  odsState.addOperands(flow_in);
  odsState.addTypes(size);
}

void TensorArraySizeV3Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value handle, ::mlir::Value flow_in) {
  odsState.addOperands(handle);
  odsState.addOperands(flow_in);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void TensorArraySizeV3Op::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult TensorArraySizeV3Op::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops11(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void TensorArraySizeV3Op::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  for (::mlir::Value value : getODSOperands(0))
    effects.emplace_back(::mlir::MemoryEffects::Read::get(), value, ::mlir::TF::ResourceEffects::TensorArray::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::TensorArraySizeV3Op)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::TensorArraySplitV3Op definitions
//===----------------------------------------------------------------------===//

TensorArraySplitV3OpAdaptor::TensorArraySplitV3OpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

TensorArraySplitV3OpAdaptor::TensorArraySplitV3OpAdaptor(TensorArraySplitV3Op &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange TensorArraySplitV3OpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> TensorArraySplitV3OpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange TensorArraySplitV3OpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TensorArraySplitV3OpAdaptor::handle() {
  return *getODSOperands(0).begin();
}

::mlir::Value TensorArraySplitV3OpAdaptor::value() {
  return *getODSOperands(1).begin();
}

::mlir::Value TensorArraySplitV3OpAdaptor::lengths() {
  return *getODSOperands(2).begin();
}

::mlir::Value TensorArraySplitV3OpAdaptor::flow_in() {
  return *getODSOperands(3).begin();
}

::mlir::DictionaryAttr TensorArraySplitV3OpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult TensorArraySplitV3OpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> TensorArraySplitV3Op::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range TensorArraySplitV3Op::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TensorArraySplitV3Op::handle() {
  return *getODSOperands(0).begin();
}

::mlir::Value TensorArraySplitV3Op::value() {
  return *getODSOperands(1).begin();
}

::mlir::Value TensorArraySplitV3Op::lengths() {
  return *getODSOperands(2).begin();
}

::mlir::Value TensorArraySplitV3Op::flow_in() {
  return *getODSOperands(3).begin();
}

::mlir::MutableOperandRange TensorArraySplitV3Op::handleMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange TensorArraySplitV3Op::valueMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange TensorArraySplitV3Op::lengthsMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange TensorArraySplitV3Op::flow_inMutable() {
  auto range = getODSOperandIndexAndLength(3);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> TensorArraySplitV3Op::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range TensorArraySplitV3Op::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TensorArraySplitV3Op::flow_out() {
  return *getODSResults(0).begin();
}

::mlir::Type TensorArraySplitV3Op::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(1).begin());
}

bool TensorArraySplitV3Op::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr TensorArraySplitV3Op::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void TensorArraySplitV3Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type flow_out, ::mlir::Value handle, ::mlir::Value value, ::mlir::Value lengths, ::mlir::Value flow_in) {
  odsState.addOperands(handle);
  odsState.addOperands(value);
  odsState.addOperands(lengths);
  odsState.addOperands(flow_in);
  odsState.addTypes(flow_out);
}

void TensorArraySplitV3Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value handle, ::mlir::Value value, ::mlir::Value lengths, ::mlir::Value flow_in) {
  odsState.addOperands(handle);
  odsState.addOperands(value);
  odsState.addOperands(lengths);
  odsState.addOperands(flow_in);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void TensorArraySplitV3Op::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 4u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult TensorArraySplitV3Op::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops16(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup3 = getODSOperands(3);

    for (auto v : valueGroup3) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void TensorArraySplitV3Op::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  for (::mlir::Value value : getODSOperands(0))
    effects.emplace_back(::mlir::MemoryEffects::Read::get(), value, ::mlir::TF::ResourceEffects::TensorArray::get());
  for (::mlir::Value value : getODSOperands(0))
    effects.emplace_back(::mlir::MemoryEffects::Write::get(), value, ::mlir::TF::ResourceEffects::TensorArray::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::TensorArraySplitV3Op)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::TensorArrayV3Op definitions
//===----------------------------------------------------------------------===//

TensorArrayV3OpAdaptor::TensorArrayV3OpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

TensorArrayV3OpAdaptor::TensorArrayV3OpAdaptor(TensorArrayV3Op &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange TensorArrayV3OpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> TensorArrayV3OpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange TensorArrayV3OpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TensorArrayV3OpAdaptor::size() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr TensorArrayV3OpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::TypeAttr TensorArrayV3OpAdaptor::dtype() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::TypeAttr attr = odsAttrs.get("dtype").cast<::mlir::TypeAttr>();
  return attr;
}

::mlir::Attribute TensorArrayV3OpAdaptor::element_shape() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::Attribute attr = odsAttrs.get("element_shape").dyn_cast_or_null<::mlir::Attribute>();
  if (!attr)
    attr = mlir::TF::ShapeAttr::get(::mlir::Builder(odsAttrs.getContext()).getContext(), llvm::None);
  return attr;
}

::mlir::BoolAttr TensorArrayV3OpAdaptor::dynamic_size() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("dynamic_size").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(false);
  return attr;
}

::mlir::BoolAttr TensorArrayV3OpAdaptor::clear_after_read() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("clear_after_read").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(true);
  return attr;
}

::mlir::BoolAttr TensorArrayV3OpAdaptor::identical_element_shapes() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("identical_element_shapes").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(false);
  return attr;
}

::mlir::StringAttr TensorArrayV3OpAdaptor::tensor_array_name() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("tensor_array_name").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("");
  return attr;
}

::mlir::LogicalResult TensorArrayV3OpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_dtype = odsAttrs.get("dtype");
    if (!tblgen_dtype)
      return emitError(loc, "'tf.TensorArrayV3' op ""requires attribute 'dtype'");

    if (tblgen_dtype && !(((tblgen_dtype.isa<::mlir::TypeAttr>())) && ((tblgen_dtype.cast<::mlir::TypeAttr>().getValue().isa<::mlir::Type>()))))
      return emitError(loc, "'tf.TensorArrayV3' op ""attribute 'dtype' failed to satisfy constraint: any type attribute");
  }
  {
    auto tblgen_element_shape = odsAttrs.get("element_shape");
    if (tblgen_element_shape && !((tblgen_element_shape.isa<mlir::TF::ShapeAttr>())))
      return emitError(loc, "'tf.TensorArrayV3' op ""attribute 'element_shape' failed to satisfy constraint: TensorFlow shape attribute");
  }
  {
    auto tblgen_dynamic_size = odsAttrs.get("dynamic_size");
    if (tblgen_dynamic_size && !((tblgen_dynamic_size.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.TensorArrayV3' op ""attribute 'dynamic_size' failed to satisfy constraint: bool attribute");
  }
  {
    auto tblgen_clear_after_read = odsAttrs.get("clear_after_read");
    if (tblgen_clear_after_read && !((tblgen_clear_after_read.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.TensorArrayV3' op ""attribute 'clear_after_read' failed to satisfy constraint: bool attribute");
  }
  {
    auto tblgen_identical_element_shapes = odsAttrs.get("identical_element_shapes");
    if (tblgen_identical_element_shapes && !((tblgen_identical_element_shapes.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.TensorArrayV3' op ""attribute 'identical_element_shapes' failed to satisfy constraint: bool attribute");
  }
  {
    auto tblgen_tensor_array_name = odsAttrs.get("tensor_array_name");
    if (tblgen_tensor_array_name && !((tblgen_tensor_array_name.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.TensorArrayV3' op ""attribute 'tensor_array_name' failed to satisfy constraint: string attribute");
  }
  return ::mlir::success();
}

void TensorArrayV3Op::getAsmResultNames(::mlir::OpAsmSetValueNameFn setNameFn) {
  auto resultGroup0 = getODSResults(0);
  if (!llvm::empty(resultGroup0))
    setNameFn(*resultGroup0.begin(), "handle");
  auto resultGroup1 = getODSResults(1);
  if (!llvm::empty(resultGroup1))
    setNameFn(*resultGroup1.begin(), "flow");
}

std::pair<unsigned, unsigned> TensorArrayV3Op::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range TensorArrayV3Op::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TensorArrayV3Op::size() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange TensorArrayV3Op::sizeMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> TensorArrayV3Op::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range TensorArrayV3Op::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TensorArrayV3Op::handle() {
  return *getODSResults(0).begin();
}

::mlir::Value TensorArrayV3Op::flow() {
  return *getODSResults(1).begin();
}

::mlir::TypeAttr TensorArrayV3Op::dtypeAttr() {
  return (*this)->getAttr(dtypeAttrName()).cast<::mlir::TypeAttr>();
}

::mlir::Type TensorArrayV3Op::dtype() {
  auto attr = dtypeAttr();
  return attr.getValue().cast<::mlir::Type>();
}

::mlir::Attribute TensorArrayV3Op::element_shapeAttr() {
  return (*this)->getAttr(element_shapeAttrName()).dyn_cast_or_null<::mlir::Attribute>();
}

llvm::Optional<llvm::ArrayRef<int64_t>> TensorArrayV3Op::element_shape() {
  auto attr = element_shapeAttr();
    if (!attr)
      return mlir::TF::ShapeAttr::get(::mlir::Builder((*this)->getContext()).getContext(), llvm::None).cast<mlir::TF::ShapeAttr>().getValue();
  return attr.cast<mlir::TF::ShapeAttr>().getValue();
}

::mlir::BoolAttr TensorArrayV3Op::dynamic_sizeAttr() {
  return (*this)->getAttr(dynamic_sizeAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool TensorArrayV3Op::dynamic_size() {
  auto attr = dynamic_sizeAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(false).getValue();
  return attr.getValue();
}

::mlir::BoolAttr TensorArrayV3Op::clear_after_readAttr() {
  return (*this)->getAttr(clear_after_readAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool TensorArrayV3Op::clear_after_read() {
  auto attr = clear_after_readAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(true).getValue();
  return attr.getValue();
}

::mlir::BoolAttr TensorArrayV3Op::identical_element_shapesAttr() {
  return (*this)->getAttr(identical_element_shapesAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool TensorArrayV3Op::identical_element_shapes() {
  auto attr = identical_element_shapesAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(false).getValue();
  return attr.getValue();
}

::mlir::StringAttr TensorArrayV3Op::tensor_array_nameAttr() {
  return (*this)->getAttr(tensor_array_nameAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef TensorArrayV3Op::tensor_array_name() {
  auto attr = tensor_array_nameAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("").getValue();
  return attr.getValue();
}

void TensorArrayV3Op::dtypeAttr(::mlir::TypeAttr attr) {
  (*this)->setAttr(dtypeAttrName(), attr);
}

void TensorArrayV3Op::element_shapeAttr(::mlir::Attribute attr) {
  (*this)->setAttr(element_shapeAttrName(), attr);
}

void TensorArrayV3Op::dynamic_sizeAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(dynamic_sizeAttrName(), attr);
}

void TensorArrayV3Op::clear_after_readAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(clear_after_readAttrName(), attr);
}

void TensorArrayV3Op::identical_element_shapesAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(identical_element_shapesAttrName(), attr);
}

void TensorArrayV3Op::tensor_array_nameAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(tensor_array_nameAttrName(), attr);
}

void TensorArrayV3Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type handle, ::mlir::Type flow, ::mlir::Value size, ::mlir::TypeAttr dtype, ::mlir::Attribute element_shape, ::mlir::BoolAttr dynamic_size, ::mlir::BoolAttr clear_after_read, ::mlir::BoolAttr identical_element_shapes, ::mlir::StringAttr tensor_array_name) {
  odsState.addOperands(size);
  odsState.addAttribute(dtypeAttrName(odsState.name), dtype);
  odsState.addAttribute(element_shapeAttrName(odsState.name), element_shape);
  odsState.addAttribute(dynamic_sizeAttrName(odsState.name), dynamic_size);
  odsState.addAttribute(clear_after_readAttrName(odsState.name), clear_after_read);
  odsState.addAttribute(identical_element_shapesAttrName(odsState.name), identical_element_shapes);
  odsState.addAttribute(tensor_array_nameAttrName(odsState.name), tensor_array_name);
  odsState.addTypes(handle);
  odsState.addTypes(flow);
}

void TensorArrayV3Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value size, ::mlir::TypeAttr dtype, ::mlir::Attribute element_shape, ::mlir::BoolAttr dynamic_size, ::mlir::BoolAttr clear_after_read, ::mlir::BoolAttr identical_element_shapes, ::mlir::StringAttr tensor_array_name) {
  odsState.addOperands(size);
  odsState.addAttribute(dtypeAttrName(odsState.name), dtype);
  odsState.addAttribute(element_shapeAttrName(odsState.name), element_shape);
  odsState.addAttribute(dynamic_sizeAttrName(odsState.name), dynamic_size);
  odsState.addAttribute(clear_after_readAttrName(odsState.name), clear_after_read);
  odsState.addAttribute(identical_element_shapesAttrName(odsState.name), identical_element_shapes);
  odsState.addAttribute(tensor_array_nameAttrName(odsState.name), tensor_array_name);
  assert(resultTypes.size() == 2u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void TensorArrayV3Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type handle, ::mlir::Type flow, ::mlir::Value size, ::mlir::Type dtype, llvm::Optional<llvm::ArrayRef<int64_t>> element_shape, bool dynamic_size, bool clear_after_read, bool identical_element_shapes, ::llvm::StringRef tensor_array_name) {
  odsState.addOperands(size);
  odsState.addAttribute(dtypeAttrName(odsState.name), ::mlir::TypeAttr::get(dtype));
  odsState.addAttribute(element_shapeAttrName(odsState.name), mlir::TF::ShapeAttr::get(odsBuilder.getContext(), element_shape));
  odsState.addAttribute(dynamic_sizeAttrName(odsState.name), odsBuilder.getBoolAttr(dynamic_size));
  odsState.addAttribute(clear_after_readAttrName(odsState.name), odsBuilder.getBoolAttr(clear_after_read));
  odsState.addAttribute(identical_element_shapesAttrName(odsState.name), odsBuilder.getBoolAttr(identical_element_shapes));
  odsState.addAttribute(tensor_array_nameAttrName(odsState.name), odsBuilder.getStringAttr(tensor_array_name));
  odsState.addTypes(handle);
  odsState.addTypes(flow);
}

void TensorArrayV3Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value size, ::mlir::Type dtype, llvm::Optional<llvm::ArrayRef<int64_t>> element_shape, bool dynamic_size, bool clear_after_read, bool identical_element_shapes, ::llvm::StringRef tensor_array_name) {
  odsState.addOperands(size);
  odsState.addAttribute(dtypeAttrName(odsState.name), ::mlir::TypeAttr::get(dtype));
  odsState.addAttribute(element_shapeAttrName(odsState.name), mlir::TF::ShapeAttr::get(odsBuilder.getContext(), element_shape));
  odsState.addAttribute(dynamic_sizeAttrName(odsState.name), odsBuilder.getBoolAttr(dynamic_size));
  odsState.addAttribute(clear_after_readAttrName(odsState.name), odsBuilder.getBoolAttr(clear_after_read));
  odsState.addAttribute(identical_element_shapesAttrName(odsState.name), odsBuilder.getBoolAttr(identical_element_shapes));
  odsState.addAttribute(tensor_array_nameAttrName(odsState.name), odsBuilder.getStringAttr(tensor_array_name));
  assert(resultTypes.size() == 2u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void TensorArrayV3Op::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 2u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult TensorArrayV3Op::verify() {
  {
    auto tblgen_dtype = (*this)->getAttr(dtypeAttrName());
    if (!tblgen_dtype)
      return emitOpError("requires attribute 'dtype'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops26(*this, tblgen_dtype, "dtype")))
      return ::mlir::failure();
  }
  {
    auto tblgen_element_shape = (*this)->getAttr(element_shapeAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops17(*this, tblgen_element_shape, "element_shape")))
      return ::mlir::failure();
  }
  {
    auto tblgen_dynamic_size = (*this)->getAttr(dynamic_sizeAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_dynamic_size, "dynamic_size")))
      return ::mlir::failure();
  }
  {
    auto tblgen_clear_after_read = (*this)->getAttr(clear_after_readAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_clear_after_read, "clear_after_read")))
      return ::mlir::failure();
  }
  {
    auto tblgen_identical_element_shapes = (*this)->getAttr(identical_element_shapesAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_identical_element_shapes, "identical_element_shapes")))
      return ::mlir::failure();
  }
  {
    auto tblgen_tensor_array_name = (*this)->getAttr(tensor_array_nameAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_tensor_array_name, "tensor_array_name")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops11(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSResults(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void TensorArrayV3Op::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  for (::mlir::Value value : getODSResults(0))
    effects.emplace_back(::mlir::MemoryEffects::Allocate::get(), value, ::mlir::TF::ResourceEffects::TensorArray::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::TensorArrayV3Op)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::TensorArrayWriteV3Op definitions
//===----------------------------------------------------------------------===//

TensorArrayWriteV3OpAdaptor::TensorArrayWriteV3OpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

TensorArrayWriteV3OpAdaptor::TensorArrayWriteV3OpAdaptor(TensorArrayWriteV3Op &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange TensorArrayWriteV3OpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> TensorArrayWriteV3OpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange TensorArrayWriteV3OpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TensorArrayWriteV3OpAdaptor::handle() {
  return *getODSOperands(0).begin();
}

::mlir::Value TensorArrayWriteV3OpAdaptor::index() {
  return *getODSOperands(1).begin();
}

::mlir::Value TensorArrayWriteV3OpAdaptor::value() {
  return *getODSOperands(2).begin();
}

::mlir::Value TensorArrayWriteV3OpAdaptor::flow_in() {
  return *getODSOperands(3).begin();
}

::mlir::DictionaryAttr TensorArrayWriteV3OpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult TensorArrayWriteV3OpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> TensorArrayWriteV3Op::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range TensorArrayWriteV3Op::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TensorArrayWriteV3Op::handle() {
  return *getODSOperands(0).begin();
}

::mlir::Value TensorArrayWriteV3Op::index() {
  return *getODSOperands(1).begin();
}

::mlir::Value TensorArrayWriteV3Op::value() {
  return *getODSOperands(2).begin();
}

::mlir::Value TensorArrayWriteV3Op::flow_in() {
  return *getODSOperands(3).begin();
}

::mlir::MutableOperandRange TensorArrayWriteV3Op::handleMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange TensorArrayWriteV3Op::indexMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange TensorArrayWriteV3Op::valueMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange TensorArrayWriteV3Op::flow_inMutable() {
  auto range = getODSOperandIndexAndLength(3);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> TensorArrayWriteV3Op::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range TensorArrayWriteV3Op::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TensorArrayWriteV3Op::flow_out() {
  return *getODSResults(0).begin();
}

::mlir::Type TensorArrayWriteV3Op::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(2).begin());
}

bool TensorArrayWriteV3Op::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr TensorArrayWriteV3Op::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void TensorArrayWriteV3Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type flow_out, ::mlir::Value handle, ::mlir::Value index, ::mlir::Value value, ::mlir::Value flow_in) {
  odsState.addOperands(handle);
  odsState.addOperands(index);
  odsState.addOperands(value);
  odsState.addOperands(flow_in);
  odsState.addTypes(flow_out);
}

void TensorArrayWriteV3Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value handle, ::mlir::Value index, ::mlir::Value value, ::mlir::Value flow_in) {
  odsState.addOperands(handle);
  odsState.addOperands(index);
  odsState.addOperands(value);
  odsState.addOperands(flow_in);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void TensorArrayWriteV3Op::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 4u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult TensorArrayWriteV3Op::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops11(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup3 = getODSOperands(3);

    for (auto v : valueGroup3) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void TensorArrayWriteV3Op::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  for (::mlir::Value value : getODSOperands(0))
    effects.emplace_back(::mlir::MemoryEffects::Read::get(), value, ::mlir::TF::ResourceEffects::TensorArray::get());
  for (::mlir::Value value : getODSOperands(0))
    effects.emplace_back(::mlir::MemoryEffects::Write::get(), value, ::mlir::TF::ResourceEffects::TensorArray::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::TensorArrayWriteV3Op)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::TensorListConcatV2Op definitions
//===----------------------------------------------------------------------===//

TensorListConcatV2OpAdaptor::TensorListConcatV2OpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

TensorListConcatV2OpAdaptor::TensorListConcatV2OpAdaptor(TensorListConcatV2Op &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange TensorListConcatV2OpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> TensorListConcatV2OpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange TensorListConcatV2OpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TensorListConcatV2OpAdaptor::input_handle() {
  return *getODSOperands(0).begin();
}

::mlir::Value TensorListConcatV2OpAdaptor::element_shape() {
  return *getODSOperands(1).begin();
}

::mlir::Value TensorListConcatV2OpAdaptor::leading_dims() {
  return *getODSOperands(2).begin();
}

::mlir::DictionaryAttr TensorListConcatV2OpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult TensorListConcatV2OpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

void TensorListConcatV2Op::getAsmResultNames(::mlir::OpAsmSetValueNameFn setNameFn) {
  auto resultGroup0 = getODSResults(0);
  if (!llvm::empty(resultGroup0))
    setNameFn(*resultGroup0.begin(), "tensor");
  auto resultGroup1 = getODSResults(1);
  if (!llvm::empty(resultGroup1))
    setNameFn(*resultGroup1.begin(), "lengths");
}

std::pair<unsigned, unsigned> TensorListConcatV2Op::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range TensorListConcatV2Op::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TensorListConcatV2Op::input_handle() {
  return *getODSOperands(0).begin();
}

::mlir::Value TensorListConcatV2Op::element_shape() {
  return *getODSOperands(1).begin();
}

::mlir::Value TensorListConcatV2Op::leading_dims() {
  return *getODSOperands(2).begin();
}

::mlir::MutableOperandRange TensorListConcatV2Op::input_handleMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange TensorListConcatV2Op::element_shapeMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange TensorListConcatV2Op::leading_dimsMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> TensorListConcatV2Op::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range TensorListConcatV2Op::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TensorListConcatV2Op::tensor() {
  return *getODSResults(0).begin();
}

::mlir::Value TensorListConcatV2Op::lengths() {
  return *getODSResults(1).begin();
}

::mlir::Type TensorListConcatV2Op::shape_type() {
  return mlir::getElementTypeOrSelf(*getODSOperands(1).begin());
}

::mlir::Type TensorListConcatV2Op::element_dtype() {
  return mlir::getElementTypeOrSelf(*getODSResults(0).begin());
}

bool TensorListConcatV2Op::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "shape_type") return true;
  if (name == "element_dtype") return true;
 return false;
}

::mlir::DictionaryAttr TensorListConcatV2Op::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {shape_typeAttrName(),
::mlir::TypeAttr::get(shape_type())},
    {element_dtypeAttrName(),
::mlir::TypeAttr::get(element_dtype())}});
}

void TensorListConcatV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type tensor, ::mlir::Type lengths, ::mlir::Value input_handle, ::mlir::Value element_shape, ::mlir::Value leading_dims) {
  odsState.addOperands(input_handle);
  odsState.addOperands(element_shape);
  odsState.addOperands(leading_dims);
  odsState.addTypes(tensor);
  odsState.addTypes(lengths);
}

void TensorListConcatV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input_handle, ::mlir::Value element_shape, ::mlir::Value leading_dims) {
  odsState.addOperands(input_handle);
  odsState.addOperands(element_shape);
  odsState.addOperands(leading_dims);
  assert(resultTypes.size() == 2u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void TensorListConcatV2Op::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 3u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 2u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult TensorListConcatV2Op::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops15(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops16(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSResults(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops16(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void TensorListConcatV2Op::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::TensorListConcatV2Op)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::TensorListElementShapeOp definitions
//===----------------------------------------------------------------------===//

TensorListElementShapeOpAdaptor::TensorListElementShapeOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

TensorListElementShapeOpAdaptor::TensorListElementShapeOpAdaptor(TensorListElementShapeOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange TensorListElementShapeOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> TensorListElementShapeOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange TensorListElementShapeOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TensorListElementShapeOpAdaptor::input_handle() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr TensorListElementShapeOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult TensorListElementShapeOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> TensorListElementShapeOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range TensorListElementShapeOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TensorListElementShapeOp::input_handle() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange TensorListElementShapeOp::input_handleMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> TensorListElementShapeOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range TensorListElementShapeOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TensorListElementShapeOp::element_shape() {
  return *getODSResults(0).begin();
}

::mlir::Type TensorListElementShapeOp::shape_type() {
  return mlir::getElementTypeOrSelf(*getODSResults(0).begin());
}

bool TensorListElementShapeOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "shape_type") return true;
 return false;
}

::mlir::DictionaryAttr TensorListElementShapeOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {shape_typeAttrName(),
::mlir::TypeAttr::get(shape_type())}});
}

void TensorListElementShapeOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type element_shape, ::mlir::Value input_handle) {
  odsState.addOperands(input_handle);
  odsState.addTypes(element_shape);
}

void TensorListElementShapeOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input_handle) {
  odsState.addOperands(input_handle);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void TensorListElementShapeOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult TensorListElementShapeOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops15(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void TensorListElementShapeOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::TensorListElementShapeOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::TensorListFromTensorOp definitions
//===----------------------------------------------------------------------===//

TensorListFromTensorOpAdaptor::TensorListFromTensorOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

TensorListFromTensorOpAdaptor::TensorListFromTensorOpAdaptor(TensorListFromTensorOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange TensorListFromTensorOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> TensorListFromTensorOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange TensorListFromTensorOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TensorListFromTensorOpAdaptor::tensor() {
  return *getODSOperands(0).begin();
}

::mlir::Value TensorListFromTensorOpAdaptor::element_shape() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr TensorListFromTensorOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult TensorListFromTensorOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> TensorListFromTensorOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range TensorListFromTensorOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TensorListFromTensorOp::tensor() {
  return *getODSOperands(0).begin();
}

::mlir::Value TensorListFromTensorOp::element_shape() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange TensorListFromTensorOp::tensorMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange TensorListFromTensorOp::element_shapeMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> TensorListFromTensorOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range TensorListFromTensorOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TensorListFromTensorOp::output_handle() {
  return *getODSResults(0).begin();
}

::mlir::Type TensorListFromTensorOp::element_dtype() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

::mlir::Type TensorListFromTensorOp::shape_type() {
  return mlir::getElementTypeOrSelf(*getODSOperands(1).begin());
}

bool TensorListFromTensorOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "element_dtype") return true;
  if (name == "shape_type") return true;
 return false;
}

::mlir::DictionaryAttr TensorListFromTensorOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {element_dtypeAttrName(),
::mlir::TypeAttr::get(element_dtype())},
    {shape_typeAttrName(),
::mlir::TypeAttr::get(shape_type())}});
}

void TensorListFromTensorOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output_handle, ::mlir::Value tensor, ::mlir::Value element_shape) {
  odsState.addOperands(tensor);
  odsState.addOperands(element_shape);
  odsState.addTypes(output_handle);
}

void TensorListFromTensorOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value tensor, ::mlir::Value element_shape) {
  odsState.addOperands(tensor);
  odsState.addOperands(element_shape);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void TensorListFromTensorOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult TensorListFromTensorOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops15(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void TensorListFromTensorOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::TensorListFromTensorOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::TensorListGatherOp definitions
//===----------------------------------------------------------------------===//

TensorListGatherOpAdaptor::TensorListGatherOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

TensorListGatherOpAdaptor::TensorListGatherOpAdaptor(TensorListGatherOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange TensorListGatherOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> TensorListGatherOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange TensorListGatherOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TensorListGatherOpAdaptor::input_handle() {
  return *getODSOperands(0).begin();
}

::mlir::Value TensorListGatherOpAdaptor::indices() {
  return *getODSOperands(1).begin();
}

::mlir::Value TensorListGatherOpAdaptor::element_shape() {
  return *getODSOperands(2).begin();
}

::mlir::DictionaryAttr TensorListGatherOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult TensorListGatherOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> TensorListGatherOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range TensorListGatherOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TensorListGatherOp::input_handle() {
  return *getODSOperands(0).begin();
}

::mlir::Value TensorListGatherOp::indices() {
  return *getODSOperands(1).begin();
}

::mlir::Value TensorListGatherOp::element_shape() {
  return *getODSOperands(2).begin();
}

::mlir::MutableOperandRange TensorListGatherOp::input_handleMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange TensorListGatherOp::indicesMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange TensorListGatherOp::element_shapeMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> TensorListGatherOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range TensorListGatherOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TensorListGatherOp::values() {
  return *getODSResults(0).begin();
}

::mlir::Type TensorListGatherOp::element_dtype() {
  return mlir::getElementTypeOrSelf(*getODSResults(0).begin());
}

bool TensorListGatherOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "element_dtype") return true;
 return false;
}

::mlir::DictionaryAttr TensorListGatherOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {element_dtypeAttrName(),
::mlir::TypeAttr::get(element_dtype())}});
}

void TensorListGatherOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type values, ::mlir::Value input_handle, ::mlir::Value indices, ::mlir::Value element_shape) {
  odsState.addOperands(input_handle);
  odsState.addOperands(indices);
  odsState.addOperands(element_shape);
  odsState.addTypes(values);
}

void TensorListGatherOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input_handle, ::mlir::Value indices, ::mlir::Value element_shape) {
  odsState.addOperands(input_handle);
  odsState.addOperands(indices);
  odsState.addOperands(element_shape);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void TensorListGatherOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 3u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult TensorListGatherOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops15(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops11(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops11(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void TensorListGatherOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::TensorListGatherOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::TensorListGetItemOp definitions
//===----------------------------------------------------------------------===//

TensorListGetItemOpAdaptor::TensorListGetItemOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

TensorListGetItemOpAdaptor::TensorListGetItemOpAdaptor(TensorListGetItemOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange TensorListGetItemOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> TensorListGetItemOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange TensorListGetItemOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TensorListGetItemOpAdaptor::input_handle() {
  return *getODSOperands(0).begin();
}

::mlir::Value TensorListGetItemOpAdaptor::index() {
  return *getODSOperands(1).begin();
}

::mlir::Value TensorListGetItemOpAdaptor::element_shape() {
  return *getODSOperands(2).begin();
}

::mlir::DictionaryAttr TensorListGetItemOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult TensorListGetItemOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> TensorListGetItemOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range TensorListGetItemOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TensorListGetItemOp::input_handle() {
  return *getODSOperands(0).begin();
}

::mlir::Value TensorListGetItemOp::index() {
  return *getODSOperands(1).begin();
}

::mlir::Value TensorListGetItemOp::element_shape() {
  return *getODSOperands(2).begin();
}

::mlir::MutableOperandRange TensorListGetItemOp::input_handleMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange TensorListGetItemOp::indexMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange TensorListGetItemOp::element_shapeMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> TensorListGetItemOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range TensorListGetItemOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TensorListGetItemOp::item() {
  return *getODSResults(0).begin();
}

::mlir::Type TensorListGetItemOp::element_dtype() {
  return mlir::getElementTypeOrSelf(*getODSResults(0).begin());
}

bool TensorListGetItemOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "element_dtype") return true;
 return false;
}

::mlir::DictionaryAttr TensorListGetItemOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {element_dtypeAttrName(),
::mlir::TypeAttr::get(element_dtype())}});
}

void TensorListGetItemOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type item, ::mlir::Value input_handle, ::mlir::Value index, ::mlir::Value element_shape) {
  odsState.addOperands(input_handle);
  odsState.addOperands(index);
  odsState.addOperands(element_shape);
  odsState.addTypes(item);
}

void TensorListGetItemOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input_handle, ::mlir::Value index, ::mlir::Value element_shape) {
  odsState.addOperands(input_handle);
  odsState.addOperands(index);
  odsState.addOperands(element_shape);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void TensorListGetItemOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 3u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult TensorListGetItemOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops15(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops11(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops11(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void TensorListGetItemOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::TensorListGetItemOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::TensorListLengthOp definitions
//===----------------------------------------------------------------------===//

TensorListLengthOpAdaptor::TensorListLengthOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

TensorListLengthOpAdaptor::TensorListLengthOpAdaptor(TensorListLengthOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange TensorListLengthOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> TensorListLengthOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange TensorListLengthOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TensorListLengthOpAdaptor::input_handle() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr TensorListLengthOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult TensorListLengthOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> TensorListLengthOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range TensorListLengthOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TensorListLengthOp::input_handle() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange TensorListLengthOp::input_handleMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> TensorListLengthOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range TensorListLengthOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TensorListLengthOp::length() {
  return *getODSResults(0).begin();
}

void TensorListLengthOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type length, ::mlir::Value input_handle) {
  odsState.addOperands(input_handle);
  odsState.addTypes(length);
}

void TensorListLengthOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input_handle) {
  odsState.addOperands(input_handle);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void TensorListLengthOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult TensorListLengthOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops15(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops11(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void TensorListLengthOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::TensorListLengthOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::TensorListPopBackOp definitions
//===----------------------------------------------------------------------===//

TensorListPopBackOpAdaptor::TensorListPopBackOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

TensorListPopBackOpAdaptor::TensorListPopBackOpAdaptor(TensorListPopBackOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange TensorListPopBackOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> TensorListPopBackOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange TensorListPopBackOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TensorListPopBackOpAdaptor::input_handle() {
  return *getODSOperands(0).begin();
}

::mlir::Value TensorListPopBackOpAdaptor::element_shape() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr TensorListPopBackOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult TensorListPopBackOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

void TensorListPopBackOp::getAsmResultNames(::mlir::OpAsmSetValueNameFn setNameFn) {
  auto resultGroup0 = getODSResults(0);
  if (!llvm::empty(resultGroup0))
    setNameFn(*resultGroup0.begin(), "output_handle");
  auto resultGroup1 = getODSResults(1);
  if (!llvm::empty(resultGroup1))
    setNameFn(*resultGroup1.begin(), "tensor");
}

std::pair<unsigned, unsigned> TensorListPopBackOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range TensorListPopBackOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TensorListPopBackOp::input_handle() {
  return *getODSOperands(0).begin();
}

::mlir::Value TensorListPopBackOp::element_shape() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange TensorListPopBackOp::input_handleMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange TensorListPopBackOp::element_shapeMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> TensorListPopBackOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range TensorListPopBackOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TensorListPopBackOp::output_handle() {
  return *getODSResults(0).begin();
}

::mlir::Value TensorListPopBackOp::tensor() {
  return *getODSResults(1).begin();
}

::mlir::Type TensorListPopBackOp::element_dtype() {
  return mlir::getElementTypeOrSelf(*getODSResults(1).begin());
}

bool TensorListPopBackOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "element_dtype") return true;
 return false;
}

::mlir::DictionaryAttr TensorListPopBackOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {element_dtypeAttrName(),
::mlir::TypeAttr::get(element_dtype())}});
}

void TensorListPopBackOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output_handle, ::mlir::Type tensor, ::mlir::Value input_handle, ::mlir::Value element_shape) {
  odsState.addOperands(input_handle);
  odsState.addOperands(element_shape);
  odsState.addTypes(output_handle);
  odsState.addTypes(tensor);
}

void TensorListPopBackOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input_handle, ::mlir::Value element_shape) {
  odsState.addOperands(input_handle);
  odsState.addOperands(element_shape);
  assert(resultTypes.size() == 2u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void TensorListPopBackOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 2u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult TensorListPopBackOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops15(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops11(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops15(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSResults(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void TensorListPopBackOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::TensorListPopBackOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::TensorListPushBackOp definitions
//===----------------------------------------------------------------------===//

TensorListPushBackOpAdaptor::TensorListPushBackOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

TensorListPushBackOpAdaptor::TensorListPushBackOpAdaptor(TensorListPushBackOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange TensorListPushBackOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> TensorListPushBackOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange TensorListPushBackOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TensorListPushBackOpAdaptor::input_handle() {
  return *getODSOperands(0).begin();
}

::mlir::Value TensorListPushBackOpAdaptor::tensor() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr TensorListPushBackOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult TensorListPushBackOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> TensorListPushBackOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range TensorListPushBackOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TensorListPushBackOp::input_handle() {
  return *getODSOperands(0).begin();
}

::mlir::Value TensorListPushBackOp::tensor() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange TensorListPushBackOp::input_handleMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange TensorListPushBackOp::tensorMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> TensorListPushBackOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range TensorListPushBackOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TensorListPushBackOp::output_handle() {
  return *getODSResults(0).begin();
}

::mlir::Type TensorListPushBackOp::element_dtype() {
  return mlir::getElementTypeOrSelf(*getODSOperands(1).begin());
}

bool TensorListPushBackOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "element_dtype") return true;
 return false;
}

::mlir::DictionaryAttr TensorListPushBackOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {element_dtypeAttrName(),
::mlir::TypeAttr::get(element_dtype())}});
}

void TensorListPushBackOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output_handle, ::mlir::Value input_handle, ::mlir::Value tensor) {
  odsState.addOperands(input_handle);
  odsState.addOperands(tensor);
  odsState.addTypes(output_handle);
}

void TensorListPushBackOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input_handle, ::mlir::Value tensor) {
  odsState.addOperands(input_handle);
  odsState.addOperands(tensor);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void TensorListPushBackOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult TensorListPushBackOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops15(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops15(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void TensorListPushBackOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::TensorListPushBackOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::TensorListReserveOp definitions
//===----------------------------------------------------------------------===//

TensorListReserveOpAdaptor::TensorListReserveOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

TensorListReserveOpAdaptor::TensorListReserveOpAdaptor(TensorListReserveOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange TensorListReserveOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> TensorListReserveOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange TensorListReserveOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TensorListReserveOpAdaptor::element_shape() {
  return *getODSOperands(0).begin();
}

::mlir::Value TensorListReserveOpAdaptor::num_elements() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr TensorListReserveOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult TensorListReserveOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> TensorListReserveOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range TensorListReserveOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TensorListReserveOp::element_shape() {
  return *getODSOperands(0).begin();
}

::mlir::Value TensorListReserveOp::num_elements() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange TensorListReserveOp::element_shapeMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange TensorListReserveOp::num_elementsMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> TensorListReserveOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range TensorListReserveOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TensorListReserveOp::handle() {
  return *getODSResults(0).begin();
}

::mlir::Type TensorListReserveOp::shape_type() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

::mlir::Type TensorListReserveOp::element_dtype() {
  return getElementTypeOrSelf(element_type());
}

bool TensorListReserveOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "shape_type") return true;
  if (name == "element_dtype") return true;
 return false;
}

::mlir::DictionaryAttr TensorListReserveOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {shape_typeAttrName(),
::mlir::TypeAttr::get(shape_type())},
    {element_dtypeAttrName(),
::mlir::TypeAttr::get(element_dtype())}});
}

void TensorListReserveOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type handle, ::mlir::Value element_shape, ::mlir::Value num_elements) {
  odsState.addOperands(element_shape);
  odsState.addOperands(num_elements);
  odsState.addTypes(handle);
}

void TensorListReserveOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value element_shape, ::mlir::Value num_elements) {
  odsState.addOperands(element_shape);
  odsState.addOperands(num_elements);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void TensorListReserveOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult TensorListReserveOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops11(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops15(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  // This is required to populate derived attributes during export in a
    // meaningful way. Else during export to GraphDef element_type() query
    // will result in out of bounds access/assert.
    if (handle_dtype().getSubtypes().size() != 1) {
      return emitOpError(
          "must have exactly one subtype in the result variant type");
    }

    return Verify(*this);
}

void TensorListReserveOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::TensorListReserveOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::TensorListResizeOp definitions
//===----------------------------------------------------------------------===//

TensorListResizeOpAdaptor::TensorListResizeOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

TensorListResizeOpAdaptor::TensorListResizeOpAdaptor(TensorListResizeOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange TensorListResizeOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> TensorListResizeOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange TensorListResizeOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TensorListResizeOpAdaptor::input_handle() {
  return *getODSOperands(0).begin();
}

::mlir::Value TensorListResizeOpAdaptor::size() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr TensorListResizeOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult TensorListResizeOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> TensorListResizeOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range TensorListResizeOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TensorListResizeOp::input_handle() {
  return *getODSOperands(0).begin();
}

::mlir::Value TensorListResizeOp::size() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange TensorListResizeOp::input_handleMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange TensorListResizeOp::sizeMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> TensorListResizeOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range TensorListResizeOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TensorListResizeOp::output_handle() {
  return *getODSResults(0).begin();
}

void TensorListResizeOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output_handle, ::mlir::Value input_handle, ::mlir::Value size) {
  odsState.addOperands(input_handle);
  odsState.addOperands(size);
  odsState.addTypes(output_handle);
}

void TensorListResizeOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input_handle, ::mlir::Value size) {
  odsState.addOperands(input_handle);
  odsState.addOperands(size);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void TensorListResizeOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult TensorListResizeOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops15(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops11(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops15(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void TensorListResizeOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::TensorListResizeOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::TensorListScatterIntoExistingListOp definitions
//===----------------------------------------------------------------------===//

TensorListScatterIntoExistingListOpAdaptor::TensorListScatterIntoExistingListOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

TensorListScatterIntoExistingListOpAdaptor::TensorListScatterIntoExistingListOpAdaptor(TensorListScatterIntoExistingListOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange TensorListScatterIntoExistingListOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> TensorListScatterIntoExistingListOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange TensorListScatterIntoExistingListOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TensorListScatterIntoExistingListOpAdaptor::input_handle() {
  return *getODSOperands(0).begin();
}

::mlir::Value TensorListScatterIntoExistingListOpAdaptor::tensor() {
  return *getODSOperands(1).begin();
}

::mlir::Value TensorListScatterIntoExistingListOpAdaptor::indices() {
  return *getODSOperands(2).begin();
}

::mlir::DictionaryAttr TensorListScatterIntoExistingListOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult TensorListScatterIntoExistingListOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> TensorListScatterIntoExistingListOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range TensorListScatterIntoExistingListOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TensorListScatterIntoExistingListOp::input_handle() {
  return *getODSOperands(0).begin();
}

::mlir::Value TensorListScatterIntoExistingListOp::tensor() {
  return *getODSOperands(1).begin();
}

::mlir::Value TensorListScatterIntoExistingListOp::indices() {
  return *getODSOperands(2).begin();
}

::mlir::MutableOperandRange TensorListScatterIntoExistingListOp::input_handleMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange TensorListScatterIntoExistingListOp::tensorMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange TensorListScatterIntoExistingListOp::indicesMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> TensorListScatterIntoExistingListOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range TensorListScatterIntoExistingListOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TensorListScatterIntoExistingListOp::output_handle() {
  return *getODSResults(0).begin();
}

::mlir::Type TensorListScatterIntoExistingListOp::element_dtype() {
  return mlir::getElementTypeOrSelf(*getODSOperands(1).begin());
}

bool TensorListScatterIntoExistingListOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "element_dtype") return true;
 return false;
}

::mlir::DictionaryAttr TensorListScatterIntoExistingListOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {element_dtypeAttrName(),
::mlir::TypeAttr::get(element_dtype())}});
}

void TensorListScatterIntoExistingListOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output_handle, ::mlir::Value input_handle, ::mlir::Value tensor, ::mlir::Value indices) {
  odsState.addOperands(input_handle);
  odsState.addOperands(tensor);
  odsState.addOperands(indices);
  odsState.addTypes(output_handle);
}

void TensorListScatterIntoExistingListOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input_handle, ::mlir::Value tensor, ::mlir::Value indices) {
  odsState.addOperands(input_handle);
  odsState.addOperands(tensor);
  odsState.addOperands(indices);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void TensorListScatterIntoExistingListOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 3u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult TensorListScatterIntoExistingListOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops15(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops11(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops15(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void TensorListScatterIntoExistingListOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::TensorListScatterIntoExistingListOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::TensorListSetItemOp definitions
//===----------------------------------------------------------------------===//

TensorListSetItemOpAdaptor::TensorListSetItemOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

TensorListSetItemOpAdaptor::TensorListSetItemOpAdaptor(TensorListSetItemOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange TensorListSetItemOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> TensorListSetItemOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange TensorListSetItemOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TensorListSetItemOpAdaptor::input_handle() {
  return *getODSOperands(0).begin();
}

::mlir::Value TensorListSetItemOpAdaptor::index() {
  return *getODSOperands(1).begin();
}

::mlir::Value TensorListSetItemOpAdaptor::item() {
  return *getODSOperands(2).begin();
}

::mlir::DictionaryAttr TensorListSetItemOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult TensorListSetItemOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> TensorListSetItemOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range TensorListSetItemOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TensorListSetItemOp::input_handle() {
  return *getODSOperands(0).begin();
}

::mlir::Value TensorListSetItemOp::index() {
  return *getODSOperands(1).begin();
}

::mlir::Value TensorListSetItemOp::item() {
  return *getODSOperands(2).begin();
}

::mlir::MutableOperandRange TensorListSetItemOp::input_handleMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange TensorListSetItemOp::indexMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange TensorListSetItemOp::itemMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> TensorListSetItemOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range TensorListSetItemOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TensorListSetItemOp::output_handle() {
  return *getODSResults(0).begin();
}

::mlir::Type TensorListSetItemOp::element_dtype() {
  return mlir::getElementTypeOrSelf(*getODSOperands(2).begin());
}

bool TensorListSetItemOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "element_dtype") return true;
 return false;
}

::mlir::DictionaryAttr TensorListSetItemOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {element_dtypeAttrName(),
::mlir::TypeAttr::get(element_dtype())}});
}

void TensorListSetItemOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output_handle, ::mlir::Value input_handle, ::mlir::Value index, ::mlir::Value item) {
  odsState.addOperands(input_handle);
  odsState.addOperands(index);
  odsState.addOperands(item);
  odsState.addTypes(output_handle);
}

void TensorListSetItemOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input_handle, ::mlir::Value index, ::mlir::Value item) {
  odsState.addOperands(input_handle);
  odsState.addOperands(index);
  odsState.addOperands(item);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void TensorListSetItemOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 3u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult TensorListSetItemOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops15(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops11(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops15(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void TensorListSetItemOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::TensorListSetItemOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::TensorListStackOp definitions
//===----------------------------------------------------------------------===//

TensorListStackOpAdaptor::TensorListStackOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

TensorListStackOpAdaptor::TensorListStackOpAdaptor(TensorListStackOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange TensorListStackOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> TensorListStackOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange TensorListStackOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TensorListStackOpAdaptor::input_handle() {
  return *getODSOperands(0).begin();
}

::mlir::Value TensorListStackOpAdaptor::element_shape() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr TensorListStackOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::IntegerAttr TensorListStackOpAdaptor::num_elements() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("num_elements").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), -1);
  return attr;
}

::mlir::LogicalResult TensorListStackOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_num_elements = odsAttrs.get("num_elements");
    if (tblgen_num_elements && !(((tblgen_num_elements.isa<::mlir::IntegerAttr>())) && ((tblgen_num_elements.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.TensorListStack' op ""attribute 'num_elements' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> TensorListStackOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range TensorListStackOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TensorListStackOp::input_handle() {
  return *getODSOperands(0).begin();
}

::mlir::Value TensorListStackOp::element_shape() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange TensorListStackOp::input_handleMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange TensorListStackOp::element_shapeMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> TensorListStackOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range TensorListStackOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TensorListStackOp::tensor() {
  return *getODSResults(0).begin();
}

::mlir::IntegerAttr TensorListStackOp::num_elementsAttr() {
  return (*this)->getAttr(num_elementsAttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t TensorListStackOp::num_elements() {
  auto attr = num_elementsAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), -1).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

::mlir::Type TensorListStackOp::element_dtype() {
  return mlir::getElementTypeOrSelf(*getODSResults(0).begin());
}

bool TensorListStackOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "element_dtype") return true;
 return false;
}

::mlir::DictionaryAttr TensorListStackOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {element_dtypeAttrName(),
::mlir::TypeAttr::get(element_dtype())}});
}

void TensorListStackOp::num_elementsAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(num_elementsAttrName(), attr);
}

void TensorListStackOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type tensor, ::mlir::Value input_handle, ::mlir::Value element_shape, ::mlir::IntegerAttr num_elements) {
  odsState.addOperands(input_handle);
  odsState.addOperands(element_shape);
  odsState.addAttribute(num_elementsAttrName(odsState.name), num_elements);
  odsState.addTypes(tensor);
}

void TensorListStackOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input_handle, ::mlir::Value element_shape, ::mlir::IntegerAttr num_elements) {
  odsState.addOperands(input_handle);
  odsState.addOperands(element_shape);
  odsState.addAttribute(num_elementsAttrName(odsState.name), num_elements);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void TensorListStackOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type tensor, ::mlir::Value input_handle, ::mlir::Value element_shape, uint64_t num_elements) {
  odsState.addOperands(input_handle);
  odsState.addOperands(element_shape);
  odsState.addAttribute(num_elementsAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), num_elements));
  odsState.addTypes(tensor);
}

void TensorListStackOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input_handle, ::mlir::Value element_shape, uint64_t num_elements) {
  odsState.addOperands(input_handle);
  odsState.addOperands(element_shape);
  odsState.addAttribute(num_elementsAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), num_elements));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void TensorListStackOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult TensorListStackOp::verify() {
  {
    auto tblgen_num_elements = (*this)->getAttr(num_elementsAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_num_elements, "num_elements")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops15(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops11(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return Verify(*this);
}

void TensorListStackOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::TensorListStackOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::TensorScatterAddOp definitions
//===----------------------------------------------------------------------===//

TensorScatterAddOpAdaptor::TensorScatterAddOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

TensorScatterAddOpAdaptor::TensorScatterAddOpAdaptor(TensorScatterAddOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange TensorScatterAddOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> TensorScatterAddOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange TensorScatterAddOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TensorScatterAddOpAdaptor::tensor() {
  return *getODSOperands(0).begin();
}

::mlir::Value TensorScatterAddOpAdaptor::indices() {
  return *getODSOperands(1).begin();
}

::mlir::Value TensorScatterAddOpAdaptor::updates() {
  return *getODSOperands(2).begin();
}

::mlir::DictionaryAttr TensorScatterAddOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult TensorScatterAddOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> TensorScatterAddOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range TensorScatterAddOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TensorScatterAddOp::tensor() {
  return *getODSOperands(0).begin();
}

::mlir::Value TensorScatterAddOp::indices() {
  return *getODSOperands(1).begin();
}

::mlir::Value TensorScatterAddOp::updates() {
  return *getODSOperands(2).begin();
}

::mlir::MutableOperandRange TensorScatterAddOp::tensorMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange TensorScatterAddOp::indicesMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange TensorScatterAddOp::updatesMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> TensorScatterAddOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range TensorScatterAddOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TensorScatterAddOp::output() {
  return *getODSResults(0).begin();
}

::mlir::Type TensorScatterAddOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

::mlir::Type TensorScatterAddOp::Tindices() {
  return mlir::getElementTypeOrSelf(*getODSOperands(1).begin());
}

bool TensorScatterAddOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
  if (name == "Tindices") return true;
 return false;
}

::mlir::DictionaryAttr TensorScatterAddOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())},
    {TindicesAttrName(),
::mlir::TypeAttr::get(Tindices())}});
}

void TensorScatterAddOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, Value tensor, Value indices, Value updates) {
build(odsBuilder, odsState, tensor.getType(), tensor, indices, updates);
}

void TensorScatterAddOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value tensor, ::mlir::Value indices, ::mlir::Value updates) {
  odsState.addOperands(tensor);
  odsState.addOperands(indices);
  odsState.addOperands(updates);
  odsState.addTypes(output);
}

void TensorScatterAddOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value tensor, ::mlir::Value indices, ::mlir::Value updates) {
  odsState.addOperands(tensor);
  odsState.addOperands(indices);
  odsState.addOperands(updates);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void TensorScatterAddOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 3u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult TensorScatterAddOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void TensorScatterAddOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::TensorScatterAddOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::TensorScatterMaxOp definitions
//===----------------------------------------------------------------------===//

TensorScatterMaxOpAdaptor::TensorScatterMaxOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

TensorScatterMaxOpAdaptor::TensorScatterMaxOpAdaptor(TensorScatterMaxOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange TensorScatterMaxOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> TensorScatterMaxOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange TensorScatterMaxOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TensorScatterMaxOpAdaptor::tensor() {
  return *getODSOperands(0).begin();
}

::mlir::Value TensorScatterMaxOpAdaptor::indices() {
  return *getODSOperands(1).begin();
}

::mlir::Value TensorScatterMaxOpAdaptor::updates() {
  return *getODSOperands(2).begin();
}

::mlir::DictionaryAttr TensorScatterMaxOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult TensorScatterMaxOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> TensorScatterMaxOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range TensorScatterMaxOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TensorScatterMaxOp::tensor() {
  return *getODSOperands(0).begin();
}

::mlir::Value TensorScatterMaxOp::indices() {
  return *getODSOperands(1).begin();
}

::mlir::Value TensorScatterMaxOp::updates() {
  return *getODSOperands(2).begin();
}

::mlir::MutableOperandRange TensorScatterMaxOp::tensorMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange TensorScatterMaxOp::indicesMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange TensorScatterMaxOp::updatesMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> TensorScatterMaxOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range TensorScatterMaxOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TensorScatterMaxOp::output() {
  return *getODSResults(0).begin();
}

::mlir::Type TensorScatterMaxOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

::mlir::Type TensorScatterMaxOp::Tindices() {
  return mlir::getElementTypeOrSelf(*getODSOperands(1).begin());
}

bool TensorScatterMaxOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
  if (name == "Tindices") return true;
 return false;
}

::mlir::DictionaryAttr TensorScatterMaxOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())},
    {TindicesAttrName(),
::mlir::TypeAttr::get(Tindices())}});
}

void TensorScatterMaxOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value tensor, ::mlir::Value indices, ::mlir::Value updates) {
  odsState.addOperands(tensor);
  odsState.addOperands(indices);
  odsState.addOperands(updates);
  odsState.addTypes(output);
}

void TensorScatterMaxOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value tensor, ::mlir::Value indices, ::mlir::Value updates) {
  odsState.addOperands(tensor);
  odsState.addOperands(indices);
  odsState.addOperands(updates);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void TensorScatterMaxOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 3u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult TensorScatterMaxOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void TensorScatterMaxOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::TensorScatterMaxOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::TensorScatterMinOp definitions
//===----------------------------------------------------------------------===//

TensorScatterMinOpAdaptor::TensorScatterMinOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

TensorScatterMinOpAdaptor::TensorScatterMinOpAdaptor(TensorScatterMinOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange TensorScatterMinOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> TensorScatterMinOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange TensorScatterMinOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TensorScatterMinOpAdaptor::tensor() {
  return *getODSOperands(0).begin();
}

::mlir::Value TensorScatterMinOpAdaptor::indices() {
  return *getODSOperands(1).begin();
}

::mlir::Value TensorScatterMinOpAdaptor::updates() {
  return *getODSOperands(2).begin();
}

::mlir::DictionaryAttr TensorScatterMinOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult TensorScatterMinOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> TensorScatterMinOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range TensorScatterMinOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TensorScatterMinOp::tensor() {
  return *getODSOperands(0).begin();
}

::mlir::Value TensorScatterMinOp::indices() {
  return *getODSOperands(1).begin();
}

::mlir::Value TensorScatterMinOp::updates() {
  return *getODSOperands(2).begin();
}

::mlir::MutableOperandRange TensorScatterMinOp::tensorMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange TensorScatterMinOp::indicesMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange TensorScatterMinOp::updatesMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> TensorScatterMinOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range TensorScatterMinOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TensorScatterMinOp::output() {
  return *getODSResults(0).begin();
}

::mlir::Type TensorScatterMinOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

::mlir::Type TensorScatterMinOp::Tindices() {
  return mlir::getElementTypeOrSelf(*getODSOperands(1).begin());
}

bool TensorScatterMinOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
  if (name == "Tindices") return true;
 return false;
}

::mlir::DictionaryAttr TensorScatterMinOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())},
    {TindicesAttrName(),
::mlir::TypeAttr::get(Tindices())}});
}

void TensorScatterMinOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value tensor, ::mlir::Value indices, ::mlir::Value updates) {
  odsState.addOperands(tensor);
  odsState.addOperands(indices);
  odsState.addOperands(updates);
  odsState.addTypes(output);
}

void TensorScatterMinOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value tensor, ::mlir::Value indices, ::mlir::Value updates) {
  odsState.addOperands(tensor);
  odsState.addOperands(indices);
  odsState.addOperands(updates);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void TensorScatterMinOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 3u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult TensorScatterMinOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void TensorScatterMinOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::TensorScatterMinOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::TensorScatterSubOp definitions
//===----------------------------------------------------------------------===//

TensorScatterSubOpAdaptor::TensorScatterSubOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

TensorScatterSubOpAdaptor::TensorScatterSubOpAdaptor(TensorScatterSubOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange TensorScatterSubOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> TensorScatterSubOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange TensorScatterSubOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TensorScatterSubOpAdaptor::tensor() {
  return *getODSOperands(0).begin();
}

::mlir::Value TensorScatterSubOpAdaptor::indices() {
  return *getODSOperands(1).begin();
}

::mlir::Value TensorScatterSubOpAdaptor::updates() {
  return *getODSOperands(2).begin();
}

::mlir::DictionaryAttr TensorScatterSubOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult TensorScatterSubOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> TensorScatterSubOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range TensorScatterSubOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TensorScatterSubOp::tensor() {
  return *getODSOperands(0).begin();
}

::mlir::Value TensorScatterSubOp::indices() {
  return *getODSOperands(1).begin();
}

::mlir::Value TensorScatterSubOp::updates() {
  return *getODSOperands(2).begin();
}

::mlir::MutableOperandRange TensorScatterSubOp::tensorMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange TensorScatterSubOp::indicesMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange TensorScatterSubOp::updatesMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> TensorScatterSubOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range TensorScatterSubOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TensorScatterSubOp::output() {
  return *getODSResults(0).begin();
}

::mlir::Type TensorScatterSubOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

::mlir::Type TensorScatterSubOp::Tindices() {
  return mlir::getElementTypeOrSelf(*getODSOperands(1).begin());
}

bool TensorScatterSubOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
  if (name == "Tindices") return true;
 return false;
}

::mlir::DictionaryAttr TensorScatterSubOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())},
    {TindicesAttrName(),
::mlir::TypeAttr::get(Tindices())}});
}

void TensorScatterSubOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value tensor, ::mlir::Value indices, ::mlir::Value updates) {
  odsState.addOperands(tensor);
  odsState.addOperands(indices);
  odsState.addOperands(updates);
  odsState.addTypes(output);
}

void TensorScatterSubOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value tensor, ::mlir::Value indices, ::mlir::Value updates) {
  odsState.addOperands(tensor);
  odsState.addOperands(indices);
  odsState.addOperands(updates);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void TensorScatterSubOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 3u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult TensorScatterSubOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void TensorScatterSubOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::TensorScatterSubOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::TensorScatterUpdateOp definitions
//===----------------------------------------------------------------------===//

TensorScatterUpdateOpAdaptor::TensorScatterUpdateOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

TensorScatterUpdateOpAdaptor::TensorScatterUpdateOpAdaptor(TensorScatterUpdateOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange TensorScatterUpdateOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> TensorScatterUpdateOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange TensorScatterUpdateOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TensorScatterUpdateOpAdaptor::tensor() {
  return *getODSOperands(0).begin();
}

::mlir::Value TensorScatterUpdateOpAdaptor::indices() {
  return *getODSOperands(1).begin();
}

::mlir::Value TensorScatterUpdateOpAdaptor::updates() {
  return *getODSOperands(2).begin();
}

::mlir::DictionaryAttr TensorScatterUpdateOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult TensorScatterUpdateOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> TensorScatterUpdateOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range TensorScatterUpdateOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TensorScatterUpdateOp::tensor() {
  return *getODSOperands(0).begin();
}

::mlir::Value TensorScatterUpdateOp::indices() {
  return *getODSOperands(1).begin();
}

::mlir::Value TensorScatterUpdateOp::updates() {
  return *getODSOperands(2).begin();
}

::mlir::MutableOperandRange TensorScatterUpdateOp::tensorMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange TensorScatterUpdateOp::indicesMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange TensorScatterUpdateOp::updatesMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> TensorScatterUpdateOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range TensorScatterUpdateOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TensorScatterUpdateOp::output() {
  return *getODSResults(0).begin();
}

::mlir::Type TensorScatterUpdateOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

::mlir::Type TensorScatterUpdateOp::Tindices() {
  return mlir::getElementTypeOrSelf(*getODSOperands(1).begin());
}

bool TensorScatterUpdateOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
  if (name == "Tindices") return true;
 return false;
}

::mlir::DictionaryAttr TensorScatterUpdateOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())},
    {TindicesAttrName(),
::mlir::TypeAttr::get(Tindices())}});
}

void TensorScatterUpdateOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, Value tensor, Value indices, Value updates) {
build(odsBuilder, odsState, tensor.getType(), tensor, indices, updates);
}

void TensorScatterUpdateOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value tensor, ::mlir::Value indices, ::mlir::Value updates) {
  odsState.addOperands(tensor);
  odsState.addOperands(indices);
  odsState.addOperands(updates);
  odsState.addTypes(output);
}

void TensorScatterUpdateOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value tensor, ::mlir::Value indices, ::mlir::Value updates) {
  odsState.addOperands(tensor);
  odsState.addOperands(indices);
  odsState.addOperands(updates);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void TensorScatterUpdateOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 3u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult TensorScatterUpdateOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return Verify(*this);
}

void TensorScatterUpdateOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::TensorScatterUpdateOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::TensorSliceDatasetOp definitions
//===----------------------------------------------------------------------===//

TensorSliceDatasetOpAdaptor::TensorSliceDatasetOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

TensorSliceDatasetOpAdaptor::TensorSliceDatasetOpAdaptor(TensorSliceDatasetOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange TensorSliceDatasetOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> TensorSliceDatasetOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  bool isVariadic[] = {true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (odsOperands.size() - 0) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::ValueRange TensorSliceDatasetOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::ValueRange TensorSliceDatasetOpAdaptor::components() {
  return getODSOperands(0);
}

::mlir::DictionaryAttr TensorSliceDatasetOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::ArrayAttr TensorSliceDatasetOpAdaptor::output_shapes() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("output_shapes").cast<::mlir::ArrayAttr>();
  return attr;
}

::mlir::BoolAttr TensorSliceDatasetOpAdaptor::is_files() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("is_files").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(false);
  return attr;
}

::mlir::StringAttr TensorSliceDatasetOpAdaptor::metadata() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("metadata").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("");
  return attr;
}

::mlir::LogicalResult TensorSliceDatasetOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_output_shapes = odsAttrs.get("output_shapes");
    if (!tblgen_output_shapes)
      return emitError(loc, "'tf.TensorSliceDataset' op ""requires attribute 'output_shapes'");

    if (tblgen_output_shapes && !((((tblgen_output_shapes.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_output_shapes.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return (attr.isa<mlir::TF::ShapeAttr>()); }))) && ((tblgen_output_shapes.cast<::mlir::ArrayAttr>().size() >= 1))))
      return emitError(loc, "'tf.TensorSliceDataset' op ""attribute 'output_shapes' failed to satisfy constraint: tensorflow shape attribute array with at least 1 elements");
  }
  {
    auto tblgen_is_files = odsAttrs.get("is_files");
    if (tblgen_is_files && !((tblgen_is_files.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.TensorSliceDataset' op ""attribute 'is_files' failed to satisfy constraint: bool attribute");
  }
  {
    auto tblgen_metadata = odsAttrs.get("metadata");
    if (tblgen_metadata && !((tblgen_metadata.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.TensorSliceDataset' op ""attribute 'metadata' failed to satisfy constraint: string attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> TensorSliceDatasetOp::getODSOperandIndexAndLength(unsigned index) {
  bool isVariadic[] = {true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (getOperation()->getNumOperands() - 0) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::Operation::operand_range TensorSliceDatasetOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Operation::operand_range TensorSliceDatasetOp::components() {
  return getODSOperands(0);
}

::mlir::MutableOperandRange TensorSliceDatasetOp::componentsMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> TensorSliceDatasetOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range TensorSliceDatasetOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TensorSliceDatasetOp::handle() {
  return *getODSResults(0).begin();
}

::mlir::ArrayAttr TensorSliceDatasetOp::output_shapesAttr() {
  return (*this)->getAttr(output_shapesAttrName()).cast<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr TensorSliceDatasetOp::output_shapes() {
  auto attr = output_shapesAttr();
  return attr;
}

::mlir::BoolAttr TensorSliceDatasetOp::is_filesAttr() {
  return (*this)->getAttr(is_filesAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool TensorSliceDatasetOp::is_files() {
  auto attr = is_filesAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(false).getValue();
  return attr.getValue();
}

::mlir::StringAttr TensorSliceDatasetOp::metadataAttr() {
  return (*this)->getAttr(metadataAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef TensorSliceDatasetOp::metadata() {
  auto attr = metadataAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("").getValue();
  return attr.getValue();
}

mlir::OperandElementTypeRange TensorSliceDatasetOp::Toutput_types() {
  auto values = getODSOperands(0);
return {mlir::OperandElementTypeIterator(values.begin()), mlir::OperandElementTypeIterator(values.end())};
}

bool TensorSliceDatasetOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "Toutput_types") return true;
 return false;
}

::mlir::DictionaryAttr TensorSliceDatasetOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {Toutput_typesAttrName(),
ArrayAttr::get(ctx, 
    [&]() {
      llvm::SmallVector<Attribute, 4> ret;
      for (auto t : Toutput_types())
        ret.push_back(TypeAttr::get(t));
      return ret;
    }())}});
}

void TensorSliceDatasetOp::output_shapesAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(output_shapesAttrName(), attr);
}

void TensorSliceDatasetOp::is_filesAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(is_filesAttrName(), attr);
}

void TensorSliceDatasetOp::metadataAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(metadataAttrName(), attr);
}

void TensorSliceDatasetOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type handle, ::mlir::ValueRange components, ::mlir::ArrayAttr output_shapes, ::mlir::BoolAttr is_files, ::mlir::StringAttr metadata) {
  odsState.addOperands(components);
  odsState.addAttribute(output_shapesAttrName(odsState.name), output_shapes);
  odsState.addAttribute(is_filesAttrName(odsState.name), is_files);
  odsState.addAttribute(metadataAttrName(odsState.name), metadata);
  odsState.addTypes(handle);
}

void TensorSliceDatasetOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange components, ::mlir::ArrayAttr output_shapes, ::mlir::BoolAttr is_files, ::mlir::StringAttr metadata) {
  odsState.addOperands(components);
  odsState.addAttribute(output_shapesAttrName(odsState.name), output_shapes);
  odsState.addAttribute(is_filesAttrName(odsState.name), is_files);
  odsState.addAttribute(metadataAttrName(odsState.name), metadata);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void TensorSliceDatasetOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type handle, ::mlir::ValueRange components, ::mlir::ArrayAttr output_shapes, bool is_files, ::llvm::StringRef metadata) {
  odsState.addOperands(components);
  odsState.addAttribute(output_shapesAttrName(odsState.name), output_shapes);
  odsState.addAttribute(is_filesAttrName(odsState.name), odsBuilder.getBoolAttr(is_files));
  odsState.addAttribute(metadataAttrName(odsState.name), odsBuilder.getStringAttr(metadata));
  odsState.addTypes(handle);
}

void TensorSliceDatasetOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange components, ::mlir::ArrayAttr output_shapes, bool is_files, ::llvm::StringRef metadata) {
  odsState.addOperands(components);
  odsState.addAttribute(output_shapesAttrName(odsState.name), output_shapes);
  odsState.addAttribute(is_filesAttrName(odsState.name), odsBuilder.getBoolAttr(is_files));
  odsState.addAttribute(metadataAttrName(odsState.name), odsBuilder.getStringAttr(metadata));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void TensorSliceDatasetOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult TensorSliceDatasetOp::verify() {
  {
    auto tblgen_output_shapes = (*this)->getAttr(output_shapesAttrName());
    if (!tblgen_output_shapes)
      return emitOpError("requires attribute 'output_shapes'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops3(*this, tblgen_output_shapes, "output_shapes")))
      return ::mlir::failure();
  }
  {
    auto tblgen_is_files = (*this)->getAttr(is_filesAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_is_files, "is_files")))
      return ::mlir::failure();
  }
  {
    auto tblgen_metadata = (*this)->getAttr(metadataAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_metadata, "metadata")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops15(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void TensorSliceDatasetOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::TensorSliceDatasetOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::TensorStridedSliceUpdateOp definitions
//===----------------------------------------------------------------------===//

TensorStridedSliceUpdateOpAdaptor::TensorStridedSliceUpdateOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

TensorStridedSliceUpdateOpAdaptor::TensorStridedSliceUpdateOpAdaptor(TensorStridedSliceUpdateOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange TensorStridedSliceUpdateOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> TensorStridedSliceUpdateOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange TensorStridedSliceUpdateOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TensorStridedSliceUpdateOpAdaptor::input() {
  return *getODSOperands(0).begin();
}

::mlir::Value TensorStridedSliceUpdateOpAdaptor::begin() {
  return *getODSOperands(1).begin();
}

::mlir::Value TensorStridedSliceUpdateOpAdaptor::end() {
  return *getODSOperands(2).begin();
}

::mlir::Value TensorStridedSliceUpdateOpAdaptor::strides() {
  return *getODSOperands(3).begin();
}

::mlir::Value TensorStridedSliceUpdateOpAdaptor::value() {
  return *getODSOperands(4).begin();
}

::mlir::DictionaryAttr TensorStridedSliceUpdateOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::IntegerAttr TensorStridedSliceUpdateOpAdaptor::begin_mask() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("begin_mask").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), 0);
  return attr;
}

::mlir::IntegerAttr TensorStridedSliceUpdateOpAdaptor::end_mask() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("end_mask").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), 0);
  return attr;
}

::mlir::IntegerAttr TensorStridedSliceUpdateOpAdaptor::ellipsis_mask() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("ellipsis_mask").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), 0);
  return attr;
}

::mlir::IntegerAttr TensorStridedSliceUpdateOpAdaptor::new_axis_mask() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("new_axis_mask").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), 0);
  return attr;
}

::mlir::IntegerAttr TensorStridedSliceUpdateOpAdaptor::shrink_axis_mask() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("shrink_axis_mask").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), 0);
  return attr;
}

::mlir::LogicalResult TensorStridedSliceUpdateOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_begin_mask = odsAttrs.get("begin_mask");
    if (tblgen_begin_mask && !(((tblgen_begin_mask.isa<::mlir::IntegerAttr>())) && ((tblgen_begin_mask.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.TensorStridedSliceUpdate' op ""attribute 'begin_mask' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_end_mask = odsAttrs.get("end_mask");
    if (tblgen_end_mask && !(((tblgen_end_mask.isa<::mlir::IntegerAttr>())) && ((tblgen_end_mask.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.TensorStridedSliceUpdate' op ""attribute 'end_mask' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_ellipsis_mask = odsAttrs.get("ellipsis_mask");
    if (tblgen_ellipsis_mask && !(((tblgen_ellipsis_mask.isa<::mlir::IntegerAttr>())) && ((tblgen_ellipsis_mask.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.TensorStridedSliceUpdate' op ""attribute 'ellipsis_mask' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_new_axis_mask = odsAttrs.get("new_axis_mask");
    if (tblgen_new_axis_mask && !(((tblgen_new_axis_mask.isa<::mlir::IntegerAttr>())) && ((tblgen_new_axis_mask.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.TensorStridedSliceUpdate' op ""attribute 'new_axis_mask' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_shrink_axis_mask = odsAttrs.get("shrink_axis_mask");
    if (tblgen_shrink_axis_mask && !(((tblgen_shrink_axis_mask.isa<::mlir::IntegerAttr>())) && ((tblgen_shrink_axis_mask.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.TensorStridedSliceUpdate' op ""attribute 'shrink_axis_mask' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> TensorStridedSliceUpdateOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range TensorStridedSliceUpdateOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TensorStridedSliceUpdateOp::input() {
  return *getODSOperands(0).begin();
}

::mlir::Value TensorStridedSliceUpdateOp::begin() {
  return *getODSOperands(1).begin();
}

::mlir::Value TensorStridedSliceUpdateOp::end() {
  return *getODSOperands(2).begin();
}

::mlir::Value TensorStridedSliceUpdateOp::strides() {
  return *getODSOperands(3).begin();
}

::mlir::Value TensorStridedSliceUpdateOp::value() {
  return *getODSOperands(4).begin();
}

::mlir::MutableOperandRange TensorStridedSliceUpdateOp::inputMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange TensorStridedSliceUpdateOp::beginMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange TensorStridedSliceUpdateOp::endMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange TensorStridedSliceUpdateOp::stridesMutable() {
  auto range = getODSOperandIndexAndLength(3);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange TensorStridedSliceUpdateOp::valueMutable() {
  auto range = getODSOperandIndexAndLength(4);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> TensorStridedSliceUpdateOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range TensorStridedSliceUpdateOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TensorStridedSliceUpdateOp::output() {
  return *getODSResults(0).begin();
}

::mlir::IntegerAttr TensorStridedSliceUpdateOp::begin_maskAttr() {
  return (*this)->getAttr(begin_maskAttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t TensorStridedSliceUpdateOp::begin_mask() {
  auto attr = begin_maskAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), 0).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

::mlir::IntegerAttr TensorStridedSliceUpdateOp::end_maskAttr() {
  return (*this)->getAttr(end_maskAttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t TensorStridedSliceUpdateOp::end_mask() {
  auto attr = end_maskAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), 0).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

::mlir::IntegerAttr TensorStridedSliceUpdateOp::ellipsis_maskAttr() {
  return (*this)->getAttr(ellipsis_maskAttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t TensorStridedSliceUpdateOp::ellipsis_mask() {
  auto attr = ellipsis_maskAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), 0).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

::mlir::IntegerAttr TensorStridedSliceUpdateOp::new_axis_maskAttr() {
  return (*this)->getAttr(new_axis_maskAttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t TensorStridedSliceUpdateOp::new_axis_mask() {
  auto attr = new_axis_maskAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), 0).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

::mlir::IntegerAttr TensorStridedSliceUpdateOp::shrink_axis_maskAttr() {
  return (*this)->getAttr(shrink_axis_maskAttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t TensorStridedSliceUpdateOp::shrink_axis_mask() {
  auto attr = shrink_axis_maskAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), 0).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

::mlir::Type TensorStridedSliceUpdateOp::Index() {
  return mlir::getElementTypeOrSelf(*getODSOperands(1).begin());
}

::mlir::Type TensorStridedSliceUpdateOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool TensorStridedSliceUpdateOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "Index") return true;
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr TensorStridedSliceUpdateOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {IndexAttrName(),
::mlir::TypeAttr::get(Index())},
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void TensorStridedSliceUpdateOp::begin_maskAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(begin_maskAttrName(), attr);
}

void TensorStridedSliceUpdateOp::end_maskAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(end_maskAttrName(), attr);
}

void TensorStridedSliceUpdateOp::ellipsis_maskAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(ellipsis_maskAttrName(), attr);
}

void TensorStridedSliceUpdateOp::new_axis_maskAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(new_axis_maskAttrName(), attr);
}

void TensorStridedSliceUpdateOp::shrink_axis_maskAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(shrink_axis_maskAttrName(), attr);
}

void TensorStridedSliceUpdateOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input, ::mlir::Value begin, ::mlir::Value end, ::mlir::Value strides, ::mlir::Value value, ::mlir::IntegerAttr begin_mask, ::mlir::IntegerAttr end_mask, ::mlir::IntegerAttr ellipsis_mask, ::mlir::IntegerAttr new_axis_mask, ::mlir::IntegerAttr shrink_axis_mask) {
  odsState.addOperands(input);
  odsState.addOperands(begin);
  odsState.addOperands(end);
  odsState.addOperands(strides);
  odsState.addOperands(value);
  odsState.addAttribute(begin_maskAttrName(odsState.name), begin_mask);
  odsState.addAttribute(end_maskAttrName(odsState.name), end_mask);
  odsState.addAttribute(ellipsis_maskAttrName(odsState.name), ellipsis_mask);
  odsState.addAttribute(new_axis_maskAttrName(odsState.name), new_axis_mask);
  odsState.addAttribute(shrink_axis_maskAttrName(odsState.name), shrink_axis_mask);
  odsState.addTypes(output);
}

void TensorStridedSliceUpdateOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::Value begin, ::mlir::Value end, ::mlir::Value strides, ::mlir::Value value, ::mlir::IntegerAttr begin_mask, ::mlir::IntegerAttr end_mask, ::mlir::IntegerAttr ellipsis_mask, ::mlir::IntegerAttr new_axis_mask, ::mlir::IntegerAttr shrink_axis_mask) {
  odsState.addOperands(input);
  odsState.addOperands(begin);
  odsState.addOperands(end);
  odsState.addOperands(strides);
  odsState.addOperands(value);
  odsState.addAttribute(begin_maskAttrName(odsState.name), begin_mask);
  odsState.addAttribute(end_maskAttrName(odsState.name), end_mask);
  odsState.addAttribute(ellipsis_maskAttrName(odsState.name), ellipsis_mask);
  odsState.addAttribute(new_axis_maskAttrName(odsState.name), new_axis_mask);
  odsState.addAttribute(shrink_axis_maskAttrName(odsState.name), shrink_axis_mask);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void TensorStridedSliceUpdateOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input, ::mlir::Value begin, ::mlir::Value end, ::mlir::Value strides, ::mlir::Value value, uint64_t begin_mask, uint64_t end_mask, uint64_t ellipsis_mask, uint64_t new_axis_mask, uint64_t shrink_axis_mask) {
  odsState.addOperands(input);
  odsState.addOperands(begin);
  odsState.addOperands(end);
  odsState.addOperands(strides);
  odsState.addOperands(value);
  odsState.addAttribute(begin_maskAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), begin_mask));
  odsState.addAttribute(end_maskAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), end_mask));
  odsState.addAttribute(ellipsis_maskAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), ellipsis_mask));
  odsState.addAttribute(new_axis_maskAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), new_axis_mask));
  odsState.addAttribute(shrink_axis_maskAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), shrink_axis_mask));
  odsState.addTypes(output);
}

void TensorStridedSliceUpdateOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::Value begin, ::mlir::Value end, ::mlir::Value strides, ::mlir::Value value, uint64_t begin_mask, uint64_t end_mask, uint64_t ellipsis_mask, uint64_t new_axis_mask, uint64_t shrink_axis_mask) {
  odsState.addOperands(input);
  odsState.addOperands(begin);
  odsState.addOperands(end);
  odsState.addOperands(strides);
  odsState.addOperands(value);
  odsState.addAttribute(begin_maskAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), begin_mask));
  odsState.addAttribute(end_maskAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), end_mask));
  odsState.addAttribute(ellipsis_maskAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), ellipsis_mask));
  odsState.addAttribute(new_axis_maskAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), new_axis_mask));
  odsState.addAttribute(shrink_axis_maskAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), shrink_axis_mask));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void TensorStridedSliceUpdateOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 5u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult TensorStridedSliceUpdateOp::verify() {
  {
    auto tblgen_begin_mask = (*this)->getAttr(begin_maskAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_begin_mask, "begin_mask")))
      return ::mlir::failure();
  }
  {
    auto tblgen_end_mask = (*this)->getAttr(end_maskAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_end_mask, "end_mask")))
      return ::mlir::failure();
  }
  {
    auto tblgen_ellipsis_mask = (*this)->getAttr(ellipsis_maskAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_ellipsis_mask, "ellipsis_mask")))
      return ::mlir::failure();
  }
  {
    auto tblgen_new_axis_mask = (*this)->getAttr(new_axis_maskAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_new_axis_mask, "new_axis_mask")))
      return ::mlir::failure();
  }
  {
    auto tblgen_shrink_axis_mask = (*this)->getAttr(shrink_axis_maskAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_shrink_axis_mask, "shrink_axis_mask")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup3 = getODSOperands(3);

    for (auto v : valueGroup3) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup4 = getODSOperands(4);

    for (auto v : valueGroup4) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void TensorStridedSliceUpdateOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::TensorStridedSliceUpdateOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::TileOp definitions
//===----------------------------------------------------------------------===//

TileOpAdaptor::TileOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

TileOpAdaptor::TileOpAdaptor(TileOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange TileOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> TileOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange TileOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TileOpAdaptor::input() {
  return *getODSOperands(0).begin();
}

::mlir::Value TileOpAdaptor::multiples() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr TileOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult TileOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> TileOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range TileOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TileOp::input() {
  return *getODSOperands(0).begin();
}

::mlir::Value TileOp::multiples() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange TileOp::inputMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange TileOp::multiplesMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> TileOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range TileOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TileOp::output() {
  return *getODSResults(0).begin();
}

::mlir::Type TileOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

::mlir::Type TileOp::Tmultiples() {
  return mlir::getElementTypeOrSelf(*getODSOperands(1).begin());
}

bool TileOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
  if (name == "Tmultiples") return true;
 return false;
}

::mlir::DictionaryAttr TileOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())},
    {TmultiplesAttrName(),
::mlir::TypeAttr::get(Tmultiples())}});
}

void TileOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input, ::mlir::Value multiples) {
  odsState.addOperands(input);
  odsState.addOperands(multiples);
  odsState.addTypes(output);
}

void TileOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::Value multiples) {
  odsState.addOperands(input);
  odsState.addOperands(multiples);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void TileOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult TileOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return Verify(*this);
}

void TileOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::TileOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::TimestampOp definitions
//===----------------------------------------------------------------------===//

TimestampOpAdaptor::TimestampOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

TimestampOpAdaptor::TimestampOpAdaptor(TimestampOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange TimestampOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> TimestampOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange TimestampOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::DictionaryAttr TimestampOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult TimestampOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> TimestampOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range TimestampOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

std::pair<unsigned, unsigned> TimestampOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range TimestampOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TimestampOp::ts() {
  return *getODSResults(0).begin();
}

void TimestampOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type ts) {
  odsState.addTypes(ts);
}

void TimestampOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes) {
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void TimestampOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 0u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult TimestampOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops59(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::TimestampOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::ToBoolOp definitions
//===----------------------------------------------------------------------===//

ToBoolOpAdaptor::ToBoolOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

ToBoolOpAdaptor::ToBoolOpAdaptor(ToBoolOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange ToBoolOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> ToBoolOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange ToBoolOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ToBoolOpAdaptor::input() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr ToBoolOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult ToBoolOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> ToBoolOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range ToBoolOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ToBoolOp::input() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange ToBoolOp::inputMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> ToBoolOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range ToBoolOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ToBoolOp::output() {
  return *getODSResults(0).begin();
}

::mlir::Type ToBoolOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool ToBoolOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr ToBoolOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void ToBoolOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input) {
  odsState.addOperands(input);
  odsState.addTypes(output);
}

void ToBoolOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value input) {
  odsState.addOperands(input);

        ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
        if (::mlir::succeeded(ToBoolOp::inferReturnTypes(odsBuilder.getContext(),
                      odsState.location, odsState.operands,
                      odsState.attributes.getDictionary(odsState.getContext()),
                      /*regions=*/{}, inferredReturnTypes)))
          odsState.addTypes(inferredReturnTypes);
        else
          ::llvm::report_fatal_error("Failed to infer result type(s).");
}

void ToBoolOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input) {
  odsState.addOperands(input);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void ToBoolOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

void ToBoolOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);

  ::mlir::SmallVector<::mlir::Type, 2> inferredReturnTypes;
  if (::mlir::succeeded(ToBoolOp::inferReturnTypes(odsBuilder.getContext(),
          odsState.location, operands,
          odsState.attributes.getDictionary(odsState.getContext()),
          odsState.regions, inferredReturnTypes))) {
    assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
    odsState.addTypes(inferredReturnTypes);
  } else {
    ::llvm::report_fatal_error("Failed to infer result type(s).");
  }
}

::mlir::LogicalResult ToBoolOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops60(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void ToBoolOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::ToBoolOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::TopKUniqueOp definitions
//===----------------------------------------------------------------------===//

TopKUniqueOpAdaptor::TopKUniqueOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

TopKUniqueOpAdaptor::TopKUniqueOpAdaptor(TopKUniqueOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange TopKUniqueOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> TopKUniqueOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange TopKUniqueOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TopKUniqueOpAdaptor::input() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr TopKUniqueOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::IntegerAttr TopKUniqueOpAdaptor::k() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("k").cast<::mlir::IntegerAttr>();
  return attr;
}

::mlir::LogicalResult TopKUniqueOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_k = odsAttrs.get("k");
    if (!tblgen_k)
      return emitError(loc, "'tf.TopKUnique' op ""requires attribute 'k'");

    if (tblgen_k && !(((tblgen_k.isa<::mlir::IntegerAttr>())) && ((tblgen_k.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.TopKUnique' op ""attribute 'k' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  return ::mlir::success();
}

void TopKUniqueOp::getAsmResultNames(::mlir::OpAsmSetValueNameFn setNameFn) {
  auto resultGroup0 = getODSResults(0);
  if (!llvm::empty(resultGroup0))
    setNameFn(*resultGroup0.begin(), "topk");
  auto resultGroup1 = getODSResults(1);
  if (!llvm::empty(resultGroup1))
    setNameFn(*resultGroup1.begin(), "topk_indices");
}

std::pair<unsigned, unsigned> TopKUniqueOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range TopKUniqueOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TopKUniqueOp::input() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange TopKUniqueOp::inputMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> TopKUniqueOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range TopKUniqueOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TopKUniqueOp::topk() {
  return *getODSResults(0).begin();
}

::mlir::Value TopKUniqueOp::topk_indices() {
  return *getODSResults(1).begin();
}

::mlir::IntegerAttr TopKUniqueOp::kAttr() {
  return (*this)->getAttr(kAttrName()).cast<::mlir::IntegerAttr>();
}

uint64_t TopKUniqueOp::k() {
  auto attr = kAttr();
  return attr.getValue().getZExtValue();
}

void TopKUniqueOp::kAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(kAttrName(), attr);
}

void TopKUniqueOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type topk, ::mlir::Type topk_indices, ::mlir::Value input, ::mlir::IntegerAttr k) {
  odsState.addOperands(input);
  odsState.addAttribute(kAttrName(odsState.name), k);
  odsState.addTypes(topk);
  odsState.addTypes(topk_indices);
}

void TopKUniqueOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::IntegerAttr k) {
  odsState.addOperands(input);
  odsState.addAttribute(kAttrName(odsState.name), k);
  assert(resultTypes.size() == 2u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void TopKUniqueOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type topk, ::mlir::Type topk_indices, ::mlir::Value input, uint64_t k) {
  odsState.addOperands(input);
  odsState.addAttribute(kAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), k));
  odsState.addTypes(topk);
  odsState.addTypes(topk_indices);
}

void TopKUniqueOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, uint64_t k) {
  odsState.addOperands(input);
  odsState.addAttribute(kAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), k));
  assert(resultTypes.size() == 2u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void TopKUniqueOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 2u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult TopKUniqueOp::verify() {
  {
    auto tblgen_k = (*this)->getAttr(kAttrName());
    if (!tblgen_k)
      return emitOpError("requires attribute 'k'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_k, "k")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSResults(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops11(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void TopKUniqueOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::TopKUniqueOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::TopKV2Op definitions
//===----------------------------------------------------------------------===//

TopKV2OpAdaptor::TopKV2OpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

TopKV2OpAdaptor::TopKV2OpAdaptor(TopKV2Op &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange TopKV2OpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> TopKV2OpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange TopKV2OpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TopKV2OpAdaptor::input() {
  return *getODSOperands(0).begin();
}

::mlir::Value TopKV2OpAdaptor::k() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr TopKV2OpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::BoolAttr TopKV2OpAdaptor::sorted() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("sorted").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(true);
  return attr;
}

::mlir::LogicalResult TopKV2OpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_sorted = odsAttrs.get("sorted");
    if (tblgen_sorted && !((tblgen_sorted.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.TopKV2' op ""attribute 'sorted' failed to satisfy constraint: bool attribute");
  }
  return ::mlir::success();
}

void TopKV2Op::getAsmResultNames(::mlir::OpAsmSetValueNameFn setNameFn) {
  auto resultGroup0 = getODSResults(0);
  if (!llvm::empty(resultGroup0))
    setNameFn(*resultGroup0.begin(), "values");
  auto resultGroup1 = getODSResults(1);
  if (!llvm::empty(resultGroup1))
    setNameFn(*resultGroup1.begin(), "indices");
}

std::pair<unsigned, unsigned> TopKV2Op::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range TopKV2Op::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TopKV2Op::input() {
  return *getODSOperands(0).begin();
}

::mlir::Value TopKV2Op::k() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange TopKV2Op::inputMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange TopKV2Op::kMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> TopKV2Op::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range TopKV2Op::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TopKV2Op::values() {
  return *getODSResults(0).begin();
}

::mlir::Value TopKV2Op::indices() {
  return *getODSResults(1).begin();
}

::mlir::BoolAttr TopKV2Op::sortedAttr() {
  return (*this)->getAttr(sortedAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool TopKV2Op::sorted() {
  auto attr = sortedAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(true).getValue();
  return attr.getValue();
}

::mlir::Type TopKV2Op::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool TopKV2Op::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr TopKV2Op::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void TopKV2Op::sortedAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(sortedAttrName(), attr);
}

void TopKV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type values, ::mlir::Type indices, ::mlir::Value input, ::mlir::Value k, ::mlir::BoolAttr sorted) {
  odsState.addOperands(input);
  odsState.addOperands(k);
  odsState.addAttribute(sortedAttrName(odsState.name), sorted);
  odsState.addTypes(values);
  odsState.addTypes(indices);
}

void TopKV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::Value k, ::mlir::BoolAttr sorted) {
  odsState.addOperands(input);
  odsState.addOperands(k);
  odsState.addAttribute(sortedAttrName(odsState.name), sorted);
  assert(resultTypes.size() == 2u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void TopKV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type values, ::mlir::Type indices, ::mlir::Value input, ::mlir::Value k, bool sorted) {
  odsState.addOperands(input);
  odsState.addOperands(k);
  odsState.addAttribute(sortedAttrName(odsState.name), odsBuilder.getBoolAttr(sorted));
  odsState.addTypes(values);
  odsState.addTypes(indices);
}

void TopKV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::Value k, bool sorted) {
  odsState.addOperands(input);
  odsState.addOperands(k);
  odsState.addAttribute(sortedAttrName(odsState.name), odsBuilder.getBoolAttr(sorted));
  assert(resultTypes.size() == 2u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void TopKV2Op::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 2u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult TopKV2Op::verify() {
  {
    auto tblgen_sorted = (*this)->getAttr(sortedAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_sorted, "sorted")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops35(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops11(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops35(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSResults(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops11(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return Verify(*this);
}

void TopKV2Op::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::TopKV2Op)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::TopKWithUniqueOp definitions
//===----------------------------------------------------------------------===//

TopKWithUniqueOpAdaptor::TopKWithUniqueOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

TopKWithUniqueOpAdaptor::TopKWithUniqueOpAdaptor(TopKWithUniqueOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange TopKWithUniqueOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> TopKWithUniqueOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange TopKWithUniqueOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TopKWithUniqueOpAdaptor::input() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr TopKWithUniqueOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::IntegerAttr TopKWithUniqueOpAdaptor::k() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("k").cast<::mlir::IntegerAttr>();
  return attr;
}

::mlir::LogicalResult TopKWithUniqueOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_k = odsAttrs.get("k");
    if (!tblgen_k)
      return emitError(loc, "'tf.TopKWithUnique' op ""requires attribute 'k'");

    if (tblgen_k && !(((tblgen_k.isa<::mlir::IntegerAttr>())) && ((tblgen_k.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.TopKWithUnique' op ""attribute 'k' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  return ::mlir::success();
}

void TopKWithUniqueOp::getAsmResultNames(::mlir::OpAsmSetValueNameFn setNameFn) {
  auto resultGroup0 = getODSResults(0);
  if (!llvm::empty(resultGroup0))
    setNameFn(*resultGroup0.begin(), "topk");
  auto resultGroup1 = getODSResults(1);
  if (!llvm::empty(resultGroup1))
    setNameFn(*resultGroup1.begin(), "topk_indices");
}

std::pair<unsigned, unsigned> TopKWithUniqueOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range TopKWithUniqueOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TopKWithUniqueOp::input() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange TopKWithUniqueOp::inputMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> TopKWithUniqueOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range TopKWithUniqueOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TopKWithUniqueOp::topk() {
  return *getODSResults(0).begin();
}

::mlir::Value TopKWithUniqueOp::topk_indices() {
  return *getODSResults(1).begin();
}

::mlir::IntegerAttr TopKWithUniqueOp::kAttr() {
  return (*this)->getAttr(kAttrName()).cast<::mlir::IntegerAttr>();
}

uint64_t TopKWithUniqueOp::k() {
  auto attr = kAttr();
  return attr.getValue().getZExtValue();
}

void TopKWithUniqueOp::kAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(kAttrName(), attr);
}

void TopKWithUniqueOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type topk, ::mlir::Type topk_indices, ::mlir::Value input, ::mlir::IntegerAttr k) {
  odsState.addOperands(input);
  odsState.addAttribute(kAttrName(odsState.name), k);
  odsState.addTypes(topk);
  odsState.addTypes(topk_indices);
}

void TopKWithUniqueOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::IntegerAttr k) {
  odsState.addOperands(input);
  odsState.addAttribute(kAttrName(odsState.name), k);
  assert(resultTypes.size() == 2u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void TopKWithUniqueOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type topk, ::mlir::Type topk_indices, ::mlir::Value input, uint64_t k) {
  odsState.addOperands(input);
  odsState.addAttribute(kAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), k));
  odsState.addTypes(topk);
  odsState.addTypes(topk_indices);
}

void TopKWithUniqueOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, uint64_t k) {
  odsState.addOperands(input);
  odsState.addAttribute(kAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), k));
  assert(resultTypes.size() == 2u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void TopKWithUniqueOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 2u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult TopKWithUniqueOp::verify() {
  {
    auto tblgen_k = (*this)->getAttr(kAttrName());
    if (!tblgen_k)
      return emitOpError("requires attribute 'k'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_k, "k")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSResults(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops11(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void TopKWithUniqueOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::TopKWithUniqueOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::TransposeOp definitions
//===----------------------------------------------------------------------===//

TransposeOpAdaptor::TransposeOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

TransposeOpAdaptor::TransposeOpAdaptor(TransposeOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange TransposeOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> TransposeOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange TransposeOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TransposeOpAdaptor::x() {
  return *getODSOperands(0).begin();
}

::mlir::Value TransposeOpAdaptor::perm() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr TransposeOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult TransposeOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> TransposeOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range TransposeOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TransposeOp::x() {
  return *getODSOperands(0).begin();
}

::mlir::Value TransposeOp::perm() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange TransposeOp::xMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange TransposeOp::permMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> TransposeOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range TransposeOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TransposeOp::y() {
  return *getODSResults(0).begin();
}

::mlir::Type TransposeOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

::mlir::Type TransposeOp::Tperm() {
  return mlir::getElementTypeOrSelf(*getODSOperands(1).begin());
}

bool TransposeOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
  if (name == "Tperm") return true;
 return false;
}

::mlir::DictionaryAttr TransposeOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())},
    {TpermAttrName(),
::mlir::TypeAttr::get(Tperm())}});
}

void TransposeOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type y, ::mlir::Value x, ::mlir::Value perm) {
  odsState.addOperands(x);
  odsState.addOperands(perm);
  odsState.addTypes(y);
}

void TransposeOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value x, ::mlir::Value perm) {
  odsState.addOperands(x);
  odsState.addOperands(perm);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void TransposeOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult TransposeOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return Verify(*this);
}

void TransposeOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::TransposeOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::TridiagonalSolveOp definitions
//===----------------------------------------------------------------------===//

TridiagonalSolveOpAdaptor::TridiagonalSolveOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

TridiagonalSolveOpAdaptor::TridiagonalSolveOpAdaptor(TridiagonalSolveOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange TridiagonalSolveOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> TridiagonalSolveOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange TridiagonalSolveOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TridiagonalSolveOpAdaptor::diagonals() {
  return *getODSOperands(0).begin();
}

::mlir::Value TridiagonalSolveOpAdaptor::rhs() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr TridiagonalSolveOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::BoolAttr TridiagonalSolveOpAdaptor::partial_pivoting() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("partial_pivoting").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(true);
  return attr;
}

::mlir::BoolAttr TridiagonalSolveOpAdaptor::perturb_singular() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("perturb_singular").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(false);
  return attr;
}

::mlir::LogicalResult TridiagonalSolveOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_partial_pivoting = odsAttrs.get("partial_pivoting");
    if (tblgen_partial_pivoting && !((tblgen_partial_pivoting.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.TridiagonalSolve' op ""attribute 'partial_pivoting' failed to satisfy constraint: bool attribute");
  }
  {
    auto tblgen_perturb_singular = odsAttrs.get("perturb_singular");
    if (tblgen_perturb_singular && !((tblgen_perturb_singular.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.TridiagonalSolve' op ""attribute 'perturb_singular' failed to satisfy constraint: bool attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> TridiagonalSolveOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range TridiagonalSolveOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TridiagonalSolveOp::diagonals() {
  return *getODSOperands(0).begin();
}

::mlir::Value TridiagonalSolveOp::rhs() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange TridiagonalSolveOp::diagonalsMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange TridiagonalSolveOp::rhsMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> TridiagonalSolveOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range TridiagonalSolveOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TridiagonalSolveOp::output() {
  return *getODSResults(0).begin();
}

::mlir::BoolAttr TridiagonalSolveOp::partial_pivotingAttr() {
  return (*this)->getAttr(partial_pivotingAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool TridiagonalSolveOp::partial_pivoting() {
  auto attr = partial_pivotingAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(true).getValue();
  return attr.getValue();
}

::mlir::BoolAttr TridiagonalSolveOp::perturb_singularAttr() {
  return (*this)->getAttr(perturb_singularAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool TridiagonalSolveOp::perturb_singular() {
  auto attr = perturb_singularAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(false).getValue();
  return attr.getValue();
}

::mlir::Type TridiagonalSolveOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool TridiagonalSolveOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr TridiagonalSolveOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void TridiagonalSolveOp::partial_pivotingAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(partial_pivotingAttrName(), attr);
}

void TridiagonalSolveOp::perturb_singularAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(perturb_singularAttrName(), attr);
}

void TridiagonalSolveOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value diagonals, ::mlir::Value rhs, ::mlir::BoolAttr partial_pivoting, ::mlir::BoolAttr perturb_singular) {
  odsState.addOperands(diagonals);
  odsState.addOperands(rhs);
  odsState.addAttribute(partial_pivotingAttrName(odsState.name), partial_pivoting);
  odsState.addAttribute(perturb_singularAttrName(odsState.name), perturb_singular);
  odsState.addTypes(output);
}

void TridiagonalSolveOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value diagonals, ::mlir::Value rhs, ::mlir::BoolAttr partial_pivoting, ::mlir::BoolAttr perturb_singular) {
  odsState.addOperands(diagonals);
  odsState.addOperands(rhs);
  odsState.addAttribute(partial_pivotingAttrName(odsState.name), partial_pivoting);
  odsState.addAttribute(perturb_singularAttrName(odsState.name), perturb_singular);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void TridiagonalSolveOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value diagonals, ::mlir::Value rhs, bool partial_pivoting, bool perturb_singular) {
  odsState.addOperands(diagonals);
  odsState.addOperands(rhs);
  odsState.addAttribute(partial_pivotingAttrName(odsState.name), odsBuilder.getBoolAttr(partial_pivoting));
  odsState.addAttribute(perturb_singularAttrName(odsState.name), odsBuilder.getBoolAttr(perturb_singular));
  odsState.addTypes(output);
}

void TridiagonalSolveOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value diagonals, ::mlir::Value rhs, bool partial_pivoting, bool perturb_singular) {
  odsState.addOperands(diagonals);
  odsState.addOperands(rhs);
  odsState.addAttribute(partial_pivotingAttrName(odsState.name), odsBuilder.getBoolAttr(partial_pivoting));
  odsState.addAttribute(perturb_singularAttrName(odsState.name), odsBuilder.getBoolAttr(perturb_singular));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void TridiagonalSolveOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult TridiagonalSolveOp::verify() {
  {
    auto tblgen_partial_pivoting = (*this)->getAttr(partial_pivotingAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_partial_pivoting, "partial_pivoting")))
      return ::mlir::failure();
  }
  {
    auto tblgen_perturb_singular = (*this)->getAttr(perturb_singularAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_perturb_singular, "perturb_singular")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops61(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops61(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops61(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void TridiagonalSolveOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::TridiagonalSolveOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::TruncateDivOp definitions
//===----------------------------------------------------------------------===//

TruncateDivOpAdaptor::TruncateDivOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

TruncateDivOpAdaptor::TruncateDivOpAdaptor(TruncateDivOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange TruncateDivOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> TruncateDivOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange TruncateDivOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TruncateDivOpAdaptor::x() {
  return *getODSOperands(0).begin();
}

::mlir::Value TruncateDivOpAdaptor::y() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr TruncateDivOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult TruncateDivOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> TruncateDivOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range TruncateDivOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TruncateDivOp::x() {
  return *getODSOperands(0).begin();
}

::mlir::Value TruncateDivOp::y() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange TruncateDivOp::xMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange TruncateDivOp::yMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> TruncateDivOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range TruncateDivOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TruncateDivOp::z() {
  return *getODSResults(0).begin();
}

::mlir::Type TruncateDivOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool TruncateDivOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr TruncateDivOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void TruncateDivOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, Value x, Value y) {
  auto resultType =
      OpTrait::util::getBroadcastedType(x.getType(), y.getType());
  if (!resultType)
    mlir::emitError(odsState.location, "non-broadcastable operands");
  return build(odsBuilder, odsState, resultType, x, y);
}

void TruncateDivOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type z, ::mlir::Value x, ::mlir::Value y) {
  odsState.addOperands(x);
  odsState.addOperands(y);
  odsState.addTypes(z);
}

void TruncateDivOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value x, ::mlir::Value y) {
  odsState.addOperands(x);
  odsState.addOperands(y);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void TruncateDivOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult TruncateDivOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops5(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops5(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops5(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void TruncateDivOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::TruncateDivOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::TruncateModOp definitions
//===----------------------------------------------------------------------===//

TruncateModOpAdaptor::TruncateModOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

TruncateModOpAdaptor::TruncateModOpAdaptor(TruncateModOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange TruncateModOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> TruncateModOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange TruncateModOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TruncateModOpAdaptor::x() {
  return *getODSOperands(0).begin();
}

::mlir::Value TruncateModOpAdaptor::y() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr TruncateModOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult TruncateModOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> TruncateModOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range TruncateModOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TruncateModOp::x() {
  return *getODSOperands(0).begin();
}

::mlir::Value TruncateModOp::y() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange TruncateModOp::xMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange TruncateModOp::yMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> TruncateModOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range TruncateModOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TruncateModOp::z() {
  return *getODSResults(0).begin();
}

::mlir::Type TruncateModOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool TruncateModOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr TruncateModOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void TruncateModOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, Value x, Value y) {
  auto resultType =
      OpTrait::util::getBroadcastedType(x.getType(), y.getType());
  if (!resultType)
    mlir::emitError(odsState.location, "non-broadcastable operands");
  return build(odsBuilder, odsState, resultType, x, y);
}

void TruncateModOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type z, ::mlir::Value x, ::mlir::Value y) {
  odsState.addOperands(x);
  odsState.addOperands(y);
  odsState.addTypes(z);
}

void TruncateModOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value x, ::mlir::Value y) {
  odsState.addOperands(x);
  odsState.addOperands(y);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void TruncateModOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult TruncateModOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops32(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops32(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops32(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void TruncateModOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::TruncateModOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::TruncatedNormalOp definitions
//===----------------------------------------------------------------------===//

TruncatedNormalOpAdaptor::TruncatedNormalOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

TruncatedNormalOpAdaptor::TruncatedNormalOpAdaptor(TruncatedNormalOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange TruncatedNormalOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> TruncatedNormalOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange TruncatedNormalOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TruncatedNormalOpAdaptor::shape() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr TruncatedNormalOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::IntegerAttr TruncatedNormalOpAdaptor::seed() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("seed").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), 0);
  return attr;
}

::mlir::IntegerAttr TruncatedNormalOpAdaptor::seed2() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("seed2").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), 0);
  return attr;
}

::mlir::LogicalResult TruncatedNormalOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_seed = odsAttrs.get("seed");
    if (tblgen_seed && !(((tblgen_seed.isa<::mlir::IntegerAttr>())) && ((tblgen_seed.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.TruncatedNormal' op ""attribute 'seed' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_seed2 = odsAttrs.get("seed2");
    if (tblgen_seed2 && !(((tblgen_seed2.isa<::mlir::IntegerAttr>())) && ((tblgen_seed2.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.TruncatedNormal' op ""attribute 'seed2' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> TruncatedNormalOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range TruncatedNormalOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TruncatedNormalOp::shape() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange TruncatedNormalOp::shapeMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> TruncatedNormalOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range TruncatedNormalOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value TruncatedNormalOp::output() {
  return *getODSResults(0).begin();
}

::mlir::IntegerAttr TruncatedNormalOp::seedAttr() {
  return (*this)->getAttr(seedAttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t TruncatedNormalOp::seed() {
  auto attr = seedAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), 0).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

::mlir::IntegerAttr TruncatedNormalOp::seed2Attr() {
  return (*this)->getAttr(seed2AttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t TruncatedNormalOp::seed2() {
  auto attr = seed2Attr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), 0).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

::mlir::Type TruncatedNormalOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

::mlir::Type TruncatedNormalOp::dtype() {
  return mlir::getElementTypeOrSelf(*getODSResults(0).begin());
}

bool TruncatedNormalOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
  if (name == "dtype") return true;
 return false;
}

::mlir::DictionaryAttr TruncatedNormalOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())},
    {dtypeAttrName(),
::mlir::TypeAttr::get(dtype())}});
}

void TruncatedNormalOp::seedAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(seedAttrName(), attr);
}

void TruncatedNormalOp::seed2Attr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(seed2AttrName(), attr);
}

void TruncatedNormalOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value shape, ::mlir::IntegerAttr seed, ::mlir::IntegerAttr seed2) {
  odsState.addOperands(shape);
  odsState.addAttribute(seedAttrName(odsState.name), seed);
  odsState.addAttribute(seed2AttrName(odsState.name), seed2);
  odsState.addTypes(output);
}

void TruncatedNormalOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value shape, ::mlir::IntegerAttr seed, ::mlir::IntegerAttr seed2) {
  odsState.addOperands(shape);
  odsState.addAttribute(seedAttrName(odsState.name), seed);
  odsState.addAttribute(seed2AttrName(odsState.name), seed2);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void TruncatedNormalOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value shape, uint64_t seed, uint64_t seed2) {
  odsState.addOperands(shape);
  odsState.addAttribute(seedAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), seed));
  odsState.addAttribute(seed2AttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), seed2));
  odsState.addTypes(output);
}

void TruncatedNormalOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value shape, uint64_t seed, uint64_t seed2) {
  odsState.addOperands(shape);
  odsState.addAttribute(seedAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), seed));
  odsState.addAttribute(seed2AttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), seed2));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void TruncatedNormalOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult TruncatedNormalOp::verify() {
  {
    auto tblgen_seed = (*this)->getAttr(seedAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_seed, "seed")))
      return ::mlir::failure();
  }
  {
    auto tblgen_seed2 = (*this)->getAttr(seed2AttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_seed2, "seed2")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops21(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::TruncatedNormalOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::UncompressElementOp definitions
//===----------------------------------------------------------------------===//

UncompressElementOpAdaptor::UncompressElementOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

UncompressElementOpAdaptor::UncompressElementOpAdaptor(UncompressElementOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange UncompressElementOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> UncompressElementOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange UncompressElementOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value UncompressElementOpAdaptor::compressed() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr UncompressElementOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult UncompressElementOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> UncompressElementOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range UncompressElementOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value UncompressElementOp::compressed() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange UncompressElementOp::compressedMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> UncompressElementOp::getODSResultIndexAndLength(unsigned index) {
  bool isVariadic[] = {true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (getOperation()->getNumResults() - 0) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::Operation::result_range UncompressElementOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Operation::result_range UncompressElementOp::components() {
  return getODSResults(0);
}

mlir::TF::ResultShapeRange UncompressElementOp::output_shapes() {
  auto values = getODSResults(0);
return {mlir::TF::ResultShapeIterator(values.begin()), mlir::TF::ResultShapeIterator(values.end())};
}

mlir::ResultElementTypeRange UncompressElementOp::output_types() {
  auto values = getODSResults(0);
return {mlir::ResultElementTypeIterator(values.begin()), mlir::ResultElementTypeIterator(values.end())};
}

bool UncompressElementOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "output_shapes") return true;
  if (name == "output_types") return true;
 return false;
}

::mlir::DictionaryAttr UncompressElementOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {output_shapesAttrName(),
ArrayAttr::get(ctx,
      [&](){
        llvm::SmallVector<Attribute, 4> ret;
        for (auto shape : output_shapes())
          ret.push_back(mlir::TF::ShapeAttr::get(ctx, shape));
        return ret;
      }())},
    {output_typesAttrName(),
ArrayAttr::get(ctx, 
    [&]() {
      llvm::SmallVector<Attribute, 4> ret;
      for (auto t : output_types())
        ret.push_back(TypeAttr::get(t));
      return ret;
    }())}});
}

void UncompressElementOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange components, ::mlir::Value compressed) {
  odsState.addOperands(compressed);
  odsState.addTypes(components);
}

void UncompressElementOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult UncompressElementOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops15(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void UncompressElementOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::UncompressElementOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::UniqueOp definitions
//===----------------------------------------------------------------------===//

UniqueOpAdaptor::UniqueOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

UniqueOpAdaptor::UniqueOpAdaptor(UniqueOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange UniqueOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> UniqueOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange UniqueOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value UniqueOpAdaptor::x() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr UniqueOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult UniqueOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

void UniqueOp::getAsmResultNames(::mlir::OpAsmSetValueNameFn setNameFn) {
  auto resultGroup0 = getODSResults(0);
  if (!llvm::empty(resultGroup0))
    setNameFn(*resultGroup0.begin(), "y");
  auto resultGroup1 = getODSResults(1);
  if (!llvm::empty(resultGroup1))
    setNameFn(*resultGroup1.begin(), "idx");
}

std::pair<unsigned, unsigned> UniqueOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range UniqueOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value UniqueOp::x() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange UniqueOp::xMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> UniqueOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range UniqueOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value UniqueOp::y() {
  return *getODSResults(0).begin();
}

::mlir::Value UniqueOp::idx() {
  return *getODSResults(1).begin();
}

::mlir::Type UniqueOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

::mlir::Type UniqueOp::out_idx() {
  return mlir::getElementTypeOrSelf(*getODSResults(1).begin());
}

bool UniqueOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
  if (name == "out_idx") return true;
 return false;
}

::mlir::DictionaryAttr UniqueOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())},
    {out_idxAttrName(),
::mlir::TypeAttr::get(out_idx())}});
}

void UniqueOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type y, ::mlir::Type idx, ::mlir::Value x) {
  odsState.addOperands(x);
  odsState.addTypes(y);
  odsState.addTypes(idx);
}

void UniqueOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value x) {
  odsState.addOperands(x);
  assert(resultTypes.size() == 2u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void UniqueOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 2u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult UniqueOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSResults(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void UniqueOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::UniqueOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::UnpackOp definitions
//===----------------------------------------------------------------------===//

UnpackOpAdaptor::UnpackOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

UnpackOpAdaptor::UnpackOpAdaptor(UnpackOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange UnpackOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> UnpackOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange UnpackOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value UnpackOpAdaptor::value() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr UnpackOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::IntegerAttr UnpackOpAdaptor::axis() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("axis").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), 0);
  return attr;
}

::mlir::LogicalResult UnpackOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_axis = odsAttrs.get("axis");
    if (tblgen_axis && !(((tblgen_axis.isa<::mlir::IntegerAttr>())) && ((tblgen_axis.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.Unpack' op ""attribute 'axis' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> UnpackOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range UnpackOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value UnpackOp::value() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange UnpackOp::valueMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> UnpackOp::getODSResultIndexAndLength(unsigned index) {
  bool isVariadic[] = {true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (getOperation()->getNumResults() - 0) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::Operation::result_range UnpackOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Operation::result_range UnpackOp::output() {
  return getODSResults(0);
}

::mlir::IntegerAttr UnpackOp::axisAttr() {
  return (*this)->getAttr(axisAttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t UnpackOp::axis() {
  auto attr = axisAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), 0).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

::mlir::Type UnpackOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

size_t UnpackOp::num() {
  auto range = getODSResults(0);
return std::distance(range.begin(), range.end());
}

bool UnpackOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
  if (name == "num") return true;
 return false;
}

::mlir::DictionaryAttr UnpackOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())},
    {numAttrName(),
odsBuilder.getI64IntegerAttr(num())}});
}

void UnpackOp::axisAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(axisAttrName(), attr);
}

void UnpackOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange output, ::mlir::Value value, ::mlir::IntegerAttr axis) {
  odsState.addOperands(value);
  odsState.addAttribute(axisAttrName(odsState.name), axis);
  odsState.addTypes(output);
}

void UnpackOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange output, ::mlir::Value value, uint64_t axis) {
  odsState.addOperands(value);
  odsState.addAttribute(axisAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), axis));
  odsState.addTypes(output);
}

void UnpackOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult UnpackOp::verify() {
  {
    auto tblgen_axis = (*this)->getAttr(axisAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_axis, "axis")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return Verify(*this);
}

void UnpackOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::UnpackOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::UnsortedSegmentMaxOp definitions
//===----------------------------------------------------------------------===//

UnsortedSegmentMaxOpAdaptor::UnsortedSegmentMaxOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

UnsortedSegmentMaxOpAdaptor::UnsortedSegmentMaxOpAdaptor(UnsortedSegmentMaxOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange UnsortedSegmentMaxOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> UnsortedSegmentMaxOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange UnsortedSegmentMaxOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value UnsortedSegmentMaxOpAdaptor::data() {
  return *getODSOperands(0).begin();
}

::mlir::Value UnsortedSegmentMaxOpAdaptor::segment_ids() {
  return *getODSOperands(1).begin();
}

::mlir::Value UnsortedSegmentMaxOpAdaptor::num_segments() {
  return *getODSOperands(2).begin();
}

::mlir::DictionaryAttr UnsortedSegmentMaxOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult UnsortedSegmentMaxOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> UnsortedSegmentMaxOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range UnsortedSegmentMaxOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value UnsortedSegmentMaxOp::data() {
  return *getODSOperands(0).begin();
}

::mlir::Value UnsortedSegmentMaxOp::segment_ids() {
  return *getODSOperands(1).begin();
}

::mlir::Value UnsortedSegmentMaxOp::num_segments() {
  return *getODSOperands(2).begin();
}

::mlir::MutableOperandRange UnsortedSegmentMaxOp::dataMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange UnsortedSegmentMaxOp::segment_idsMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange UnsortedSegmentMaxOp::num_segmentsMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> UnsortedSegmentMaxOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range UnsortedSegmentMaxOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value UnsortedSegmentMaxOp::output() {
  return *getODSResults(0).begin();
}

::mlir::Type UnsortedSegmentMaxOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

::mlir::Type UnsortedSegmentMaxOp::Tindices() {
  return mlir::getElementTypeOrSelf(*getODSOperands(1).begin());
}

::mlir::Type UnsortedSegmentMaxOp::Tnumsegments() {
  return mlir::getElementTypeOrSelf(*getODSOperands(2).begin());
}

bool UnsortedSegmentMaxOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
  if (name == "Tindices") return true;
  if (name == "Tnumsegments") return true;
 return false;
}

::mlir::DictionaryAttr UnsortedSegmentMaxOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())},
    {TindicesAttrName(),
::mlir::TypeAttr::get(Tindices())},
    {TnumsegmentsAttrName(),
::mlir::TypeAttr::get(Tnumsegments())}});
}

void UnsortedSegmentMaxOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value data, ::mlir::Value segment_ids, ::mlir::Value num_segments) {
  odsState.addOperands(data);
  odsState.addOperands(segment_ids);
  odsState.addOperands(num_segments);
  odsState.addTypes(output);
}

void UnsortedSegmentMaxOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value data, ::mlir::Value segment_ids, ::mlir::Value num_segments) {
  odsState.addOperands(data);
  odsState.addOperands(segment_ids);
  odsState.addOperands(num_segments);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void UnsortedSegmentMaxOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 3u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult UnsortedSegmentMaxOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops35(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops35(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return VerifyUnsortedSegmentReduction(*this);
}

void UnsortedSegmentMaxOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::UnsortedSegmentMaxOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::UnsortedSegmentMinOp definitions
//===----------------------------------------------------------------------===//

UnsortedSegmentMinOpAdaptor::UnsortedSegmentMinOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

UnsortedSegmentMinOpAdaptor::UnsortedSegmentMinOpAdaptor(UnsortedSegmentMinOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange UnsortedSegmentMinOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> UnsortedSegmentMinOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange UnsortedSegmentMinOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value UnsortedSegmentMinOpAdaptor::data() {
  return *getODSOperands(0).begin();
}

::mlir::Value UnsortedSegmentMinOpAdaptor::segment_ids() {
  return *getODSOperands(1).begin();
}

::mlir::Value UnsortedSegmentMinOpAdaptor::num_segments() {
  return *getODSOperands(2).begin();
}

::mlir::DictionaryAttr UnsortedSegmentMinOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult UnsortedSegmentMinOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> UnsortedSegmentMinOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range UnsortedSegmentMinOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value UnsortedSegmentMinOp::data() {
  return *getODSOperands(0).begin();
}

::mlir::Value UnsortedSegmentMinOp::segment_ids() {
  return *getODSOperands(1).begin();
}

::mlir::Value UnsortedSegmentMinOp::num_segments() {
  return *getODSOperands(2).begin();
}

::mlir::MutableOperandRange UnsortedSegmentMinOp::dataMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange UnsortedSegmentMinOp::segment_idsMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange UnsortedSegmentMinOp::num_segmentsMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> UnsortedSegmentMinOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range UnsortedSegmentMinOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value UnsortedSegmentMinOp::output() {
  return *getODSResults(0).begin();
}

::mlir::Type UnsortedSegmentMinOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

::mlir::Type UnsortedSegmentMinOp::Tindices() {
  return mlir::getElementTypeOrSelf(*getODSOperands(1).begin());
}

::mlir::Type UnsortedSegmentMinOp::Tnumsegments() {
  return mlir::getElementTypeOrSelf(*getODSOperands(2).begin());
}

bool UnsortedSegmentMinOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
  if (name == "Tindices") return true;
  if (name == "Tnumsegments") return true;
 return false;
}

::mlir::DictionaryAttr UnsortedSegmentMinOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())},
    {TindicesAttrName(),
::mlir::TypeAttr::get(Tindices())},
    {TnumsegmentsAttrName(),
::mlir::TypeAttr::get(Tnumsegments())}});
}

void UnsortedSegmentMinOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value data, ::mlir::Value segment_ids, ::mlir::Value num_segments) {
  odsState.addOperands(data);
  odsState.addOperands(segment_ids);
  odsState.addOperands(num_segments);
  odsState.addTypes(output);
}

void UnsortedSegmentMinOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value data, ::mlir::Value segment_ids, ::mlir::Value num_segments) {
  odsState.addOperands(data);
  odsState.addOperands(segment_ids);
  odsState.addOperands(num_segments);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void UnsortedSegmentMinOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 3u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult UnsortedSegmentMinOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops35(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops35(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return VerifyUnsortedSegmentReduction(*this);
}

void UnsortedSegmentMinOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::UnsortedSegmentMinOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::UnsortedSegmentProdOp definitions
//===----------------------------------------------------------------------===//

UnsortedSegmentProdOpAdaptor::UnsortedSegmentProdOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

UnsortedSegmentProdOpAdaptor::UnsortedSegmentProdOpAdaptor(UnsortedSegmentProdOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange UnsortedSegmentProdOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> UnsortedSegmentProdOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange UnsortedSegmentProdOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value UnsortedSegmentProdOpAdaptor::data() {
  return *getODSOperands(0).begin();
}

::mlir::Value UnsortedSegmentProdOpAdaptor::segment_ids() {
  return *getODSOperands(1).begin();
}

::mlir::Value UnsortedSegmentProdOpAdaptor::num_segments() {
  return *getODSOperands(2).begin();
}

::mlir::DictionaryAttr UnsortedSegmentProdOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult UnsortedSegmentProdOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> UnsortedSegmentProdOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range UnsortedSegmentProdOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value UnsortedSegmentProdOp::data() {
  return *getODSOperands(0).begin();
}

::mlir::Value UnsortedSegmentProdOp::segment_ids() {
  return *getODSOperands(1).begin();
}

::mlir::Value UnsortedSegmentProdOp::num_segments() {
  return *getODSOperands(2).begin();
}

::mlir::MutableOperandRange UnsortedSegmentProdOp::dataMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange UnsortedSegmentProdOp::segment_idsMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange UnsortedSegmentProdOp::num_segmentsMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> UnsortedSegmentProdOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range UnsortedSegmentProdOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value UnsortedSegmentProdOp::output() {
  return *getODSResults(0).begin();
}

::mlir::Type UnsortedSegmentProdOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

::mlir::Type UnsortedSegmentProdOp::Tindices() {
  return mlir::getElementTypeOrSelf(*getODSOperands(1).begin());
}

::mlir::Type UnsortedSegmentProdOp::Tnumsegments() {
  return mlir::getElementTypeOrSelf(*getODSOperands(2).begin());
}

bool UnsortedSegmentProdOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
  if (name == "Tindices") return true;
  if (name == "Tnumsegments") return true;
 return false;
}

::mlir::DictionaryAttr UnsortedSegmentProdOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())},
    {TindicesAttrName(),
::mlir::TypeAttr::get(Tindices())},
    {TnumsegmentsAttrName(),
::mlir::TypeAttr::get(Tnumsegments())}});
}

void UnsortedSegmentProdOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value data, ::mlir::Value segment_ids, ::mlir::Value num_segments) {
  odsState.addOperands(data);
  odsState.addOperands(segment_ids);
  odsState.addOperands(num_segments);
  odsState.addTypes(output);
}

void UnsortedSegmentProdOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value data, ::mlir::Value segment_ids, ::mlir::Value num_segments) {
  odsState.addOperands(data);
  odsState.addOperands(segment_ids);
  odsState.addOperands(num_segments);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void UnsortedSegmentProdOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 3u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult UnsortedSegmentProdOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return VerifyUnsortedSegmentReduction(*this);
}

void UnsortedSegmentProdOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::UnsortedSegmentProdOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::UnsortedSegmentSumOp definitions
//===----------------------------------------------------------------------===//

UnsortedSegmentSumOpAdaptor::UnsortedSegmentSumOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

UnsortedSegmentSumOpAdaptor::UnsortedSegmentSumOpAdaptor(UnsortedSegmentSumOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange UnsortedSegmentSumOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> UnsortedSegmentSumOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange UnsortedSegmentSumOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value UnsortedSegmentSumOpAdaptor::data() {
  return *getODSOperands(0).begin();
}

::mlir::Value UnsortedSegmentSumOpAdaptor::segment_ids() {
  return *getODSOperands(1).begin();
}

::mlir::Value UnsortedSegmentSumOpAdaptor::num_segments() {
  return *getODSOperands(2).begin();
}

::mlir::DictionaryAttr UnsortedSegmentSumOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult UnsortedSegmentSumOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> UnsortedSegmentSumOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range UnsortedSegmentSumOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value UnsortedSegmentSumOp::data() {
  return *getODSOperands(0).begin();
}

::mlir::Value UnsortedSegmentSumOp::segment_ids() {
  return *getODSOperands(1).begin();
}

::mlir::Value UnsortedSegmentSumOp::num_segments() {
  return *getODSOperands(2).begin();
}

::mlir::MutableOperandRange UnsortedSegmentSumOp::dataMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange UnsortedSegmentSumOp::segment_idsMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange UnsortedSegmentSumOp::num_segmentsMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> UnsortedSegmentSumOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range UnsortedSegmentSumOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value UnsortedSegmentSumOp::output() {
  return *getODSResults(0).begin();
}

::mlir::Type UnsortedSegmentSumOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

::mlir::Type UnsortedSegmentSumOp::Tindices() {
  return mlir::getElementTypeOrSelf(*getODSOperands(1).begin());
}

::mlir::Type UnsortedSegmentSumOp::Tnumsegments() {
  return mlir::getElementTypeOrSelf(*getODSOperands(2).begin());
}

bool UnsortedSegmentSumOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
  if (name == "Tindices") return true;
  if (name == "Tnumsegments") return true;
 return false;
}

::mlir::DictionaryAttr UnsortedSegmentSumOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())},
    {TindicesAttrName(),
::mlir::TypeAttr::get(Tindices())},
    {TnumsegmentsAttrName(),
::mlir::TypeAttr::get(Tnumsegments())}});
}

void UnsortedSegmentSumOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value data, ::mlir::Value segment_ids, ::mlir::Value num_segments) {
  odsState.addOperands(data);
  odsState.addOperands(segment_ids);
  odsState.addOperands(num_segments);
  odsState.addTypes(output);
}

void UnsortedSegmentSumOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value data, ::mlir::Value segment_ids, ::mlir::Value num_segments) {
  odsState.addOperands(data);
  odsState.addOperands(segment_ids);
  odsState.addOperands(num_segments);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void UnsortedSegmentSumOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 3u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult UnsortedSegmentSumOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return VerifyUnsortedSegmentReduction(*this);
}

void UnsortedSegmentSumOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::UnsortedSegmentSumOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::UpperBoundOp definitions
//===----------------------------------------------------------------------===//

UpperBoundOpAdaptor::UpperBoundOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

UpperBoundOpAdaptor::UpperBoundOpAdaptor(UpperBoundOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange UpperBoundOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> UpperBoundOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange UpperBoundOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value UpperBoundOpAdaptor::sorted_inputs() {
  return *getODSOperands(0).begin();
}

::mlir::Value UpperBoundOpAdaptor::values() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr UpperBoundOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult UpperBoundOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> UpperBoundOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range UpperBoundOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value UpperBoundOp::sorted_inputs() {
  return *getODSOperands(0).begin();
}

::mlir::Value UpperBoundOp::values() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange UpperBoundOp::sorted_inputsMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange UpperBoundOp::valuesMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> UpperBoundOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range UpperBoundOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value UpperBoundOp::output() {
  return *getODSResults(0).begin();
}

::mlir::Type UpperBoundOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

::mlir::Type UpperBoundOp::out_type() {
  return mlir::getElementTypeOrSelf(*getODSResults(0).begin());
}

bool UpperBoundOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
  if (name == "out_type") return true;
 return false;
}

::mlir::DictionaryAttr UpperBoundOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())},
    {out_typeAttrName(),
::mlir::TypeAttr::get(out_type())}});
}

void UpperBoundOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value sorted_inputs, ::mlir::Value values) {
  odsState.addOperands(sorted_inputs);
  odsState.addOperands(values);
  odsState.addTypes(output);
}

void UpperBoundOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value sorted_inputs, ::mlir::Value values) {
  odsState.addOperands(sorted_inputs);
  odsState.addOperands(values);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void UpperBoundOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult UpperBoundOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void UpperBoundOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::UpperBoundOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::VarHandleOp definitions
//===----------------------------------------------------------------------===//

VarHandleOpAdaptor::VarHandleOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

VarHandleOpAdaptor::VarHandleOpAdaptor(VarHandleOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange VarHandleOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> VarHandleOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange VarHandleOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::DictionaryAttr VarHandleOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::StringAttr VarHandleOpAdaptor::container() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("container").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("");
  return attr;
}

::mlir::StringAttr VarHandleOpAdaptor::shared_name() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("shared_name").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("");
  return attr;
}

::mlir::LogicalResult VarHandleOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_container = odsAttrs.get("container");
    if (tblgen_container && !((tblgen_container.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.VarHandleOp' op ""attribute 'container' failed to satisfy constraint: string attribute");
  }
  {
    auto tblgen_shared_name = odsAttrs.get("shared_name");
    if (tblgen_shared_name && !((tblgen_shared_name.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.VarHandleOp' op ""attribute 'shared_name' failed to satisfy constraint: string attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> VarHandleOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range VarHandleOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

std::pair<unsigned, unsigned> VarHandleOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range VarHandleOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value VarHandleOp::resource() {
  return *getODSResults(0).begin();
}

::mlir::StringAttr VarHandleOp::containerAttr() {
  return (*this)->getAttr(containerAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef VarHandleOp::container() {
  auto attr = containerAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("").getValue();
  return attr.getValue();
}

::mlir::StringAttr VarHandleOp::shared_nameAttr() {
  return (*this)->getAttr(shared_nameAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef VarHandleOp::shared_name() {
  auto attr = shared_nameAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("").getValue();
  return attr.getValue();
}

::mlir::Type VarHandleOp::dtype() {
  return getElementTypeOrSelf(resource_subtype());
}

ShapedType VarHandleOp::shape() {
  return resource_subtype().cast<ShapedType>();
}

bool VarHandleOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "dtype") return true;
  if (name == "shape") return true;
 return false;
}

::mlir::DictionaryAttr VarHandleOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {dtypeAttrName(),
::mlir::TypeAttr::get(dtype())},
    {shapeAttrName(),
mlir::TF::ShapeAttr::get(ctx, shape())}});
}

void VarHandleOp::containerAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(containerAttrName(), attr);
}

void VarHandleOp::shared_nameAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(shared_nameAttrName(), attr);
}

void VarHandleOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type resource, ::mlir::StringAttr container, ::mlir::StringAttr shared_name) {
  odsState.addAttribute(containerAttrName(odsState.name), container);
  odsState.addAttribute(shared_nameAttrName(odsState.name), shared_name);
  odsState.addTypes(resource);
}

void VarHandleOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::StringAttr container, ::mlir::StringAttr shared_name) {
  odsState.addAttribute(containerAttrName(odsState.name), container);
  odsState.addAttribute(shared_nameAttrName(odsState.name), shared_name);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void VarHandleOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type resource, ::llvm::StringRef container, ::llvm::StringRef shared_name) {
  odsState.addAttribute(containerAttrName(odsState.name), odsBuilder.getStringAttr(container));
  odsState.addAttribute(shared_nameAttrName(odsState.name), odsBuilder.getStringAttr(shared_name));
  odsState.addTypes(resource);
}

void VarHandleOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::llvm::StringRef container, ::llvm::StringRef shared_name) {
  odsState.addAttribute(containerAttrName(odsState.name), odsBuilder.getStringAttr(container));
  odsState.addAttribute(shared_nameAttrName(odsState.name), odsBuilder.getStringAttr(shared_name));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void VarHandleOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 0u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult VarHandleOp::verify() {
  {
    auto tblgen_container = (*this)->getAttr(containerAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_container, "container")))
      return ::mlir::failure();
  }
  {
    auto tblgen_shared_name = (*this)->getAttr(shared_nameAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_shared_name, "shared_name")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  // VarHandleOp requires the resource handle supply a single subtype from
    // which to derive the dtype and shape attributes.
    if (resource_type().getSubtypes().size() != 1) {
      return emitOpError(
          "must have exactly one subtype in the result resource type");
    }

    return success();
}

void VarHandleOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  for (::mlir::Value value : getODSResults(0))
    effects.emplace_back(::mlir::MemoryEffects::Allocate::get(), value, ::mlir::TF::ResourceEffects::Variable::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::VarHandleOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::VarIsInitializedOp definitions
//===----------------------------------------------------------------------===//

VarIsInitializedOpAdaptor::VarIsInitializedOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

VarIsInitializedOpAdaptor::VarIsInitializedOpAdaptor(VarIsInitializedOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange VarIsInitializedOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> VarIsInitializedOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange VarIsInitializedOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value VarIsInitializedOpAdaptor::resource() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr VarIsInitializedOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult VarIsInitializedOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> VarIsInitializedOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range VarIsInitializedOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value VarIsInitializedOp::resource() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange VarIsInitializedOp::resourceMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> VarIsInitializedOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range VarIsInitializedOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value VarIsInitializedOp::is_initialized() {
  return *getODSResults(0).begin();
}

void VarIsInitializedOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type is_initialized, ::mlir::Value resource) {
  odsState.addOperands(resource);
  odsState.addTypes(is_initialized);
}

void VarIsInitializedOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value resource) {
  odsState.addOperands(resource);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void VarIsInitializedOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult VarIsInitializedOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops8(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void VarIsInitializedOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  for (::mlir::Value value : getODSOperands(0))
    effects.emplace_back(::mlir::MemoryEffects::Read::get(), value, ::mlir::TF::ResourceEffects::Variable::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::VarIsInitializedOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::VariableOp definitions
//===----------------------------------------------------------------------===//

VariableOpAdaptor::VariableOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

VariableOpAdaptor::VariableOpAdaptor(VariableOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange VariableOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> VariableOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange VariableOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::DictionaryAttr VariableOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::Attribute VariableOpAdaptor::shape() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::Attribute attr = odsAttrs.get("shape").cast<::mlir::Attribute>();
  return attr;
}

::mlir::StringAttr VariableOpAdaptor::container() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("container").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("");
  return attr;
}

::mlir::StringAttr VariableOpAdaptor::shared_name() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("shared_name").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("");
  return attr;
}

::mlir::LogicalResult VariableOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_shape = odsAttrs.get("shape");
    if (!tblgen_shape)
      return emitError(loc, "'tf.Variable' op ""requires attribute 'shape'");

    if (tblgen_shape && !((tblgen_shape.isa<mlir::TF::ShapeAttr>())))
      return emitError(loc, "'tf.Variable' op ""attribute 'shape' failed to satisfy constraint: TensorFlow shape attribute");
  }
  {
    auto tblgen_container = odsAttrs.get("container");
    if (tblgen_container && !((tblgen_container.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.Variable' op ""attribute 'container' failed to satisfy constraint: string attribute");
  }
  {
    auto tblgen_shared_name = odsAttrs.get("shared_name");
    if (tblgen_shared_name && !((tblgen_shared_name.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.Variable' op ""attribute 'shared_name' failed to satisfy constraint: string attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> VariableOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range VariableOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

std::pair<unsigned, unsigned> VariableOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range VariableOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value VariableOp::ref() {
  return *getODSResults(0).begin();
}

::mlir::Attribute VariableOp::shapeAttr() {
  return (*this)->getAttr(shapeAttrName()).cast<::mlir::Attribute>();
}

llvm::Optional<llvm::ArrayRef<int64_t>> VariableOp::shape() {
  auto attr = shapeAttr();
  return attr.cast<mlir::TF::ShapeAttr>().getValue();
}

::mlir::StringAttr VariableOp::containerAttr() {
  return (*this)->getAttr(containerAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef VariableOp::container() {
  auto attr = containerAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("").getValue();
  return attr.getValue();
}

::mlir::StringAttr VariableOp::shared_nameAttr() {
  return (*this)->getAttr(shared_nameAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef VariableOp::shared_name() {
  auto attr = shared_nameAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("").getValue();
  return attr.getValue();
}

::mlir::Type VariableOp::dtype() {
  return mlir::getElementTypeOrSelf(*getODSResults(0).begin());
}

bool VariableOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "dtype") return true;
 return false;
}

::mlir::DictionaryAttr VariableOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {dtypeAttrName(),
::mlir::TypeAttr::get(dtype())}});
}

void VariableOp::shapeAttr(::mlir::Attribute attr) {
  (*this)->setAttr(shapeAttrName(), attr);
}

void VariableOp::containerAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(containerAttrName(), attr);
}

void VariableOp::shared_nameAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(shared_nameAttrName(), attr);
}

void VariableOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type ref, ::mlir::Attribute shape, ::mlir::StringAttr container, ::mlir::StringAttr shared_name) {
  odsState.addAttribute(shapeAttrName(odsState.name), shape);
  odsState.addAttribute(containerAttrName(odsState.name), container);
  odsState.addAttribute(shared_nameAttrName(odsState.name), shared_name);
  odsState.addTypes(ref);
}

void VariableOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Attribute shape, ::mlir::StringAttr container, ::mlir::StringAttr shared_name) {
  odsState.addAttribute(shapeAttrName(odsState.name), shape);
  odsState.addAttribute(containerAttrName(odsState.name), container);
  odsState.addAttribute(shared_nameAttrName(odsState.name), shared_name);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void VariableOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type ref, llvm::Optional<llvm::ArrayRef<int64_t>> shape, ::llvm::StringRef container, ::llvm::StringRef shared_name) {
  odsState.addAttribute(shapeAttrName(odsState.name), mlir::TF::ShapeAttr::get(odsBuilder.getContext(), shape));
  odsState.addAttribute(containerAttrName(odsState.name), odsBuilder.getStringAttr(container));
  odsState.addAttribute(shared_nameAttrName(odsState.name), odsBuilder.getStringAttr(shared_name));
  odsState.addTypes(ref);
}

void VariableOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, llvm::Optional<llvm::ArrayRef<int64_t>> shape, ::llvm::StringRef container, ::llvm::StringRef shared_name) {
  odsState.addAttribute(shapeAttrName(odsState.name), mlir::TF::ShapeAttr::get(odsBuilder.getContext(), shape));
  odsState.addAttribute(containerAttrName(odsState.name), odsBuilder.getStringAttr(container));
  odsState.addAttribute(shared_nameAttrName(odsState.name), odsBuilder.getStringAttr(shared_name));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void VariableOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 0u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult VariableOp::verify() {
  {
    auto tblgen_shape = (*this)->getAttr(shapeAttrName());
    if (!tblgen_shape)
      return emitOpError("requires attribute 'shape'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops17(*this, tblgen_shape, "shape")))
      return ::mlir::failure();
  }
  {
    auto tblgen_container = (*this)->getAttr(containerAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_container, "container")))
      return ::mlir::failure();
  }
  {
    auto tblgen_shared_name = (*this)->getAttr(shared_nameAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_shared_name, "shared_name")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::VariableOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::VariableShapeOp definitions
//===----------------------------------------------------------------------===//

VariableShapeOpAdaptor::VariableShapeOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

VariableShapeOpAdaptor::VariableShapeOpAdaptor(VariableShapeOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange VariableShapeOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> VariableShapeOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange VariableShapeOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value VariableShapeOpAdaptor::input() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr VariableShapeOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult VariableShapeOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> VariableShapeOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range VariableShapeOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value VariableShapeOp::input() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange VariableShapeOp::inputMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> VariableShapeOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range VariableShapeOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value VariableShapeOp::output() {
  return *getODSResults(0).begin();
}

::mlir::Type VariableShapeOp::out_type() {
  return mlir::getElementTypeOrSelf(*getODSResults(0).begin());
}

bool VariableShapeOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "out_type") return true;
 return false;
}

::mlir::DictionaryAttr VariableShapeOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {out_typeAttrName(),
::mlir::TypeAttr::get(out_type())}});
}

void VariableShapeOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input) {
  odsState.addOperands(input);
  odsState.addTypes(output);
}

void VariableShapeOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input) {
  odsState.addOperands(input);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void VariableShapeOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult VariableShapeOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return Verify(*this);
}

void VariableShapeOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  for (::mlir::Value value : getODSOperands(0))
    effects.emplace_back(::mlir::MemoryEffects::Read::get(), value, ::mlir::TF::ResourceEffects::Variable::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::VariableShapeOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::VariableV2Op definitions
//===----------------------------------------------------------------------===//

VariableV2OpAdaptor::VariableV2OpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

VariableV2OpAdaptor::VariableV2OpAdaptor(VariableV2Op &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange VariableV2OpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> VariableV2OpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange VariableV2OpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::DictionaryAttr VariableV2OpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::Attribute VariableV2OpAdaptor::shape() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::Attribute attr = odsAttrs.get("shape").cast<::mlir::Attribute>();
  return attr;
}

::mlir::StringAttr VariableV2OpAdaptor::container() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("container").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("");
  return attr;
}

::mlir::StringAttr VariableV2OpAdaptor::shared_name() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("shared_name").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("");
  return attr;
}

::mlir::LogicalResult VariableV2OpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_shape = odsAttrs.get("shape");
    if (!tblgen_shape)
      return emitError(loc, "'tf.VariableV2' op ""requires attribute 'shape'");

    if (tblgen_shape && !((tblgen_shape.isa<mlir::TF::ShapeAttr>())))
      return emitError(loc, "'tf.VariableV2' op ""attribute 'shape' failed to satisfy constraint: TensorFlow shape attribute");
  }
  {
    auto tblgen_container = odsAttrs.get("container");
    if (tblgen_container && !((tblgen_container.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.VariableV2' op ""attribute 'container' failed to satisfy constraint: string attribute");
  }
  {
    auto tblgen_shared_name = odsAttrs.get("shared_name");
    if (tblgen_shared_name && !((tblgen_shared_name.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.VariableV2' op ""attribute 'shared_name' failed to satisfy constraint: string attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> VariableV2Op::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range VariableV2Op::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

std::pair<unsigned, unsigned> VariableV2Op::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range VariableV2Op::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value VariableV2Op::ref() {
  return *getODSResults(0).begin();
}

::mlir::Attribute VariableV2Op::shapeAttr() {
  return (*this)->getAttr(shapeAttrName()).cast<::mlir::Attribute>();
}

llvm::Optional<llvm::ArrayRef<int64_t>> VariableV2Op::shape() {
  auto attr = shapeAttr();
  return attr.cast<mlir::TF::ShapeAttr>().getValue();
}

::mlir::StringAttr VariableV2Op::containerAttr() {
  return (*this)->getAttr(containerAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef VariableV2Op::container() {
  auto attr = containerAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("").getValue();
  return attr.getValue();
}

::mlir::StringAttr VariableV2Op::shared_nameAttr() {
  return (*this)->getAttr(shared_nameAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef VariableV2Op::shared_name() {
  auto attr = shared_nameAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("").getValue();
  return attr.getValue();
}

::mlir::Type VariableV2Op::dtype() {
  return mlir::getElementTypeOrSelf(*getODSResults(0).begin());
}

bool VariableV2Op::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "dtype") return true;
 return false;
}

::mlir::DictionaryAttr VariableV2Op::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {dtypeAttrName(),
::mlir::TypeAttr::get(dtype())}});
}

void VariableV2Op::shapeAttr(::mlir::Attribute attr) {
  (*this)->setAttr(shapeAttrName(), attr);
}

void VariableV2Op::containerAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(containerAttrName(), attr);
}

void VariableV2Op::shared_nameAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(shared_nameAttrName(), attr);
}

void VariableV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type ref, ::mlir::Attribute shape, ::mlir::StringAttr container, ::mlir::StringAttr shared_name) {
  odsState.addAttribute(shapeAttrName(odsState.name), shape);
  odsState.addAttribute(containerAttrName(odsState.name), container);
  odsState.addAttribute(shared_nameAttrName(odsState.name), shared_name);
  odsState.addTypes(ref);
}

void VariableV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Attribute shape, ::mlir::StringAttr container, ::mlir::StringAttr shared_name) {
  odsState.addAttribute(shapeAttrName(odsState.name), shape);
  odsState.addAttribute(containerAttrName(odsState.name), container);
  odsState.addAttribute(shared_nameAttrName(odsState.name), shared_name);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void VariableV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type ref, llvm::Optional<llvm::ArrayRef<int64_t>> shape, ::llvm::StringRef container, ::llvm::StringRef shared_name) {
  odsState.addAttribute(shapeAttrName(odsState.name), mlir::TF::ShapeAttr::get(odsBuilder.getContext(), shape));
  odsState.addAttribute(containerAttrName(odsState.name), odsBuilder.getStringAttr(container));
  odsState.addAttribute(shared_nameAttrName(odsState.name), odsBuilder.getStringAttr(shared_name));
  odsState.addTypes(ref);
}

void VariableV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, llvm::Optional<llvm::ArrayRef<int64_t>> shape, ::llvm::StringRef container, ::llvm::StringRef shared_name) {
  odsState.addAttribute(shapeAttrName(odsState.name), mlir::TF::ShapeAttr::get(odsBuilder.getContext(), shape));
  odsState.addAttribute(containerAttrName(odsState.name), odsBuilder.getStringAttr(container));
  odsState.addAttribute(shared_nameAttrName(odsState.name), odsBuilder.getStringAttr(shared_name));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void VariableV2Op::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 0u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult VariableV2Op::verify() {
  {
    auto tblgen_shape = (*this)->getAttr(shapeAttrName());
    if (!tblgen_shape)
      return emitOpError("requires attribute 'shape'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops17(*this, tblgen_shape, "shape")))
      return ::mlir::failure();
  }
  {
    auto tblgen_container = (*this)->getAttr(containerAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_container, "container")))
      return ::mlir::failure();
  }
  {
    auto tblgen_shared_name = (*this)->getAttr(shared_nameAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_shared_name, "shared_name")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::VariableV2Op)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::WhereOp definitions
//===----------------------------------------------------------------------===//

WhereOpAdaptor::WhereOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

WhereOpAdaptor::WhereOpAdaptor(WhereOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange WhereOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> WhereOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange WhereOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value WhereOpAdaptor::input() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr WhereOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult WhereOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> WhereOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range WhereOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value WhereOp::input() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange WhereOp::inputMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> WhereOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range WhereOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value WhereOp::index() {
  return *getODSResults(0).begin();
}

::mlir::Type WhereOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool WhereOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr WhereOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void WhereOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type index, ::mlir::Value input) {
  odsState.addOperands(input);
  odsState.addTypes(index);
}

void WhereOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input) {
  odsState.addOperands(input);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void WhereOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult WhereOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops10(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops16(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void WhereOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::WhereOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::WhileOp definitions
//===----------------------------------------------------------------------===//

WhileOpAdaptor::WhileOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

WhileOpAdaptor::WhileOpAdaptor(WhileOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange WhileOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> WhileOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  bool isVariadic[] = {true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (odsOperands.size() - 0) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::ValueRange WhileOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::ValueRange WhileOpAdaptor::input() {
  return getODSOperands(0);
}

::mlir::DictionaryAttr WhileOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::FlatSymbolRefAttr WhileOpAdaptor::cond() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::FlatSymbolRefAttr attr = odsAttrs.get("cond").cast<::mlir::FlatSymbolRefAttr>();
  return attr;
}

::mlir::FlatSymbolRefAttr WhileOpAdaptor::body() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::FlatSymbolRefAttr attr = odsAttrs.get("body").cast<::mlir::FlatSymbolRefAttr>();
  return attr;
}

::mlir::IntegerAttr WhileOpAdaptor::parallel_iterations() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("parallel_iterations").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), 10);
  return attr;
}

::mlir::BoolAttr WhileOpAdaptor::is_stateless() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("is_stateless").cast<::mlir::BoolAttr>();
  return attr;
}

::mlir::UnitAttr WhileOpAdaptor::shape_invariant() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::UnitAttr attr = odsAttrs.get("shape_invariant").dyn_cast_or_null<::mlir::UnitAttr>();
  return attr;
}

::mlir::LogicalResult WhileOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_cond = odsAttrs.get("cond");
    if (!tblgen_cond)
      return emitError(loc, "'tf.While' op ""requires attribute 'cond'");

    if (tblgen_cond && !((tblgen_cond.isa<::mlir::FlatSymbolRefAttr>())))
      return emitError(loc, "'tf.While' op ""attribute 'cond' failed to satisfy constraint: flat symbol reference attribute");
  }
  {
    auto tblgen_body = odsAttrs.get("body");
    if (!tblgen_body)
      return emitError(loc, "'tf.While' op ""requires attribute 'body'");

    if (tblgen_body && !((tblgen_body.isa<::mlir::FlatSymbolRefAttr>())))
      return emitError(loc, "'tf.While' op ""attribute 'body' failed to satisfy constraint: flat symbol reference attribute");
  }
  {
    auto tblgen_parallel_iterations = odsAttrs.get("parallel_iterations");
    if (tblgen_parallel_iterations && !(((tblgen_parallel_iterations.isa<::mlir::IntegerAttr>())) && ((tblgen_parallel_iterations.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.While' op ""attribute 'parallel_iterations' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_is_stateless = odsAttrs.get("is_stateless");
    if (!tblgen_is_stateless)
      return emitError(loc, "'tf.While' op ""requires attribute 'is_stateless'");

    if (tblgen_is_stateless && !((tblgen_is_stateless.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.While' op ""attribute 'is_stateless' failed to satisfy constraint: bool attribute");
  }
  {
    auto tblgen_shape_invariant = odsAttrs.get("shape_invariant");
    if (tblgen_shape_invariant && !((tblgen_shape_invariant.isa<::mlir::UnitAttr>())))
      return emitError(loc, "'tf.While' op ""attribute 'shape_invariant' failed to satisfy constraint: unit attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> WhileOp::getODSOperandIndexAndLength(unsigned index) {
  bool isVariadic[] = {true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (getOperation()->getNumOperands() - 0) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::Operation::operand_range WhileOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Operation::operand_range WhileOp::input() {
  return getODSOperands(0);
}

::mlir::MutableOperandRange WhileOp::inputMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> WhileOp::getODSResultIndexAndLength(unsigned index) {
  bool isVariadic[] = {true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (getOperation()->getNumResults() - 0) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::Operation::result_range WhileOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Operation::result_range WhileOp::output() {
  return getODSResults(0);
}

::mlir::FlatSymbolRefAttr WhileOp::condAttr() {
  return (*this)->getAttr(condAttrName()).cast<::mlir::FlatSymbolRefAttr>();
}

::llvm::StringRef WhileOp::cond() {
  auto attr = condAttr();
  return attr.getValue();
}

::mlir::FlatSymbolRefAttr WhileOp::bodyAttr() {
  return (*this)->getAttr(bodyAttrName()).cast<::mlir::FlatSymbolRefAttr>();
}

::llvm::StringRef WhileOp::body() {
  auto attr = bodyAttr();
  return attr.getValue();
}

::mlir::IntegerAttr WhileOp::parallel_iterationsAttr() {
  return (*this)->getAttr(parallel_iterationsAttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t WhileOp::parallel_iterations() {
  auto attr = parallel_iterationsAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), 10).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

::mlir::BoolAttr WhileOp::is_statelessAttr() {
  return (*this)->getAttr(is_statelessAttrName()).cast<::mlir::BoolAttr>();
}

bool WhileOp::is_stateless() {
  auto attr = is_statelessAttr();
  return attr.getValue();
}

::mlir::UnitAttr WhileOp::shape_invariantAttr() {
  return (*this)->getAttr(shape_invariantAttrName()).dyn_cast_or_null<::mlir::UnitAttr>();
}

bool WhileOp::shape_invariant() {
  auto attr = shape_invariantAttr();
  return attr != nullptr;
}

mlir::OperandElementTypeRange WhileOp::T() {
  auto values = getODSOperands(0);
return {mlir::OperandElementTypeIterator(values.begin()), mlir::OperandElementTypeIterator(values.end())};
}

mlir::TF::ResultShapeRange WhileOp::output_shapes() {
  auto values = getODSResults(0);
return {mlir::TF::ResultShapeIterator(values.begin()), mlir::TF::ResultShapeIterator(values.end())};
}

bool WhileOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
  if (name == "output_shapes") return true;
 return false;
}

::mlir::DictionaryAttr WhileOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
ArrayAttr::get(ctx, 
    [&]() {
      llvm::SmallVector<Attribute, 4> ret;
      for (auto t : T())
        ret.push_back(TypeAttr::get(t));
      return ret;
    }())},
    {output_shapesAttrName(),
ArrayAttr::get(ctx,
      [&](){
        llvm::SmallVector<Attribute, 4> ret;
        for (auto shape : output_shapes())
          ret.push_back(mlir::TF::ShapeAttr::get(ctx, shape));
        return ret;
      }())}});
}

void WhileOp::condAttr(::mlir::FlatSymbolRefAttr attr) {
  (*this)->setAttr(condAttrName(), attr);
}

void WhileOp::bodyAttr(::mlir::FlatSymbolRefAttr attr) {
  (*this)->setAttr(bodyAttrName(), attr);
}

void WhileOp::parallel_iterationsAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(parallel_iterationsAttrName(), attr);
}

void WhileOp::is_statelessAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(is_statelessAttrName(), attr);
}

void WhileOp::shape_invariantAttr(::mlir::UnitAttr attr) {
  (*this)->setAttr(shape_invariantAttrName(), attr);
}

::mlir::Attribute WhileOp::removeShape_invariantAttr() {
  return (*this)->removeAttr(shape_invariantAttrName());
}

void WhileOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange output, ::mlir::ValueRange input, ::mlir::FlatSymbolRefAttr cond, ::mlir::FlatSymbolRefAttr body, ::mlir::IntegerAttr parallel_iterations, ::mlir::BoolAttr is_stateless, /*optional*/::mlir::UnitAttr shape_invariant) {
  odsState.addOperands(input);
  odsState.addAttribute(condAttrName(odsState.name), cond);
  odsState.addAttribute(bodyAttrName(odsState.name), body);
  odsState.addAttribute(parallel_iterationsAttrName(odsState.name), parallel_iterations);
  odsState.addAttribute(is_statelessAttrName(odsState.name), is_stateless);
  if (shape_invariant) {
  odsState.addAttribute(shape_invariantAttrName(odsState.name), shape_invariant);
  }
  odsState.addTypes(output);
}

void WhileOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange output, ::mlir::ValueRange input, ::llvm::StringRef cond, ::llvm::StringRef body, uint64_t parallel_iterations, bool is_stateless, /*optional*/bool shape_invariant) {
  odsState.addOperands(input);
  odsState.addAttribute(condAttrName(odsState.name), ::mlir::SymbolRefAttr::get(odsBuilder.getContext(), cond));
  odsState.addAttribute(bodyAttrName(odsState.name), ::mlir::SymbolRefAttr::get(odsBuilder.getContext(), body));
  odsState.addAttribute(parallel_iterationsAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), parallel_iterations));
  odsState.addAttribute(is_statelessAttrName(odsState.name), odsBuilder.getBoolAttr(is_stateless));
  if (shape_invariant) {
  odsState.addAttribute(shape_invariantAttrName(odsState.name), odsBuilder.getUnitAttr());
  }
  odsState.addTypes(output);
}

void WhileOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult WhileOp::verify() {
  {
    auto tblgen_cond = (*this)->getAttr(condAttrName());
    if (!tblgen_cond)
      return emitOpError("requires attribute 'cond'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops27(*this, tblgen_cond, "cond")))
      return ::mlir::failure();
  }
  {
    auto tblgen_body = (*this)->getAttr(bodyAttrName());
    if (!tblgen_body)
      return emitOpError("requires attribute 'body'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops27(*this, tblgen_body, "body")))
      return ::mlir::failure();
  }
  {
    auto tblgen_parallel_iterations = (*this)->getAttr(parallel_iterationsAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_parallel_iterations, "parallel_iterations")))
      return ::mlir::failure();
  }
  {
    auto tblgen_is_stateless = (*this)->getAttr(is_statelessAttrName());
    if (!tblgen_is_stateless)
      return emitOpError("requires attribute 'is_stateless'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_is_stateless, "is_stateless")))
      return ::mlir::failure();
  }
  {
    auto tblgen_shape_invariant = (*this)->getAttr(shape_invariantAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops40(*this, tblgen_shape_invariant, "shape_invariant")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::WhileOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::WhileRegionOp definitions
//===----------------------------------------------------------------------===//

WhileRegionOpAdaptor::WhileRegionOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

WhileRegionOpAdaptor::WhileRegionOpAdaptor(WhileRegionOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange WhileRegionOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> WhileRegionOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  bool isVariadic[] = {true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (odsOperands.size() - 0) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::ValueRange WhileRegionOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::ValueRange WhileRegionOpAdaptor::input() {
  return getODSOperands(0);
}

::mlir::DictionaryAttr WhileRegionOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::IntegerAttr WhileRegionOpAdaptor::parallel_iterations() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("parallel_iterations").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), 10);
  return attr;
}

::mlir::BoolAttr WhileRegionOpAdaptor::is_stateless() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("is_stateless").cast<::mlir::BoolAttr>();
  return attr;
}

::mlir::UnitAttr WhileRegionOpAdaptor::shape_invariant() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::UnitAttr attr = odsAttrs.get("shape_invariant").dyn_cast_or_null<::mlir::UnitAttr>();
  return attr;
}

::mlir::RegionRange WhileRegionOpAdaptor::getRegions() {
  return odsRegions;
}

::mlir::Region &WhileRegionOpAdaptor::cond() {
  return *odsRegions[0];
}

::mlir::Region &WhileRegionOpAdaptor::body() {
  return *odsRegions[1];
}

::mlir::LogicalResult WhileRegionOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_parallel_iterations = odsAttrs.get("parallel_iterations");
    if (tblgen_parallel_iterations && !(((tblgen_parallel_iterations.isa<::mlir::IntegerAttr>())) && ((tblgen_parallel_iterations.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.WhileRegion' op ""attribute 'parallel_iterations' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_is_stateless = odsAttrs.get("is_stateless");
    if (!tblgen_is_stateless)
      return emitError(loc, "'tf.WhileRegion' op ""requires attribute 'is_stateless'");

    if (tblgen_is_stateless && !((tblgen_is_stateless.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.WhileRegion' op ""attribute 'is_stateless' failed to satisfy constraint: bool attribute");
  }
  {
    auto tblgen_shape_invariant = odsAttrs.get("shape_invariant");
    if (tblgen_shape_invariant && !((tblgen_shape_invariant.isa<::mlir::UnitAttr>())))
      return emitError(loc, "'tf.WhileRegion' op ""attribute 'shape_invariant' failed to satisfy constraint: unit attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> WhileRegionOp::getODSOperandIndexAndLength(unsigned index) {
  bool isVariadic[] = {true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (getOperation()->getNumOperands() - 0) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::Operation::operand_range WhileRegionOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Operation::operand_range WhileRegionOp::input() {
  return getODSOperands(0);
}

::mlir::MutableOperandRange WhileRegionOp::inputMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> WhileRegionOp::getODSResultIndexAndLength(unsigned index) {
  bool isVariadic[] = {true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (getOperation()->getNumResults() - 0) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::Operation::result_range WhileRegionOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Operation::result_range WhileRegionOp::output() {
  return getODSResults(0);
}

::mlir::Region &WhileRegionOp::cond() {
  return (*this)->getRegion(0);
}

::mlir::Region &WhileRegionOp::body() {
  return (*this)->getRegion(1);
}

::mlir::IntegerAttr WhileRegionOp::parallel_iterationsAttr() {
  return (*this)->getAttr(parallel_iterationsAttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t WhileRegionOp::parallel_iterations() {
  auto attr = parallel_iterationsAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), 10).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

::mlir::BoolAttr WhileRegionOp::is_statelessAttr() {
  return (*this)->getAttr(is_statelessAttrName()).cast<::mlir::BoolAttr>();
}

bool WhileRegionOp::is_stateless() {
  auto attr = is_statelessAttr();
  return attr.getValue();
}

::mlir::UnitAttr WhileRegionOp::shape_invariantAttr() {
  return (*this)->getAttr(shape_invariantAttrName()).dyn_cast_or_null<::mlir::UnitAttr>();
}

bool WhileRegionOp::shape_invariant() {
  auto attr = shape_invariantAttr();
  return attr != nullptr;
}

void WhileRegionOp::parallel_iterationsAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(parallel_iterationsAttrName(), attr);
}

void WhileRegionOp::is_statelessAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(is_statelessAttrName(), attr);
}

void WhileRegionOp::shape_invariantAttr(::mlir::UnitAttr attr) {
  (*this)->setAttr(shape_invariantAttrName(), attr);
}

::mlir::Attribute WhileRegionOp::removeShape_invariantAttr() {
  return (*this)->removeAttr(shape_invariantAttrName());
}

void WhileRegionOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange output, ::mlir::ValueRange input, ::mlir::IntegerAttr parallel_iterations, ::mlir::BoolAttr is_stateless, /*optional*/::mlir::UnitAttr shape_invariant) {
  odsState.addOperands(input);
  odsState.addAttribute(parallel_iterationsAttrName(odsState.name), parallel_iterations);
  odsState.addAttribute(is_statelessAttrName(odsState.name), is_stateless);
  if (shape_invariant) {
  odsState.addAttribute(shape_invariantAttrName(odsState.name), shape_invariant);
  }
  (void)odsState.addRegion();
  (void)odsState.addRegion();
  odsState.addTypes(output);
}

void WhileRegionOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange output, ::mlir::ValueRange input, uint64_t parallel_iterations, bool is_stateless, /*optional*/bool shape_invariant) {
  odsState.addOperands(input);
  odsState.addAttribute(parallel_iterationsAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), parallel_iterations));
  odsState.addAttribute(is_statelessAttrName(odsState.name), odsBuilder.getBoolAttr(is_stateless));
  if (shape_invariant) {
  odsState.addAttribute(shape_invariantAttrName(odsState.name), odsBuilder.getUnitAttr());
  }
  (void)odsState.addRegion();
  (void)odsState.addRegion();
  odsState.addTypes(output);
}

void WhileRegionOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  for (unsigned i = 0; i != 2; ++i)
    (void)odsState.addRegion();
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult WhileRegionOp::verify() {
  {
    auto tblgen_parallel_iterations = (*this)->getAttr(parallel_iterationsAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_parallel_iterations, "parallel_iterations")))
      return ::mlir::failure();
  }
  {
    auto tblgen_is_stateless = (*this)->getAttr(is_statelessAttrName());
    if (!tblgen_is_stateless)
      return emitOpError("requires attribute 'is_stateless'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_is_stateless, "is_stateless")))
      return ::mlir::failure();
  }
  {
    auto tblgen_shape_invariant = (*this)->getAttr(shape_invariantAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops40(*this, tblgen_shape_invariant, "shape_invariant")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops62(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops62(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;

    for (auto &region : ::llvm::makeMutableArrayRef((*this)->getRegion(0)))
      if (::mlir::failed(__mlir_ods_local_region_constraint_tf_ops0(*this, region, "cond", index++)))
        return ::mlir::failure();

    for (auto &region : ::llvm::makeMutableArrayRef((*this)->getRegion(1)))
      if (::mlir::failed(__mlir_ods_local_region_constraint_tf_ops0(*this, region, "body", index++)))
        return ::mlir::failure();
  }
  return Verify(*this);
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::WhileRegionOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::WriteAudioSummaryOp definitions
//===----------------------------------------------------------------------===//

WriteAudioSummaryOpAdaptor::WriteAudioSummaryOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

WriteAudioSummaryOpAdaptor::WriteAudioSummaryOpAdaptor(WriteAudioSummaryOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange WriteAudioSummaryOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> WriteAudioSummaryOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange WriteAudioSummaryOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value WriteAudioSummaryOpAdaptor::writer() {
  return *getODSOperands(0).begin();
}

::mlir::Value WriteAudioSummaryOpAdaptor::step() {
  return *getODSOperands(1).begin();
}

::mlir::Value WriteAudioSummaryOpAdaptor::tag() {
  return *getODSOperands(2).begin();
}

::mlir::Value WriteAudioSummaryOpAdaptor::tensor() {
  return *getODSOperands(3).begin();
}

::mlir::Value WriteAudioSummaryOpAdaptor::sample_rate() {
  return *getODSOperands(4).begin();
}

::mlir::DictionaryAttr WriteAudioSummaryOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::IntegerAttr WriteAudioSummaryOpAdaptor::max_outputs() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("max_outputs").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), 3);
  return attr;
}

::mlir::LogicalResult WriteAudioSummaryOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_max_outputs = odsAttrs.get("max_outputs");
    if (tblgen_max_outputs && !((((tblgen_max_outputs.isa<::mlir::IntegerAttr>())) && ((tblgen_max_outputs.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))) && ((tblgen_max_outputs.cast<::mlir::IntegerAttr>().getInt() >= 1))))
      return emitError(loc, "'tf.WriteAudioSummary' op ""attribute 'max_outputs' failed to satisfy constraint: 64-bit signless integer attribute whose minimum value is 1");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> WriteAudioSummaryOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range WriteAudioSummaryOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value WriteAudioSummaryOp::writer() {
  return *getODSOperands(0).begin();
}

::mlir::Value WriteAudioSummaryOp::step() {
  return *getODSOperands(1).begin();
}

::mlir::Value WriteAudioSummaryOp::tag() {
  return *getODSOperands(2).begin();
}

::mlir::Value WriteAudioSummaryOp::tensor() {
  return *getODSOperands(3).begin();
}

::mlir::Value WriteAudioSummaryOp::sample_rate() {
  return *getODSOperands(4).begin();
}

::mlir::MutableOperandRange WriteAudioSummaryOp::writerMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange WriteAudioSummaryOp::stepMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange WriteAudioSummaryOp::tagMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange WriteAudioSummaryOp::tensorMutable() {
  auto range = getODSOperandIndexAndLength(3);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange WriteAudioSummaryOp::sample_rateMutable() {
  auto range = getODSOperandIndexAndLength(4);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> WriteAudioSummaryOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range WriteAudioSummaryOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::IntegerAttr WriteAudioSummaryOp::max_outputsAttr() {
  return (*this)->getAttr(max_outputsAttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t WriteAudioSummaryOp::max_outputs() {
  auto attr = max_outputsAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), 3).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

void WriteAudioSummaryOp::max_outputsAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(max_outputsAttrName(), attr);
}

void WriteAudioSummaryOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value writer, ::mlir::Value step, ::mlir::Value tag, ::mlir::Value tensor, ::mlir::Value sample_rate, ::mlir::IntegerAttr max_outputs) {
  odsState.addOperands(writer);
  odsState.addOperands(step);
  odsState.addOperands(tag);
  odsState.addOperands(tensor);
  odsState.addOperands(sample_rate);
  odsState.addAttribute(max_outputsAttrName(odsState.name), max_outputs);
}

void WriteAudioSummaryOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value writer, ::mlir::Value step, ::mlir::Value tag, ::mlir::Value tensor, ::mlir::Value sample_rate, ::mlir::IntegerAttr max_outputs) {
  odsState.addOperands(writer);
  odsState.addOperands(step);
  odsState.addOperands(tag);
  odsState.addOperands(tensor);
  odsState.addOperands(sample_rate);
  odsState.addAttribute(max_outputsAttrName(odsState.name), max_outputs);
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void WriteAudioSummaryOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value writer, ::mlir::Value step, ::mlir::Value tag, ::mlir::Value tensor, ::mlir::Value sample_rate, uint64_t max_outputs) {
  odsState.addOperands(writer);
  odsState.addOperands(step);
  odsState.addOperands(tag);
  odsState.addOperands(tensor);
  odsState.addOperands(sample_rate);
  odsState.addAttribute(max_outputsAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), max_outputs));
}

void WriteAudioSummaryOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value writer, ::mlir::Value step, ::mlir::Value tag, ::mlir::Value tensor, ::mlir::Value sample_rate, uint64_t max_outputs) {
  odsState.addOperands(writer);
  odsState.addOperands(step);
  odsState.addOperands(tag);
  odsState.addOperands(tensor);
  odsState.addOperands(sample_rate);
  odsState.addAttribute(max_outputsAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), max_outputs));
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void WriteAudioSummaryOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 5u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 0u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult WriteAudioSummaryOp::verify() {
  {
    auto tblgen_max_outputs = (*this)->getAttr(max_outputsAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops38(*this, tblgen_max_outputs, "max_outputs")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops16(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops19(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup3 = getODSOperands(3);

    for (auto v : valueGroup3) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup4 = getODSOperands(4);

    for (auto v : valueGroup4) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void WriteAudioSummaryOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  for (::mlir::Value value : getODSOperands(0))
    effects.emplace_back(::mlir::MemoryEffects::Write::get(), value, ::mlir::TF::ResourceEffects::Summary::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::WriteAudioSummaryOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::WriteGraphSummaryOp definitions
//===----------------------------------------------------------------------===//

WriteGraphSummaryOpAdaptor::WriteGraphSummaryOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

WriteGraphSummaryOpAdaptor::WriteGraphSummaryOpAdaptor(WriteGraphSummaryOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange WriteGraphSummaryOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> WriteGraphSummaryOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange WriteGraphSummaryOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value WriteGraphSummaryOpAdaptor::writer() {
  return *getODSOperands(0).begin();
}

::mlir::Value WriteGraphSummaryOpAdaptor::step() {
  return *getODSOperands(1).begin();
}

::mlir::Value WriteGraphSummaryOpAdaptor::tensor() {
  return *getODSOperands(2).begin();
}

::mlir::DictionaryAttr WriteGraphSummaryOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult WriteGraphSummaryOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> WriteGraphSummaryOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range WriteGraphSummaryOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value WriteGraphSummaryOp::writer() {
  return *getODSOperands(0).begin();
}

::mlir::Value WriteGraphSummaryOp::step() {
  return *getODSOperands(1).begin();
}

::mlir::Value WriteGraphSummaryOp::tensor() {
  return *getODSOperands(2).begin();
}

::mlir::MutableOperandRange WriteGraphSummaryOp::writerMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange WriteGraphSummaryOp::stepMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange WriteGraphSummaryOp::tensorMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> WriteGraphSummaryOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range WriteGraphSummaryOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

void WriteGraphSummaryOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value writer, ::mlir::Value step, ::mlir::Value tensor) {
  odsState.addOperands(writer);
  odsState.addOperands(step);
  odsState.addOperands(tensor);
}

void WriteGraphSummaryOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value writer, ::mlir::Value step, ::mlir::Value tensor) {
  odsState.addOperands(writer);
  odsState.addOperands(step);
  odsState.addOperands(tensor);
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void WriteGraphSummaryOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 3u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 0u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult WriteGraphSummaryOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops16(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops19(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void WriteGraphSummaryOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  for (::mlir::Value value : getODSOperands(0))
    effects.emplace_back(::mlir::MemoryEffects::Write::get(), value, ::mlir::TF::ResourceEffects::Summary::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::WriteGraphSummaryOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::WriteHistogramSummaryOp definitions
//===----------------------------------------------------------------------===//

WriteHistogramSummaryOpAdaptor::WriteHistogramSummaryOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

WriteHistogramSummaryOpAdaptor::WriteHistogramSummaryOpAdaptor(WriteHistogramSummaryOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange WriteHistogramSummaryOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> WriteHistogramSummaryOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange WriteHistogramSummaryOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value WriteHistogramSummaryOpAdaptor::writer() {
  return *getODSOperands(0).begin();
}

::mlir::Value WriteHistogramSummaryOpAdaptor::step() {
  return *getODSOperands(1).begin();
}

::mlir::Value WriteHistogramSummaryOpAdaptor::tag() {
  return *getODSOperands(2).begin();
}

::mlir::Value WriteHistogramSummaryOpAdaptor::values() {
  return *getODSOperands(3).begin();
}

::mlir::DictionaryAttr WriteHistogramSummaryOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult WriteHistogramSummaryOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> WriteHistogramSummaryOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range WriteHistogramSummaryOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value WriteHistogramSummaryOp::writer() {
  return *getODSOperands(0).begin();
}

::mlir::Value WriteHistogramSummaryOp::step() {
  return *getODSOperands(1).begin();
}

::mlir::Value WriteHistogramSummaryOp::tag() {
  return *getODSOperands(2).begin();
}

::mlir::Value WriteHistogramSummaryOp::values() {
  return *getODSOperands(3).begin();
}

::mlir::MutableOperandRange WriteHistogramSummaryOp::writerMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange WriteHistogramSummaryOp::stepMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange WriteHistogramSummaryOp::tagMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange WriteHistogramSummaryOp::valuesMutable() {
  auto range = getODSOperandIndexAndLength(3);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> WriteHistogramSummaryOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range WriteHistogramSummaryOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Type WriteHistogramSummaryOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(3).begin());
}

bool WriteHistogramSummaryOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr WriteHistogramSummaryOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void WriteHistogramSummaryOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value writer, ::mlir::Value step, ::mlir::Value tag, ::mlir::Value values) {
  odsState.addOperands(writer);
  odsState.addOperands(step);
  odsState.addOperands(tag);
  odsState.addOperands(values);
}

void WriteHistogramSummaryOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value writer, ::mlir::Value step, ::mlir::Value tag, ::mlir::Value values) {
  odsState.addOperands(writer);
  odsState.addOperands(step);
  odsState.addOperands(tag);
  odsState.addOperands(values);
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void WriteHistogramSummaryOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 4u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 0u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult WriteHistogramSummaryOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops16(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops19(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup3 = getODSOperands(3);

    for (auto v : valueGroup3) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops35(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void WriteHistogramSummaryOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  for (::mlir::Value value : getODSOperands(0))
    effects.emplace_back(::mlir::MemoryEffects::Write::get(), value, ::mlir::TF::ResourceEffects::Summary::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::WriteHistogramSummaryOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::WriteImageSummaryOp definitions
//===----------------------------------------------------------------------===//

WriteImageSummaryOpAdaptor::WriteImageSummaryOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

WriteImageSummaryOpAdaptor::WriteImageSummaryOpAdaptor(WriteImageSummaryOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange WriteImageSummaryOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> WriteImageSummaryOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange WriteImageSummaryOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value WriteImageSummaryOpAdaptor::writer() {
  return *getODSOperands(0).begin();
}

::mlir::Value WriteImageSummaryOpAdaptor::step() {
  return *getODSOperands(1).begin();
}

::mlir::Value WriteImageSummaryOpAdaptor::tag() {
  return *getODSOperands(2).begin();
}

::mlir::Value WriteImageSummaryOpAdaptor::tensor() {
  return *getODSOperands(3).begin();
}

::mlir::Value WriteImageSummaryOpAdaptor::bad_color() {
  return *getODSOperands(4).begin();
}

::mlir::DictionaryAttr WriteImageSummaryOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::IntegerAttr WriteImageSummaryOpAdaptor::max_images() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("max_images").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), 3);
  return attr;
}

::mlir::LogicalResult WriteImageSummaryOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_max_images = odsAttrs.get("max_images");
    if (tblgen_max_images && !((((tblgen_max_images.isa<::mlir::IntegerAttr>())) && ((tblgen_max_images.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))) && ((tblgen_max_images.cast<::mlir::IntegerAttr>().getInt() >= 1))))
      return emitError(loc, "'tf.WriteImageSummary' op ""attribute 'max_images' failed to satisfy constraint: 64-bit signless integer attribute whose minimum value is 1");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> WriteImageSummaryOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range WriteImageSummaryOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value WriteImageSummaryOp::writer() {
  return *getODSOperands(0).begin();
}

::mlir::Value WriteImageSummaryOp::step() {
  return *getODSOperands(1).begin();
}

::mlir::Value WriteImageSummaryOp::tag() {
  return *getODSOperands(2).begin();
}

::mlir::Value WriteImageSummaryOp::tensor() {
  return *getODSOperands(3).begin();
}

::mlir::Value WriteImageSummaryOp::bad_color() {
  return *getODSOperands(4).begin();
}

::mlir::MutableOperandRange WriteImageSummaryOp::writerMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange WriteImageSummaryOp::stepMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange WriteImageSummaryOp::tagMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange WriteImageSummaryOp::tensorMutable() {
  auto range = getODSOperandIndexAndLength(3);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange WriteImageSummaryOp::bad_colorMutable() {
  auto range = getODSOperandIndexAndLength(4);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> WriteImageSummaryOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range WriteImageSummaryOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::IntegerAttr WriteImageSummaryOp::max_imagesAttr() {
  return (*this)->getAttr(max_imagesAttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t WriteImageSummaryOp::max_images() {
  auto attr = max_imagesAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), 3).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

::mlir::Type WriteImageSummaryOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(3).begin());
}

bool WriteImageSummaryOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr WriteImageSummaryOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void WriteImageSummaryOp::max_imagesAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(max_imagesAttrName(), attr);
}

void WriteImageSummaryOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value writer, ::mlir::Value step, ::mlir::Value tag, ::mlir::Value tensor, ::mlir::Value bad_color, ::mlir::IntegerAttr max_images) {
  odsState.addOperands(writer);
  odsState.addOperands(step);
  odsState.addOperands(tag);
  odsState.addOperands(tensor);
  odsState.addOperands(bad_color);
  odsState.addAttribute(max_imagesAttrName(odsState.name), max_images);
}

void WriteImageSummaryOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value writer, ::mlir::Value step, ::mlir::Value tag, ::mlir::Value tensor, ::mlir::Value bad_color, ::mlir::IntegerAttr max_images) {
  odsState.addOperands(writer);
  odsState.addOperands(step);
  odsState.addOperands(tag);
  odsState.addOperands(tensor);
  odsState.addOperands(bad_color);
  odsState.addAttribute(max_imagesAttrName(odsState.name), max_images);
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void WriteImageSummaryOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value writer, ::mlir::Value step, ::mlir::Value tag, ::mlir::Value tensor, ::mlir::Value bad_color, uint64_t max_images) {
  odsState.addOperands(writer);
  odsState.addOperands(step);
  odsState.addOperands(tag);
  odsState.addOperands(tensor);
  odsState.addOperands(bad_color);
  odsState.addAttribute(max_imagesAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), max_images));
}

void WriteImageSummaryOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value writer, ::mlir::Value step, ::mlir::Value tag, ::mlir::Value tensor, ::mlir::Value bad_color, uint64_t max_images) {
  odsState.addOperands(writer);
  odsState.addOperands(step);
  odsState.addOperands(tag);
  odsState.addOperands(tensor);
  odsState.addOperands(bad_color);
  odsState.addAttribute(max_imagesAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), max_images));
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void WriteImageSummaryOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 5u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 0u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult WriteImageSummaryOp::verify() {
  {
    auto tblgen_max_images = (*this)->getAttr(max_imagesAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops38(*this, tblgen_max_images, "max_images")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops16(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops19(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup3 = getODSOperands(3);

    for (auto v : valueGroup3) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops63(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup4 = getODSOperands(4);

    for (auto v : valueGroup4) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops37(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void WriteImageSummaryOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  for (::mlir::Value value : getODSOperands(0))
    effects.emplace_back(::mlir::MemoryEffects::Write::get(), value, ::mlir::TF::ResourceEffects::Summary::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::WriteImageSummaryOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::WriteRawProtoSummaryOp definitions
//===----------------------------------------------------------------------===//

WriteRawProtoSummaryOpAdaptor::WriteRawProtoSummaryOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

WriteRawProtoSummaryOpAdaptor::WriteRawProtoSummaryOpAdaptor(WriteRawProtoSummaryOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange WriteRawProtoSummaryOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> WriteRawProtoSummaryOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange WriteRawProtoSummaryOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value WriteRawProtoSummaryOpAdaptor::writer() {
  return *getODSOperands(0).begin();
}

::mlir::Value WriteRawProtoSummaryOpAdaptor::step() {
  return *getODSOperands(1).begin();
}

::mlir::Value WriteRawProtoSummaryOpAdaptor::tensor() {
  return *getODSOperands(2).begin();
}

::mlir::DictionaryAttr WriteRawProtoSummaryOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult WriteRawProtoSummaryOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> WriteRawProtoSummaryOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range WriteRawProtoSummaryOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value WriteRawProtoSummaryOp::writer() {
  return *getODSOperands(0).begin();
}

::mlir::Value WriteRawProtoSummaryOp::step() {
  return *getODSOperands(1).begin();
}

::mlir::Value WriteRawProtoSummaryOp::tensor() {
  return *getODSOperands(2).begin();
}

::mlir::MutableOperandRange WriteRawProtoSummaryOp::writerMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange WriteRawProtoSummaryOp::stepMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange WriteRawProtoSummaryOp::tensorMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> WriteRawProtoSummaryOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range WriteRawProtoSummaryOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

void WriteRawProtoSummaryOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value writer, ::mlir::Value step, ::mlir::Value tensor) {
  odsState.addOperands(writer);
  odsState.addOperands(step);
  odsState.addOperands(tensor);
}

void WriteRawProtoSummaryOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value writer, ::mlir::Value step, ::mlir::Value tensor) {
  odsState.addOperands(writer);
  odsState.addOperands(step);
  odsState.addOperands(tensor);
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void WriteRawProtoSummaryOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 3u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 0u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult WriteRawProtoSummaryOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops16(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops19(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void WriteRawProtoSummaryOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  for (::mlir::Value value : getODSOperands(0))
    effects.emplace_back(::mlir::MemoryEffects::Write::get(), value, ::mlir::TF::ResourceEffects::Summary::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::WriteRawProtoSummaryOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::WriteScalarSummaryOp definitions
//===----------------------------------------------------------------------===//

WriteScalarSummaryOpAdaptor::WriteScalarSummaryOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

WriteScalarSummaryOpAdaptor::WriteScalarSummaryOpAdaptor(WriteScalarSummaryOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange WriteScalarSummaryOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> WriteScalarSummaryOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange WriteScalarSummaryOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value WriteScalarSummaryOpAdaptor::writer() {
  return *getODSOperands(0).begin();
}

::mlir::Value WriteScalarSummaryOpAdaptor::step() {
  return *getODSOperands(1).begin();
}

::mlir::Value WriteScalarSummaryOpAdaptor::tag() {
  return *getODSOperands(2).begin();
}

::mlir::Value WriteScalarSummaryOpAdaptor::value() {
  return *getODSOperands(3).begin();
}

::mlir::DictionaryAttr WriteScalarSummaryOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult WriteScalarSummaryOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> WriteScalarSummaryOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range WriteScalarSummaryOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value WriteScalarSummaryOp::writer() {
  return *getODSOperands(0).begin();
}

::mlir::Value WriteScalarSummaryOp::step() {
  return *getODSOperands(1).begin();
}

::mlir::Value WriteScalarSummaryOp::tag() {
  return *getODSOperands(2).begin();
}

::mlir::Value WriteScalarSummaryOp::value() {
  return *getODSOperands(3).begin();
}

::mlir::MutableOperandRange WriteScalarSummaryOp::writerMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange WriteScalarSummaryOp::stepMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange WriteScalarSummaryOp::tagMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange WriteScalarSummaryOp::valueMutable() {
  auto range = getODSOperandIndexAndLength(3);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> WriteScalarSummaryOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range WriteScalarSummaryOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Type WriteScalarSummaryOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(3).begin());
}

bool WriteScalarSummaryOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr WriteScalarSummaryOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void WriteScalarSummaryOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value writer, ::mlir::Value step, ::mlir::Value tag, ::mlir::Value value) {
  odsState.addOperands(writer);
  odsState.addOperands(step);
  odsState.addOperands(tag);
  odsState.addOperands(value);
}

void WriteScalarSummaryOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value writer, ::mlir::Value step, ::mlir::Value tag, ::mlir::Value value) {
  odsState.addOperands(writer);
  odsState.addOperands(step);
  odsState.addOperands(tag);
  odsState.addOperands(value);
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void WriteScalarSummaryOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 4u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 0u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult WriteScalarSummaryOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops16(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops19(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup3 = getODSOperands(3);

    for (auto v : valueGroup3) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops35(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void WriteScalarSummaryOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  for (::mlir::Value value : getODSOperands(0))
    effects.emplace_back(::mlir::MemoryEffects::Write::get(), value, ::mlir::TF::ResourceEffects::Summary::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::WriteScalarSummaryOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::WriteSummaryOp definitions
//===----------------------------------------------------------------------===//

WriteSummaryOpAdaptor::WriteSummaryOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

WriteSummaryOpAdaptor::WriteSummaryOpAdaptor(WriteSummaryOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange WriteSummaryOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> WriteSummaryOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange WriteSummaryOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value WriteSummaryOpAdaptor::writer() {
  return *getODSOperands(0).begin();
}

::mlir::Value WriteSummaryOpAdaptor::step() {
  return *getODSOperands(1).begin();
}

::mlir::Value WriteSummaryOpAdaptor::tensor() {
  return *getODSOperands(2).begin();
}

::mlir::Value WriteSummaryOpAdaptor::tag() {
  return *getODSOperands(3).begin();
}

::mlir::Value WriteSummaryOpAdaptor::summary_metadata() {
  return *getODSOperands(4).begin();
}

::mlir::DictionaryAttr WriteSummaryOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult WriteSummaryOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> WriteSummaryOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range WriteSummaryOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value WriteSummaryOp::writer() {
  return *getODSOperands(0).begin();
}

::mlir::Value WriteSummaryOp::step() {
  return *getODSOperands(1).begin();
}

::mlir::Value WriteSummaryOp::tensor() {
  return *getODSOperands(2).begin();
}

::mlir::Value WriteSummaryOp::tag() {
  return *getODSOperands(3).begin();
}

::mlir::Value WriteSummaryOp::summary_metadata() {
  return *getODSOperands(4).begin();
}

::mlir::MutableOperandRange WriteSummaryOp::writerMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange WriteSummaryOp::stepMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange WriteSummaryOp::tensorMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange WriteSummaryOp::tagMutable() {
  auto range = getODSOperandIndexAndLength(3);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange WriteSummaryOp::summary_metadataMutable() {
  auto range = getODSOperandIndexAndLength(4);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> WriteSummaryOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range WriteSummaryOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Type WriteSummaryOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(2).begin());
}

bool WriteSummaryOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr WriteSummaryOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void WriteSummaryOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value writer, ::mlir::Value step, ::mlir::Value tensor, ::mlir::Value tag, ::mlir::Value summary_metadata) {
  odsState.addOperands(writer);
  odsState.addOperands(step);
  odsState.addOperands(tensor);
  odsState.addOperands(tag);
  odsState.addOperands(summary_metadata);
}

void WriteSummaryOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value writer, ::mlir::Value step, ::mlir::Value tensor, ::mlir::Value tag, ::mlir::Value summary_metadata) {
  odsState.addOperands(writer);
  odsState.addOperands(step);
  odsState.addOperands(tensor);
  odsState.addOperands(tag);
  odsState.addOperands(summary_metadata);
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void WriteSummaryOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 5u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 0u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult WriteSummaryOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops14(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops16(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup3 = getODSOperands(3);

    for (auto v : valueGroup3) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops19(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup4 = getODSOperands(4);

    for (auto v : valueGroup4) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops19(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void WriteSummaryOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  for (::mlir::Value value : getODSOperands(0))
    effects.emplace_back(::mlir::MemoryEffects::Write::get(), value, ::mlir::TF::ResourceEffects::Summary::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::WriteSummaryOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::XdivyOp definitions
//===----------------------------------------------------------------------===//

XdivyOpAdaptor::XdivyOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

XdivyOpAdaptor::XdivyOpAdaptor(XdivyOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange XdivyOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> XdivyOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange XdivyOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value XdivyOpAdaptor::x() {
  return *getODSOperands(0).begin();
}

::mlir::Value XdivyOpAdaptor::y() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr XdivyOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult XdivyOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> XdivyOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range XdivyOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value XdivyOp::x() {
  return *getODSOperands(0).begin();
}

::mlir::Value XdivyOp::y() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange XdivyOp::xMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange XdivyOp::yMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> XdivyOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range XdivyOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value XdivyOp::z() {
  return *getODSResults(0).begin();
}

::mlir::Type XdivyOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool XdivyOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr XdivyOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void XdivyOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, Value x, Value y) {
  auto resultType =
      OpTrait::util::getBroadcastedType(x.getType(), y.getType());
  if (!resultType)
    mlir::emitError(odsState.location, "non-broadcastable operands");
  return build(odsBuilder, odsState, resultType, x, y);
}

void XdivyOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type z, ::mlir::Value x, ::mlir::Value y) {
  odsState.addOperands(x);
  odsState.addOperands(y);
  odsState.addTypes(z);
}

void XdivyOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value x, ::mlir::Value y) {
  odsState.addOperands(x);
  odsState.addOperands(y);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void XdivyOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult XdivyOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops29(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops29(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops29(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void XdivyOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::XdivyOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::XlaAllReduceOp definitions
//===----------------------------------------------------------------------===//

XlaAllReduceOpAdaptor::XlaAllReduceOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

XlaAllReduceOpAdaptor::XlaAllReduceOpAdaptor(XlaAllReduceOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange XlaAllReduceOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> XlaAllReduceOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange XlaAllReduceOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value XlaAllReduceOpAdaptor::input() {
  return *getODSOperands(0).begin();
}

::mlir::Value XlaAllReduceOpAdaptor::group_assignment() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr XlaAllReduceOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::StringAttr XlaAllReduceOpAdaptor::reduce_op() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("reduce_op").cast<::mlir::StringAttr>();
  return attr;
}

::mlir::StringAttr XlaAllReduceOpAdaptor::mode() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("mode").cast<::mlir::StringAttr>();
  return attr;
}

::mlir::LogicalResult XlaAllReduceOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_reduce_op = odsAttrs.get("reduce_op");
    if (!tblgen_reduce_op)
      return emitError(loc, "'tf.XlaAllReduce' op ""requires attribute 'reduce_op'");

    if (tblgen_reduce_op && !((tblgen_reduce_op.cast<StringAttr>().getValue() == "Min" || tblgen_reduce_op.cast<StringAttr>().getValue() == "Max" || tblgen_reduce_op.cast<StringAttr>().getValue() == "Mul" || tblgen_reduce_op.cast<StringAttr>().getValue() == "Add" || tblgen_reduce_op.cast<StringAttr>().getValue() == "Mean")))
      return emitError(loc, "'tf.XlaAllReduce' op ""attribute 'reduce_op' failed to satisfy constraint: string attribute whose value is Min, or Max, or Mul, or Add, or Mean");
  }
  {
    auto tblgen_mode = odsAttrs.get("mode");
    if (!tblgen_mode)
      return emitError(loc, "'tf.XlaAllReduce' op ""requires attribute 'mode'");

    if (tblgen_mode && !((tblgen_mode.cast<StringAttr>().getValue() == "CrossReplica" || tblgen_mode.cast<StringAttr>().getValue() == "CrossReplicaAndPartition")))
      return emitError(loc, "'tf.XlaAllReduce' op ""attribute 'mode' failed to satisfy constraint: string attribute whose value is CrossReplica, or CrossReplicaAndPartition");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> XlaAllReduceOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range XlaAllReduceOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value XlaAllReduceOp::input() {
  return *getODSOperands(0).begin();
}

::mlir::Value XlaAllReduceOp::group_assignment() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange XlaAllReduceOp::inputMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange XlaAllReduceOp::group_assignmentMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> XlaAllReduceOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range XlaAllReduceOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value XlaAllReduceOp::output() {
  return *getODSResults(0).begin();
}

::mlir::StringAttr XlaAllReduceOp::reduce_opAttr() {
  return (*this)->getAttr(reduce_opAttrName()).cast<::mlir::StringAttr>();
}

::llvm::StringRef XlaAllReduceOp::reduce_op() {
  auto attr = reduce_opAttr();
  return attr.getValue();
}

::mlir::StringAttr XlaAllReduceOp::modeAttr() {
  return (*this)->getAttr(modeAttrName()).cast<::mlir::StringAttr>();
}

::llvm::StringRef XlaAllReduceOp::mode() {
  auto attr = modeAttr();
  return attr.getValue();
}

::mlir::Type XlaAllReduceOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool XlaAllReduceOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr XlaAllReduceOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void XlaAllReduceOp::reduce_opAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(reduce_opAttrName(), attr);
}

void XlaAllReduceOp::modeAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(modeAttrName(), attr);
}

void XlaAllReduceOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input, ::mlir::Value group_assignment, ::mlir::StringAttr reduce_op, ::mlir::StringAttr mode) {
  odsState.addOperands(input);
  odsState.addOperands(group_assignment);
  odsState.addAttribute(reduce_opAttrName(odsState.name), reduce_op);
  odsState.addAttribute(modeAttrName(odsState.name), mode);
  odsState.addTypes(output);
}

void XlaAllReduceOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::Value group_assignment, ::mlir::StringAttr reduce_op, ::mlir::StringAttr mode) {
  odsState.addOperands(input);
  odsState.addOperands(group_assignment);
  odsState.addAttribute(reduce_opAttrName(odsState.name), reduce_op);
  odsState.addAttribute(modeAttrName(odsState.name), mode);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void XlaAllReduceOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input, ::mlir::Value group_assignment, ::llvm::StringRef reduce_op, ::llvm::StringRef mode) {
  odsState.addOperands(input);
  odsState.addOperands(group_assignment);
  odsState.addAttribute(reduce_opAttrName(odsState.name), odsBuilder.getStringAttr(reduce_op));
  odsState.addAttribute(modeAttrName(odsState.name), odsBuilder.getStringAttr(mode));
  odsState.addTypes(output);
}

void XlaAllReduceOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::Value group_assignment, ::llvm::StringRef reduce_op, ::llvm::StringRef mode) {
  odsState.addOperands(input);
  odsState.addOperands(group_assignment);
  odsState.addAttribute(reduce_opAttrName(odsState.name), odsBuilder.getStringAttr(reduce_op));
  odsState.addAttribute(modeAttrName(odsState.name), odsBuilder.getStringAttr(mode));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void XlaAllReduceOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult XlaAllReduceOp::verify() {
  {
    auto tblgen_reduce_op = (*this)->getAttr(reduce_opAttrName());
    if (!tblgen_reduce_op)
      return emitOpError("requires attribute 'reduce_op'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops41(*this, tblgen_reduce_op, "reduce_op")))
      return ::mlir::failure();
  }
  {
    auto tblgen_mode = (*this)->getAttr(modeAttrName());
    if (!tblgen_mode)
      return emitOpError("requires attribute 'mode'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops42(*this, tblgen_mode, "mode")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops64(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops11(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops64(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void XlaAllReduceOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::XlaAllReduceOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::XlaBroadcastHelperOp definitions
//===----------------------------------------------------------------------===//

XlaBroadcastHelperOpAdaptor::XlaBroadcastHelperOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

XlaBroadcastHelperOpAdaptor::XlaBroadcastHelperOpAdaptor(XlaBroadcastHelperOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange XlaBroadcastHelperOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> XlaBroadcastHelperOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange XlaBroadcastHelperOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value XlaBroadcastHelperOpAdaptor::lhs() {
  return *getODSOperands(0).begin();
}

::mlir::Value XlaBroadcastHelperOpAdaptor::rhs() {
  return *getODSOperands(1).begin();
}

::mlir::Value XlaBroadcastHelperOpAdaptor::broadcast_dims() {
  return *getODSOperands(2).begin();
}

::mlir::DictionaryAttr XlaBroadcastHelperOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult XlaBroadcastHelperOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

void XlaBroadcastHelperOp::getAsmResultNames(::mlir::OpAsmSetValueNameFn setNameFn) {
  auto resultGroup0 = getODSResults(0);
  if (!llvm::empty(resultGroup0))
    setNameFn(*resultGroup0.begin(), "lhs_output");
  auto resultGroup1 = getODSResults(1);
  if (!llvm::empty(resultGroup1))
    setNameFn(*resultGroup1.begin(), "rhs_output");
}

std::pair<unsigned, unsigned> XlaBroadcastHelperOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range XlaBroadcastHelperOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value XlaBroadcastHelperOp::lhs() {
  return *getODSOperands(0).begin();
}

::mlir::Value XlaBroadcastHelperOp::rhs() {
  return *getODSOperands(1).begin();
}

::mlir::Value XlaBroadcastHelperOp::broadcast_dims() {
  return *getODSOperands(2).begin();
}

::mlir::MutableOperandRange XlaBroadcastHelperOp::lhsMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange XlaBroadcastHelperOp::rhsMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange XlaBroadcastHelperOp::broadcast_dimsMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> XlaBroadcastHelperOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range XlaBroadcastHelperOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value XlaBroadcastHelperOp::lhs_output() {
  return *getODSResults(0).begin();
}

::mlir::Value XlaBroadcastHelperOp::rhs_output() {
  return *getODSResults(1).begin();
}

::mlir::Type XlaBroadcastHelperOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

::mlir::Type XlaBroadcastHelperOp::Tindices() {
  return mlir::getElementTypeOrSelf(*getODSOperands(2).begin());
}

bool XlaBroadcastHelperOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
  if (name == "Tindices") return true;
 return false;
}

::mlir::DictionaryAttr XlaBroadcastHelperOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())},
    {TindicesAttrName(),
::mlir::TypeAttr::get(Tindices())}});
}

void XlaBroadcastHelperOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type lhs_output, ::mlir::Type rhs_output, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::Value broadcast_dims) {
  odsState.addOperands(lhs);
  odsState.addOperands(rhs);
  odsState.addOperands(broadcast_dims);
  odsState.addTypes(lhs_output);
  odsState.addTypes(rhs_output);
}

void XlaBroadcastHelperOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::Value broadcast_dims) {
  odsState.addOperands(lhs);
  odsState.addOperands(rhs);
  odsState.addOperands(broadcast_dims);

        ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
        if (::mlir::succeeded(XlaBroadcastHelperOp::inferReturnTypes(odsBuilder.getContext(),
                      odsState.location, odsState.operands,
                      odsState.attributes.getDictionary(odsState.getContext()),
                      /*regions=*/{}, inferredReturnTypes)))
          odsState.addTypes(inferredReturnTypes);
        else
          ::llvm::report_fatal_error("Failed to infer result type(s).");
}

void XlaBroadcastHelperOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::Value broadcast_dims) {
  odsState.addOperands(lhs);
  odsState.addOperands(rhs);
  odsState.addOperands(broadcast_dims);
  assert(resultTypes.size() == 2u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void XlaBroadcastHelperOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 3u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 2u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

void XlaBroadcastHelperOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 3u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);

  ::mlir::SmallVector<::mlir::Type, 2> inferredReturnTypes;
  if (::mlir::succeeded(XlaBroadcastHelperOp::inferReturnTypes(odsBuilder.getContext(),
          odsState.location, operands,
          odsState.attributes.getDictionary(odsState.getContext()),
          odsState.regions, inferredReturnTypes))) {
    assert(inferredReturnTypes.size() == 2u && "mismatched number of return types");
    odsState.addTypes(inferredReturnTypes);
  } else {
    ::llvm::report_fatal_error("Failed to infer result type(s).");
  }
}

::mlir::LogicalResult XlaBroadcastHelperOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSResults(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void XlaBroadcastHelperOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::XlaBroadcastHelperOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::XlaClusterOutputOp definitions
//===----------------------------------------------------------------------===//

XlaClusterOutputOpAdaptor::XlaClusterOutputOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

XlaClusterOutputOpAdaptor::XlaClusterOutputOpAdaptor(XlaClusterOutputOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange XlaClusterOutputOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> XlaClusterOutputOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange XlaClusterOutputOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value XlaClusterOutputOpAdaptor::input() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr XlaClusterOutputOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult XlaClusterOutputOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> XlaClusterOutputOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range XlaClusterOutputOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value XlaClusterOutputOp::input() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange XlaClusterOutputOp::inputMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> XlaClusterOutputOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range XlaClusterOutputOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value XlaClusterOutputOp::outputs() {
  return *getODSResults(0).begin();
}

::mlir::Type XlaClusterOutputOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool XlaClusterOutputOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr XlaClusterOutputOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void XlaClusterOutputOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type outputs, ::mlir::Value input) {
  odsState.addOperands(input);
  odsState.addTypes(outputs);
}

void XlaClusterOutputOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input) {
  odsState.addOperands(input);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void XlaClusterOutputOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult XlaClusterOutputOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void XlaClusterOutputOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::XlaClusterOutputOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::XlaConvOp definitions
//===----------------------------------------------------------------------===//

XlaConvOpAdaptor::XlaConvOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

XlaConvOpAdaptor::XlaConvOpAdaptor(XlaConvOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange XlaConvOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> XlaConvOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange XlaConvOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value XlaConvOpAdaptor::lhs() {
  return *getODSOperands(0).begin();
}

::mlir::Value XlaConvOpAdaptor::rhs() {
  return *getODSOperands(1).begin();
}

::mlir::Value XlaConvOpAdaptor::window_strides() {
  return *getODSOperands(2).begin();
}

::mlir::Value XlaConvOpAdaptor::padding() {
  return *getODSOperands(3).begin();
}

::mlir::Value XlaConvOpAdaptor::lhs_dilation() {
  return *getODSOperands(4).begin();
}

::mlir::Value XlaConvOpAdaptor::rhs_dilation() {
  return *getODSOperands(5).begin();
}

::mlir::Value XlaConvOpAdaptor::feature_group_count() {
  return *getODSOperands(6).begin();
}

::mlir::DictionaryAttr XlaConvOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::StringAttr XlaConvOpAdaptor::dimension_numbers() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("dimension_numbers").cast<::mlir::StringAttr>();
  return attr;
}

::mlir::StringAttr XlaConvOpAdaptor::precision_config() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("precision_config").cast<::mlir::StringAttr>();
  return attr;
}

::mlir::LogicalResult XlaConvOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_dimension_numbers = odsAttrs.get("dimension_numbers");
    if (!tblgen_dimension_numbers)
      return emitError(loc, "'tf.XlaConv' op ""requires attribute 'dimension_numbers'");

    if (tblgen_dimension_numbers && !((tblgen_dimension_numbers.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.XlaConv' op ""attribute 'dimension_numbers' failed to satisfy constraint: string attribute");
  }
  {
    auto tblgen_precision_config = odsAttrs.get("precision_config");
    if (!tblgen_precision_config)
      return emitError(loc, "'tf.XlaConv' op ""requires attribute 'precision_config'");

    if (tblgen_precision_config && !((tblgen_precision_config.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.XlaConv' op ""attribute 'precision_config' failed to satisfy constraint: string attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> XlaConvOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range XlaConvOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value XlaConvOp::lhs() {
  return *getODSOperands(0).begin();
}

::mlir::Value XlaConvOp::rhs() {
  return *getODSOperands(1).begin();
}

::mlir::Value XlaConvOp::window_strides() {
  return *getODSOperands(2).begin();
}

::mlir::Value XlaConvOp::padding() {
  return *getODSOperands(3).begin();
}

::mlir::Value XlaConvOp::lhs_dilation() {
  return *getODSOperands(4).begin();
}

::mlir::Value XlaConvOp::rhs_dilation() {
  return *getODSOperands(5).begin();
}

::mlir::Value XlaConvOp::feature_group_count() {
  return *getODSOperands(6).begin();
}

::mlir::MutableOperandRange XlaConvOp::lhsMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange XlaConvOp::rhsMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange XlaConvOp::window_stridesMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange XlaConvOp::paddingMutable() {
  auto range = getODSOperandIndexAndLength(3);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange XlaConvOp::lhs_dilationMutable() {
  auto range = getODSOperandIndexAndLength(4);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange XlaConvOp::rhs_dilationMutable() {
  auto range = getODSOperandIndexAndLength(5);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange XlaConvOp::feature_group_countMutable() {
  auto range = getODSOperandIndexAndLength(6);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> XlaConvOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range XlaConvOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value XlaConvOp::output() {
  return *getODSResults(0).begin();
}

::mlir::StringAttr XlaConvOp::dimension_numbersAttr() {
  return (*this)->getAttr(dimension_numbersAttrName()).cast<::mlir::StringAttr>();
}

::llvm::StringRef XlaConvOp::dimension_numbers() {
  auto attr = dimension_numbersAttr();
  return attr.getValue();
}

::mlir::StringAttr XlaConvOp::precision_configAttr() {
  return (*this)->getAttr(precision_configAttrName()).cast<::mlir::StringAttr>();
}

::llvm::StringRef XlaConvOp::precision_config() {
  auto attr = precision_configAttr();
  return attr.getValue();
}

::mlir::Type XlaConvOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

::mlir::Type XlaConvOp::Tindices() {
  return mlir::getElementTypeOrSelf(*getODSOperands(2).begin());
}

bool XlaConvOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
  if (name == "Tindices") return true;
 return false;
}

::mlir::DictionaryAttr XlaConvOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())},
    {TindicesAttrName(),
::mlir::TypeAttr::get(Tindices())}});
}

void XlaConvOp::dimension_numbersAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(dimension_numbersAttrName(), attr);
}

void XlaConvOp::precision_configAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(precision_configAttrName(), attr);
}

void XlaConvOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::Value window_strides, ::mlir::Value padding, ::mlir::Value lhs_dilation, ::mlir::Value rhs_dilation, ::mlir::Value feature_group_count, ::mlir::StringAttr dimension_numbers, ::mlir::StringAttr precision_config) {
  odsState.addOperands(lhs);
  odsState.addOperands(rhs);
  odsState.addOperands(window_strides);
  odsState.addOperands(padding);
  odsState.addOperands(lhs_dilation);
  odsState.addOperands(rhs_dilation);
  odsState.addOperands(feature_group_count);
  odsState.addAttribute(dimension_numbersAttrName(odsState.name), dimension_numbers);
  odsState.addAttribute(precision_configAttrName(odsState.name), precision_config);
  odsState.addTypes(output);
}

void XlaConvOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::Value window_strides, ::mlir::Value padding, ::mlir::Value lhs_dilation, ::mlir::Value rhs_dilation, ::mlir::Value feature_group_count, ::mlir::StringAttr dimension_numbers, ::mlir::StringAttr precision_config) {
  odsState.addOperands(lhs);
  odsState.addOperands(rhs);
  odsState.addOperands(window_strides);
  odsState.addOperands(padding);
  odsState.addOperands(lhs_dilation);
  odsState.addOperands(rhs_dilation);
  odsState.addOperands(feature_group_count);
  odsState.addAttribute(dimension_numbersAttrName(odsState.name), dimension_numbers);
  odsState.addAttribute(precision_configAttrName(odsState.name), precision_config);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void XlaConvOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::Value window_strides, ::mlir::Value padding, ::mlir::Value lhs_dilation, ::mlir::Value rhs_dilation, ::mlir::Value feature_group_count, ::llvm::StringRef dimension_numbers, ::llvm::StringRef precision_config) {
  odsState.addOperands(lhs);
  odsState.addOperands(rhs);
  odsState.addOperands(window_strides);
  odsState.addOperands(padding);
  odsState.addOperands(lhs_dilation);
  odsState.addOperands(rhs_dilation);
  odsState.addOperands(feature_group_count);
  odsState.addAttribute(dimension_numbersAttrName(odsState.name), odsBuilder.getStringAttr(dimension_numbers));
  odsState.addAttribute(precision_configAttrName(odsState.name), odsBuilder.getStringAttr(precision_config));
  odsState.addTypes(output);
}

void XlaConvOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::Value window_strides, ::mlir::Value padding, ::mlir::Value lhs_dilation, ::mlir::Value rhs_dilation, ::mlir::Value feature_group_count, ::llvm::StringRef dimension_numbers, ::llvm::StringRef precision_config) {
  odsState.addOperands(lhs);
  odsState.addOperands(rhs);
  odsState.addOperands(window_strides);
  odsState.addOperands(padding);
  odsState.addOperands(lhs_dilation);
  odsState.addOperands(rhs_dilation);
  odsState.addOperands(feature_group_count);
  odsState.addAttribute(dimension_numbersAttrName(odsState.name), odsBuilder.getStringAttr(dimension_numbers));
  odsState.addAttribute(precision_configAttrName(odsState.name), odsBuilder.getStringAttr(precision_config));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void XlaConvOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 7u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult XlaConvOp::verify() {
  {
    auto tblgen_dimension_numbers = (*this)->getAttr(dimension_numbersAttrName());
    if (!tblgen_dimension_numbers)
      return emitOpError("requires attribute 'dimension_numbers'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_dimension_numbers, "dimension_numbers")))
      return ::mlir::failure();
  }
  {
    auto tblgen_precision_config = (*this)->getAttr(precision_configAttrName());
    if (!tblgen_precision_config)
      return emitOpError("requires attribute 'precision_config'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_precision_config, "precision_config")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup3 = getODSOperands(3);

    for (auto v : valueGroup3) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup4 = getODSOperands(4);

    for (auto v : valueGroup4) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup5 = getODSOperands(5);

    for (auto v : valueGroup5) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup6 = getODSOperands(6);

    for (auto v : valueGroup6) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void XlaConvOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::XlaConvOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::XlaConvV2Op definitions
//===----------------------------------------------------------------------===//

XlaConvV2OpAdaptor::XlaConvV2OpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

XlaConvV2OpAdaptor::XlaConvV2OpAdaptor(XlaConvV2Op &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange XlaConvV2OpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> XlaConvV2OpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange XlaConvV2OpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value XlaConvV2OpAdaptor::lhs() {
  return *getODSOperands(0).begin();
}

::mlir::Value XlaConvV2OpAdaptor::rhs() {
  return *getODSOperands(1).begin();
}

::mlir::Value XlaConvV2OpAdaptor::window_strides() {
  return *getODSOperands(2).begin();
}

::mlir::Value XlaConvV2OpAdaptor::padding() {
  return *getODSOperands(3).begin();
}

::mlir::Value XlaConvV2OpAdaptor::lhs_dilation() {
  return *getODSOperands(4).begin();
}

::mlir::Value XlaConvV2OpAdaptor::rhs_dilation() {
  return *getODSOperands(5).begin();
}

::mlir::Value XlaConvV2OpAdaptor::feature_group_count() {
  return *getODSOperands(6).begin();
}

::mlir::DictionaryAttr XlaConvV2OpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::StringAttr XlaConvV2OpAdaptor::dimension_numbers() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("dimension_numbers").cast<::mlir::StringAttr>();
  return attr;
}

::mlir::StringAttr XlaConvV2OpAdaptor::precision_config() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("precision_config").cast<::mlir::StringAttr>();
  return attr;
}

::mlir::IntegerAttr XlaConvV2OpAdaptor::batch_group_count() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("batch_group_count").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), 1);
  return attr;
}

::mlir::LogicalResult XlaConvV2OpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_dimension_numbers = odsAttrs.get("dimension_numbers");
    if (!tblgen_dimension_numbers)
      return emitError(loc, "'tf.XlaConvV2' op ""requires attribute 'dimension_numbers'");

    if (tblgen_dimension_numbers && !((tblgen_dimension_numbers.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.XlaConvV2' op ""attribute 'dimension_numbers' failed to satisfy constraint: string attribute");
  }
  {
    auto tblgen_precision_config = odsAttrs.get("precision_config");
    if (!tblgen_precision_config)
      return emitError(loc, "'tf.XlaConvV2' op ""requires attribute 'precision_config'");

    if (tblgen_precision_config && !((tblgen_precision_config.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.XlaConvV2' op ""attribute 'precision_config' failed to satisfy constraint: string attribute");
  }
  {
    auto tblgen_batch_group_count = odsAttrs.get("batch_group_count");
    if (tblgen_batch_group_count && !(((tblgen_batch_group_count.isa<::mlir::IntegerAttr>())) && ((tblgen_batch_group_count.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.XlaConvV2' op ""attribute 'batch_group_count' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> XlaConvV2Op::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range XlaConvV2Op::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value XlaConvV2Op::lhs() {
  return *getODSOperands(0).begin();
}

::mlir::Value XlaConvV2Op::rhs() {
  return *getODSOperands(1).begin();
}

::mlir::Value XlaConvV2Op::window_strides() {
  return *getODSOperands(2).begin();
}

::mlir::Value XlaConvV2Op::padding() {
  return *getODSOperands(3).begin();
}

::mlir::Value XlaConvV2Op::lhs_dilation() {
  return *getODSOperands(4).begin();
}

::mlir::Value XlaConvV2Op::rhs_dilation() {
  return *getODSOperands(5).begin();
}

::mlir::Value XlaConvV2Op::feature_group_count() {
  return *getODSOperands(6).begin();
}

::mlir::MutableOperandRange XlaConvV2Op::lhsMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange XlaConvV2Op::rhsMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange XlaConvV2Op::window_stridesMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange XlaConvV2Op::paddingMutable() {
  auto range = getODSOperandIndexAndLength(3);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange XlaConvV2Op::lhs_dilationMutable() {
  auto range = getODSOperandIndexAndLength(4);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange XlaConvV2Op::rhs_dilationMutable() {
  auto range = getODSOperandIndexAndLength(5);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange XlaConvV2Op::feature_group_countMutable() {
  auto range = getODSOperandIndexAndLength(6);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> XlaConvV2Op::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range XlaConvV2Op::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value XlaConvV2Op::output() {
  return *getODSResults(0).begin();
}

::mlir::StringAttr XlaConvV2Op::dimension_numbersAttr() {
  return (*this)->getAttr(dimension_numbersAttrName()).cast<::mlir::StringAttr>();
}

::llvm::StringRef XlaConvV2Op::dimension_numbers() {
  auto attr = dimension_numbersAttr();
  return attr.getValue();
}

::mlir::StringAttr XlaConvV2Op::precision_configAttr() {
  return (*this)->getAttr(precision_configAttrName()).cast<::mlir::StringAttr>();
}

::llvm::StringRef XlaConvV2Op::precision_config() {
  auto attr = precision_configAttr();
  return attr.getValue();
}

::mlir::IntegerAttr XlaConvV2Op::batch_group_countAttr() {
  return (*this)->getAttr(batch_group_countAttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t XlaConvV2Op::batch_group_count() {
  auto attr = batch_group_countAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), 1).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

::mlir::Type XlaConvV2Op::LhsT() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

::mlir::Type XlaConvV2Op::RhsT() {
  return mlir::getElementTypeOrSelf(*getODSOperands(1).begin());
}

::mlir::Type XlaConvV2Op::Tindices() {
  return mlir::getElementTypeOrSelf(*getODSOperands(2).begin());
}

::mlir::Type XlaConvV2Op::preferred_element_type() {
  return mlir::getElementTypeOrSelf(*getODSResults(0).begin());
}

bool XlaConvV2Op::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "LhsT") return true;
  if (name == "RhsT") return true;
  if (name == "Tindices") return true;
  if (name == "preferred_element_type") return true;
 return false;
}

::mlir::DictionaryAttr XlaConvV2Op::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {LhsTAttrName(),
::mlir::TypeAttr::get(LhsT())},
    {RhsTAttrName(),
::mlir::TypeAttr::get(RhsT())},
    {TindicesAttrName(),
::mlir::TypeAttr::get(Tindices())},
    {preferred_element_typeAttrName(),
::mlir::TypeAttr::get(preferred_element_type())}});
}

void XlaConvV2Op::dimension_numbersAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(dimension_numbersAttrName(), attr);
}

void XlaConvV2Op::precision_configAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(precision_configAttrName(), attr);
}

void XlaConvV2Op::batch_group_countAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(batch_group_countAttrName(), attr);
}

void XlaConvV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::Value window_strides, ::mlir::Value padding, ::mlir::Value lhs_dilation, ::mlir::Value rhs_dilation, ::mlir::Value feature_group_count, ::mlir::StringAttr dimension_numbers, ::mlir::StringAttr precision_config, ::mlir::IntegerAttr batch_group_count) {
  odsState.addOperands(lhs);
  odsState.addOperands(rhs);
  odsState.addOperands(window_strides);
  odsState.addOperands(padding);
  odsState.addOperands(lhs_dilation);
  odsState.addOperands(rhs_dilation);
  odsState.addOperands(feature_group_count);
  odsState.addAttribute(dimension_numbersAttrName(odsState.name), dimension_numbers);
  odsState.addAttribute(precision_configAttrName(odsState.name), precision_config);
  odsState.addAttribute(batch_group_countAttrName(odsState.name), batch_group_count);
  odsState.addTypes(output);
}

void XlaConvV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::Value window_strides, ::mlir::Value padding, ::mlir::Value lhs_dilation, ::mlir::Value rhs_dilation, ::mlir::Value feature_group_count, ::mlir::StringAttr dimension_numbers, ::mlir::StringAttr precision_config, ::mlir::IntegerAttr batch_group_count) {
  odsState.addOperands(lhs);
  odsState.addOperands(rhs);
  odsState.addOperands(window_strides);
  odsState.addOperands(padding);
  odsState.addOperands(lhs_dilation);
  odsState.addOperands(rhs_dilation);
  odsState.addOperands(feature_group_count);
  odsState.addAttribute(dimension_numbersAttrName(odsState.name), dimension_numbers);
  odsState.addAttribute(precision_configAttrName(odsState.name), precision_config);
  odsState.addAttribute(batch_group_countAttrName(odsState.name), batch_group_count);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void XlaConvV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::Value window_strides, ::mlir::Value padding, ::mlir::Value lhs_dilation, ::mlir::Value rhs_dilation, ::mlir::Value feature_group_count, ::llvm::StringRef dimension_numbers, ::llvm::StringRef precision_config, uint64_t batch_group_count) {
  odsState.addOperands(lhs);
  odsState.addOperands(rhs);
  odsState.addOperands(window_strides);
  odsState.addOperands(padding);
  odsState.addOperands(lhs_dilation);
  odsState.addOperands(rhs_dilation);
  odsState.addOperands(feature_group_count);
  odsState.addAttribute(dimension_numbersAttrName(odsState.name), odsBuilder.getStringAttr(dimension_numbers));
  odsState.addAttribute(precision_configAttrName(odsState.name), odsBuilder.getStringAttr(precision_config));
  odsState.addAttribute(batch_group_countAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), batch_group_count));
  odsState.addTypes(output);
}

void XlaConvV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::Value window_strides, ::mlir::Value padding, ::mlir::Value lhs_dilation, ::mlir::Value rhs_dilation, ::mlir::Value feature_group_count, ::llvm::StringRef dimension_numbers, ::llvm::StringRef precision_config, uint64_t batch_group_count) {
  odsState.addOperands(lhs);
  odsState.addOperands(rhs);
  odsState.addOperands(window_strides);
  odsState.addOperands(padding);
  odsState.addOperands(lhs_dilation);
  odsState.addOperands(rhs_dilation);
  odsState.addOperands(feature_group_count);
  odsState.addAttribute(dimension_numbersAttrName(odsState.name), odsBuilder.getStringAttr(dimension_numbers));
  odsState.addAttribute(precision_configAttrName(odsState.name), odsBuilder.getStringAttr(precision_config));
  odsState.addAttribute(batch_group_countAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), batch_group_count));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void XlaConvV2Op::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 7u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult XlaConvV2Op::verify() {
  {
    auto tblgen_dimension_numbers = (*this)->getAttr(dimension_numbersAttrName());
    if (!tblgen_dimension_numbers)
      return emitOpError("requires attribute 'dimension_numbers'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_dimension_numbers, "dimension_numbers")))
      return ::mlir::failure();
  }
  {
    auto tblgen_precision_config = (*this)->getAttr(precision_configAttrName());
    if (!tblgen_precision_config)
      return emitOpError("requires attribute 'precision_config'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_precision_config, "precision_config")))
      return ::mlir::failure();
  }
  {
    auto tblgen_batch_group_count = (*this)->getAttr(batch_group_countAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_batch_group_count, "batch_group_count")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup3 = getODSOperands(3);

    for (auto v : valueGroup3) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup4 = getODSOperands(4);

    for (auto v : valueGroup4) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup5 = getODSOperands(5);

    for (auto v : valueGroup5) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup6 = getODSOperands(6);

    for (auto v : valueGroup6) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void XlaConvV2Op::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::XlaConvV2Op)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::XlaDotOp definitions
//===----------------------------------------------------------------------===//

XlaDotOpAdaptor::XlaDotOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

XlaDotOpAdaptor::XlaDotOpAdaptor(XlaDotOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange XlaDotOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> XlaDotOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange XlaDotOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value XlaDotOpAdaptor::lhs() {
  return *getODSOperands(0).begin();
}

::mlir::Value XlaDotOpAdaptor::rhs() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr XlaDotOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::StringAttr XlaDotOpAdaptor::dimension_numbers() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("dimension_numbers").cast<::mlir::StringAttr>();
  return attr;
}

::mlir::StringAttr XlaDotOpAdaptor::precision_config() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("precision_config").cast<::mlir::StringAttr>();
  return attr;
}

::mlir::LogicalResult XlaDotOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_dimension_numbers = odsAttrs.get("dimension_numbers");
    if (!tblgen_dimension_numbers)
      return emitError(loc, "'tf.XlaDot' op ""requires attribute 'dimension_numbers'");

    if (tblgen_dimension_numbers && !((tblgen_dimension_numbers.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.XlaDot' op ""attribute 'dimension_numbers' failed to satisfy constraint: string attribute");
  }
  {
    auto tblgen_precision_config = odsAttrs.get("precision_config");
    if (!tblgen_precision_config)
      return emitError(loc, "'tf.XlaDot' op ""requires attribute 'precision_config'");

    if (tblgen_precision_config && !((tblgen_precision_config.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.XlaDot' op ""attribute 'precision_config' failed to satisfy constraint: string attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> XlaDotOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range XlaDotOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value XlaDotOp::lhs() {
  return *getODSOperands(0).begin();
}

::mlir::Value XlaDotOp::rhs() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange XlaDotOp::lhsMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange XlaDotOp::rhsMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> XlaDotOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range XlaDotOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value XlaDotOp::output() {
  return *getODSResults(0).begin();
}

::mlir::StringAttr XlaDotOp::dimension_numbersAttr() {
  return (*this)->getAttr(dimension_numbersAttrName()).cast<::mlir::StringAttr>();
}

::llvm::StringRef XlaDotOp::dimension_numbers() {
  auto attr = dimension_numbersAttr();
  return attr.getValue();
}

::mlir::StringAttr XlaDotOp::precision_configAttr() {
  return (*this)->getAttr(precision_configAttrName()).cast<::mlir::StringAttr>();
}

::llvm::StringRef XlaDotOp::precision_config() {
  auto attr = precision_configAttr();
  return attr.getValue();
}

::mlir::Type XlaDotOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool XlaDotOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr XlaDotOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void XlaDotOp::dimension_numbersAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(dimension_numbersAttrName(), attr);
}

void XlaDotOp::precision_configAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(precision_configAttrName(), attr);
}

void XlaDotOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::StringAttr dimension_numbers, ::mlir::StringAttr precision_config) {
  odsState.addOperands(lhs);
  odsState.addOperands(rhs);
  odsState.addAttribute(dimension_numbersAttrName(odsState.name), dimension_numbers);
  odsState.addAttribute(precision_configAttrName(odsState.name), precision_config);
  odsState.addTypes(output);
}

void XlaDotOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::StringAttr dimension_numbers, ::mlir::StringAttr precision_config) {
  odsState.addOperands(lhs);
  odsState.addOperands(rhs);
  odsState.addAttribute(dimension_numbersAttrName(odsState.name), dimension_numbers);
  odsState.addAttribute(precision_configAttrName(odsState.name), precision_config);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void XlaDotOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value lhs, ::mlir::Value rhs, ::llvm::StringRef dimension_numbers, ::llvm::StringRef precision_config) {
  odsState.addOperands(lhs);
  odsState.addOperands(rhs);
  odsState.addAttribute(dimension_numbersAttrName(odsState.name), odsBuilder.getStringAttr(dimension_numbers));
  odsState.addAttribute(precision_configAttrName(odsState.name), odsBuilder.getStringAttr(precision_config));
  odsState.addTypes(output);
}

void XlaDotOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::llvm::StringRef dimension_numbers, ::llvm::StringRef precision_config) {
  odsState.addOperands(lhs);
  odsState.addOperands(rhs);
  odsState.addAttribute(dimension_numbersAttrName(odsState.name), odsBuilder.getStringAttr(dimension_numbers));
  odsState.addAttribute(precision_configAttrName(odsState.name), odsBuilder.getStringAttr(precision_config));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void XlaDotOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult XlaDotOp::verify() {
  {
    auto tblgen_dimension_numbers = (*this)->getAttr(dimension_numbersAttrName());
    if (!tblgen_dimension_numbers)
      return emitOpError("requires attribute 'dimension_numbers'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_dimension_numbers, "dimension_numbers")))
      return ::mlir::failure();
  }
  {
    auto tblgen_precision_config = (*this)->getAttr(precision_configAttrName());
    if (!tblgen_precision_config)
      return emitOpError("requires attribute 'precision_config'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_precision_config, "precision_config")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void XlaDotOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::XlaDotOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::XlaDotV2Op definitions
//===----------------------------------------------------------------------===//

XlaDotV2OpAdaptor::XlaDotV2OpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

XlaDotV2OpAdaptor::XlaDotV2OpAdaptor(XlaDotV2Op &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange XlaDotV2OpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> XlaDotV2OpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange XlaDotV2OpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value XlaDotV2OpAdaptor::lhs() {
  return *getODSOperands(0).begin();
}

::mlir::Value XlaDotV2OpAdaptor::rhs() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr XlaDotV2OpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::StringAttr XlaDotV2OpAdaptor::dimension_numbers() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("dimension_numbers").cast<::mlir::StringAttr>();
  return attr;
}

::mlir::StringAttr XlaDotV2OpAdaptor::precision_config() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("precision_config").cast<::mlir::StringAttr>();
  return attr;
}

::mlir::LogicalResult XlaDotV2OpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_dimension_numbers = odsAttrs.get("dimension_numbers");
    if (!tblgen_dimension_numbers)
      return emitError(loc, "'tf.XlaDotV2' op ""requires attribute 'dimension_numbers'");

    if (tblgen_dimension_numbers && !((tblgen_dimension_numbers.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.XlaDotV2' op ""attribute 'dimension_numbers' failed to satisfy constraint: string attribute");
  }
  {
    auto tblgen_precision_config = odsAttrs.get("precision_config");
    if (!tblgen_precision_config)
      return emitError(loc, "'tf.XlaDotV2' op ""requires attribute 'precision_config'");

    if (tblgen_precision_config && !((tblgen_precision_config.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.XlaDotV2' op ""attribute 'precision_config' failed to satisfy constraint: string attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> XlaDotV2Op::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range XlaDotV2Op::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value XlaDotV2Op::lhs() {
  return *getODSOperands(0).begin();
}

::mlir::Value XlaDotV2Op::rhs() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange XlaDotV2Op::lhsMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange XlaDotV2Op::rhsMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> XlaDotV2Op::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range XlaDotV2Op::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value XlaDotV2Op::output() {
  return *getODSResults(0).begin();
}

::mlir::StringAttr XlaDotV2Op::dimension_numbersAttr() {
  return (*this)->getAttr(dimension_numbersAttrName()).cast<::mlir::StringAttr>();
}

::llvm::StringRef XlaDotV2Op::dimension_numbers() {
  auto attr = dimension_numbersAttr();
  return attr.getValue();
}

::mlir::StringAttr XlaDotV2Op::precision_configAttr() {
  return (*this)->getAttr(precision_configAttrName()).cast<::mlir::StringAttr>();
}

::llvm::StringRef XlaDotV2Op::precision_config() {
  auto attr = precision_configAttr();
  return attr.getValue();
}

::mlir::Type XlaDotV2Op::LhsT() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

::mlir::Type XlaDotV2Op::RhsT() {
  return mlir::getElementTypeOrSelf(*getODSOperands(1).begin());
}

::mlir::Type XlaDotV2Op::preferred_element_type() {
  return mlir::getElementTypeOrSelf(*getODSResults(0).begin());
}

bool XlaDotV2Op::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "LhsT") return true;
  if (name == "RhsT") return true;
  if (name == "preferred_element_type") return true;
 return false;
}

::mlir::DictionaryAttr XlaDotV2Op::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {LhsTAttrName(),
::mlir::TypeAttr::get(LhsT())},
    {RhsTAttrName(),
::mlir::TypeAttr::get(RhsT())},
    {preferred_element_typeAttrName(),
::mlir::TypeAttr::get(preferred_element_type())}});
}

void XlaDotV2Op::dimension_numbersAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(dimension_numbersAttrName(), attr);
}

void XlaDotV2Op::precision_configAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(precision_configAttrName(), attr);
}

void XlaDotV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::StringAttr dimension_numbers, ::mlir::StringAttr precision_config) {
  odsState.addOperands(lhs);
  odsState.addOperands(rhs);
  odsState.addAttribute(dimension_numbersAttrName(odsState.name), dimension_numbers);
  odsState.addAttribute(precision_configAttrName(odsState.name), precision_config);
  odsState.addTypes(output);
}

void XlaDotV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::StringAttr dimension_numbers, ::mlir::StringAttr precision_config) {
  odsState.addOperands(lhs);
  odsState.addOperands(rhs);
  odsState.addAttribute(dimension_numbersAttrName(odsState.name), dimension_numbers);
  odsState.addAttribute(precision_configAttrName(odsState.name), precision_config);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void XlaDotV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value lhs, ::mlir::Value rhs, ::llvm::StringRef dimension_numbers, ::llvm::StringRef precision_config) {
  odsState.addOperands(lhs);
  odsState.addOperands(rhs);
  odsState.addAttribute(dimension_numbersAttrName(odsState.name), odsBuilder.getStringAttr(dimension_numbers));
  odsState.addAttribute(precision_configAttrName(odsState.name), odsBuilder.getStringAttr(precision_config));
  odsState.addTypes(output);
}

void XlaDotV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::llvm::StringRef dimension_numbers, ::llvm::StringRef precision_config) {
  odsState.addOperands(lhs);
  odsState.addOperands(rhs);
  odsState.addAttribute(dimension_numbersAttrName(odsState.name), odsBuilder.getStringAttr(dimension_numbers));
  odsState.addAttribute(precision_configAttrName(odsState.name), odsBuilder.getStringAttr(precision_config));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void XlaDotV2Op::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult XlaDotV2Op::verify() {
  {
    auto tblgen_dimension_numbers = (*this)->getAttr(dimension_numbersAttrName());
    if (!tblgen_dimension_numbers)
      return emitOpError("requires attribute 'dimension_numbers'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_dimension_numbers, "dimension_numbers")))
      return ::mlir::failure();
  }
  {
    auto tblgen_precision_config = (*this)->getAttr(precision_configAttrName());
    if (!tblgen_precision_config)
      return emitOpError("requires attribute 'precision_config'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_precision_config, "precision_config")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void XlaDotV2Op::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::XlaDotV2Op)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::XlaDynamicSliceOp definitions
//===----------------------------------------------------------------------===//

XlaDynamicSliceOpAdaptor::XlaDynamicSliceOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

XlaDynamicSliceOpAdaptor::XlaDynamicSliceOpAdaptor(XlaDynamicSliceOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange XlaDynamicSliceOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> XlaDynamicSliceOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange XlaDynamicSliceOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value XlaDynamicSliceOpAdaptor::input() {
  return *getODSOperands(0).begin();
}

::mlir::Value XlaDynamicSliceOpAdaptor::start_indices() {
  return *getODSOperands(1).begin();
}

::mlir::Value XlaDynamicSliceOpAdaptor::size_indices() {
  return *getODSOperands(2).begin();
}

::mlir::DictionaryAttr XlaDynamicSliceOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult XlaDynamicSliceOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> XlaDynamicSliceOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range XlaDynamicSliceOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value XlaDynamicSliceOp::input() {
  return *getODSOperands(0).begin();
}

::mlir::Value XlaDynamicSliceOp::start_indices() {
  return *getODSOperands(1).begin();
}

::mlir::Value XlaDynamicSliceOp::size_indices() {
  return *getODSOperands(2).begin();
}

::mlir::MutableOperandRange XlaDynamicSliceOp::inputMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange XlaDynamicSliceOp::start_indicesMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange XlaDynamicSliceOp::size_indicesMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> XlaDynamicSliceOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range XlaDynamicSliceOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value XlaDynamicSliceOp::output() {
  return *getODSResults(0).begin();
}

::mlir::Type XlaDynamicSliceOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

::mlir::Type XlaDynamicSliceOp::Tindices() {
  return mlir::getElementTypeOrSelf(*getODSOperands(1).begin());
}

bool XlaDynamicSliceOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
  if (name == "Tindices") return true;
 return false;
}

::mlir::DictionaryAttr XlaDynamicSliceOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())},
    {TindicesAttrName(),
::mlir::TypeAttr::get(Tindices())}});
}

void XlaDynamicSliceOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input, ::mlir::Value start_indices, ::mlir::Value size_indices) {
  odsState.addOperands(input);
  odsState.addOperands(start_indices);
  odsState.addOperands(size_indices);
  odsState.addTypes(output);
}

void XlaDynamicSliceOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::Value start_indices, ::mlir::Value size_indices) {
  odsState.addOperands(input);
  odsState.addOperands(start_indices);
  odsState.addOperands(size_indices);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void XlaDynamicSliceOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 3u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult XlaDynamicSliceOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void XlaDynamicSliceOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::XlaDynamicSliceOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::XlaDynamicUpdateSliceOp definitions
//===----------------------------------------------------------------------===//

XlaDynamicUpdateSliceOpAdaptor::XlaDynamicUpdateSliceOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

XlaDynamicUpdateSliceOpAdaptor::XlaDynamicUpdateSliceOpAdaptor(XlaDynamicUpdateSliceOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange XlaDynamicUpdateSliceOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> XlaDynamicUpdateSliceOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange XlaDynamicUpdateSliceOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value XlaDynamicUpdateSliceOpAdaptor::input() {
  return *getODSOperands(0).begin();
}

::mlir::Value XlaDynamicUpdateSliceOpAdaptor::update() {
  return *getODSOperands(1).begin();
}

::mlir::Value XlaDynamicUpdateSliceOpAdaptor::indices() {
  return *getODSOperands(2).begin();
}

::mlir::DictionaryAttr XlaDynamicUpdateSliceOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult XlaDynamicUpdateSliceOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> XlaDynamicUpdateSliceOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range XlaDynamicUpdateSliceOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value XlaDynamicUpdateSliceOp::input() {
  return *getODSOperands(0).begin();
}

::mlir::Value XlaDynamicUpdateSliceOp::update() {
  return *getODSOperands(1).begin();
}

::mlir::Value XlaDynamicUpdateSliceOp::indices() {
  return *getODSOperands(2).begin();
}

::mlir::MutableOperandRange XlaDynamicUpdateSliceOp::inputMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange XlaDynamicUpdateSliceOp::updateMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange XlaDynamicUpdateSliceOp::indicesMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> XlaDynamicUpdateSliceOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range XlaDynamicUpdateSliceOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value XlaDynamicUpdateSliceOp::output() {
  return *getODSResults(0).begin();
}

::mlir::Type XlaDynamicUpdateSliceOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

::mlir::Type XlaDynamicUpdateSliceOp::Tindices() {
  return mlir::getElementTypeOrSelf(*getODSOperands(2).begin());
}

bool XlaDynamicUpdateSliceOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
  if (name == "Tindices") return true;
 return false;
}

::mlir::DictionaryAttr XlaDynamicUpdateSliceOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())},
    {TindicesAttrName(),
::mlir::TypeAttr::get(Tindices())}});
}

void XlaDynamicUpdateSliceOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input, ::mlir::Value update, ::mlir::Value indices) {
  odsState.addOperands(input);
  odsState.addOperands(update);
  odsState.addOperands(indices);
  odsState.addTypes(output);
}

void XlaDynamicUpdateSliceOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::Value update, ::mlir::Value indices) {
  odsState.addOperands(input);
  odsState.addOperands(update);
  odsState.addOperands(indices);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void XlaDynamicUpdateSliceOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 3u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult XlaDynamicUpdateSliceOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void XlaDynamicUpdateSliceOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::XlaDynamicUpdateSliceOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::XlaEinsumOp definitions
//===----------------------------------------------------------------------===//

XlaEinsumOpAdaptor::XlaEinsumOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

XlaEinsumOpAdaptor::XlaEinsumOpAdaptor(XlaEinsumOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange XlaEinsumOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> XlaEinsumOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange XlaEinsumOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value XlaEinsumOpAdaptor::a() {
  return *getODSOperands(0).begin();
}

::mlir::Value XlaEinsumOpAdaptor::b() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr XlaEinsumOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::StringAttr XlaEinsumOpAdaptor::equation() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("equation").cast<::mlir::StringAttr>();
  return attr;
}

::mlir::LogicalResult XlaEinsumOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_equation = odsAttrs.get("equation");
    if (!tblgen_equation)
      return emitError(loc, "'tf.XlaEinsum' op ""requires attribute 'equation'");

    if (tblgen_equation && !((tblgen_equation.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.XlaEinsum' op ""attribute 'equation' failed to satisfy constraint: string attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> XlaEinsumOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range XlaEinsumOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value XlaEinsumOp::a() {
  return *getODSOperands(0).begin();
}

::mlir::Value XlaEinsumOp::b() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange XlaEinsumOp::aMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange XlaEinsumOp::bMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> XlaEinsumOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range XlaEinsumOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value XlaEinsumOp::product() {
  return *getODSResults(0).begin();
}

::mlir::StringAttr XlaEinsumOp::equationAttr() {
  return (*this)->getAttr(equationAttrName()).cast<::mlir::StringAttr>();
}

::llvm::StringRef XlaEinsumOp::equation() {
  auto attr = equationAttr();
  return attr.getValue();
}

::mlir::Type XlaEinsumOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool XlaEinsumOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr XlaEinsumOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void XlaEinsumOp::equationAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(equationAttrName(), attr);
}

void XlaEinsumOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type product, ::mlir::Value a, ::mlir::Value b, ::mlir::StringAttr equation) {
  odsState.addOperands(a);
  odsState.addOperands(b);
  odsState.addAttribute(equationAttrName(odsState.name), equation);
  odsState.addTypes(product);
}

void XlaEinsumOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value a, ::mlir::Value b, ::mlir::StringAttr equation) {
  odsState.addOperands(a);
  odsState.addOperands(b);
  odsState.addAttribute(equationAttrName(odsState.name), equation);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void XlaEinsumOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type product, ::mlir::Value a, ::mlir::Value b, ::llvm::StringRef equation) {
  odsState.addOperands(a);
  odsState.addOperands(b);
  odsState.addAttribute(equationAttrName(odsState.name), odsBuilder.getStringAttr(equation));
  odsState.addTypes(product);
}

void XlaEinsumOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value a, ::mlir::Value b, ::llvm::StringRef equation) {
  odsState.addOperands(a);
  odsState.addOperands(b);
  odsState.addAttribute(equationAttrName(odsState.name), odsBuilder.getStringAttr(equation));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void XlaEinsumOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult XlaEinsumOp::verify() {
  {
    auto tblgen_equation = (*this)->getAttr(equationAttrName());
    if (!tblgen_equation)
      return emitOpError("requires attribute 'equation'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_equation, "equation")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops65(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops65(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops65(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void XlaEinsumOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::XlaEinsumOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::XlaGatherOp definitions
//===----------------------------------------------------------------------===//

XlaGatherOpAdaptor::XlaGatherOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

XlaGatherOpAdaptor::XlaGatherOpAdaptor(XlaGatherOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange XlaGatherOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> XlaGatherOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange XlaGatherOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value XlaGatherOpAdaptor::operand() {
  return *getODSOperands(0).begin();
}

::mlir::Value XlaGatherOpAdaptor::start_indices() {
  return *getODSOperands(1).begin();
}

::mlir::Value XlaGatherOpAdaptor::slice_sizes() {
  return *getODSOperands(2).begin();
}

::mlir::DictionaryAttr XlaGatherOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::StringAttr XlaGatherOpAdaptor::dimension_numbers() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("dimension_numbers").cast<::mlir::StringAttr>();
  return attr;
}

::mlir::BoolAttr XlaGatherOpAdaptor::indices_are_sorted() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("indices_are_sorted").cast<::mlir::BoolAttr>();
  return attr;
}

::mlir::LogicalResult XlaGatherOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_dimension_numbers = odsAttrs.get("dimension_numbers");
    if (!tblgen_dimension_numbers)
      return emitError(loc, "'tf.XlaGather' op ""requires attribute 'dimension_numbers'");

    if (tblgen_dimension_numbers && !((tblgen_dimension_numbers.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.XlaGather' op ""attribute 'dimension_numbers' failed to satisfy constraint: string attribute");
  }
  {
    auto tblgen_indices_are_sorted = odsAttrs.get("indices_are_sorted");
    if (!tblgen_indices_are_sorted)
      return emitError(loc, "'tf.XlaGather' op ""requires attribute 'indices_are_sorted'");

    if (tblgen_indices_are_sorted && !((tblgen_indices_are_sorted.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.XlaGather' op ""attribute 'indices_are_sorted' failed to satisfy constraint: bool attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> XlaGatherOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range XlaGatherOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value XlaGatherOp::operand() {
  return *getODSOperands(0).begin();
}

::mlir::Value XlaGatherOp::start_indices() {
  return *getODSOperands(1).begin();
}

::mlir::Value XlaGatherOp::slice_sizes() {
  return *getODSOperands(2).begin();
}

::mlir::MutableOperandRange XlaGatherOp::operandMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange XlaGatherOp::start_indicesMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange XlaGatherOp::slice_sizesMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> XlaGatherOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range XlaGatherOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value XlaGatherOp::output() {
  return *getODSResults(0).begin();
}

::mlir::StringAttr XlaGatherOp::dimension_numbersAttr() {
  return (*this)->getAttr(dimension_numbersAttrName()).cast<::mlir::StringAttr>();
}

::llvm::StringRef XlaGatherOp::dimension_numbers() {
  auto attr = dimension_numbersAttr();
  return attr.getValue();
}

::mlir::BoolAttr XlaGatherOp::indices_are_sortedAttr() {
  return (*this)->getAttr(indices_are_sortedAttrName()).cast<::mlir::BoolAttr>();
}

bool XlaGatherOp::indices_are_sorted() {
  auto attr = indices_are_sortedAttr();
  return attr.getValue();
}

::mlir::Type XlaGatherOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

::mlir::Type XlaGatherOp::Tindices() {
  return mlir::getElementTypeOrSelf(*getODSOperands(1).begin());
}

bool XlaGatherOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
  if (name == "Tindices") return true;
 return false;
}

::mlir::DictionaryAttr XlaGatherOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())},
    {TindicesAttrName(),
::mlir::TypeAttr::get(Tindices())}});
}

void XlaGatherOp::dimension_numbersAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(dimension_numbersAttrName(), attr);
}

void XlaGatherOp::indices_are_sortedAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(indices_are_sortedAttrName(), attr);
}

void XlaGatherOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value operand, ::mlir::Value start_indices, ::mlir::Value slice_sizes, ::mlir::StringAttr dimension_numbers, ::mlir::BoolAttr indices_are_sorted) {
  odsState.addOperands(operand);
  odsState.addOperands(start_indices);
  odsState.addOperands(slice_sizes);
  odsState.addAttribute(dimension_numbersAttrName(odsState.name), dimension_numbers);
  odsState.addAttribute(indices_are_sortedAttrName(odsState.name), indices_are_sorted);
  odsState.addTypes(output);
}

void XlaGatherOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value operand, ::mlir::Value start_indices, ::mlir::Value slice_sizes, ::mlir::StringAttr dimension_numbers, ::mlir::BoolAttr indices_are_sorted) {
  odsState.addOperands(operand);
  odsState.addOperands(start_indices);
  odsState.addOperands(slice_sizes);
  odsState.addAttribute(dimension_numbersAttrName(odsState.name), dimension_numbers);
  odsState.addAttribute(indices_are_sortedAttrName(odsState.name), indices_are_sorted);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void XlaGatherOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value operand, ::mlir::Value start_indices, ::mlir::Value slice_sizes, ::llvm::StringRef dimension_numbers, bool indices_are_sorted) {
  odsState.addOperands(operand);
  odsState.addOperands(start_indices);
  odsState.addOperands(slice_sizes);
  odsState.addAttribute(dimension_numbersAttrName(odsState.name), odsBuilder.getStringAttr(dimension_numbers));
  odsState.addAttribute(indices_are_sortedAttrName(odsState.name), odsBuilder.getBoolAttr(indices_are_sorted));
  odsState.addTypes(output);
}

void XlaGatherOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value operand, ::mlir::Value start_indices, ::mlir::Value slice_sizes, ::llvm::StringRef dimension_numbers, bool indices_are_sorted) {
  odsState.addOperands(operand);
  odsState.addOperands(start_indices);
  odsState.addOperands(slice_sizes);
  odsState.addAttribute(dimension_numbersAttrName(odsState.name), odsBuilder.getStringAttr(dimension_numbers));
  odsState.addAttribute(indices_are_sortedAttrName(odsState.name), odsBuilder.getBoolAttr(indices_are_sorted));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void XlaGatherOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 3u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult XlaGatherOp::verify() {
  {
    auto tblgen_dimension_numbers = (*this)->getAttr(dimension_numbersAttrName());
    if (!tblgen_dimension_numbers)
      return emitOpError("requires attribute 'dimension_numbers'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_dimension_numbers, "dimension_numbers")))
      return ::mlir::failure();
  }
  {
    auto tblgen_indices_are_sorted = (*this)->getAttr(indices_are_sortedAttrName());
    if (!tblgen_indices_are_sorted)
      return emitOpError("requires attribute 'indices_are_sorted'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_indices_are_sorted, "indices_are_sorted")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops10(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops10(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void XlaGatherOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::XlaGatherOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::XlaHostComputeOp definitions
//===----------------------------------------------------------------------===//

XlaHostComputeOpAdaptor::XlaHostComputeOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

XlaHostComputeOpAdaptor::XlaHostComputeOpAdaptor(XlaHostComputeOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange XlaHostComputeOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> XlaHostComputeOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  bool isVariadic[] = {true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (odsOperands.size() - 0) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::ValueRange XlaHostComputeOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::ValueRange XlaHostComputeOpAdaptor::inputs() {
  return getODSOperands(0);
}

::mlir::DictionaryAttr XlaHostComputeOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::ArrayAttr XlaHostComputeOpAdaptor::ancestors() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("ancestors").cast<::mlir::ArrayAttr>();
  return attr;
}

::mlir::ArrayAttr XlaHostComputeOpAdaptor::shapes() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("shapes").cast<::mlir::ArrayAttr>();
  return attr;
}

::mlir::SymbolRefAttr XlaHostComputeOpAdaptor::shape_inference_graph() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::SymbolRefAttr attr = odsAttrs.get("shape_inference_graph").dyn_cast_or_null<::mlir::SymbolRefAttr>();
  return attr;
}

::mlir::StringAttr XlaHostComputeOpAdaptor::key() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("key").cast<::mlir::StringAttr>();
  return attr;
}

::mlir::StringAttr XlaHostComputeOpAdaptor::send_key() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("send_key").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("");
  return attr;
}

::mlir::StringAttr XlaHostComputeOpAdaptor::recv_key() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("recv_key").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("");
  return attr;
}

::mlir::IntegerAttr XlaHostComputeOpAdaptor::cost_estimate_ns() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("cost_estimate_ns").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), 1000000);
  return attr;
}

::mlir::IntegerAttr XlaHostComputeOpAdaptor::tpu_core() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("tpu_core").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), 0);
  return attr;
}

::mlir::LogicalResult XlaHostComputeOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_ancestors = odsAttrs.get("ancestors");
    if (!tblgen_ancestors)
      return emitError(loc, "'tf.XlaHostCompute' op ""requires attribute 'ancestors'");

    if (tblgen_ancestors && !(((tblgen_ancestors.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_ancestors.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return (attr.isa<::mlir::StringAttr>()); }))))
      return emitError(loc, "'tf.XlaHostCompute' op ""attribute 'ancestors' failed to satisfy constraint: string array attribute");
  }
  {
    auto tblgen_shapes = odsAttrs.get("shapes");
    if (!tblgen_shapes)
      return emitError(loc, "'tf.XlaHostCompute' op ""requires attribute 'shapes'");

    if (tblgen_shapes && !(((tblgen_shapes.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_shapes.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return (attr.isa<mlir::TF::ShapeAttr>()); }))))
      return emitError(loc, "'tf.XlaHostCompute' op ""attribute 'shapes' failed to satisfy constraint: tensorflow shape attribute array");
  }
  {
    auto tblgen_shape_inference_graph = odsAttrs.get("shape_inference_graph");
    if (tblgen_shape_inference_graph && !((tblgen_shape_inference_graph.isa<::mlir::SymbolRefAttr>())))
      return emitError(loc, "'tf.XlaHostCompute' op ""attribute 'shape_inference_graph' failed to satisfy constraint: symbol reference attribute");
  }
  {
    auto tblgen_key = odsAttrs.get("key");
    if (!tblgen_key)
      return emitError(loc, "'tf.XlaHostCompute' op ""requires attribute 'key'");

    if (tblgen_key && !((tblgen_key.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.XlaHostCompute' op ""attribute 'key' failed to satisfy constraint: string attribute");
  }
  {
    auto tblgen_send_key = odsAttrs.get("send_key");
    if (tblgen_send_key && !((tblgen_send_key.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.XlaHostCompute' op ""attribute 'send_key' failed to satisfy constraint: string attribute");
  }
  {
    auto tblgen_recv_key = odsAttrs.get("recv_key");
    if (tblgen_recv_key && !((tblgen_recv_key.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.XlaHostCompute' op ""attribute 'recv_key' failed to satisfy constraint: string attribute");
  }
  {
    auto tblgen_cost_estimate_ns = odsAttrs.get("cost_estimate_ns");
    if (tblgen_cost_estimate_ns && !(((tblgen_cost_estimate_ns.isa<::mlir::IntegerAttr>())) && ((tblgen_cost_estimate_ns.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.XlaHostCompute' op ""attribute 'cost_estimate_ns' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_tpu_core = odsAttrs.get("tpu_core");
    if (tblgen_tpu_core && !(((tblgen_tpu_core.isa<::mlir::IntegerAttr>())) && ((tblgen_tpu_core.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.XlaHostCompute' op ""attribute 'tpu_core' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> XlaHostComputeOp::getODSOperandIndexAndLength(unsigned index) {
  bool isVariadic[] = {true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (getOperation()->getNumOperands() - 0) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::Operation::operand_range XlaHostComputeOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Operation::operand_range XlaHostComputeOp::inputs() {
  return getODSOperands(0);
}

::mlir::MutableOperandRange XlaHostComputeOp::inputsMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> XlaHostComputeOp::getODSResultIndexAndLength(unsigned index) {
  bool isVariadic[] = {true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (getOperation()->getNumResults() - 0) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::Operation::result_range XlaHostComputeOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Operation::result_range XlaHostComputeOp::outputs() {
  return getODSResults(0);
}

::mlir::ArrayAttr XlaHostComputeOp::ancestorsAttr() {
  return (*this)->getAttr(ancestorsAttrName()).cast<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr XlaHostComputeOp::ancestors() {
  auto attr = ancestorsAttr();
  return attr;
}

::mlir::ArrayAttr XlaHostComputeOp::shapesAttr() {
  return (*this)->getAttr(shapesAttrName()).cast<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr XlaHostComputeOp::shapes() {
  auto attr = shapesAttr();
  return attr;
}

::mlir::SymbolRefAttr XlaHostComputeOp::shape_inference_graphAttr() {
  return (*this)->getAttr(shape_inference_graphAttrName()).dyn_cast_or_null<::mlir::SymbolRefAttr>();
}

::llvm::Optional< ::mlir::SymbolRefAttr > XlaHostComputeOp::shape_inference_graph() {
  auto attr = shape_inference_graphAttr();
  return attr ? ::llvm::Optional< ::mlir::SymbolRefAttr >(attr) : (::llvm::None);
}

::mlir::StringAttr XlaHostComputeOp::keyAttr() {
  return (*this)->getAttr(keyAttrName()).cast<::mlir::StringAttr>();
}

::llvm::StringRef XlaHostComputeOp::key() {
  auto attr = keyAttr();
  return attr.getValue();
}

::mlir::StringAttr XlaHostComputeOp::send_keyAttr() {
  return (*this)->getAttr(send_keyAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef XlaHostComputeOp::send_key() {
  auto attr = send_keyAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("").getValue();
  return attr.getValue();
}

::mlir::StringAttr XlaHostComputeOp::recv_keyAttr() {
  return (*this)->getAttr(recv_keyAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef XlaHostComputeOp::recv_key() {
  auto attr = recv_keyAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("").getValue();
  return attr.getValue();
}

::mlir::IntegerAttr XlaHostComputeOp::cost_estimate_nsAttr() {
  return (*this)->getAttr(cost_estimate_nsAttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t XlaHostComputeOp::cost_estimate_ns() {
  auto attr = cost_estimate_nsAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), 1000000).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

::mlir::IntegerAttr XlaHostComputeOp::tpu_coreAttr() {
  return (*this)->getAttr(tpu_coreAttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t XlaHostComputeOp::tpu_core() {
  auto attr = tpu_coreAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), 0).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

mlir::OperandElementTypeRange XlaHostComputeOp::Tinputs() {
  auto values = getODSOperands(0);
return {mlir::OperandElementTypeIterator(values.begin()), mlir::OperandElementTypeIterator(values.end())};
}

mlir::ResultElementTypeRange XlaHostComputeOp::Toutputs() {
  auto values = getODSResults(0);
return {mlir::ResultElementTypeIterator(values.begin()), mlir::ResultElementTypeIterator(values.end())};
}

bool XlaHostComputeOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "Tinputs") return true;
  if (name == "Toutputs") return true;
 return false;
}

::mlir::DictionaryAttr XlaHostComputeOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TinputsAttrName(),
ArrayAttr::get(ctx, 
    [&]() {
      llvm::SmallVector<Attribute, 4> ret;
      for (auto t : Tinputs())
        ret.push_back(TypeAttr::get(t));
      return ret;
    }())},
    {ToutputsAttrName(),
ArrayAttr::get(ctx, 
    [&]() {
      llvm::SmallVector<Attribute, 4> ret;
      for (auto t : Toutputs())
        ret.push_back(TypeAttr::get(t));
      return ret;
    }())}});
}

void XlaHostComputeOp::ancestorsAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(ancestorsAttrName(), attr);
}

void XlaHostComputeOp::shapesAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(shapesAttrName(), attr);
}

void XlaHostComputeOp::shape_inference_graphAttr(::mlir::SymbolRefAttr attr) {
  (*this)->setAttr(shape_inference_graphAttrName(), attr);
}

void XlaHostComputeOp::keyAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(keyAttrName(), attr);
}

void XlaHostComputeOp::send_keyAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(send_keyAttrName(), attr);
}

void XlaHostComputeOp::recv_keyAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(recv_keyAttrName(), attr);
}

void XlaHostComputeOp::cost_estimate_nsAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(cost_estimate_nsAttrName(), attr);
}

void XlaHostComputeOp::tpu_coreAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(tpu_coreAttrName(), attr);
}

::mlir::Attribute XlaHostComputeOp::removeShape_inference_graphAttr() {
  return (*this)->removeAttr(shape_inference_graphAttrName());
}

void XlaHostComputeOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange outputs, ::mlir::ValueRange inputs, ::mlir::ArrayAttr ancestors, ::mlir::ArrayAttr shapes, /*optional*/::mlir::SymbolRefAttr shape_inference_graph, ::mlir::StringAttr key, ::mlir::StringAttr send_key, ::mlir::StringAttr recv_key, ::mlir::IntegerAttr cost_estimate_ns, ::mlir::IntegerAttr tpu_core) {
  odsState.addOperands(inputs);
  odsState.addAttribute(ancestorsAttrName(odsState.name), ancestors);
  odsState.addAttribute(shapesAttrName(odsState.name), shapes);
  if (shape_inference_graph) {
  odsState.addAttribute(shape_inference_graphAttrName(odsState.name), shape_inference_graph);
  }
  odsState.addAttribute(keyAttrName(odsState.name), key);
  odsState.addAttribute(send_keyAttrName(odsState.name), send_key);
  odsState.addAttribute(recv_keyAttrName(odsState.name), recv_key);
  odsState.addAttribute(cost_estimate_nsAttrName(odsState.name), cost_estimate_ns);
  odsState.addAttribute(tpu_coreAttrName(odsState.name), tpu_core);
  odsState.addTypes(outputs);
}

void XlaHostComputeOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange outputs, ::mlir::ValueRange inputs, ::mlir::ArrayAttr ancestors, ::mlir::ArrayAttr shapes, /*optional*/::mlir::SymbolRefAttr shape_inference_graph, ::llvm::StringRef key, ::llvm::StringRef send_key, ::llvm::StringRef recv_key, uint64_t cost_estimate_ns, uint64_t tpu_core) {
  odsState.addOperands(inputs);
  odsState.addAttribute(ancestorsAttrName(odsState.name), ancestors);
  odsState.addAttribute(shapesAttrName(odsState.name), shapes);
  if (shape_inference_graph) {
  odsState.addAttribute(shape_inference_graphAttrName(odsState.name), shape_inference_graph);
  }
  odsState.addAttribute(keyAttrName(odsState.name), odsBuilder.getStringAttr(key));
  odsState.addAttribute(send_keyAttrName(odsState.name), odsBuilder.getStringAttr(send_key));
  odsState.addAttribute(recv_keyAttrName(odsState.name), odsBuilder.getStringAttr(recv_key));
  odsState.addAttribute(cost_estimate_nsAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), cost_estimate_ns));
  odsState.addAttribute(tpu_coreAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), tpu_core));
  odsState.addTypes(outputs);
}

void XlaHostComputeOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult XlaHostComputeOp::verify() {
  {
    auto tblgen_ancestors = (*this)->getAttr(ancestorsAttrName());
    if (!tblgen_ancestors)
      return emitOpError("requires attribute 'ancestors'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops22(*this, tblgen_ancestors, "ancestors")))
      return ::mlir::failure();
  }
  {
    auto tblgen_shapes = (*this)->getAttr(shapesAttrName());
    if (!tblgen_shapes)
      return emitOpError("requires attribute 'shapes'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops28(*this, tblgen_shapes, "shapes")))
      return ::mlir::failure();
  }
  {
    auto tblgen_shape_inference_graph = (*this)->getAttr(shape_inference_graphAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops12(*this, tblgen_shape_inference_graph, "shape_inference_graph")))
      return ::mlir::failure();
  }
  {
    auto tblgen_key = (*this)->getAttr(keyAttrName());
    if (!tblgen_key)
      return emitOpError("requires attribute 'key'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_key, "key")))
      return ::mlir::failure();
  }
  {
    auto tblgen_send_key = (*this)->getAttr(send_keyAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_send_key, "send_key")))
      return ::mlir::failure();
  }
  {
    auto tblgen_recv_key = (*this)->getAttr(recv_keyAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_recv_key, "recv_key")))
      return ::mlir::failure();
  }
  {
    auto tblgen_cost_estimate_ns = (*this)->getAttr(cost_estimate_nsAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_cost_estimate_ns, "cost_estimate_ns")))
      return ::mlir::failure();
  }
  {
    auto tblgen_tpu_core = (*this)->getAttr(tpu_coreAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_tpu_core, "tpu_core")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void XlaHostComputeOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  effects.emplace_back(::mlir::MemoryEffects::Write::get(), ::mlir::TF::ResourceEffects::SendRecv::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::XlaHostComputeOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::XlaKeyValueSortOp definitions
//===----------------------------------------------------------------------===//

XlaKeyValueSortOpAdaptor::XlaKeyValueSortOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

XlaKeyValueSortOpAdaptor::XlaKeyValueSortOpAdaptor(XlaKeyValueSortOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange XlaKeyValueSortOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> XlaKeyValueSortOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange XlaKeyValueSortOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value XlaKeyValueSortOpAdaptor::keys() {
  return *getODSOperands(0).begin();
}

::mlir::Value XlaKeyValueSortOpAdaptor::values() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr XlaKeyValueSortOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult XlaKeyValueSortOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

void XlaKeyValueSortOp::getAsmResultNames(::mlir::OpAsmSetValueNameFn setNameFn) {
  auto resultGroup0 = getODSResults(0);
  if (!llvm::empty(resultGroup0))
    setNameFn(*resultGroup0.begin(), "sorted_keys");
  auto resultGroup1 = getODSResults(1);
  if (!llvm::empty(resultGroup1))
    setNameFn(*resultGroup1.begin(), "sorted_values");
}

std::pair<unsigned, unsigned> XlaKeyValueSortOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range XlaKeyValueSortOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value XlaKeyValueSortOp::keys() {
  return *getODSOperands(0).begin();
}

::mlir::Value XlaKeyValueSortOp::values() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange XlaKeyValueSortOp::keysMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange XlaKeyValueSortOp::valuesMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> XlaKeyValueSortOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range XlaKeyValueSortOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value XlaKeyValueSortOp::sorted_keys() {
  return *getODSResults(0).begin();
}

::mlir::Value XlaKeyValueSortOp::sorted_values() {
  return *getODSResults(1).begin();
}

::mlir::Type XlaKeyValueSortOp::K() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

::mlir::Type XlaKeyValueSortOp::V() {
  return mlir::getElementTypeOrSelf(*getODSOperands(1).begin());
}

bool XlaKeyValueSortOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "K") return true;
  if (name == "V") return true;
 return false;
}

::mlir::DictionaryAttr XlaKeyValueSortOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {KAttrName(),
::mlir::TypeAttr::get(K())},
    {VAttrName(),
::mlir::TypeAttr::get(V())}});
}

void XlaKeyValueSortOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type sorted_keys, ::mlir::Type sorted_values, ::mlir::Value keys, ::mlir::Value values) {
  odsState.addOperands(keys);
  odsState.addOperands(values);
  odsState.addTypes(sorted_keys);
  odsState.addTypes(sorted_values);
}

void XlaKeyValueSortOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value keys, ::mlir::Value values) {
  odsState.addOperands(keys);
  odsState.addOperands(values);
  assert(resultTypes.size() == 2u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void XlaKeyValueSortOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 2u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult XlaKeyValueSortOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops35(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops35(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSResults(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void XlaKeyValueSortOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::XlaKeyValueSortOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::XlaPadOp definitions
//===----------------------------------------------------------------------===//

XlaPadOpAdaptor::XlaPadOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

XlaPadOpAdaptor::XlaPadOpAdaptor(XlaPadOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange XlaPadOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> XlaPadOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange XlaPadOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value XlaPadOpAdaptor::input() {
  return *getODSOperands(0).begin();
}

::mlir::Value XlaPadOpAdaptor::padding_value() {
  return *getODSOperands(1).begin();
}

::mlir::Value XlaPadOpAdaptor::padding_low() {
  return *getODSOperands(2).begin();
}

::mlir::Value XlaPadOpAdaptor::padding_high() {
  return *getODSOperands(3).begin();
}

::mlir::Value XlaPadOpAdaptor::padding_interior() {
  return *getODSOperands(4).begin();
}

::mlir::DictionaryAttr XlaPadOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult XlaPadOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> XlaPadOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range XlaPadOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value XlaPadOp::input() {
  return *getODSOperands(0).begin();
}

::mlir::Value XlaPadOp::padding_value() {
  return *getODSOperands(1).begin();
}

::mlir::Value XlaPadOp::padding_low() {
  return *getODSOperands(2).begin();
}

::mlir::Value XlaPadOp::padding_high() {
  return *getODSOperands(3).begin();
}

::mlir::Value XlaPadOp::padding_interior() {
  return *getODSOperands(4).begin();
}

::mlir::MutableOperandRange XlaPadOp::inputMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange XlaPadOp::padding_valueMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange XlaPadOp::padding_lowMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange XlaPadOp::padding_highMutable() {
  auto range = getODSOperandIndexAndLength(3);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange XlaPadOp::padding_interiorMutable() {
  auto range = getODSOperandIndexAndLength(4);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> XlaPadOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range XlaPadOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value XlaPadOp::output() {
  return *getODSResults(0).begin();
}

::mlir::Type XlaPadOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

::mlir::Type XlaPadOp::Tindices() {
  return mlir::getElementTypeOrSelf(*getODSOperands(2).begin());
}

bool XlaPadOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
  if (name == "Tindices") return true;
 return false;
}

::mlir::DictionaryAttr XlaPadOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())},
    {TindicesAttrName(),
::mlir::TypeAttr::get(Tindices())}});
}

void XlaPadOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input, ::mlir::Value padding_value, ::mlir::Value padding_low, ::mlir::Value padding_high, ::mlir::Value padding_interior) {
  odsState.addOperands(input);
  odsState.addOperands(padding_value);
  odsState.addOperands(padding_low);
  odsState.addOperands(padding_high);
  odsState.addOperands(padding_interior);
  odsState.addTypes(output);
}

void XlaPadOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::Value padding_value, ::mlir::Value padding_low, ::mlir::Value padding_high, ::mlir::Value padding_interior) {
  odsState.addOperands(input);
  odsState.addOperands(padding_value);
  odsState.addOperands(padding_low);
  odsState.addOperands(padding_high);
  odsState.addOperands(padding_interior);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void XlaPadOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 5u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult XlaPadOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup3 = getODSOperands(3);

    for (auto v : valueGroup3) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup4 = getODSOperands(4);

    for (auto v : valueGroup4) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void XlaPadOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::XlaPadOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::XlaRecvFromHostOp definitions
//===----------------------------------------------------------------------===//

XlaRecvFromHostOpAdaptor::XlaRecvFromHostOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

XlaRecvFromHostOpAdaptor::XlaRecvFromHostOpAdaptor(XlaRecvFromHostOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange XlaRecvFromHostOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> XlaRecvFromHostOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange XlaRecvFromHostOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::DictionaryAttr XlaRecvFromHostOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::Attribute XlaRecvFromHostOpAdaptor::shape() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::Attribute attr = odsAttrs.get("shape").cast<::mlir::Attribute>();
  return attr;
}

::mlir::StringAttr XlaRecvFromHostOpAdaptor::key() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("key").cast<::mlir::StringAttr>();
  return attr;
}

::mlir::LogicalResult XlaRecvFromHostOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_shape = odsAttrs.get("shape");
    if (!tblgen_shape)
      return emitError(loc, "'tf.XlaRecvFromHost' op ""requires attribute 'shape'");

    if (tblgen_shape && !((tblgen_shape.isa<mlir::TF::ShapeAttr>())))
      return emitError(loc, "'tf.XlaRecvFromHost' op ""attribute 'shape' failed to satisfy constraint: TensorFlow shape attribute");
  }
  {
    auto tblgen_key = odsAttrs.get("key");
    if (!tblgen_key)
      return emitError(loc, "'tf.XlaRecvFromHost' op ""requires attribute 'key'");

    if (tblgen_key && !((tblgen_key.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.XlaRecvFromHost' op ""attribute 'key' failed to satisfy constraint: string attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> XlaRecvFromHostOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range XlaRecvFromHostOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

std::pair<unsigned, unsigned> XlaRecvFromHostOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range XlaRecvFromHostOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value XlaRecvFromHostOp::output() {
  return *getODSResults(0).begin();
}

::mlir::Attribute XlaRecvFromHostOp::shapeAttr() {
  return (*this)->getAttr(shapeAttrName()).cast<::mlir::Attribute>();
}

llvm::Optional<llvm::ArrayRef<int64_t>> XlaRecvFromHostOp::shape() {
  auto attr = shapeAttr();
  return attr.cast<mlir::TF::ShapeAttr>().getValue();
}

::mlir::StringAttr XlaRecvFromHostOp::keyAttr() {
  return (*this)->getAttr(keyAttrName()).cast<::mlir::StringAttr>();
}

::llvm::StringRef XlaRecvFromHostOp::key() {
  auto attr = keyAttr();
  return attr.getValue();
}

::mlir::Type XlaRecvFromHostOp::Toutput() {
  return mlir::getElementTypeOrSelf(*getODSResults(0).begin());
}

bool XlaRecvFromHostOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "Toutput") return true;
 return false;
}

::mlir::DictionaryAttr XlaRecvFromHostOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {ToutputAttrName(),
::mlir::TypeAttr::get(Toutput())}});
}

void XlaRecvFromHostOp::shapeAttr(::mlir::Attribute attr) {
  (*this)->setAttr(shapeAttrName(), attr);
}

void XlaRecvFromHostOp::keyAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(keyAttrName(), attr);
}

void XlaRecvFromHostOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Attribute shape, ::mlir::StringAttr key) {
  odsState.addAttribute(shapeAttrName(odsState.name), shape);
  odsState.addAttribute(keyAttrName(odsState.name), key);
  odsState.addTypes(output);
}

void XlaRecvFromHostOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Attribute shape, ::mlir::StringAttr key) {
  odsState.addAttribute(shapeAttrName(odsState.name), shape);
  odsState.addAttribute(keyAttrName(odsState.name), key);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void XlaRecvFromHostOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, llvm::Optional<llvm::ArrayRef<int64_t>> shape, ::llvm::StringRef key) {
  odsState.addAttribute(shapeAttrName(odsState.name), mlir::TF::ShapeAttr::get(odsBuilder.getContext(), shape));
  odsState.addAttribute(keyAttrName(odsState.name), odsBuilder.getStringAttr(key));
  odsState.addTypes(output);
}

void XlaRecvFromHostOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, llvm::Optional<llvm::ArrayRef<int64_t>> shape, ::llvm::StringRef key) {
  odsState.addAttribute(shapeAttrName(odsState.name), mlir::TF::ShapeAttr::get(odsBuilder.getContext(), shape));
  odsState.addAttribute(keyAttrName(odsState.name), odsBuilder.getStringAttr(key));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void XlaRecvFromHostOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 0u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult XlaRecvFromHostOp::verify() {
  {
    auto tblgen_shape = (*this)->getAttr(shapeAttrName());
    if (!tblgen_shape)
      return emitOpError("requires attribute 'shape'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops17(*this, tblgen_shape, "shape")))
      return ::mlir::failure();
  }
  {
    auto tblgen_key = (*this)->getAttr(keyAttrName());
    if (!tblgen_key)
      return emitOpError("requires attribute 'key'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_key, "key")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void XlaRecvFromHostOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  effects.emplace_back(::mlir::MemoryEffects::Write::get(), ::mlir::TF::ResourceEffects::SendRecv::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::XlaRecvFromHostOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::XlaReduceOp definitions
//===----------------------------------------------------------------------===//

XlaReduceOpAdaptor::XlaReduceOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

XlaReduceOpAdaptor::XlaReduceOpAdaptor(XlaReduceOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange XlaReduceOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> XlaReduceOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange XlaReduceOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value XlaReduceOpAdaptor::input() {
  return *getODSOperands(0).begin();
}

::mlir::Value XlaReduceOpAdaptor::init_value() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr XlaReduceOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::ArrayAttr XlaReduceOpAdaptor::dimensions_to_reduce() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("dimensions_to_reduce").cast<::mlir::ArrayAttr>();
  return attr;
}

::mlir::SymbolRefAttr XlaReduceOpAdaptor::reducer() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::SymbolRefAttr attr = odsAttrs.get("reducer").cast<::mlir::SymbolRefAttr>();
  return attr;
}

::mlir::LogicalResult XlaReduceOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_dimensions_to_reduce = odsAttrs.get("dimensions_to_reduce");
    if (!tblgen_dimensions_to_reduce)
      return emitError(loc, "'tf.XlaReduce' op ""requires attribute 'dimensions_to_reduce'");

    if (tblgen_dimensions_to_reduce && !(((tblgen_dimensions_to_reduce.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_dimensions_to_reduce.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return ((attr.isa<::mlir::IntegerAttr>())) && ((attr.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64))); }))))
      return emitError(loc, "'tf.XlaReduce' op ""attribute 'dimensions_to_reduce' failed to satisfy constraint: 64-bit integer array attribute");
  }
  {
    auto tblgen_reducer = odsAttrs.get("reducer");
    if (!tblgen_reducer)
      return emitError(loc, "'tf.XlaReduce' op ""requires attribute 'reducer'");

    if (tblgen_reducer && !((tblgen_reducer.isa<::mlir::SymbolRefAttr>())))
      return emitError(loc, "'tf.XlaReduce' op ""attribute 'reducer' failed to satisfy constraint: symbol reference attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> XlaReduceOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range XlaReduceOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value XlaReduceOp::input() {
  return *getODSOperands(0).begin();
}

::mlir::Value XlaReduceOp::init_value() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange XlaReduceOp::inputMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange XlaReduceOp::init_valueMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> XlaReduceOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range XlaReduceOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value XlaReduceOp::output() {
  return *getODSResults(0).begin();
}

::mlir::ArrayAttr XlaReduceOp::dimensions_to_reduceAttr() {
  return (*this)->getAttr(dimensions_to_reduceAttrName()).cast<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr XlaReduceOp::dimensions_to_reduce() {
  auto attr = dimensions_to_reduceAttr();
  return attr;
}

::mlir::SymbolRefAttr XlaReduceOp::reducerAttr() {
  return (*this)->getAttr(reducerAttrName()).cast<::mlir::SymbolRefAttr>();
}

::mlir::SymbolRefAttr XlaReduceOp::reducer() {
  auto attr = reducerAttr();
  return attr;
}

::mlir::Type XlaReduceOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool XlaReduceOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr XlaReduceOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void XlaReduceOp::dimensions_to_reduceAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(dimensions_to_reduceAttrName(), attr);
}

void XlaReduceOp::reducerAttr(::mlir::SymbolRefAttr attr) {
  (*this)->setAttr(reducerAttrName(), attr);
}

void XlaReduceOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input, ::mlir::Value init_value, ::mlir::ArrayAttr dimensions_to_reduce, ::mlir::SymbolRefAttr reducer) {
  odsState.addOperands(input);
  odsState.addOperands(init_value);
  odsState.addAttribute(dimensions_to_reduceAttrName(odsState.name), dimensions_to_reduce);
  odsState.addAttribute(reducerAttrName(odsState.name), reducer);
  odsState.addTypes(output);
}

void XlaReduceOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::Value init_value, ::mlir::ArrayAttr dimensions_to_reduce, ::mlir::SymbolRefAttr reducer) {
  odsState.addOperands(input);
  odsState.addOperands(init_value);
  odsState.addAttribute(dimensions_to_reduceAttrName(odsState.name), dimensions_to_reduce);
  odsState.addAttribute(reducerAttrName(odsState.name), reducer);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void XlaReduceOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult XlaReduceOp::verify() {
  {
    auto tblgen_dimensions_to_reduce = (*this)->getAttr(dimensions_to_reduceAttrName());
    if (!tblgen_dimensions_to_reduce)
      return emitOpError("requires attribute 'dimensions_to_reduce'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops13(*this, tblgen_dimensions_to_reduce, "dimensions_to_reduce")))
      return ::mlir::failure();
  }
  {
    auto tblgen_reducer = (*this)->getAttr(reducerAttrName());
    if (!tblgen_reducer)
      return emitOpError("requires attribute 'reducer'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops12(*this, tblgen_reducer, "reducer")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops10(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops10(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops10(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void XlaReduceOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::XlaReduceOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::XlaReduceScatterOp definitions
//===----------------------------------------------------------------------===//

XlaReduceScatterOpAdaptor::XlaReduceScatterOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

XlaReduceScatterOpAdaptor::XlaReduceScatterOpAdaptor(XlaReduceScatterOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange XlaReduceScatterOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> XlaReduceScatterOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange XlaReduceScatterOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value XlaReduceScatterOpAdaptor::input() {
  return *getODSOperands(0).begin();
}

::mlir::Value XlaReduceScatterOpAdaptor::group_assignment() {
  return *getODSOperands(1).begin();
}

::mlir::Value XlaReduceScatterOpAdaptor::scatter_dimension() {
  return *getODSOperands(2).begin();
}

::mlir::DictionaryAttr XlaReduceScatterOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::StringAttr XlaReduceScatterOpAdaptor::reduce_op() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("reduce_op").cast<::mlir::StringAttr>();
  return attr;
}

::mlir::LogicalResult XlaReduceScatterOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_reduce_op = odsAttrs.get("reduce_op");
    if (!tblgen_reduce_op)
      return emitError(loc, "'tf.XlaReduceScatter' op ""requires attribute 'reduce_op'");

    if (tblgen_reduce_op && !((tblgen_reduce_op.cast<StringAttr>().getValue() == "Min" || tblgen_reduce_op.cast<StringAttr>().getValue() == "Max" || tblgen_reduce_op.cast<StringAttr>().getValue() == "Mul" || tblgen_reduce_op.cast<StringAttr>().getValue() == "Add" || tblgen_reduce_op.cast<StringAttr>().getValue() == "Mean")))
      return emitError(loc, "'tf.XlaReduceScatter' op ""attribute 'reduce_op' failed to satisfy constraint: string attribute whose value is Min, or Max, or Mul, or Add, or Mean");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> XlaReduceScatterOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range XlaReduceScatterOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value XlaReduceScatterOp::input() {
  return *getODSOperands(0).begin();
}

::mlir::Value XlaReduceScatterOp::group_assignment() {
  return *getODSOperands(1).begin();
}

::mlir::Value XlaReduceScatterOp::scatter_dimension() {
  return *getODSOperands(2).begin();
}

::mlir::MutableOperandRange XlaReduceScatterOp::inputMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange XlaReduceScatterOp::group_assignmentMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange XlaReduceScatterOp::scatter_dimensionMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> XlaReduceScatterOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range XlaReduceScatterOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value XlaReduceScatterOp::output() {
  return *getODSResults(0).begin();
}

::mlir::StringAttr XlaReduceScatterOp::reduce_opAttr() {
  return (*this)->getAttr(reduce_opAttrName()).cast<::mlir::StringAttr>();
}

::llvm::StringRef XlaReduceScatterOp::reduce_op() {
  auto attr = reduce_opAttr();
  return attr.getValue();
}

::mlir::Type XlaReduceScatterOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool XlaReduceScatterOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr XlaReduceScatterOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void XlaReduceScatterOp::reduce_opAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(reduce_opAttrName(), attr);
}

void XlaReduceScatterOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input, ::mlir::Value group_assignment, ::mlir::Value scatter_dimension, ::mlir::StringAttr reduce_op) {
  odsState.addOperands(input);
  odsState.addOperands(group_assignment);
  odsState.addOperands(scatter_dimension);
  odsState.addAttribute(reduce_opAttrName(odsState.name), reduce_op);
  odsState.addTypes(output);
}

void XlaReduceScatterOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::Value group_assignment, ::mlir::Value scatter_dimension, ::mlir::StringAttr reduce_op) {
  odsState.addOperands(input);
  odsState.addOperands(group_assignment);
  odsState.addOperands(scatter_dimension);
  odsState.addAttribute(reduce_opAttrName(odsState.name), reduce_op);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void XlaReduceScatterOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input, ::mlir::Value group_assignment, ::mlir::Value scatter_dimension, ::llvm::StringRef reduce_op) {
  odsState.addOperands(input);
  odsState.addOperands(group_assignment);
  odsState.addOperands(scatter_dimension);
  odsState.addAttribute(reduce_opAttrName(odsState.name), odsBuilder.getStringAttr(reduce_op));
  odsState.addTypes(output);
}

void XlaReduceScatterOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::Value group_assignment, ::mlir::Value scatter_dimension, ::llvm::StringRef reduce_op) {
  odsState.addOperands(input);
  odsState.addOperands(group_assignment);
  odsState.addOperands(scatter_dimension);
  odsState.addAttribute(reduce_opAttrName(odsState.name), odsBuilder.getStringAttr(reduce_op));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void XlaReduceScatterOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 3u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult XlaReduceScatterOp::verify() {
  {
    auto tblgen_reduce_op = (*this)->getAttr(reduce_opAttrName());
    if (!tblgen_reduce_op)
      return emitOpError("requires attribute 'reduce_op'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops41(*this, tblgen_reduce_op, "reduce_op")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops64(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops11(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops11(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops64(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void XlaReduceScatterOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::XlaReduceScatterOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::XlaReduceWindowOp definitions
//===----------------------------------------------------------------------===//

XlaReduceWindowOpAdaptor::XlaReduceWindowOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

XlaReduceWindowOpAdaptor::XlaReduceWindowOpAdaptor(XlaReduceWindowOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange XlaReduceWindowOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> XlaReduceWindowOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange XlaReduceWindowOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value XlaReduceWindowOpAdaptor::input() {
  return *getODSOperands(0).begin();
}

::mlir::Value XlaReduceWindowOpAdaptor::init_value() {
  return *getODSOperands(1).begin();
}

::mlir::Value XlaReduceWindowOpAdaptor::window_dimensions() {
  return *getODSOperands(2).begin();
}

::mlir::Value XlaReduceWindowOpAdaptor::window_strides() {
  return *getODSOperands(3).begin();
}

::mlir::Value XlaReduceWindowOpAdaptor::base_dilations() {
  return *getODSOperands(4).begin();
}

::mlir::Value XlaReduceWindowOpAdaptor::window_dilations() {
  return *getODSOperands(5).begin();
}

::mlir::Value XlaReduceWindowOpAdaptor::padding() {
  return *getODSOperands(6).begin();
}

::mlir::DictionaryAttr XlaReduceWindowOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::SymbolRefAttr XlaReduceWindowOpAdaptor::computation() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::SymbolRefAttr attr = odsAttrs.get("computation").cast<::mlir::SymbolRefAttr>();
  return attr;
}

::mlir::LogicalResult XlaReduceWindowOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_computation = odsAttrs.get("computation");
    if (!tblgen_computation)
      return emitError(loc, "'tf.XlaReduceWindow' op ""requires attribute 'computation'");

    if (tblgen_computation && !((tblgen_computation.isa<::mlir::SymbolRefAttr>())))
      return emitError(loc, "'tf.XlaReduceWindow' op ""attribute 'computation' failed to satisfy constraint: symbol reference attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> XlaReduceWindowOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range XlaReduceWindowOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value XlaReduceWindowOp::input() {
  return *getODSOperands(0).begin();
}

::mlir::Value XlaReduceWindowOp::init_value() {
  return *getODSOperands(1).begin();
}

::mlir::Value XlaReduceWindowOp::window_dimensions() {
  return *getODSOperands(2).begin();
}

::mlir::Value XlaReduceWindowOp::window_strides() {
  return *getODSOperands(3).begin();
}

::mlir::Value XlaReduceWindowOp::base_dilations() {
  return *getODSOperands(4).begin();
}

::mlir::Value XlaReduceWindowOp::window_dilations() {
  return *getODSOperands(5).begin();
}

::mlir::Value XlaReduceWindowOp::padding() {
  return *getODSOperands(6).begin();
}

::mlir::MutableOperandRange XlaReduceWindowOp::inputMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange XlaReduceWindowOp::init_valueMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange XlaReduceWindowOp::window_dimensionsMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange XlaReduceWindowOp::window_stridesMutable() {
  auto range = getODSOperandIndexAndLength(3);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange XlaReduceWindowOp::base_dilationsMutable() {
  auto range = getODSOperandIndexAndLength(4);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange XlaReduceWindowOp::window_dilationsMutable() {
  auto range = getODSOperandIndexAndLength(5);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange XlaReduceWindowOp::paddingMutable() {
  auto range = getODSOperandIndexAndLength(6);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> XlaReduceWindowOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range XlaReduceWindowOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value XlaReduceWindowOp::output() {
  return *getODSResults(0).begin();
}

::mlir::SymbolRefAttr XlaReduceWindowOp::computationAttr() {
  return (*this)->getAttr(computationAttrName()).cast<::mlir::SymbolRefAttr>();
}

::mlir::SymbolRefAttr XlaReduceWindowOp::computation() {
  auto attr = computationAttr();
  return attr;
}

::mlir::Type XlaReduceWindowOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

::mlir::Type XlaReduceWindowOp::Tindices() {
  return mlir::getElementTypeOrSelf(*getODSOperands(2).begin());
}

bool XlaReduceWindowOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
  if (name == "Tindices") return true;
 return false;
}

::mlir::DictionaryAttr XlaReduceWindowOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())},
    {TindicesAttrName(),
::mlir::TypeAttr::get(Tindices())}});
}

void XlaReduceWindowOp::computationAttr(::mlir::SymbolRefAttr attr) {
  (*this)->setAttr(computationAttrName(), attr);
}

void XlaReduceWindowOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input, ::mlir::Value init_value, ::mlir::Value window_dimensions, ::mlir::Value window_strides, ::mlir::Value base_dilations, ::mlir::Value window_dilations, ::mlir::Value padding, ::mlir::SymbolRefAttr computation) {
  odsState.addOperands(input);
  odsState.addOperands(init_value);
  odsState.addOperands(window_dimensions);
  odsState.addOperands(window_strides);
  odsState.addOperands(base_dilations);
  odsState.addOperands(window_dilations);
  odsState.addOperands(padding);
  odsState.addAttribute(computationAttrName(odsState.name), computation);
  odsState.addTypes(output);
}

void XlaReduceWindowOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::Value init_value, ::mlir::Value window_dimensions, ::mlir::Value window_strides, ::mlir::Value base_dilations, ::mlir::Value window_dilations, ::mlir::Value padding, ::mlir::SymbolRefAttr computation) {
  odsState.addOperands(input);
  odsState.addOperands(init_value);
  odsState.addOperands(window_dimensions);
  odsState.addOperands(window_strides);
  odsState.addOperands(base_dilations);
  odsState.addOperands(window_dilations);
  odsState.addOperands(padding);
  odsState.addAttribute(computationAttrName(odsState.name), computation);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void XlaReduceWindowOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 7u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult XlaReduceWindowOp::verify() {
  {
    auto tblgen_computation = (*this)->getAttr(computationAttrName());
    if (!tblgen_computation)
      return emitOpError("requires attribute 'computation'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops12(*this, tblgen_computation, "computation")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops10(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops10(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup3 = getODSOperands(3);

    for (auto v : valueGroup3) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup4 = getODSOperands(4);

    for (auto v : valueGroup4) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup5 = getODSOperands(5);

    for (auto v : valueGroup5) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup6 = getODSOperands(6);

    for (auto v : valueGroup6) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops10(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void XlaReduceWindowOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::XlaReduceWindowOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::XlaRemoveDynamicDimensionSizeOp definitions
//===----------------------------------------------------------------------===//

XlaRemoveDynamicDimensionSizeOpAdaptor::XlaRemoveDynamicDimensionSizeOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

XlaRemoveDynamicDimensionSizeOpAdaptor::XlaRemoveDynamicDimensionSizeOpAdaptor(XlaRemoveDynamicDimensionSizeOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange XlaRemoveDynamicDimensionSizeOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> XlaRemoveDynamicDimensionSizeOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange XlaRemoveDynamicDimensionSizeOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value XlaRemoveDynamicDimensionSizeOpAdaptor::input() {
  return *getODSOperands(0).begin();
}

::mlir::Value XlaRemoveDynamicDimensionSizeOpAdaptor::dim_index() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr XlaRemoveDynamicDimensionSizeOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult XlaRemoveDynamicDimensionSizeOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> XlaRemoveDynamicDimensionSizeOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range XlaRemoveDynamicDimensionSizeOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value XlaRemoveDynamicDimensionSizeOp::input() {
  return *getODSOperands(0).begin();
}

::mlir::Value XlaRemoveDynamicDimensionSizeOp::dim_index() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange XlaRemoveDynamicDimensionSizeOp::inputMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange XlaRemoveDynamicDimensionSizeOp::dim_indexMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> XlaRemoveDynamicDimensionSizeOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range XlaRemoveDynamicDimensionSizeOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value XlaRemoveDynamicDimensionSizeOp::output() {
  return *getODSResults(0).begin();
}

::mlir::Type XlaRemoveDynamicDimensionSizeOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool XlaRemoveDynamicDimensionSizeOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr XlaRemoveDynamicDimensionSizeOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void XlaRemoveDynamicDimensionSizeOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input, ::mlir::Value dim_index) {
  odsState.addOperands(input);
  odsState.addOperands(dim_index);
  odsState.addTypes(output);
}

void XlaRemoveDynamicDimensionSizeOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::Value dim_index) {
  odsState.addOperands(input);
  odsState.addOperands(dim_index);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void XlaRemoveDynamicDimensionSizeOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult XlaRemoveDynamicDimensionSizeOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops11(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void XlaRemoveDynamicDimensionSizeOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::XlaRemoveDynamicDimensionSizeOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::XlaReplicaIdOp definitions
//===----------------------------------------------------------------------===//

XlaReplicaIdOpAdaptor::XlaReplicaIdOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

XlaReplicaIdOpAdaptor::XlaReplicaIdOpAdaptor(XlaReplicaIdOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange XlaReplicaIdOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> XlaReplicaIdOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange XlaReplicaIdOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::DictionaryAttr XlaReplicaIdOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult XlaReplicaIdOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> XlaReplicaIdOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range XlaReplicaIdOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

std::pair<unsigned, unsigned> XlaReplicaIdOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range XlaReplicaIdOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value XlaReplicaIdOp::id() {
  return *getODSResults(0).begin();
}

void XlaReplicaIdOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type id) {
  odsState.addTypes(id);
}

void XlaReplicaIdOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes) {
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void XlaReplicaIdOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 0u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult XlaReplicaIdOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops11(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void XlaReplicaIdOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::XlaReplicaIdOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::XlaRngBitGeneratorOp definitions
//===----------------------------------------------------------------------===//

XlaRngBitGeneratorOpAdaptor::XlaRngBitGeneratorOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

XlaRngBitGeneratorOpAdaptor::XlaRngBitGeneratorOpAdaptor(XlaRngBitGeneratorOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange XlaRngBitGeneratorOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> XlaRngBitGeneratorOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange XlaRngBitGeneratorOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value XlaRngBitGeneratorOpAdaptor::algorithm() {
  return *getODSOperands(0).begin();
}

::mlir::Value XlaRngBitGeneratorOpAdaptor::initial_state() {
  return *getODSOperands(1).begin();
}

::mlir::Value XlaRngBitGeneratorOpAdaptor::shape() {
  return *getODSOperands(2).begin();
}

::mlir::DictionaryAttr XlaRngBitGeneratorOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult XlaRngBitGeneratorOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

void XlaRngBitGeneratorOp::getAsmResultNames(::mlir::OpAsmSetValueNameFn setNameFn) {
  auto resultGroup0 = getODSResults(0);
  if (!llvm::empty(resultGroup0))
    setNameFn(*resultGroup0.begin(), "output_key");
  auto resultGroup1 = getODSResults(1);
  if (!llvm::empty(resultGroup1))
    setNameFn(*resultGroup1.begin(), "output");
}

std::pair<unsigned, unsigned> XlaRngBitGeneratorOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range XlaRngBitGeneratorOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value XlaRngBitGeneratorOp::algorithm() {
  return *getODSOperands(0).begin();
}

::mlir::Value XlaRngBitGeneratorOp::initial_state() {
  return *getODSOperands(1).begin();
}

::mlir::Value XlaRngBitGeneratorOp::shape() {
  return *getODSOperands(2).begin();
}

::mlir::MutableOperandRange XlaRngBitGeneratorOp::algorithmMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange XlaRngBitGeneratorOp::initial_stateMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange XlaRngBitGeneratorOp::shapeMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> XlaRngBitGeneratorOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range XlaRngBitGeneratorOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value XlaRngBitGeneratorOp::output_key() {
  return *getODSResults(0).begin();
}

::mlir::Value XlaRngBitGeneratorOp::output() {
  return *getODSResults(1).begin();
}

::mlir::Type XlaRngBitGeneratorOp::Tshape() {
  return mlir::getElementTypeOrSelf(*getODSOperands(2).begin());
}

::mlir::Type XlaRngBitGeneratorOp::dtype() {
  return mlir::getElementTypeOrSelf(*getODSResults(1).begin());
}

bool XlaRngBitGeneratorOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "Tshape") return true;
  if (name == "dtype") return true;
 return false;
}

::mlir::DictionaryAttr XlaRngBitGeneratorOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TshapeAttrName(),
::mlir::TypeAttr::get(Tshape())},
    {dtypeAttrName(),
::mlir::TypeAttr::get(dtype())}});
}

void XlaRngBitGeneratorOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output_key, ::mlir::Type output, ::mlir::Value algorithm, ::mlir::Value initial_state, ::mlir::Value shape) {
  odsState.addOperands(algorithm);
  odsState.addOperands(initial_state);
  odsState.addOperands(shape);
  odsState.addTypes(output_key);
  odsState.addTypes(output);
}

void XlaRngBitGeneratorOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value algorithm, ::mlir::Value initial_state, ::mlir::Value shape) {
  odsState.addOperands(algorithm);
  odsState.addOperands(initial_state);
  odsState.addOperands(shape);
  assert(resultTypes.size() == 2u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void XlaRngBitGeneratorOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 3u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 2u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult XlaRngBitGeneratorOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops11(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops57(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops57(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSResults(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops58(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void XlaRngBitGeneratorOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::XlaRngBitGeneratorOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::XlaScatterOp definitions
//===----------------------------------------------------------------------===//

XlaScatterOpAdaptor::XlaScatterOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

XlaScatterOpAdaptor::XlaScatterOpAdaptor(XlaScatterOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange XlaScatterOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> XlaScatterOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange XlaScatterOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value XlaScatterOpAdaptor::operand() {
  return *getODSOperands(0).begin();
}

::mlir::Value XlaScatterOpAdaptor::scatter_indices() {
  return *getODSOperands(1).begin();
}

::mlir::Value XlaScatterOpAdaptor::updates() {
  return *getODSOperands(2).begin();
}

::mlir::DictionaryAttr XlaScatterOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::SymbolRefAttr XlaScatterOpAdaptor::update_computation() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::SymbolRefAttr attr = odsAttrs.get("update_computation").cast<::mlir::SymbolRefAttr>();
  return attr;
}

::mlir::StringAttr XlaScatterOpAdaptor::dimension_numbers() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("dimension_numbers").cast<::mlir::StringAttr>();
  return attr;
}

::mlir::BoolAttr XlaScatterOpAdaptor::indices_are_sorted() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("indices_are_sorted").cast<::mlir::BoolAttr>();
  return attr;
}

::mlir::LogicalResult XlaScatterOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_update_computation = odsAttrs.get("update_computation");
    if (!tblgen_update_computation)
      return emitError(loc, "'tf.XlaScatter' op ""requires attribute 'update_computation'");

    if (tblgen_update_computation && !((tblgen_update_computation.isa<::mlir::SymbolRefAttr>())))
      return emitError(loc, "'tf.XlaScatter' op ""attribute 'update_computation' failed to satisfy constraint: symbol reference attribute");
  }
  {
    auto tblgen_dimension_numbers = odsAttrs.get("dimension_numbers");
    if (!tblgen_dimension_numbers)
      return emitError(loc, "'tf.XlaScatter' op ""requires attribute 'dimension_numbers'");

    if (tblgen_dimension_numbers && !((tblgen_dimension_numbers.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.XlaScatter' op ""attribute 'dimension_numbers' failed to satisfy constraint: string attribute");
  }
  {
    auto tblgen_indices_are_sorted = odsAttrs.get("indices_are_sorted");
    if (!tblgen_indices_are_sorted)
      return emitError(loc, "'tf.XlaScatter' op ""requires attribute 'indices_are_sorted'");

    if (tblgen_indices_are_sorted && !((tblgen_indices_are_sorted.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.XlaScatter' op ""attribute 'indices_are_sorted' failed to satisfy constraint: bool attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> XlaScatterOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range XlaScatterOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value XlaScatterOp::operand() {
  return *getODSOperands(0).begin();
}

::mlir::Value XlaScatterOp::scatter_indices() {
  return *getODSOperands(1).begin();
}

::mlir::Value XlaScatterOp::updates() {
  return *getODSOperands(2).begin();
}

::mlir::MutableOperandRange XlaScatterOp::operandMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange XlaScatterOp::scatter_indicesMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange XlaScatterOp::updatesMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> XlaScatterOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range XlaScatterOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value XlaScatterOp::output() {
  return *getODSResults(0).begin();
}

::mlir::SymbolRefAttr XlaScatterOp::update_computationAttr() {
  return (*this)->getAttr(update_computationAttrName()).cast<::mlir::SymbolRefAttr>();
}

::mlir::SymbolRefAttr XlaScatterOp::update_computation() {
  auto attr = update_computationAttr();
  return attr;
}

::mlir::StringAttr XlaScatterOp::dimension_numbersAttr() {
  return (*this)->getAttr(dimension_numbersAttrName()).cast<::mlir::StringAttr>();
}

::llvm::StringRef XlaScatterOp::dimension_numbers() {
  auto attr = dimension_numbersAttr();
  return attr.getValue();
}

::mlir::BoolAttr XlaScatterOp::indices_are_sortedAttr() {
  return (*this)->getAttr(indices_are_sortedAttrName()).cast<::mlir::BoolAttr>();
}

bool XlaScatterOp::indices_are_sorted() {
  auto attr = indices_are_sortedAttr();
  return attr.getValue();
}

::mlir::Type XlaScatterOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

::mlir::Type XlaScatterOp::Tindices() {
  return mlir::getElementTypeOrSelf(*getODSOperands(1).begin());
}

bool XlaScatterOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
  if (name == "Tindices") return true;
 return false;
}

::mlir::DictionaryAttr XlaScatterOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())},
    {TindicesAttrName(),
::mlir::TypeAttr::get(Tindices())}});
}

void XlaScatterOp::update_computationAttr(::mlir::SymbolRefAttr attr) {
  (*this)->setAttr(update_computationAttrName(), attr);
}

void XlaScatterOp::dimension_numbersAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(dimension_numbersAttrName(), attr);
}

void XlaScatterOp::indices_are_sortedAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(indices_are_sortedAttrName(), attr);
}

void XlaScatterOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value operand, ::mlir::Value scatter_indices, ::mlir::Value updates, ::mlir::SymbolRefAttr update_computation, ::mlir::StringAttr dimension_numbers, ::mlir::BoolAttr indices_are_sorted) {
  odsState.addOperands(operand);
  odsState.addOperands(scatter_indices);
  odsState.addOperands(updates);
  odsState.addAttribute(update_computationAttrName(odsState.name), update_computation);
  odsState.addAttribute(dimension_numbersAttrName(odsState.name), dimension_numbers);
  odsState.addAttribute(indices_are_sortedAttrName(odsState.name), indices_are_sorted);
  odsState.addTypes(output);
}

void XlaScatterOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value operand, ::mlir::Value scatter_indices, ::mlir::Value updates, ::mlir::SymbolRefAttr update_computation, ::mlir::StringAttr dimension_numbers, ::mlir::BoolAttr indices_are_sorted) {
  odsState.addOperands(operand);
  odsState.addOperands(scatter_indices);
  odsState.addOperands(updates);
  odsState.addAttribute(update_computationAttrName(odsState.name), update_computation);
  odsState.addAttribute(dimension_numbersAttrName(odsState.name), dimension_numbers);
  odsState.addAttribute(indices_are_sortedAttrName(odsState.name), indices_are_sorted);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void XlaScatterOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value operand, ::mlir::Value scatter_indices, ::mlir::Value updates, ::mlir::SymbolRefAttr update_computation, ::llvm::StringRef dimension_numbers, bool indices_are_sorted) {
  odsState.addOperands(operand);
  odsState.addOperands(scatter_indices);
  odsState.addOperands(updates);
  odsState.addAttribute(update_computationAttrName(odsState.name), update_computation);
  odsState.addAttribute(dimension_numbersAttrName(odsState.name), odsBuilder.getStringAttr(dimension_numbers));
  odsState.addAttribute(indices_are_sortedAttrName(odsState.name), odsBuilder.getBoolAttr(indices_are_sorted));
  odsState.addTypes(output);
}

void XlaScatterOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value operand, ::mlir::Value scatter_indices, ::mlir::Value updates, ::mlir::SymbolRefAttr update_computation, ::llvm::StringRef dimension_numbers, bool indices_are_sorted) {
  odsState.addOperands(operand);
  odsState.addOperands(scatter_indices);
  odsState.addOperands(updates);
  odsState.addAttribute(update_computationAttrName(odsState.name), update_computation);
  odsState.addAttribute(dimension_numbersAttrName(odsState.name), odsBuilder.getStringAttr(dimension_numbers));
  odsState.addAttribute(indices_are_sortedAttrName(odsState.name), odsBuilder.getBoolAttr(indices_are_sorted));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void XlaScatterOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 3u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult XlaScatterOp::verify() {
  {
    auto tblgen_update_computation = (*this)->getAttr(update_computationAttrName());
    if (!tblgen_update_computation)
      return emitOpError("requires attribute 'update_computation'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops12(*this, tblgen_update_computation, "update_computation")))
      return ::mlir::failure();
  }
  {
    auto tblgen_dimension_numbers = (*this)->getAttr(dimension_numbersAttrName());
    if (!tblgen_dimension_numbers)
      return emitOpError("requires attribute 'dimension_numbers'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_dimension_numbers, "dimension_numbers")))
      return ::mlir::failure();
  }
  {
    auto tblgen_indices_are_sorted = (*this)->getAttr(indices_are_sortedAttrName());
    if (!tblgen_indices_are_sorted)
      return emitOpError("requires attribute 'indices_are_sorted'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_indices_are_sorted, "indices_are_sorted")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops10(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops10(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops10(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void XlaScatterOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::XlaScatterOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::XlaSelectAndScatterOp definitions
//===----------------------------------------------------------------------===//

XlaSelectAndScatterOpAdaptor::XlaSelectAndScatterOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

XlaSelectAndScatterOpAdaptor::XlaSelectAndScatterOpAdaptor(XlaSelectAndScatterOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange XlaSelectAndScatterOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> XlaSelectAndScatterOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange XlaSelectAndScatterOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value XlaSelectAndScatterOpAdaptor::operand() {
  return *getODSOperands(0).begin();
}

::mlir::Value XlaSelectAndScatterOpAdaptor::window_dimensions() {
  return *getODSOperands(1).begin();
}

::mlir::Value XlaSelectAndScatterOpAdaptor::window_strides() {
  return *getODSOperands(2).begin();
}

::mlir::Value XlaSelectAndScatterOpAdaptor::padding() {
  return *getODSOperands(3).begin();
}

::mlir::Value XlaSelectAndScatterOpAdaptor::source() {
  return *getODSOperands(4).begin();
}

::mlir::Value XlaSelectAndScatterOpAdaptor::init_value() {
  return *getODSOperands(5).begin();
}

::mlir::DictionaryAttr XlaSelectAndScatterOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::SymbolRefAttr XlaSelectAndScatterOpAdaptor::select() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::SymbolRefAttr attr = odsAttrs.get("select").cast<::mlir::SymbolRefAttr>();
  return attr;
}

::mlir::SymbolRefAttr XlaSelectAndScatterOpAdaptor::scatter() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::SymbolRefAttr attr = odsAttrs.get("scatter").cast<::mlir::SymbolRefAttr>();
  return attr;
}

::mlir::LogicalResult XlaSelectAndScatterOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_select = odsAttrs.get("select");
    if (!tblgen_select)
      return emitError(loc, "'tf.XlaSelectAndScatter' op ""requires attribute 'select'");

    if (tblgen_select && !((tblgen_select.isa<::mlir::SymbolRefAttr>())))
      return emitError(loc, "'tf.XlaSelectAndScatter' op ""attribute 'select' failed to satisfy constraint: symbol reference attribute");
  }
  {
    auto tblgen_scatter = odsAttrs.get("scatter");
    if (!tblgen_scatter)
      return emitError(loc, "'tf.XlaSelectAndScatter' op ""requires attribute 'scatter'");

    if (tblgen_scatter && !((tblgen_scatter.isa<::mlir::SymbolRefAttr>())))
      return emitError(loc, "'tf.XlaSelectAndScatter' op ""attribute 'scatter' failed to satisfy constraint: symbol reference attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> XlaSelectAndScatterOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range XlaSelectAndScatterOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value XlaSelectAndScatterOp::operand() {
  return *getODSOperands(0).begin();
}

::mlir::Value XlaSelectAndScatterOp::window_dimensions() {
  return *getODSOperands(1).begin();
}

::mlir::Value XlaSelectAndScatterOp::window_strides() {
  return *getODSOperands(2).begin();
}

::mlir::Value XlaSelectAndScatterOp::padding() {
  return *getODSOperands(3).begin();
}

::mlir::Value XlaSelectAndScatterOp::source() {
  return *getODSOperands(4).begin();
}

::mlir::Value XlaSelectAndScatterOp::init_value() {
  return *getODSOperands(5).begin();
}

::mlir::MutableOperandRange XlaSelectAndScatterOp::operandMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange XlaSelectAndScatterOp::window_dimensionsMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange XlaSelectAndScatterOp::window_stridesMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange XlaSelectAndScatterOp::paddingMutable() {
  auto range = getODSOperandIndexAndLength(3);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange XlaSelectAndScatterOp::sourceMutable() {
  auto range = getODSOperandIndexAndLength(4);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange XlaSelectAndScatterOp::init_valueMutable() {
  auto range = getODSOperandIndexAndLength(5);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> XlaSelectAndScatterOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range XlaSelectAndScatterOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value XlaSelectAndScatterOp::output() {
  return *getODSResults(0).begin();
}

::mlir::SymbolRefAttr XlaSelectAndScatterOp::selectAttr() {
  return (*this)->getAttr(selectAttrName()).cast<::mlir::SymbolRefAttr>();
}

::mlir::SymbolRefAttr XlaSelectAndScatterOp::select() {
  auto attr = selectAttr();
  return attr;
}

::mlir::SymbolRefAttr XlaSelectAndScatterOp::scatterAttr() {
  return (*this)->getAttr(scatterAttrName()).cast<::mlir::SymbolRefAttr>();
}

::mlir::SymbolRefAttr XlaSelectAndScatterOp::scatter() {
  auto attr = scatterAttr();
  return attr;
}

::mlir::Type XlaSelectAndScatterOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

::mlir::Type XlaSelectAndScatterOp::Tindices() {
  return mlir::getElementTypeOrSelf(*getODSOperands(1).begin());
}

bool XlaSelectAndScatterOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
  if (name == "Tindices") return true;
 return false;
}

::mlir::DictionaryAttr XlaSelectAndScatterOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())},
    {TindicesAttrName(),
::mlir::TypeAttr::get(Tindices())}});
}

void XlaSelectAndScatterOp::selectAttr(::mlir::SymbolRefAttr attr) {
  (*this)->setAttr(selectAttrName(), attr);
}

void XlaSelectAndScatterOp::scatterAttr(::mlir::SymbolRefAttr attr) {
  (*this)->setAttr(scatterAttrName(), attr);
}

void XlaSelectAndScatterOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value operand, ::mlir::Value window_dimensions, ::mlir::Value window_strides, ::mlir::Value padding, ::mlir::Value source, ::mlir::Value init_value, ::mlir::SymbolRefAttr select, ::mlir::SymbolRefAttr scatter) {
  odsState.addOperands(operand);
  odsState.addOperands(window_dimensions);
  odsState.addOperands(window_strides);
  odsState.addOperands(padding);
  odsState.addOperands(source);
  odsState.addOperands(init_value);
  odsState.addAttribute(selectAttrName(odsState.name), select);
  odsState.addAttribute(scatterAttrName(odsState.name), scatter);
  odsState.addTypes(output);
}

void XlaSelectAndScatterOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value operand, ::mlir::Value window_dimensions, ::mlir::Value window_strides, ::mlir::Value padding, ::mlir::Value source, ::mlir::Value init_value, ::mlir::SymbolRefAttr select, ::mlir::SymbolRefAttr scatter) {
  odsState.addOperands(operand);
  odsState.addOperands(window_dimensions);
  odsState.addOperands(window_strides);
  odsState.addOperands(padding);
  odsState.addOperands(source);
  odsState.addOperands(init_value);
  odsState.addAttribute(selectAttrName(odsState.name), select);
  odsState.addAttribute(scatterAttrName(odsState.name), scatter);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void XlaSelectAndScatterOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 6u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult XlaSelectAndScatterOp::verify() {
  {
    auto tblgen_select = (*this)->getAttr(selectAttrName());
    if (!tblgen_select)
      return emitOpError("requires attribute 'select'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops12(*this, tblgen_select, "select")))
      return ::mlir::failure();
  }
  {
    auto tblgen_scatter = (*this)->getAttr(scatterAttrName());
    if (!tblgen_scatter)
      return emitOpError("requires attribute 'scatter'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops12(*this, tblgen_scatter, "scatter")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup3 = getODSOperands(3);

    for (auto v : valueGroup3) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops9(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup4 = getODSOperands(4);

    for (auto v : valueGroup4) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup5 = getODSOperands(5);

    for (auto v : valueGroup5) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void XlaSelectAndScatterOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::XlaSelectAndScatterOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::XlaSelfAdjointEigOp definitions
//===----------------------------------------------------------------------===//

XlaSelfAdjointEigOpAdaptor::XlaSelfAdjointEigOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

XlaSelfAdjointEigOpAdaptor::XlaSelfAdjointEigOpAdaptor(XlaSelfAdjointEigOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange XlaSelfAdjointEigOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> XlaSelfAdjointEigOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange XlaSelfAdjointEigOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value XlaSelfAdjointEigOpAdaptor::a() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr XlaSelfAdjointEigOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::BoolAttr XlaSelfAdjointEigOpAdaptor::lower() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("lower").cast<::mlir::BoolAttr>();
  return attr;
}

::mlir::IntegerAttr XlaSelfAdjointEigOpAdaptor::max_iter() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("max_iter").cast<::mlir::IntegerAttr>();
  return attr;
}

::mlir::FloatAttr XlaSelfAdjointEigOpAdaptor::epsilon() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::FloatAttr attr = odsAttrs.get("epsilon").cast<::mlir::FloatAttr>();
  return attr;
}

::mlir::LogicalResult XlaSelfAdjointEigOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_lower = odsAttrs.get("lower");
    if (!tblgen_lower)
      return emitError(loc, "'tf.XlaSelfAdjointEig' op ""requires attribute 'lower'");

    if (tblgen_lower && !((tblgen_lower.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.XlaSelfAdjointEig' op ""attribute 'lower' failed to satisfy constraint: bool attribute");
  }
  {
    auto tblgen_max_iter = odsAttrs.get("max_iter");
    if (!tblgen_max_iter)
      return emitError(loc, "'tf.XlaSelfAdjointEig' op ""requires attribute 'max_iter'");

    if (tblgen_max_iter && !(((tblgen_max_iter.isa<::mlir::IntegerAttr>())) && ((tblgen_max_iter.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.XlaSelfAdjointEig' op ""attribute 'max_iter' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_epsilon = odsAttrs.get("epsilon");
    if (!tblgen_epsilon)
      return emitError(loc, "'tf.XlaSelfAdjointEig' op ""requires attribute 'epsilon'");

    if (tblgen_epsilon && !(((tblgen_epsilon.isa<::mlir::FloatAttr>())) && ((tblgen_epsilon.cast<::mlir::FloatAttr>().getType().isF32()))))
      return emitError(loc, "'tf.XlaSelfAdjointEig' op ""attribute 'epsilon' failed to satisfy constraint: 32-bit float attribute");
  }
  return ::mlir::success();
}

void XlaSelfAdjointEigOp::getAsmResultNames(::mlir::OpAsmSetValueNameFn setNameFn) {
  auto resultGroup0 = getODSResults(0);
  if (!llvm::empty(resultGroup0))
    setNameFn(*resultGroup0.begin(), "w");
  auto resultGroup1 = getODSResults(1);
  if (!llvm::empty(resultGroup1))
    setNameFn(*resultGroup1.begin(), "v");
}

std::pair<unsigned, unsigned> XlaSelfAdjointEigOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range XlaSelfAdjointEigOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value XlaSelfAdjointEigOp::a() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange XlaSelfAdjointEigOp::aMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> XlaSelfAdjointEigOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range XlaSelfAdjointEigOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value XlaSelfAdjointEigOp::w() {
  return *getODSResults(0).begin();
}

::mlir::Value XlaSelfAdjointEigOp::v() {
  return *getODSResults(1).begin();
}

::mlir::BoolAttr XlaSelfAdjointEigOp::lowerAttr() {
  return (*this)->getAttr(lowerAttrName()).cast<::mlir::BoolAttr>();
}

bool XlaSelfAdjointEigOp::lower() {
  auto attr = lowerAttr();
  return attr.getValue();
}

::mlir::IntegerAttr XlaSelfAdjointEigOp::max_iterAttr() {
  return (*this)->getAttr(max_iterAttrName()).cast<::mlir::IntegerAttr>();
}

uint64_t XlaSelfAdjointEigOp::max_iter() {
  auto attr = max_iterAttr();
  return attr.getValue().getZExtValue();
}

::mlir::FloatAttr XlaSelfAdjointEigOp::epsilonAttr() {
  return (*this)->getAttr(epsilonAttrName()).cast<::mlir::FloatAttr>();
}

::llvm::APFloat XlaSelfAdjointEigOp::epsilon() {
  auto attr = epsilonAttr();
  return attr.getValue();
}

::mlir::Type XlaSelfAdjointEigOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool XlaSelfAdjointEigOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr XlaSelfAdjointEigOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void XlaSelfAdjointEigOp::lowerAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(lowerAttrName(), attr);
}

void XlaSelfAdjointEigOp::max_iterAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(max_iterAttrName(), attr);
}

void XlaSelfAdjointEigOp::epsilonAttr(::mlir::FloatAttr attr) {
  (*this)->setAttr(epsilonAttrName(), attr);
}

void XlaSelfAdjointEigOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type w, ::mlir::Type v, ::mlir::Value a, ::mlir::BoolAttr lower, ::mlir::IntegerAttr max_iter, ::mlir::FloatAttr epsilon) {
  odsState.addOperands(a);
  odsState.addAttribute(lowerAttrName(odsState.name), lower);
  odsState.addAttribute(max_iterAttrName(odsState.name), max_iter);
  odsState.addAttribute(epsilonAttrName(odsState.name), epsilon);
  odsState.addTypes(w);
  odsState.addTypes(v);
}

void XlaSelfAdjointEigOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value a, ::mlir::BoolAttr lower, ::mlir::IntegerAttr max_iter, ::mlir::FloatAttr epsilon) {
  odsState.addOperands(a);
  odsState.addAttribute(lowerAttrName(odsState.name), lower);
  odsState.addAttribute(max_iterAttrName(odsState.name), max_iter);
  odsState.addAttribute(epsilonAttrName(odsState.name), epsilon);
  assert(resultTypes.size() == 2u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void XlaSelfAdjointEigOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type w, ::mlir::Type v, ::mlir::Value a, bool lower, uint64_t max_iter, ::llvm::APFloat epsilon) {
  odsState.addOperands(a);
  odsState.addAttribute(lowerAttrName(odsState.name), odsBuilder.getBoolAttr(lower));
  odsState.addAttribute(max_iterAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), max_iter));
  odsState.addAttribute(epsilonAttrName(odsState.name), odsBuilder.getFloatAttr(odsBuilder.getF32Type(), epsilon));
  odsState.addTypes(w);
  odsState.addTypes(v);
}

void XlaSelfAdjointEigOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value a, bool lower, uint64_t max_iter, ::llvm::APFloat epsilon) {
  odsState.addOperands(a);
  odsState.addAttribute(lowerAttrName(odsState.name), odsBuilder.getBoolAttr(lower));
  odsState.addAttribute(max_iterAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), max_iter));
  odsState.addAttribute(epsilonAttrName(odsState.name), odsBuilder.getFloatAttr(odsBuilder.getF32Type(), epsilon));
  assert(resultTypes.size() == 2u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void XlaSelfAdjointEigOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 2u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult XlaSelfAdjointEigOp::verify() {
  {
    auto tblgen_lower = (*this)->getAttr(lowerAttrName());
    if (!tblgen_lower)
      return emitOpError("requires attribute 'lower'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_lower, "lower")))
      return ::mlir::failure();
  }
  {
    auto tblgen_max_iter = (*this)->getAttr(max_iterAttrName());
    if (!tblgen_max_iter)
      return emitOpError("requires attribute 'max_iter'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_max_iter, "max_iter")))
      return ::mlir::failure();
  }
  {
    auto tblgen_epsilon = (*this)->getAttr(epsilonAttrName());
    if (!tblgen_epsilon)
      return emitOpError("requires attribute 'epsilon'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops5(*this, tblgen_epsilon, "epsilon")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSResults(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void XlaSelfAdjointEigOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::XlaSelfAdjointEigOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::XlaSendToHostOp definitions
//===----------------------------------------------------------------------===//

XlaSendToHostOpAdaptor::XlaSendToHostOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

XlaSendToHostOpAdaptor::XlaSendToHostOpAdaptor(XlaSendToHostOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange XlaSendToHostOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> XlaSendToHostOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange XlaSendToHostOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value XlaSendToHostOpAdaptor::input() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr XlaSendToHostOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::StringAttr XlaSendToHostOpAdaptor::key() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("key").cast<::mlir::StringAttr>();
  return attr;
}

::mlir::LogicalResult XlaSendToHostOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_key = odsAttrs.get("key");
    if (!tblgen_key)
      return emitError(loc, "'tf.XlaSendToHost' op ""requires attribute 'key'");

    if (tblgen_key && !((tblgen_key.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.XlaSendToHost' op ""attribute 'key' failed to satisfy constraint: string attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> XlaSendToHostOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range XlaSendToHostOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value XlaSendToHostOp::input() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange XlaSendToHostOp::inputMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> XlaSendToHostOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range XlaSendToHostOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::StringAttr XlaSendToHostOp::keyAttr() {
  return (*this)->getAttr(keyAttrName()).cast<::mlir::StringAttr>();
}

::llvm::StringRef XlaSendToHostOp::key() {
  auto attr = keyAttr();
  return attr.getValue();
}

::mlir::Type XlaSendToHostOp::Tinput() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool XlaSendToHostOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "Tinput") return true;
 return false;
}

::mlir::DictionaryAttr XlaSendToHostOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TinputAttrName(),
::mlir::TypeAttr::get(Tinput())}});
}

void XlaSendToHostOp::keyAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(keyAttrName(), attr);
}

void XlaSendToHostOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value input, ::mlir::StringAttr key) {
  odsState.addOperands(input);
  odsState.addAttribute(keyAttrName(odsState.name), key);
}

void XlaSendToHostOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::StringAttr key) {
  odsState.addOperands(input);
  odsState.addAttribute(keyAttrName(odsState.name), key);
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void XlaSendToHostOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value input, ::llvm::StringRef key) {
  odsState.addOperands(input);
  odsState.addAttribute(keyAttrName(odsState.name), odsBuilder.getStringAttr(key));
}

void XlaSendToHostOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::llvm::StringRef key) {
  odsState.addOperands(input);
  odsState.addAttribute(keyAttrName(odsState.name), odsBuilder.getStringAttr(key));
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void XlaSendToHostOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 0u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult XlaSendToHostOp::verify() {
  {
    auto tblgen_key = (*this)->getAttr(keyAttrName());
    if (!tblgen_key)
      return emitOpError("requires attribute 'key'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_key, "key")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void XlaSendToHostOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  effects.emplace_back(::mlir::MemoryEffects::Write::get(), ::mlir::TF::ResourceEffects::SendRecv::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::XlaSendToHostOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::XlaSetDynamicDimensionSizeOp definitions
//===----------------------------------------------------------------------===//

XlaSetDynamicDimensionSizeOpAdaptor::XlaSetDynamicDimensionSizeOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

XlaSetDynamicDimensionSizeOpAdaptor::XlaSetDynamicDimensionSizeOpAdaptor(XlaSetDynamicDimensionSizeOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange XlaSetDynamicDimensionSizeOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> XlaSetDynamicDimensionSizeOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange XlaSetDynamicDimensionSizeOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value XlaSetDynamicDimensionSizeOpAdaptor::input() {
  return *getODSOperands(0).begin();
}

::mlir::Value XlaSetDynamicDimensionSizeOpAdaptor::dim_index() {
  return *getODSOperands(1).begin();
}

::mlir::Value XlaSetDynamicDimensionSizeOpAdaptor::size() {
  return *getODSOperands(2).begin();
}

::mlir::DictionaryAttr XlaSetDynamicDimensionSizeOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult XlaSetDynamicDimensionSizeOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> XlaSetDynamicDimensionSizeOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range XlaSetDynamicDimensionSizeOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value XlaSetDynamicDimensionSizeOp::input() {
  return *getODSOperands(0).begin();
}

::mlir::Value XlaSetDynamicDimensionSizeOp::dim_index() {
  return *getODSOperands(1).begin();
}

::mlir::Value XlaSetDynamicDimensionSizeOp::size() {
  return *getODSOperands(2).begin();
}

::mlir::MutableOperandRange XlaSetDynamicDimensionSizeOp::inputMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange XlaSetDynamicDimensionSizeOp::dim_indexMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange XlaSetDynamicDimensionSizeOp::sizeMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> XlaSetDynamicDimensionSizeOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range XlaSetDynamicDimensionSizeOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value XlaSetDynamicDimensionSizeOp::output() {
  return *getODSResults(0).begin();
}

::mlir::Type XlaSetDynamicDimensionSizeOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool XlaSetDynamicDimensionSizeOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr XlaSetDynamicDimensionSizeOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void XlaSetDynamicDimensionSizeOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input, ::mlir::Value dim_index, ::mlir::Value size) {
  odsState.addOperands(input);
  odsState.addOperands(dim_index);
  odsState.addOperands(size);
  odsState.addTypes(output);
}

void XlaSetDynamicDimensionSizeOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value input, ::mlir::Value dim_index, ::mlir::Value size) {
  odsState.addOperands(input);
  odsState.addOperands(dim_index);
  odsState.addOperands(size);

        ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
        if (::mlir::succeeded(XlaSetDynamicDimensionSizeOp::inferReturnTypes(odsBuilder.getContext(),
                      odsState.location, odsState.operands,
                      odsState.attributes.getDictionary(odsState.getContext()),
                      /*regions=*/{}, inferredReturnTypes)))
          odsState.addTypes(inferredReturnTypes);
        else
          ::llvm::report_fatal_error("Failed to infer result type(s).");
}

void XlaSetDynamicDimensionSizeOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::Value dim_index, ::mlir::Value size) {
  odsState.addOperands(input);
  odsState.addOperands(dim_index);
  odsState.addOperands(size);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void XlaSetDynamicDimensionSizeOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 3u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

void XlaSetDynamicDimensionSizeOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 3u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);

  ::mlir::SmallVector<::mlir::Type, 2> inferredReturnTypes;
  if (::mlir::succeeded(XlaSetDynamicDimensionSizeOp::inferReturnTypes(odsBuilder.getContext(),
          odsState.location, operands,
          odsState.attributes.getDictionary(odsState.getContext()),
          odsState.regions, inferredReturnTypes))) {
    assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
    odsState.addTypes(inferredReturnTypes);
  } else {
    ::llvm::report_fatal_error("Failed to infer result type(s).");
  }
}

::mlir::LogicalResult XlaSetDynamicDimensionSizeOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops11(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops11(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void XlaSetDynamicDimensionSizeOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::XlaSetDynamicDimensionSizeOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::XlaShardingOp definitions
//===----------------------------------------------------------------------===//

XlaShardingOpAdaptor::XlaShardingOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

XlaShardingOpAdaptor::XlaShardingOpAdaptor(XlaShardingOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange XlaShardingOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> XlaShardingOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange XlaShardingOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value XlaShardingOpAdaptor::input() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr XlaShardingOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::StringAttr XlaShardingOpAdaptor::sharding() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("sharding").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("");
  return attr;
}

::mlir::StringAttr XlaShardingOpAdaptor::_XlaSharding() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("_XlaSharding").dyn_cast_or_null<::mlir::StringAttr>();
  return attr;
}

::mlir::LogicalResult XlaShardingOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_sharding = odsAttrs.get("sharding");
    if (tblgen_sharding && !((tblgen_sharding.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.XlaSharding' op ""attribute 'sharding' failed to satisfy constraint: string attribute");
  }
  {
    auto tblgen__XlaSharding = odsAttrs.get("_XlaSharding");
    if (tblgen__XlaSharding && !((tblgen__XlaSharding.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.XlaSharding' op ""attribute '_XlaSharding' failed to satisfy constraint: string attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> XlaShardingOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range XlaShardingOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value XlaShardingOp::input() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange XlaShardingOp::inputMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> XlaShardingOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range XlaShardingOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value XlaShardingOp::output() {
  return *getODSResults(0).begin();
}

::mlir::StringAttr XlaShardingOp::shardingAttr() {
  return (*this)->getAttr(shardingAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef XlaShardingOp::sharding() {
  auto attr = shardingAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("").getValue();
  return attr.getValue();
}

::mlir::StringAttr XlaShardingOp::_XlaShardingAttr() {
  return (*this)->getAttr(_XlaShardingAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::Optional< ::llvm::StringRef > XlaShardingOp::_XlaSharding() {
  auto attr = _XlaShardingAttr();
  return attr ? ::llvm::Optional< ::llvm::StringRef >(attr.getValue()) : (::llvm::None);
}

::mlir::Type XlaShardingOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool XlaShardingOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr XlaShardingOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void XlaShardingOp::shardingAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(shardingAttrName(), attr);
}

void XlaShardingOp::_XlaShardingAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(_XlaShardingAttrName(), attr);
}

::mlir::Attribute XlaShardingOp::remove_XlaShardingAttr() {
  return (*this)->removeAttr(_XlaShardingAttrName());
}

void XlaShardingOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input, ::mlir::StringAttr sharding, /*optional*/::mlir::StringAttr _XlaSharding) {
  odsState.addOperands(input);
  odsState.addAttribute(shardingAttrName(odsState.name), sharding);
  if (_XlaSharding) {
  odsState.addAttribute(_XlaShardingAttrName(odsState.name), _XlaSharding);
  }
  odsState.addTypes(output);
}

void XlaShardingOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::StringAttr sharding, /*optional*/::mlir::StringAttr _XlaSharding) {
  odsState.addOperands(input);
  odsState.addAttribute(shardingAttrName(odsState.name), sharding);
  if (_XlaSharding) {
  odsState.addAttribute(_XlaShardingAttrName(odsState.name), _XlaSharding);
  }
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void XlaShardingOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input, ::llvm::StringRef sharding, /*optional*/::mlir::StringAttr _XlaSharding) {
  odsState.addOperands(input);
  odsState.addAttribute(shardingAttrName(odsState.name), odsBuilder.getStringAttr(sharding));
  if (_XlaSharding) {
  odsState.addAttribute(_XlaShardingAttrName(odsState.name), _XlaSharding);
  }
  odsState.addTypes(output);
}

void XlaShardingOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::llvm::StringRef sharding, /*optional*/::mlir::StringAttr _XlaSharding) {
  odsState.addOperands(input);
  odsState.addAttribute(shardingAttrName(odsState.name), odsBuilder.getStringAttr(sharding));
  if (_XlaSharding) {
  odsState.addAttribute(_XlaShardingAttrName(odsState.name), _XlaSharding);
  }
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void XlaShardingOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult XlaShardingOp::verify() {
  {
    auto tblgen_sharding = (*this)->getAttr(shardingAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_sharding, "sharding")))
      return ::mlir::failure();
  }
  {
    auto tblgen__XlaSharding = (*this)->getAttr(_XlaShardingAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen__XlaSharding, "_XlaSharding")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void XlaShardingOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::XlaShardingOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::XlaSortOp definitions
//===----------------------------------------------------------------------===//

XlaSortOpAdaptor::XlaSortOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

XlaSortOpAdaptor::XlaSortOpAdaptor(XlaSortOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange XlaSortOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> XlaSortOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange XlaSortOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value XlaSortOpAdaptor::input() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr XlaSortOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult XlaSortOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> XlaSortOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range XlaSortOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value XlaSortOp::input() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange XlaSortOp::inputMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> XlaSortOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range XlaSortOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value XlaSortOp::output() {
  return *getODSResults(0).begin();
}

::mlir::Type XlaSortOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool XlaSortOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr XlaSortOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void XlaSortOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input) {
  odsState.addOperands(input);
  odsState.addTypes(output);
}

void XlaSortOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input) {
  odsState.addOperands(input);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void XlaSortOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult XlaSortOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void XlaSortOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::XlaSortOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::XlaSvdOp definitions
//===----------------------------------------------------------------------===//

XlaSvdOpAdaptor::XlaSvdOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

XlaSvdOpAdaptor::XlaSvdOpAdaptor(XlaSvdOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange XlaSvdOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> XlaSvdOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange XlaSvdOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value XlaSvdOpAdaptor::a() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr XlaSvdOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::IntegerAttr XlaSvdOpAdaptor::max_iter() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("max_iter").cast<::mlir::IntegerAttr>();
  return attr;
}

::mlir::FloatAttr XlaSvdOpAdaptor::epsilon() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::FloatAttr attr = odsAttrs.get("epsilon").cast<::mlir::FloatAttr>();
  return attr;
}

::mlir::StringAttr XlaSvdOpAdaptor::precision_config() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("precision_config").cast<::mlir::StringAttr>();
  return attr;
}

::mlir::LogicalResult XlaSvdOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_max_iter = odsAttrs.get("max_iter");
    if (!tblgen_max_iter)
      return emitError(loc, "'tf.XlaSvd' op ""requires attribute 'max_iter'");

    if (tblgen_max_iter && !(((tblgen_max_iter.isa<::mlir::IntegerAttr>())) && ((tblgen_max_iter.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf.XlaSvd' op ""attribute 'max_iter' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_epsilon = odsAttrs.get("epsilon");
    if (!tblgen_epsilon)
      return emitError(loc, "'tf.XlaSvd' op ""requires attribute 'epsilon'");

    if (tblgen_epsilon && !(((tblgen_epsilon.isa<::mlir::FloatAttr>())) && ((tblgen_epsilon.cast<::mlir::FloatAttr>().getType().isF32()))))
      return emitError(loc, "'tf.XlaSvd' op ""attribute 'epsilon' failed to satisfy constraint: 32-bit float attribute");
  }
  {
    auto tblgen_precision_config = odsAttrs.get("precision_config");
    if (!tblgen_precision_config)
      return emitError(loc, "'tf.XlaSvd' op ""requires attribute 'precision_config'");

    if (tblgen_precision_config && !((tblgen_precision_config.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf.XlaSvd' op ""attribute 'precision_config' failed to satisfy constraint: string attribute");
  }
  return ::mlir::success();
}

void XlaSvdOp::getAsmResultNames(::mlir::OpAsmSetValueNameFn setNameFn) {
  auto resultGroup0 = getODSResults(0);
  if (!llvm::empty(resultGroup0))
    setNameFn(*resultGroup0.begin(), "s");
  auto resultGroup1 = getODSResults(1);
  if (!llvm::empty(resultGroup1))
    setNameFn(*resultGroup1.begin(), "u");
  auto resultGroup2 = getODSResults(2);
  if (!llvm::empty(resultGroup2))
    setNameFn(*resultGroup2.begin(), "v");
}

std::pair<unsigned, unsigned> XlaSvdOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range XlaSvdOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value XlaSvdOp::a() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange XlaSvdOp::aMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> XlaSvdOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range XlaSvdOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value XlaSvdOp::s() {
  return *getODSResults(0).begin();
}

::mlir::Value XlaSvdOp::u() {
  return *getODSResults(1).begin();
}

::mlir::Value XlaSvdOp::v() {
  return *getODSResults(2).begin();
}

::mlir::IntegerAttr XlaSvdOp::max_iterAttr() {
  return (*this)->getAttr(max_iterAttrName()).cast<::mlir::IntegerAttr>();
}

uint64_t XlaSvdOp::max_iter() {
  auto attr = max_iterAttr();
  return attr.getValue().getZExtValue();
}

::mlir::FloatAttr XlaSvdOp::epsilonAttr() {
  return (*this)->getAttr(epsilonAttrName()).cast<::mlir::FloatAttr>();
}

::llvm::APFloat XlaSvdOp::epsilon() {
  auto attr = epsilonAttr();
  return attr.getValue();
}

::mlir::StringAttr XlaSvdOp::precision_configAttr() {
  return (*this)->getAttr(precision_configAttrName()).cast<::mlir::StringAttr>();
}

::llvm::StringRef XlaSvdOp::precision_config() {
  auto attr = precision_configAttr();
  return attr.getValue();
}

::mlir::Type XlaSvdOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool XlaSvdOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr XlaSvdOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void XlaSvdOp::max_iterAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(max_iterAttrName(), attr);
}

void XlaSvdOp::epsilonAttr(::mlir::FloatAttr attr) {
  (*this)->setAttr(epsilonAttrName(), attr);
}

void XlaSvdOp::precision_configAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(precision_configAttrName(), attr);
}

void XlaSvdOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type s, ::mlir::Type u, ::mlir::Type v, ::mlir::Value a, ::mlir::IntegerAttr max_iter, ::mlir::FloatAttr epsilon, ::mlir::StringAttr precision_config) {
  odsState.addOperands(a);
  odsState.addAttribute(max_iterAttrName(odsState.name), max_iter);
  odsState.addAttribute(epsilonAttrName(odsState.name), epsilon);
  odsState.addAttribute(precision_configAttrName(odsState.name), precision_config);
  odsState.addTypes(s);
  odsState.addTypes(u);
  odsState.addTypes(v);
}

void XlaSvdOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value a, ::mlir::IntegerAttr max_iter, ::mlir::FloatAttr epsilon, ::mlir::StringAttr precision_config) {
  odsState.addOperands(a);
  odsState.addAttribute(max_iterAttrName(odsState.name), max_iter);
  odsState.addAttribute(epsilonAttrName(odsState.name), epsilon);
  odsState.addAttribute(precision_configAttrName(odsState.name), precision_config);
  assert(resultTypes.size() == 3u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void XlaSvdOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type s, ::mlir::Type u, ::mlir::Type v, ::mlir::Value a, uint64_t max_iter, ::llvm::APFloat epsilon, ::llvm::StringRef precision_config) {
  odsState.addOperands(a);
  odsState.addAttribute(max_iterAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), max_iter));
  odsState.addAttribute(epsilonAttrName(odsState.name), odsBuilder.getFloatAttr(odsBuilder.getF32Type(), epsilon));
  odsState.addAttribute(precision_configAttrName(odsState.name), odsBuilder.getStringAttr(precision_config));
  odsState.addTypes(s);
  odsState.addTypes(u);
  odsState.addTypes(v);
}

void XlaSvdOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value a, uint64_t max_iter, ::llvm::APFloat epsilon, ::llvm::StringRef precision_config) {
  odsState.addOperands(a);
  odsState.addAttribute(max_iterAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), max_iter));
  odsState.addAttribute(epsilonAttrName(odsState.name), odsBuilder.getFloatAttr(odsBuilder.getF32Type(), epsilon));
  odsState.addAttribute(precision_configAttrName(odsState.name), odsBuilder.getStringAttr(precision_config));
  assert(resultTypes.size() == 3u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void XlaSvdOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 3u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult XlaSvdOp::verify() {
  {
    auto tblgen_max_iter = (*this)->getAttr(max_iterAttrName());
    if (!tblgen_max_iter)
      return emitOpError("requires attribute 'max_iter'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_max_iter, "max_iter")))
      return ::mlir::failure();
  }
  {
    auto tblgen_epsilon = (*this)->getAttr(epsilonAttrName());
    if (!tblgen_epsilon)
      return emitOpError("requires attribute 'epsilon'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops5(*this, tblgen_epsilon, "epsilon")))
      return ::mlir::failure();
  }
  {
    auto tblgen_precision_config = (*this)->getAttr(precision_configAttrName());
    if (!tblgen_precision_config)
      return emitOpError("requires attribute 'precision_config'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_precision_config, "precision_config")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSResults(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSResults(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops17(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void XlaSvdOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::XlaSvdOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::XlaVariadicReduceOp definitions
//===----------------------------------------------------------------------===//

XlaVariadicReduceOpAdaptor::XlaVariadicReduceOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

XlaVariadicReduceOpAdaptor::XlaVariadicReduceOpAdaptor(XlaVariadicReduceOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange XlaVariadicReduceOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> XlaVariadicReduceOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  bool isVariadic[] = {true, true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (odsOperands.size() - 0) / 2;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::ValueRange XlaVariadicReduceOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::ValueRange XlaVariadicReduceOpAdaptor::input() {
  return getODSOperands(0);
}

::mlir::ValueRange XlaVariadicReduceOpAdaptor::init_value() {
  return getODSOperands(1);
}

::mlir::DictionaryAttr XlaVariadicReduceOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::ArrayAttr XlaVariadicReduceOpAdaptor::dimensions_to_reduce() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("dimensions_to_reduce").cast<::mlir::ArrayAttr>();
  return attr;
}

::mlir::SymbolRefAttr XlaVariadicReduceOpAdaptor::reducer() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::SymbolRefAttr attr = odsAttrs.get("reducer").cast<::mlir::SymbolRefAttr>();
  return attr;
}

::mlir::LogicalResult XlaVariadicReduceOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_dimensions_to_reduce = odsAttrs.get("dimensions_to_reduce");
    if (!tblgen_dimensions_to_reduce)
      return emitError(loc, "'tf.XlaVariadicReduce' op ""requires attribute 'dimensions_to_reduce'");

    if (tblgen_dimensions_to_reduce && !(((tblgen_dimensions_to_reduce.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_dimensions_to_reduce.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return ((attr.isa<::mlir::IntegerAttr>())) && ((attr.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64))); }))))
      return emitError(loc, "'tf.XlaVariadicReduce' op ""attribute 'dimensions_to_reduce' failed to satisfy constraint: 64-bit integer array attribute");
  }
  {
    auto tblgen_reducer = odsAttrs.get("reducer");
    if (!tblgen_reducer)
      return emitError(loc, "'tf.XlaVariadicReduce' op ""requires attribute 'reducer'");

    if (tblgen_reducer && !((tblgen_reducer.isa<::mlir::SymbolRefAttr>())))
      return emitError(loc, "'tf.XlaVariadicReduce' op ""attribute 'reducer' failed to satisfy constraint: symbol reference attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> XlaVariadicReduceOp::getODSOperandIndexAndLength(unsigned index) {
  bool isVariadic[] = {true, true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (getOperation()->getNumOperands() - 0) / 2;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::Operation::operand_range XlaVariadicReduceOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Operation::operand_range XlaVariadicReduceOp::input() {
  return getODSOperands(0);
}

::mlir::Operation::operand_range XlaVariadicReduceOp::init_value() {
  return getODSOperands(1);
}

::mlir::MutableOperandRange XlaVariadicReduceOp::inputMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange XlaVariadicReduceOp::init_valueMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> XlaVariadicReduceOp::getODSResultIndexAndLength(unsigned index) {
  bool isVariadic[] = {true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (getOperation()->getNumResults() - 0) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::Operation::result_range XlaVariadicReduceOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Operation::result_range XlaVariadicReduceOp::output() {
  return getODSResults(0);
}

::mlir::ArrayAttr XlaVariadicReduceOp::dimensions_to_reduceAttr() {
  return (*this)->getAttr(dimensions_to_reduceAttrName()).cast<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr XlaVariadicReduceOp::dimensions_to_reduce() {
  auto attr = dimensions_to_reduceAttr();
  return attr;
}

::mlir::SymbolRefAttr XlaVariadicReduceOp::reducerAttr() {
  return (*this)->getAttr(reducerAttrName()).cast<::mlir::SymbolRefAttr>();
}

::mlir::SymbolRefAttr XlaVariadicReduceOp::reducer() {
  auto attr = reducerAttr();
  return attr;
}

size_t XlaVariadicReduceOp::N() {
  auto range = getODSOperands(0);
return std::distance(range.begin(), range.end());
}

::mlir::Type XlaVariadicReduceOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool XlaVariadicReduceOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "N") return true;
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr XlaVariadicReduceOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {NAttrName(),
odsBuilder.getI64IntegerAttr(N())},
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void XlaVariadicReduceOp::dimensions_to_reduceAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(dimensions_to_reduceAttrName(), attr);
}

void XlaVariadicReduceOp::reducerAttr(::mlir::SymbolRefAttr attr) {
  (*this)->setAttr(reducerAttrName(), attr);
}

void XlaVariadicReduceOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange output, ::mlir::ValueRange input, ::mlir::ValueRange init_value, ::mlir::ArrayAttr dimensions_to_reduce, ::mlir::SymbolRefAttr reducer) {
  odsState.addOperands(input);
  odsState.addOperands(init_value);
  odsState.addAttribute(dimensions_to_reduceAttrName(odsState.name), dimensions_to_reduce);
  odsState.addAttribute(reducerAttrName(odsState.name), reducer);
  odsState.addTypes(output);
}

void XlaVariadicReduceOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult XlaVariadicReduceOp::verify() {
  {
    auto tblgen_dimensions_to_reduce = (*this)->getAttr(dimensions_to_reduceAttrName());
    if (!tblgen_dimensions_to_reduce)
      return emitOpError("requires attribute 'dimensions_to_reduce'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops13(*this, tblgen_dimensions_to_reduce, "dimensions_to_reduce")))
      return ::mlir::failure();
  }
  {
    auto tblgen_reducer = (*this)->getAttr(reducerAttrName());
    if (!tblgen_reducer)
      return emitOpError("requires attribute 'reducer'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops12(*this, tblgen_reducer, "reducer")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops10(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops10(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops10(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return Verify(*this);
}

void XlaVariadicReduceOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::XlaVariadicReduceOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::XlaVariadicReduceV2Op definitions
//===----------------------------------------------------------------------===//

XlaVariadicReduceV2OpAdaptor::XlaVariadicReduceV2OpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

XlaVariadicReduceV2OpAdaptor::XlaVariadicReduceV2OpAdaptor(XlaVariadicReduceV2Op &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange XlaVariadicReduceV2OpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> XlaVariadicReduceV2OpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  assert(odsAttrs && "missing segment size attribute for op");
  auto sizeAttr = odsAttrs.get("operand_segment_sizes").cast<::mlir::DenseIntElementsAttr>();

  const uint32_t *sizeAttrValueIt = &*sizeAttr.value_begin<uint32_t>();
  if (sizeAttr.isSplat())
    return {*sizeAttrValueIt * index, *sizeAttrValueIt};

  unsigned start = 0;
  for (unsigned i = 0; i < index; ++i)
    start += sizeAttrValueIt[i];
  return {start, sizeAttrValueIt[index]};
}

::mlir::ValueRange XlaVariadicReduceV2OpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::ValueRange XlaVariadicReduceV2OpAdaptor::inputs() {
  return getODSOperands(0);
}

::mlir::ValueRange XlaVariadicReduceV2OpAdaptor::init_values() {
  return getODSOperands(1);
}

::mlir::DictionaryAttr XlaVariadicReduceV2OpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::ArrayAttr XlaVariadicReduceV2OpAdaptor::dimensions_to_reduce() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("dimensions_to_reduce").cast<::mlir::ArrayAttr>();
  return attr;
}

::mlir::SymbolRefAttr XlaVariadicReduceV2OpAdaptor::reducer() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::SymbolRefAttr attr = odsAttrs.get("reducer").cast<::mlir::SymbolRefAttr>();
  return attr;
}

::mlir::LogicalResult XlaVariadicReduceV2OpAdaptor::verify(::mlir::Location loc) {
  {
    auto sizeAttr = odsAttrs.get("operand_segment_sizes").dyn_cast<::mlir::DenseIntElementsAttr>();
    if (!sizeAttr)
      return emitError(loc, "'tf.XlaVariadicReduceV2' op ""missing segment sizes attribute 'operand_segment_sizes'");
    auto numElements =
        sizeAttr.getType().cast<::mlir::ShapedType>().getNumElements();
    if (numElements != 2)
      return emitError(loc, "'tf.XlaVariadicReduceV2' op ""'operand_segment_sizes' attribute for specifying operand segments must have 2 "
                "elements, but got ") << numElements;
  }
    {
    auto tblgen_dimensions_to_reduce = odsAttrs.get("dimensions_to_reduce");
    if (!tblgen_dimensions_to_reduce)
      return emitError(loc, "'tf.XlaVariadicReduceV2' op ""requires attribute 'dimensions_to_reduce'");

    if (tblgen_dimensions_to_reduce && !(((tblgen_dimensions_to_reduce.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_dimensions_to_reduce.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return ((attr.isa<::mlir::IntegerAttr>())) && ((attr.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64))); }))))
      return emitError(loc, "'tf.XlaVariadicReduceV2' op ""attribute 'dimensions_to_reduce' failed to satisfy constraint: 64-bit integer array attribute");
  }
  {
    auto tblgen_reducer = odsAttrs.get("reducer");
    if (!tblgen_reducer)
      return emitError(loc, "'tf.XlaVariadicReduceV2' op ""requires attribute 'reducer'");

    if (tblgen_reducer && !((tblgen_reducer.isa<::mlir::SymbolRefAttr>())))
      return emitError(loc, "'tf.XlaVariadicReduceV2' op ""attribute 'reducer' failed to satisfy constraint: symbol reference attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> XlaVariadicReduceV2Op::getODSOperandIndexAndLength(unsigned index) {
  auto sizeAttr =
      (*this)->getAttr(operand_segment_sizesAttrName()).cast<::mlir::DenseIntElementsAttr>();

  const uint32_t *sizeAttrValueIt = &*sizeAttr.value_begin<uint32_t>();
  if (sizeAttr.isSplat())
    return {*sizeAttrValueIt * index, *sizeAttrValueIt};

  unsigned start = 0;
  for (unsigned i = 0; i < index; ++i)
    start += sizeAttrValueIt[i];
  return {start, sizeAttrValueIt[index]};
}

::mlir::Operation::operand_range XlaVariadicReduceV2Op::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Operation::operand_range XlaVariadicReduceV2Op::inputs() {
  return getODSOperands(0);
}

::mlir::Operation::operand_range XlaVariadicReduceV2Op::init_values() {
  return getODSOperands(1);
}

::mlir::MutableOperandRange XlaVariadicReduceV2Op::inputsMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second, ::mlir::MutableOperandRange::OperandSegment(0u, *getOperation()->getAttrDictionary().getNamed(operand_segment_sizesAttrName())));
  return mutableRange;
}

::mlir::MutableOperandRange XlaVariadicReduceV2Op::init_valuesMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second, ::mlir::MutableOperandRange::OperandSegment(1u, *getOperation()->getAttrDictionary().getNamed(operand_segment_sizesAttrName())));
  return mutableRange;
}

std::pair<unsigned, unsigned> XlaVariadicReduceV2Op::getODSResultIndexAndLength(unsigned index) {
  bool isVariadic[] = {true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (getOperation()->getNumResults() - 0) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::Operation::result_range XlaVariadicReduceV2Op::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Operation::result_range XlaVariadicReduceV2Op::outputs() {
  return getODSResults(0);
}

::mlir::ArrayAttr XlaVariadicReduceV2Op::dimensions_to_reduceAttr() {
  return (*this)->getAttr(dimensions_to_reduceAttrName()).cast<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr XlaVariadicReduceV2Op::dimensions_to_reduce() {
  auto attr = dimensions_to_reduceAttr();
  return attr;
}

::mlir::SymbolRefAttr XlaVariadicReduceV2Op::reducerAttr() {
  return (*this)->getAttr(reducerAttrName()).cast<::mlir::SymbolRefAttr>();
}

::mlir::SymbolRefAttr XlaVariadicReduceV2Op::reducer() {
  auto attr = reducerAttr();
  return attr;
}

mlir::OperandElementTypeRange XlaVariadicReduceV2Op::T() {
  auto values = getODSOperands(0);
return {mlir::OperandElementTypeIterator(values.begin()), mlir::OperandElementTypeIterator(values.end())};
}

bool XlaVariadicReduceV2Op::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr XlaVariadicReduceV2Op::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
ArrayAttr::get(ctx, 
    [&]() {
      llvm::SmallVector<Attribute, 4> ret;
      for (auto t : T())
        ret.push_back(TypeAttr::get(t));
      return ret;
    }())}});
}

void XlaVariadicReduceV2Op::dimensions_to_reduceAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(dimensions_to_reduceAttrName(), attr);
}

void XlaVariadicReduceV2Op::reducerAttr(::mlir::SymbolRefAttr attr) {
  (*this)->setAttr(reducerAttrName(), attr);
}

void XlaVariadicReduceV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange outputs, ::mlir::ValueRange inputs, ::mlir::ValueRange init_values, ::mlir::ArrayAttr dimensions_to_reduce, ::mlir::SymbolRefAttr reducer) {
  odsState.addOperands(inputs);
  odsState.addOperands(init_values);
  odsState.addAttribute(operand_segment_sizesAttrName(odsState.name), odsBuilder.getI32VectorAttr({static_cast<int32_t>(inputs.size()), static_cast<int32_t>(init_values.size())}));
  odsState.addAttribute(dimensions_to_reduceAttrName(odsState.name), dimensions_to_reduce);
  odsState.addAttribute(reducerAttrName(odsState.name), reducer);
  odsState.addTypes(outputs);
}

void XlaVariadicReduceV2Op::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult XlaVariadicReduceV2Op::verify() {
  {
    auto sizeAttr = (*this)->getAttr(operand_segment_sizesAttrName()).dyn_cast<::mlir::DenseIntElementsAttr>();
    if (!sizeAttr)
      return emitOpError("missing segment sizes attribute 'operand_segment_sizes'");
    auto numElements =
        sizeAttr.getType().cast<::mlir::ShapedType>().getNumElements();
    if (numElements != 2)
      return emitOpError("'operand_segment_sizes' attribute for specifying operand segments must have 2 "
                "elements, but got ") << numElements;
  }
    {
    auto tblgen_dimensions_to_reduce = (*this)->getAttr(dimensions_to_reduceAttrName());
    if (!tblgen_dimensions_to_reduce)
      return emitOpError("requires attribute 'dimensions_to_reduce'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops13(*this, tblgen_dimensions_to_reduce, "dimensions_to_reduce")))
      return ::mlir::failure();
  }
  {
    auto tblgen_reducer = (*this)->getAttr(reducerAttrName());
    if (!tblgen_reducer)
      return emitOpError("requires attribute 'reducer'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops12(*this, tblgen_reducer, "reducer")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return Verify(*this);
}

void XlaVariadicReduceV2Op::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::XlaVariadicReduceV2Op)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::XlaVariadicSortOp definitions
//===----------------------------------------------------------------------===//

XlaVariadicSortOpAdaptor::XlaVariadicSortOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

XlaVariadicSortOpAdaptor::XlaVariadicSortOpAdaptor(XlaVariadicSortOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange XlaVariadicSortOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> XlaVariadicSortOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  bool isVariadic[] = {true, false};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (odsOperands.size() - 1) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::ValueRange XlaVariadicSortOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::ValueRange XlaVariadicSortOpAdaptor::inputs() {
  return getODSOperands(0);
}

::mlir::Value XlaVariadicSortOpAdaptor::dimension() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr XlaVariadicSortOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::SymbolRefAttr XlaVariadicSortOpAdaptor::comparator() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::SymbolRefAttr attr = odsAttrs.get("comparator").cast<::mlir::SymbolRefAttr>();
  return attr;
}

::mlir::BoolAttr XlaVariadicSortOpAdaptor::is_stable() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("is_stable").cast<::mlir::BoolAttr>();
  return attr;
}

::mlir::LogicalResult XlaVariadicSortOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_comparator = odsAttrs.get("comparator");
    if (!tblgen_comparator)
      return emitError(loc, "'tf.XlaVariadicSort' op ""requires attribute 'comparator'");

    if (tblgen_comparator && !((tblgen_comparator.isa<::mlir::SymbolRefAttr>())))
      return emitError(loc, "'tf.XlaVariadicSort' op ""attribute 'comparator' failed to satisfy constraint: symbol reference attribute");
  }
  {
    auto tblgen_is_stable = odsAttrs.get("is_stable");
    if (!tblgen_is_stable)
      return emitError(loc, "'tf.XlaVariadicSort' op ""requires attribute 'is_stable'");

    if (tblgen_is_stable && !((tblgen_is_stable.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf.XlaVariadicSort' op ""attribute 'is_stable' failed to satisfy constraint: bool attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> XlaVariadicSortOp::getODSOperandIndexAndLength(unsigned index) {
  bool isVariadic[] = {true, false};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (getOperation()->getNumOperands() - 1) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::Operation::operand_range XlaVariadicSortOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Operation::operand_range XlaVariadicSortOp::inputs() {
  return getODSOperands(0);
}

::mlir::Value XlaVariadicSortOp::dimension() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange XlaVariadicSortOp::inputsMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange XlaVariadicSortOp::dimensionMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> XlaVariadicSortOp::getODSResultIndexAndLength(unsigned index) {
  bool isVariadic[] = {true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (getOperation()->getNumResults() - 0) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::Operation::result_range XlaVariadicSortOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Operation::result_range XlaVariadicSortOp::outputs() {
  return getODSResults(0);
}

::mlir::SymbolRefAttr XlaVariadicSortOp::comparatorAttr() {
  return (*this)->getAttr(comparatorAttrName()).cast<::mlir::SymbolRefAttr>();
}

::mlir::SymbolRefAttr XlaVariadicSortOp::comparator() {
  auto attr = comparatorAttr();
  return attr;
}

::mlir::BoolAttr XlaVariadicSortOp::is_stableAttr() {
  return (*this)->getAttr(is_stableAttrName()).cast<::mlir::BoolAttr>();
}

bool XlaVariadicSortOp::is_stable() {
  auto attr = is_stableAttr();
  return attr.getValue();
}

mlir::OperandElementTypeRange XlaVariadicSortOp::T() {
  auto values = getODSOperands(0);
return {mlir::OperandElementTypeIterator(values.begin()), mlir::OperandElementTypeIterator(values.end())};
}

bool XlaVariadicSortOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr XlaVariadicSortOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
ArrayAttr::get(ctx, 
    [&]() {
      llvm::SmallVector<Attribute, 4> ret;
      for (auto t : T())
        ret.push_back(TypeAttr::get(t));
      return ret;
    }())}});
}

void XlaVariadicSortOp::comparatorAttr(::mlir::SymbolRefAttr attr) {
  (*this)->setAttr(comparatorAttrName(), attr);
}

void XlaVariadicSortOp::is_stableAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(is_stableAttrName(), attr);
}

void XlaVariadicSortOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange outputs, ::mlir::ValueRange inputs, ::mlir::Value dimension, ::mlir::SymbolRefAttr comparator, ::mlir::BoolAttr is_stable) {
  odsState.addOperands(inputs);
  odsState.addOperands(dimension);
  odsState.addAttribute(comparatorAttrName(odsState.name), comparator);
  odsState.addAttribute(is_stableAttrName(odsState.name), is_stable);
  odsState.addTypes(outputs);
}

void XlaVariadicSortOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange outputs, ::mlir::ValueRange inputs, ::mlir::Value dimension, ::mlir::SymbolRefAttr comparator, bool is_stable) {
  odsState.addOperands(inputs);
  odsState.addOperands(dimension);
  odsState.addAttribute(comparatorAttrName(odsState.name), comparator);
  odsState.addAttribute(is_stableAttrName(odsState.name), odsBuilder.getBoolAttr(is_stable));
  odsState.addTypes(outputs);
}

void XlaVariadicSortOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() >= 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult XlaVariadicSortOp::verify() {
  {
    auto tblgen_comparator = (*this)->getAttr(comparatorAttrName());
    if (!tblgen_comparator)
      return emitOpError("requires attribute 'comparator'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops12(*this, tblgen_comparator, "comparator")))
      return ::mlir::failure();
  }
  {
    auto tblgen_is_stable = (*this)->getAttr(is_stableAttrName());
    if (!tblgen_is_stable)
      return emitOpError("requires attribute 'is_stable'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_is_stable, "is_stable")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops11(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return Verify(*this);
}

void XlaVariadicSortOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::XlaVariadicSortOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::Xlog1pyOp definitions
//===----------------------------------------------------------------------===//

Xlog1pyOpAdaptor::Xlog1pyOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

Xlog1pyOpAdaptor::Xlog1pyOpAdaptor(Xlog1pyOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange Xlog1pyOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> Xlog1pyOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange Xlog1pyOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value Xlog1pyOpAdaptor::x() {
  return *getODSOperands(0).begin();
}

::mlir::Value Xlog1pyOpAdaptor::y() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr Xlog1pyOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult Xlog1pyOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> Xlog1pyOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range Xlog1pyOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value Xlog1pyOp::x() {
  return *getODSOperands(0).begin();
}

::mlir::Value Xlog1pyOp::y() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange Xlog1pyOp::xMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange Xlog1pyOp::yMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> Xlog1pyOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range Xlog1pyOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value Xlog1pyOp::z() {
  return *getODSResults(0).begin();
}

::mlir::Type Xlog1pyOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool Xlog1pyOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr Xlog1pyOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void Xlog1pyOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type z, ::mlir::Value x, ::mlir::Value y) {
  odsState.addOperands(x);
  odsState.addOperands(y);
  odsState.addTypes(z);
}

void Xlog1pyOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value x, ::mlir::Value y) {
  odsState.addOperands(x);
  odsState.addOperands(y);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void Xlog1pyOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult Xlog1pyOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops29(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops29(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops29(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void Xlog1pyOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::Xlog1pyOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::XlogyOp definitions
//===----------------------------------------------------------------------===//

XlogyOpAdaptor::XlogyOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

XlogyOpAdaptor::XlogyOpAdaptor(XlogyOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange XlogyOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> XlogyOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange XlogyOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value XlogyOpAdaptor::x() {
  return *getODSOperands(0).begin();
}

::mlir::Value XlogyOpAdaptor::y() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr XlogyOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult XlogyOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> XlogyOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range XlogyOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value XlogyOp::x() {
  return *getODSOperands(0).begin();
}

::mlir::Value XlogyOp::y() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange XlogyOp::xMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange XlogyOp::yMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> XlogyOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range XlogyOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value XlogyOp::z() {
  return *getODSResults(0).begin();
}

::mlir::Type XlogyOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool XlogyOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr XlogyOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void XlogyOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, Value x, Value y) {
  auto resultType =
      OpTrait::util::getBroadcastedType(x.getType(), y.getType());
  if (!resultType)
    mlir::emitError(odsState.location, "non-broadcastable operands");
  return build(odsBuilder, odsState, resultType, x, y);
}

void XlogyOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type z, ::mlir::Value x, ::mlir::Value y) {
  odsState.addOperands(x);
  odsState.addOperands(y);
  odsState.addTypes(z);
}

void XlogyOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value x, ::mlir::Value y) {
  odsState.addOperands(x);
  odsState.addOperands(y);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void XlogyOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult XlogyOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops29(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops29(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops29(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void XlogyOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::XlogyOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::YieldOp definitions
//===----------------------------------------------------------------------===//

YieldOpAdaptor::YieldOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

YieldOpAdaptor::YieldOpAdaptor(YieldOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange YieldOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> YieldOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  bool isVariadic[] = {true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (odsOperands.size() - 0) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::ValueRange YieldOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::ValueRange YieldOpAdaptor::operands() {
  return getODSOperands(0);
}

::mlir::DictionaryAttr YieldOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult YieldOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> YieldOp::getODSOperandIndexAndLength(unsigned index) {
  bool isVariadic[] = {true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (getOperation()->getNumOperands() - 0) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::Operation::operand_range YieldOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Operation::operand_range YieldOp::operands() {
  return getODSOperands(0);
}

::mlir::MutableOperandRange YieldOp::operandsMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> YieldOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range YieldOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

void YieldOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands) {
  odsState.addOperands(operands);
}

void YieldOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 0u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult YieldOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops66(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void YieldOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::YieldOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::ZerosLikeOp definitions
//===----------------------------------------------------------------------===//

ZerosLikeOpAdaptor::ZerosLikeOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

ZerosLikeOpAdaptor::ZerosLikeOpAdaptor(ZerosLikeOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange ZerosLikeOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> ZerosLikeOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange ZerosLikeOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ZerosLikeOpAdaptor::x() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr ZerosLikeOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult ZerosLikeOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> ZerosLikeOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range ZerosLikeOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ZerosLikeOp::x() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange ZerosLikeOp::xMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> ZerosLikeOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range ZerosLikeOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ZerosLikeOp::y() {
  return *getODSResults(0).begin();
}

::mlir::Type ZerosLikeOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool ZerosLikeOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr ZerosLikeOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void ZerosLikeOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type y, ::mlir::Value x) {
  odsState.addOperands(x);
  odsState.addTypes(y);
}

void ZerosLikeOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value x) {
  odsState.addOperands(x);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void ZerosLikeOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

void ZerosLikeOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value x) {
  odsState.addOperands(x);
  odsState.addTypes({x.getType()});

}

void ZerosLikeOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  odsState.addTypes({operands[0].getType()});

}

::mlir::LogicalResult ZerosLikeOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void ZerosLikeOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::ZerosLikeOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::ZetaOp definitions
//===----------------------------------------------------------------------===//

ZetaOpAdaptor::ZetaOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

ZetaOpAdaptor::ZetaOpAdaptor(ZetaOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange ZetaOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> ZetaOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange ZetaOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ZetaOpAdaptor::x() {
  return *getODSOperands(0).begin();
}

::mlir::Value ZetaOpAdaptor::q() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr ZetaOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult ZetaOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> ZetaOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range ZetaOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ZetaOp::x() {
  return *getODSOperands(0).begin();
}

::mlir::Value ZetaOp::q() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange ZetaOp::xMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange ZetaOp::qMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> ZetaOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range ZetaOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value ZetaOp::z() {
  return *getODSResults(0).begin();
}

::mlir::Type ZetaOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool ZetaOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr ZetaOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void ZetaOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, Value x, Value y) {
  auto resultType =
      OpTrait::util::getBroadcastedType(x.getType(), y.getType());
  if (!resultType)
    mlir::emitError(odsState.location, "non-broadcastable operands");
  return build(odsBuilder, odsState, resultType, x, y);
}

void ZetaOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type z, ::mlir::Value x, ::mlir::Value q) {
  odsState.addOperands(x);
  odsState.addOperands(q);
  odsState.addTypes(z);
}

void ZetaOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value x, ::mlir::Value q) {
  odsState.addOperands(x);
  odsState.addOperands(q);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void ZetaOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult ZetaOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops13(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops13(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops13(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void ZetaOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::ZetaOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::_ArrayToListOp definitions
//===----------------------------------------------------------------------===//

_ArrayToListOpAdaptor::_ArrayToListOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

_ArrayToListOpAdaptor::_ArrayToListOpAdaptor(_ArrayToListOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange _ArrayToListOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> _ArrayToListOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  bool isVariadic[] = {true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (odsOperands.size() - 0) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::ValueRange _ArrayToListOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::ValueRange _ArrayToListOpAdaptor::input() {
  return getODSOperands(0);
}

::mlir::DictionaryAttr _ArrayToListOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult _ArrayToListOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> _ArrayToListOp::getODSOperandIndexAndLength(unsigned index) {
  bool isVariadic[] = {true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (getOperation()->getNumOperands() - 0) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::Operation::operand_range _ArrayToListOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Operation::operand_range _ArrayToListOp::input() {
  return getODSOperands(0);
}

::mlir::MutableOperandRange _ArrayToListOp::inputMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> _ArrayToListOp::getODSResultIndexAndLength(unsigned index) {
  bool isVariadic[] = {true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (getOperation()->getNumResults() - 0) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::Operation::result_range _ArrayToListOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Operation::result_range _ArrayToListOp::output() {
  return getODSResults(0);
}

size_t _ArrayToListOp::N() {
  auto range = getODSOperands(0);
return std::distance(range.begin(), range.end());
}

::mlir::Type _ArrayToListOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

mlir::ResultElementTypeRange _ArrayToListOp::out_types() {
  auto values = getODSResults(0);
return {mlir::ResultElementTypeIterator(values.begin()), mlir::ResultElementTypeIterator(values.end())};
}

bool _ArrayToListOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "N") return true;
  if (name == "T") return true;
  if (name == "out_types") return true;
 return false;
}

::mlir::DictionaryAttr _ArrayToListOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {NAttrName(),
odsBuilder.getI64IntegerAttr(N())},
    {TAttrName(),
::mlir::TypeAttr::get(T())},
    {out_typesAttrName(),
ArrayAttr::get(ctx, 
    [&]() {
      llvm::SmallVector<Attribute, 4> ret;
      for (auto t : out_types())
        ret.push_back(TypeAttr::get(t));
      return ret;
    }())}});
}

void _ArrayToListOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult _ArrayToListOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void _ArrayToListOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::_ArrayToListOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::_EagerConstOp definitions
//===----------------------------------------------------------------------===//

_EagerConstOpAdaptor::_EagerConstOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

_EagerConstOpAdaptor::_EagerConstOpAdaptor(_EagerConstOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange _EagerConstOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> _EagerConstOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange _EagerConstOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value _EagerConstOpAdaptor::input() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr _EagerConstOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult _EagerConstOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> _EagerConstOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range _EagerConstOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value _EagerConstOp::input() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange _EagerConstOp::inputMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> _EagerConstOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range _EagerConstOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value _EagerConstOp::output() {
  return *getODSResults(0).begin();
}

::mlir::Type _EagerConstOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool _EagerConstOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr _EagerConstOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void _EagerConstOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input) {
  odsState.addOperands(input);
  odsState.addTypes(output);
}

void _EagerConstOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input) {
  odsState.addOperands(input);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void _EagerConstOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult _EagerConstOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void _EagerConstOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::_EagerConstOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::_FusedBatchNormExOp definitions
//===----------------------------------------------------------------------===//

_FusedBatchNormExOpAdaptor::_FusedBatchNormExOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

_FusedBatchNormExOpAdaptor::_FusedBatchNormExOpAdaptor(_FusedBatchNormExOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange _FusedBatchNormExOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> _FusedBatchNormExOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  bool isVariadic[] = {false, false, false, false, false, true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (odsOperands.size() - 5) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::ValueRange _FusedBatchNormExOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value _FusedBatchNormExOpAdaptor::x() {
  return *getODSOperands(0).begin();
}

::mlir::Value _FusedBatchNormExOpAdaptor::scale() {
  return *getODSOperands(1).begin();
}

::mlir::Value _FusedBatchNormExOpAdaptor::offset() {
  return *getODSOperands(2).begin();
}

::mlir::Value _FusedBatchNormExOpAdaptor::mean() {
  return *getODSOperands(3).begin();
}

::mlir::Value _FusedBatchNormExOpAdaptor::variance() {
  return *getODSOperands(4).begin();
}

::mlir::ValueRange _FusedBatchNormExOpAdaptor::side_input() {
  return getODSOperands(5);
}

::mlir::DictionaryAttr _FusedBatchNormExOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::FloatAttr _FusedBatchNormExOpAdaptor::epsilon() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::FloatAttr attr = odsAttrs.get("epsilon").dyn_cast_or_null<::mlir::FloatAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getFloatAttr(::mlir::Builder(odsAttrs.getContext()).getF32Type(), 0.0001f);
  return attr;
}

::mlir::FloatAttr _FusedBatchNormExOpAdaptor::exponential_avg_factor() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::FloatAttr attr = odsAttrs.get("exponential_avg_factor").dyn_cast_or_null<::mlir::FloatAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getFloatAttr(::mlir::Builder(odsAttrs.getContext()).getF32Type(), 1.0f);
  return attr;
}

::mlir::StringAttr _FusedBatchNormExOpAdaptor::activation_mode() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("activation_mode").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("Identity");
  return attr;
}

::mlir::StringAttr _FusedBatchNormExOpAdaptor::data_format() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("data_format").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("NHWC");
  return attr;
}

::mlir::BoolAttr _FusedBatchNormExOpAdaptor::is_training() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("is_training").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(true);
  return attr;
}

::mlir::LogicalResult _FusedBatchNormExOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_epsilon = odsAttrs.get("epsilon");
    if (tblgen_epsilon && !(((tblgen_epsilon.isa<::mlir::FloatAttr>())) && ((tblgen_epsilon.cast<::mlir::FloatAttr>().getType().isF32()))))
      return emitError(loc, "'tf._FusedBatchNormEx' op ""attribute 'epsilon' failed to satisfy constraint: 32-bit float attribute");
  }
  {
    auto tblgen_exponential_avg_factor = odsAttrs.get("exponential_avg_factor");
    if (tblgen_exponential_avg_factor && !(((tblgen_exponential_avg_factor.isa<::mlir::FloatAttr>())) && ((tblgen_exponential_avg_factor.cast<::mlir::FloatAttr>().getType().isF32()))))
      return emitError(loc, "'tf._FusedBatchNormEx' op ""attribute 'exponential_avg_factor' failed to satisfy constraint: 32-bit float attribute");
  }
  {
    auto tblgen_activation_mode = odsAttrs.get("activation_mode");
    if (tblgen_activation_mode && !((tblgen_activation_mode.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf._FusedBatchNormEx' op ""attribute 'activation_mode' failed to satisfy constraint: string attribute");
  }
  {
    auto tblgen_data_format = odsAttrs.get("data_format");
    if (tblgen_data_format && !((tblgen_data_format.cast<StringAttr>().getValue() == "NHWC" || tblgen_data_format.cast<StringAttr>().getValue() == "NCHW")))
      return emitError(loc, "'tf._FusedBatchNormEx' op ""attribute 'data_format' failed to satisfy constraint: 'NHWC' or 'NCHW' convnet data format");
  }
  {
    auto tblgen_is_training = odsAttrs.get("is_training");
    if (tblgen_is_training && !((tblgen_is_training.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf._FusedBatchNormEx' op ""attribute 'is_training' failed to satisfy constraint: bool attribute");
  }
  return ::mlir::success();
}

void _FusedBatchNormExOp::getAsmResultNames(::mlir::OpAsmSetValueNameFn setNameFn) {
  auto resultGroup0 = getODSResults(0);
  if (!llvm::empty(resultGroup0))
    setNameFn(*resultGroup0.begin(), "y");
  auto resultGroup1 = getODSResults(1);
  if (!llvm::empty(resultGroup1))
    setNameFn(*resultGroup1.begin(), "batch_mean");
  auto resultGroup2 = getODSResults(2);
  if (!llvm::empty(resultGroup2))
    setNameFn(*resultGroup2.begin(), "batch_variance");
  auto resultGroup3 = getODSResults(3);
  if (!llvm::empty(resultGroup3))
    setNameFn(*resultGroup3.begin(), "reserve_space_1");
  auto resultGroup4 = getODSResults(4);
  if (!llvm::empty(resultGroup4))
    setNameFn(*resultGroup4.begin(), "reserve_space_2");
  auto resultGroup5 = getODSResults(5);
  if (!llvm::empty(resultGroup5))
    setNameFn(*resultGroup5.begin(), "reserve_space_3");
}

std::pair<unsigned, unsigned> _FusedBatchNormExOp::getODSOperandIndexAndLength(unsigned index) {
  bool isVariadic[] = {false, false, false, false, false, true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (getOperation()->getNumOperands() - 5) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::Operation::operand_range _FusedBatchNormExOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value _FusedBatchNormExOp::x() {
  return *getODSOperands(0).begin();
}

::mlir::Value _FusedBatchNormExOp::scale() {
  return *getODSOperands(1).begin();
}

::mlir::Value _FusedBatchNormExOp::offset() {
  return *getODSOperands(2).begin();
}

::mlir::Value _FusedBatchNormExOp::mean() {
  return *getODSOperands(3).begin();
}

::mlir::Value _FusedBatchNormExOp::variance() {
  return *getODSOperands(4).begin();
}

::mlir::Operation::operand_range _FusedBatchNormExOp::side_input() {
  return getODSOperands(5);
}

::mlir::MutableOperandRange _FusedBatchNormExOp::xMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange _FusedBatchNormExOp::scaleMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange _FusedBatchNormExOp::offsetMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange _FusedBatchNormExOp::meanMutable() {
  auto range = getODSOperandIndexAndLength(3);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange _FusedBatchNormExOp::varianceMutable() {
  auto range = getODSOperandIndexAndLength(4);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange _FusedBatchNormExOp::side_inputMutable() {
  auto range = getODSOperandIndexAndLength(5);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> _FusedBatchNormExOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range _FusedBatchNormExOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value _FusedBatchNormExOp::y() {
  return *getODSResults(0).begin();
}

::mlir::Value _FusedBatchNormExOp::batch_mean() {
  return *getODSResults(1).begin();
}

::mlir::Value _FusedBatchNormExOp::batch_variance() {
  return *getODSResults(2).begin();
}

::mlir::Value _FusedBatchNormExOp::reserve_space_1() {
  return *getODSResults(3).begin();
}

::mlir::Value _FusedBatchNormExOp::reserve_space_2() {
  return *getODSResults(4).begin();
}

::mlir::Value _FusedBatchNormExOp::reserve_space_3() {
  return *getODSResults(5).begin();
}

::mlir::FloatAttr _FusedBatchNormExOp::epsilonAttr() {
  return (*this)->getAttr(epsilonAttrName()).dyn_cast_or_null<::mlir::FloatAttr>();
}

::llvm::APFloat _FusedBatchNormExOp::epsilon() {
  auto attr = epsilonAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getFloatAttr(::mlir::Builder((*this)->getContext()).getF32Type(), 0.0001f).getValue();
  return attr.getValue();
}

::mlir::FloatAttr _FusedBatchNormExOp::exponential_avg_factorAttr() {
  return (*this)->getAttr(exponential_avg_factorAttrName()).dyn_cast_or_null<::mlir::FloatAttr>();
}

::llvm::APFloat _FusedBatchNormExOp::exponential_avg_factor() {
  auto attr = exponential_avg_factorAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getFloatAttr(::mlir::Builder((*this)->getContext()).getF32Type(), 1.0f).getValue();
  return attr.getValue();
}

::mlir::StringAttr _FusedBatchNormExOp::activation_modeAttr() {
  return (*this)->getAttr(activation_modeAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef _FusedBatchNormExOp::activation_mode() {
  auto attr = activation_modeAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("Identity").getValue();
  return attr.getValue();
}

::mlir::StringAttr _FusedBatchNormExOp::data_formatAttr() {
  return (*this)->getAttr(data_formatAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef _FusedBatchNormExOp::data_format() {
  auto attr = data_formatAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("NHWC").getValue();
  return attr.getValue();
}

::mlir::BoolAttr _FusedBatchNormExOp::is_trainingAttr() {
  return (*this)->getAttr(is_trainingAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool _FusedBatchNormExOp::is_training() {
  auto attr = is_trainingAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(true).getValue();
  return attr.getValue();
}

size_t _FusedBatchNormExOp::num_side_inputs() {
  auto range = getODSOperands(5);
return std::distance(range.begin(), range.end());
}

::mlir::Type _FusedBatchNormExOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

::mlir::Type _FusedBatchNormExOp::U() {
  return mlir::getElementTypeOrSelf(*getODSOperands(1).begin());
}

bool _FusedBatchNormExOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "num_side_inputs") return true;
  if (name == "T") return true;
  if (name == "U") return true;
 return false;
}

::mlir::DictionaryAttr _FusedBatchNormExOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {num_side_inputsAttrName(),
odsBuilder.getI64IntegerAttr(num_side_inputs())},
    {TAttrName(),
::mlir::TypeAttr::get(T())},
    {UAttrName(),
::mlir::TypeAttr::get(U())}});
}

void _FusedBatchNormExOp::epsilonAttr(::mlir::FloatAttr attr) {
  (*this)->setAttr(epsilonAttrName(), attr);
}

void _FusedBatchNormExOp::exponential_avg_factorAttr(::mlir::FloatAttr attr) {
  (*this)->setAttr(exponential_avg_factorAttrName(), attr);
}

void _FusedBatchNormExOp::activation_modeAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(activation_modeAttrName(), attr);
}

void _FusedBatchNormExOp::data_formatAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(data_formatAttrName(), attr);
}

void _FusedBatchNormExOp::is_trainingAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(is_trainingAttrName(), attr);
}

void _FusedBatchNormExOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type y, ::mlir::Type batch_mean, ::mlir::Type batch_variance, ::mlir::Type reserve_space_1, ::mlir::Type reserve_space_2, ::mlir::Type reserve_space_3, ::mlir::Value x, ::mlir::Value scale, ::mlir::Value offset, ::mlir::Value mean, ::mlir::Value variance, ::mlir::ValueRange side_input, ::mlir::FloatAttr epsilon, ::mlir::FloatAttr exponential_avg_factor, ::mlir::StringAttr activation_mode, ::mlir::StringAttr data_format, ::mlir::BoolAttr is_training) {
  odsState.addOperands(x);
  odsState.addOperands(scale);
  odsState.addOperands(offset);
  odsState.addOperands(mean);
  odsState.addOperands(variance);
  odsState.addOperands(side_input);
  odsState.addAttribute(epsilonAttrName(odsState.name), epsilon);
  odsState.addAttribute(exponential_avg_factorAttrName(odsState.name), exponential_avg_factor);
  odsState.addAttribute(activation_modeAttrName(odsState.name), activation_mode);
  odsState.addAttribute(data_formatAttrName(odsState.name), data_format);
  odsState.addAttribute(is_trainingAttrName(odsState.name), is_training);
  odsState.addTypes(y);
  odsState.addTypes(batch_mean);
  odsState.addTypes(batch_variance);
  odsState.addTypes(reserve_space_1);
  odsState.addTypes(reserve_space_2);
  odsState.addTypes(reserve_space_3);
}

void _FusedBatchNormExOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value x, ::mlir::Value scale, ::mlir::Value offset, ::mlir::Value mean, ::mlir::Value variance, ::mlir::ValueRange side_input, ::mlir::FloatAttr epsilon, ::mlir::FloatAttr exponential_avg_factor, ::mlir::StringAttr activation_mode, ::mlir::StringAttr data_format, ::mlir::BoolAttr is_training) {
  odsState.addOperands(x);
  odsState.addOperands(scale);
  odsState.addOperands(offset);
  odsState.addOperands(mean);
  odsState.addOperands(variance);
  odsState.addOperands(side_input);
  odsState.addAttribute(epsilonAttrName(odsState.name), epsilon);
  odsState.addAttribute(exponential_avg_factorAttrName(odsState.name), exponential_avg_factor);
  odsState.addAttribute(activation_modeAttrName(odsState.name), activation_mode);
  odsState.addAttribute(data_formatAttrName(odsState.name), data_format);
  odsState.addAttribute(is_trainingAttrName(odsState.name), is_training);
  assert(resultTypes.size() == 6u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void _FusedBatchNormExOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type y, ::mlir::Type batch_mean, ::mlir::Type batch_variance, ::mlir::Type reserve_space_1, ::mlir::Type reserve_space_2, ::mlir::Type reserve_space_3, ::mlir::Value x, ::mlir::Value scale, ::mlir::Value offset, ::mlir::Value mean, ::mlir::Value variance, ::mlir::ValueRange side_input, ::llvm::APFloat epsilon, ::llvm::APFloat exponential_avg_factor, ::llvm::StringRef activation_mode, ::llvm::StringRef data_format, bool is_training) {
  odsState.addOperands(x);
  odsState.addOperands(scale);
  odsState.addOperands(offset);
  odsState.addOperands(mean);
  odsState.addOperands(variance);
  odsState.addOperands(side_input);
  odsState.addAttribute(epsilonAttrName(odsState.name), odsBuilder.getFloatAttr(odsBuilder.getF32Type(), epsilon));
  odsState.addAttribute(exponential_avg_factorAttrName(odsState.name), odsBuilder.getFloatAttr(odsBuilder.getF32Type(), exponential_avg_factor));
  odsState.addAttribute(activation_modeAttrName(odsState.name), odsBuilder.getStringAttr(activation_mode));
  odsState.addAttribute(data_formatAttrName(odsState.name), odsBuilder.getStringAttr(data_format));
  odsState.addAttribute(is_trainingAttrName(odsState.name), odsBuilder.getBoolAttr(is_training));
  odsState.addTypes(y);
  odsState.addTypes(batch_mean);
  odsState.addTypes(batch_variance);
  odsState.addTypes(reserve_space_1);
  odsState.addTypes(reserve_space_2);
  odsState.addTypes(reserve_space_3);
}

void _FusedBatchNormExOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value x, ::mlir::Value scale, ::mlir::Value offset, ::mlir::Value mean, ::mlir::Value variance, ::mlir::ValueRange side_input, ::llvm::APFloat epsilon, ::llvm::APFloat exponential_avg_factor, ::llvm::StringRef activation_mode, ::llvm::StringRef data_format, bool is_training) {
  odsState.addOperands(x);
  odsState.addOperands(scale);
  odsState.addOperands(offset);
  odsState.addOperands(mean);
  odsState.addOperands(variance);
  odsState.addOperands(side_input);
  odsState.addAttribute(epsilonAttrName(odsState.name), odsBuilder.getFloatAttr(odsBuilder.getF32Type(), epsilon));
  odsState.addAttribute(exponential_avg_factorAttrName(odsState.name), odsBuilder.getFloatAttr(odsBuilder.getF32Type(), exponential_avg_factor));
  odsState.addAttribute(activation_modeAttrName(odsState.name), odsBuilder.getStringAttr(activation_mode));
  odsState.addAttribute(data_formatAttrName(odsState.name), odsBuilder.getStringAttr(data_format));
  odsState.addAttribute(is_trainingAttrName(odsState.name), odsBuilder.getBoolAttr(is_training));
  assert(resultTypes.size() == 6u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void _FusedBatchNormExOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() >= 5u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 6u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult _FusedBatchNormExOp::verify() {
  {
    auto tblgen_epsilon = (*this)->getAttr(epsilonAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops5(*this, tblgen_epsilon, "epsilon")))
      return ::mlir::failure();
  }
  {
    auto tblgen_exponential_avg_factor = (*this)->getAttr(exponential_avg_factorAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops5(*this, tblgen_exponential_avg_factor, "exponential_avg_factor")))
      return ::mlir::failure();
  }
  {
    auto tblgen_activation_mode = (*this)->getAttr(activation_modeAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_activation_mode, "activation_mode")))
      return ::mlir::failure();
  }
  {
    auto tblgen_data_format = (*this)->getAttr(data_formatAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops11(*this, tblgen_data_format, "data_format")))
      return ::mlir::failure();
  }
  {
    auto tblgen_is_training = (*this)->getAttr(is_trainingAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_is_training, "is_training")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops44(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup3 = getODSOperands(3);

    for (auto v : valueGroup3) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup4 = getODSOperands(4);

    for (auto v : valueGroup4) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup5 = getODSOperands(5);

    for (auto v : valueGroup5) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops44(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops44(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSResults(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSResults(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
    auto valueGroup3 = getODSResults(3);

    for (auto v : valueGroup3) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
    auto valueGroup4 = getODSResults(4);

    for (auto v : valueGroup4) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
    auto valueGroup5 = getODSResults(5);

    for (auto v : valueGroup5) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void _FusedBatchNormExOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::_FusedBatchNormExOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::_FusedConv2DOp definitions
//===----------------------------------------------------------------------===//

_FusedConv2DOpAdaptor::_FusedConv2DOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

_FusedConv2DOpAdaptor::_FusedConv2DOpAdaptor(_FusedConv2DOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange _FusedConv2DOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> _FusedConv2DOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  bool isVariadic[] = {false, false, true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (odsOperands.size() - 2) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::ValueRange _FusedConv2DOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value _FusedConv2DOpAdaptor::input() {
  return *getODSOperands(0).begin();
}

::mlir::Value _FusedConv2DOpAdaptor::filter() {
  return *getODSOperands(1).begin();
}

::mlir::ValueRange _FusedConv2DOpAdaptor::args() {
  return getODSOperands(2);
}

::mlir::DictionaryAttr _FusedConv2DOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::ArrayAttr _FusedConv2DOpAdaptor::strides() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("strides").cast<::mlir::ArrayAttr>();
  return attr;
}

::mlir::StringAttr _FusedConv2DOpAdaptor::padding() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("padding").cast<::mlir::StringAttr>();
  return attr;
}

::mlir::ArrayAttr _FusedConv2DOpAdaptor::explicit_paddings() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("explicit_paddings").dyn_cast_or_null<::mlir::ArrayAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getI64ArrayAttr({});
  return attr;
}

::mlir::StringAttr _FusedConv2DOpAdaptor::data_format() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("data_format").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("NHWC");
  return attr;
}

::mlir::ArrayAttr _FusedConv2DOpAdaptor::dilations() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("dilations").dyn_cast_or_null<::mlir::ArrayAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getI64ArrayAttr({1, 1, 1, 1});
  return attr;
}

::mlir::BoolAttr _FusedConv2DOpAdaptor::use_cudnn_on_gpu() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("use_cudnn_on_gpu").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(true);
  return attr;
}

::mlir::ArrayAttr _FusedConv2DOpAdaptor::fused_ops() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("fused_ops").dyn_cast_or_null<::mlir::ArrayAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStrArrayAttr({});
  return attr;
}

::mlir::FloatAttr _FusedConv2DOpAdaptor::epsilon() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::FloatAttr attr = odsAttrs.get("epsilon").dyn_cast_or_null<::mlir::FloatAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getFloatAttr(::mlir::Builder(odsAttrs.getContext()).getF32Type(), 0.0001f);
  return attr;
}

::mlir::FloatAttr _FusedConv2DOpAdaptor::leakyrelu_alpha() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::FloatAttr attr = odsAttrs.get("leakyrelu_alpha").dyn_cast_or_null<::mlir::FloatAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getFloatAttr(::mlir::Builder(odsAttrs.getContext()).getF32Type(), 0.2f);
  return attr;
}

::mlir::LogicalResult _FusedConv2DOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_strides = odsAttrs.get("strides");
    if (!tblgen_strides)
      return emitError(loc, "'tf._FusedConv2D' op ""requires attribute 'strides'");

    if (tblgen_strides && !(((tblgen_strides.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_strides.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return ((attr.isa<::mlir::IntegerAttr>())) && ((attr.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64))); }))))
      return emitError(loc, "'tf._FusedConv2D' op ""attribute 'strides' failed to satisfy constraint: 64-bit integer array attribute");
  }
  {
    auto tblgen_padding = odsAttrs.get("padding");
    if (!tblgen_padding)
      return emitError(loc, "'tf._FusedConv2D' op ""requires attribute 'padding'");

    if (tblgen_padding && !((tblgen_padding.cast<StringAttr>().getValue() == "SAME" || tblgen_padding.cast<StringAttr>().getValue() == "VALID" || tblgen_padding.cast<StringAttr>().getValue() == "EXPLICIT")))
      return emitError(loc, "'tf._FusedConv2D' op ""attribute 'padding' failed to satisfy constraint: string attribute whose value is SAME, or VALID, or EXPLICIT");
  }
  {
    auto tblgen_explicit_paddings = odsAttrs.get("explicit_paddings");
    if (tblgen_explicit_paddings && !(((tblgen_explicit_paddings.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_explicit_paddings.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return ((attr.isa<::mlir::IntegerAttr>())) && ((attr.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64))); }))))
      return emitError(loc, "'tf._FusedConv2D' op ""attribute 'explicit_paddings' failed to satisfy constraint: 64-bit integer array attribute");
  }
  {
    auto tblgen_data_format = odsAttrs.get("data_format");
    if (tblgen_data_format && !((tblgen_data_format.cast<StringAttr>().getValue() == "NHWC" || tblgen_data_format.cast<StringAttr>().getValue() == "NCHW")))
      return emitError(loc, "'tf._FusedConv2D' op ""attribute 'data_format' failed to satisfy constraint: 'NHWC' or 'NCHW' convnet data format");
  }
  {
    auto tblgen_dilations = odsAttrs.get("dilations");
    if (tblgen_dilations && !(((tblgen_dilations.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_dilations.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return ((attr.isa<::mlir::IntegerAttr>())) && ((attr.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64))); }))))
      return emitError(loc, "'tf._FusedConv2D' op ""attribute 'dilations' failed to satisfy constraint: 64-bit integer array attribute");
  }
  {
    auto tblgen_use_cudnn_on_gpu = odsAttrs.get("use_cudnn_on_gpu");
    if (tblgen_use_cudnn_on_gpu && !((tblgen_use_cudnn_on_gpu.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf._FusedConv2D' op ""attribute 'use_cudnn_on_gpu' failed to satisfy constraint: bool attribute");
  }
  {
    auto tblgen_fused_ops = odsAttrs.get("fused_ops");
    if (tblgen_fused_ops && !(((tblgen_fused_ops.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_fused_ops.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return (attr.isa<::mlir::StringAttr>()); }))))
      return emitError(loc, "'tf._FusedConv2D' op ""attribute 'fused_ops' failed to satisfy constraint: string array attribute");
  }
  {
    auto tblgen_epsilon = odsAttrs.get("epsilon");
    if (tblgen_epsilon && !(((tblgen_epsilon.isa<::mlir::FloatAttr>())) && ((tblgen_epsilon.cast<::mlir::FloatAttr>().getType().isF32()))))
      return emitError(loc, "'tf._FusedConv2D' op ""attribute 'epsilon' failed to satisfy constraint: 32-bit float attribute");
  }
  {
    auto tblgen_leakyrelu_alpha = odsAttrs.get("leakyrelu_alpha");
    if (tblgen_leakyrelu_alpha && !(((tblgen_leakyrelu_alpha.isa<::mlir::FloatAttr>())) && ((tblgen_leakyrelu_alpha.cast<::mlir::FloatAttr>().getType().isF32()))))
      return emitError(loc, "'tf._FusedConv2D' op ""attribute 'leakyrelu_alpha' failed to satisfy constraint: 32-bit float attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> _FusedConv2DOp::getODSOperandIndexAndLength(unsigned index) {
  bool isVariadic[] = {false, false, true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (getOperation()->getNumOperands() - 2) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::Operation::operand_range _FusedConv2DOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value _FusedConv2DOp::input() {
  return *getODSOperands(0).begin();
}

::mlir::Value _FusedConv2DOp::filter() {
  return *getODSOperands(1).begin();
}

::mlir::Operation::operand_range _FusedConv2DOp::args() {
  return getODSOperands(2);
}

::mlir::MutableOperandRange _FusedConv2DOp::inputMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange _FusedConv2DOp::filterMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange _FusedConv2DOp::argsMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> _FusedConv2DOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range _FusedConv2DOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value _FusedConv2DOp::output() {
  return *getODSResults(0).begin();
}

::mlir::ArrayAttr _FusedConv2DOp::stridesAttr() {
  return (*this)->getAttr(stridesAttrName()).cast<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr _FusedConv2DOp::strides() {
  auto attr = stridesAttr();
  return attr;
}

::mlir::StringAttr _FusedConv2DOp::paddingAttr() {
  return (*this)->getAttr(paddingAttrName()).cast<::mlir::StringAttr>();
}

::llvm::StringRef _FusedConv2DOp::padding() {
  auto attr = paddingAttr();
  return attr.getValue();
}

::mlir::ArrayAttr _FusedConv2DOp::explicit_paddingsAttr() {
  return (*this)->getAttr(explicit_paddingsAttrName()).dyn_cast_or_null<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr _FusedConv2DOp::explicit_paddings() {
  auto attr = explicit_paddingsAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getI64ArrayAttr({});
  return attr;
}

::mlir::StringAttr _FusedConv2DOp::data_formatAttr() {
  return (*this)->getAttr(data_formatAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef _FusedConv2DOp::data_format() {
  auto attr = data_formatAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("NHWC").getValue();
  return attr.getValue();
}

::mlir::ArrayAttr _FusedConv2DOp::dilationsAttr() {
  return (*this)->getAttr(dilationsAttrName()).dyn_cast_or_null<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr _FusedConv2DOp::dilations() {
  auto attr = dilationsAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getI64ArrayAttr({1, 1, 1, 1});
  return attr;
}

::mlir::BoolAttr _FusedConv2DOp::use_cudnn_on_gpuAttr() {
  return (*this)->getAttr(use_cudnn_on_gpuAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool _FusedConv2DOp::use_cudnn_on_gpu() {
  auto attr = use_cudnn_on_gpuAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(true).getValue();
  return attr.getValue();
}

::mlir::ArrayAttr _FusedConv2DOp::fused_opsAttr() {
  return (*this)->getAttr(fused_opsAttrName()).dyn_cast_or_null<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr _FusedConv2DOp::fused_ops() {
  auto attr = fused_opsAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStrArrayAttr({});
  return attr;
}

::mlir::FloatAttr _FusedConv2DOp::epsilonAttr() {
  return (*this)->getAttr(epsilonAttrName()).dyn_cast_or_null<::mlir::FloatAttr>();
}

::llvm::APFloat _FusedConv2DOp::epsilon() {
  auto attr = epsilonAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getFloatAttr(::mlir::Builder((*this)->getContext()).getF32Type(), 0.0001f).getValue();
  return attr.getValue();
}

::mlir::FloatAttr _FusedConv2DOp::leakyrelu_alphaAttr() {
  return (*this)->getAttr(leakyrelu_alphaAttrName()).dyn_cast_or_null<::mlir::FloatAttr>();
}

::llvm::APFloat _FusedConv2DOp::leakyrelu_alpha() {
  auto attr = leakyrelu_alphaAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getFloatAttr(::mlir::Builder((*this)->getContext()).getF32Type(), 0.2f).getValue();
  return attr.getValue();
}

size_t _FusedConv2DOp::num_args() {
  auto range = getODSOperands(2);
return std::distance(range.begin(), range.end());
}

::mlir::Type _FusedConv2DOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool _FusedConv2DOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "num_args") return true;
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr _FusedConv2DOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {num_argsAttrName(),
odsBuilder.getI64IntegerAttr(num_args())},
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void _FusedConv2DOp::stridesAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(stridesAttrName(), attr);
}

void _FusedConv2DOp::paddingAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(paddingAttrName(), attr);
}

void _FusedConv2DOp::explicit_paddingsAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(explicit_paddingsAttrName(), attr);
}

void _FusedConv2DOp::data_formatAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(data_formatAttrName(), attr);
}

void _FusedConv2DOp::dilationsAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(dilationsAttrName(), attr);
}

void _FusedConv2DOp::use_cudnn_on_gpuAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(use_cudnn_on_gpuAttrName(), attr);
}

void _FusedConv2DOp::fused_opsAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(fused_opsAttrName(), attr);
}

void _FusedConv2DOp::epsilonAttr(::mlir::FloatAttr attr) {
  (*this)->setAttr(epsilonAttrName(), attr);
}

void _FusedConv2DOp::leakyrelu_alphaAttr(::mlir::FloatAttr attr) {
  (*this)->setAttr(leakyrelu_alphaAttrName(), attr);
}

void _FusedConv2DOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input, ::mlir::Value filter, ::mlir::ValueRange args, ::mlir::ArrayAttr strides, ::mlir::StringAttr padding, ::mlir::ArrayAttr explicit_paddings, ::mlir::StringAttr data_format, ::mlir::ArrayAttr dilations, ::mlir::BoolAttr use_cudnn_on_gpu, ::mlir::ArrayAttr fused_ops, ::mlir::FloatAttr epsilon, ::mlir::FloatAttr leakyrelu_alpha) {
  odsState.addOperands(input);
  odsState.addOperands(filter);
  odsState.addOperands(args);
  odsState.addAttribute(stridesAttrName(odsState.name), strides);
  odsState.addAttribute(paddingAttrName(odsState.name), padding);
  odsState.addAttribute(explicit_paddingsAttrName(odsState.name), explicit_paddings);
  odsState.addAttribute(data_formatAttrName(odsState.name), data_format);
  odsState.addAttribute(dilationsAttrName(odsState.name), dilations);
  odsState.addAttribute(use_cudnn_on_gpuAttrName(odsState.name), use_cudnn_on_gpu);
  odsState.addAttribute(fused_opsAttrName(odsState.name), fused_ops);
  odsState.addAttribute(epsilonAttrName(odsState.name), epsilon);
  odsState.addAttribute(leakyrelu_alphaAttrName(odsState.name), leakyrelu_alpha);
  odsState.addTypes(output);
}

void _FusedConv2DOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::Value filter, ::mlir::ValueRange args, ::mlir::ArrayAttr strides, ::mlir::StringAttr padding, ::mlir::ArrayAttr explicit_paddings, ::mlir::StringAttr data_format, ::mlir::ArrayAttr dilations, ::mlir::BoolAttr use_cudnn_on_gpu, ::mlir::ArrayAttr fused_ops, ::mlir::FloatAttr epsilon, ::mlir::FloatAttr leakyrelu_alpha) {
  odsState.addOperands(input);
  odsState.addOperands(filter);
  odsState.addOperands(args);
  odsState.addAttribute(stridesAttrName(odsState.name), strides);
  odsState.addAttribute(paddingAttrName(odsState.name), padding);
  odsState.addAttribute(explicit_paddingsAttrName(odsState.name), explicit_paddings);
  odsState.addAttribute(data_formatAttrName(odsState.name), data_format);
  odsState.addAttribute(dilationsAttrName(odsState.name), dilations);
  odsState.addAttribute(use_cudnn_on_gpuAttrName(odsState.name), use_cudnn_on_gpu);
  odsState.addAttribute(fused_opsAttrName(odsState.name), fused_ops);
  odsState.addAttribute(epsilonAttrName(odsState.name), epsilon);
  odsState.addAttribute(leakyrelu_alphaAttrName(odsState.name), leakyrelu_alpha);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void _FusedConv2DOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::Value input, ::mlir::Value filter, ::mlir::ValueRange args, ::mlir::ArrayAttr strides, ::llvm::StringRef padding, ::mlir::ArrayAttr explicit_paddings, ::llvm::StringRef data_format, ::mlir::ArrayAttr dilations, bool use_cudnn_on_gpu, ::mlir::ArrayAttr fused_ops, ::llvm::APFloat epsilon, ::llvm::APFloat leakyrelu_alpha) {
  odsState.addOperands(input);
  odsState.addOperands(filter);
  odsState.addOperands(args);
  odsState.addAttribute(stridesAttrName(odsState.name), strides);
  odsState.addAttribute(paddingAttrName(odsState.name), odsBuilder.getStringAttr(padding));
  odsState.addAttribute(explicit_paddingsAttrName(odsState.name), explicit_paddings);
  odsState.addAttribute(data_formatAttrName(odsState.name), odsBuilder.getStringAttr(data_format));
  odsState.addAttribute(dilationsAttrName(odsState.name), dilations);
  odsState.addAttribute(use_cudnn_on_gpuAttrName(odsState.name), odsBuilder.getBoolAttr(use_cudnn_on_gpu));
  odsState.addAttribute(fused_opsAttrName(odsState.name), fused_ops);
  odsState.addAttribute(epsilonAttrName(odsState.name), odsBuilder.getFloatAttr(odsBuilder.getF32Type(), epsilon));
  odsState.addAttribute(leakyrelu_alphaAttrName(odsState.name), odsBuilder.getFloatAttr(odsBuilder.getF32Type(), leakyrelu_alpha));
  odsState.addTypes(output);
}

void _FusedConv2DOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input, ::mlir::Value filter, ::mlir::ValueRange args, ::mlir::ArrayAttr strides, ::llvm::StringRef padding, ::mlir::ArrayAttr explicit_paddings, ::llvm::StringRef data_format, ::mlir::ArrayAttr dilations, bool use_cudnn_on_gpu, ::mlir::ArrayAttr fused_ops, ::llvm::APFloat epsilon, ::llvm::APFloat leakyrelu_alpha) {
  odsState.addOperands(input);
  odsState.addOperands(filter);
  odsState.addOperands(args);
  odsState.addAttribute(stridesAttrName(odsState.name), strides);
  odsState.addAttribute(paddingAttrName(odsState.name), odsBuilder.getStringAttr(padding));
  odsState.addAttribute(explicit_paddingsAttrName(odsState.name), explicit_paddings);
  odsState.addAttribute(data_formatAttrName(odsState.name), odsBuilder.getStringAttr(data_format));
  odsState.addAttribute(dilationsAttrName(odsState.name), dilations);
  odsState.addAttribute(use_cudnn_on_gpuAttrName(odsState.name), odsBuilder.getBoolAttr(use_cudnn_on_gpu));
  odsState.addAttribute(fused_opsAttrName(odsState.name), fused_ops);
  odsState.addAttribute(epsilonAttrName(odsState.name), odsBuilder.getFloatAttr(odsBuilder.getF32Type(), epsilon));
  odsState.addAttribute(leakyrelu_alphaAttrName(odsState.name), odsBuilder.getFloatAttr(odsBuilder.getF32Type(), leakyrelu_alpha));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void _FusedConv2DOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() >= 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult _FusedConv2DOp::verify() {
  {
    auto tblgen_strides = (*this)->getAttr(stridesAttrName());
    if (!tblgen_strides)
      return emitOpError("requires attribute 'strides'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops13(*this, tblgen_strides, "strides")))
      return ::mlir::failure();
  }
  {
    auto tblgen_padding = (*this)->getAttr(paddingAttrName());
    if (!tblgen_padding)
      return emitOpError("requires attribute 'padding'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops21(*this, tblgen_padding, "padding")))
      return ::mlir::failure();
  }
  {
    auto tblgen_explicit_paddings = (*this)->getAttr(explicit_paddingsAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops13(*this, tblgen_explicit_paddings, "explicit_paddings")))
      return ::mlir::failure();
  }
  {
    auto tblgen_data_format = (*this)->getAttr(data_formatAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops11(*this, tblgen_data_format, "data_format")))
      return ::mlir::failure();
  }
  {
    auto tblgen_dilations = (*this)->getAttr(dilationsAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops13(*this, tblgen_dilations, "dilations")))
      return ::mlir::failure();
  }
  {
    auto tblgen_use_cudnn_on_gpu = (*this)->getAttr(use_cudnn_on_gpuAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_use_cudnn_on_gpu, "use_cudnn_on_gpu")))
      return ::mlir::failure();
  }
  {
    auto tblgen_fused_ops = (*this)->getAttr(fused_opsAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops22(*this, tblgen_fused_ops, "fused_ops")))
      return ::mlir::failure();
  }
  {
    auto tblgen_epsilon = (*this)->getAttr(epsilonAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops5(*this, tblgen_epsilon, "epsilon")))
      return ::mlir::failure();
  }
  {
    auto tblgen_leakyrelu_alpha = (*this)->getAttr(leakyrelu_alphaAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops5(*this, tblgen_leakyrelu_alpha, "leakyrelu_alpha")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops13(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops13(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops13(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops13(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void _FusedConv2DOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::_FusedConv2DOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::_FusedMatMulOp definitions
//===----------------------------------------------------------------------===//

_FusedMatMulOpAdaptor::_FusedMatMulOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

_FusedMatMulOpAdaptor::_FusedMatMulOpAdaptor(_FusedMatMulOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange _FusedMatMulOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> _FusedMatMulOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  bool isVariadic[] = {false, false, true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (odsOperands.size() - 2) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::ValueRange _FusedMatMulOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value _FusedMatMulOpAdaptor::a() {
  return *getODSOperands(0).begin();
}

::mlir::Value _FusedMatMulOpAdaptor::b() {
  return *getODSOperands(1).begin();
}

::mlir::ValueRange _FusedMatMulOpAdaptor::args() {
  return getODSOperands(2);
}

::mlir::DictionaryAttr _FusedMatMulOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::BoolAttr _FusedMatMulOpAdaptor::transpose_a() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("transpose_a").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(false);
  return attr;
}

::mlir::BoolAttr _FusedMatMulOpAdaptor::transpose_b() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("transpose_b").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(false);
  return attr;
}

::mlir::ArrayAttr _FusedMatMulOpAdaptor::fused_ops() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("fused_ops").dyn_cast_or_null<::mlir::ArrayAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStrArrayAttr({});
  return attr;
}

::mlir::FloatAttr _FusedMatMulOpAdaptor::epsilon() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::FloatAttr attr = odsAttrs.get("epsilon").dyn_cast_or_null<::mlir::FloatAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getFloatAttr(::mlir::Builder(odsAttrs.getContext()).getF32Type(), 0.0001f);
  return attr;
}

::mlir::FloatAttr _FusedMatMulOpAdaptor::leakyrelu_alpha() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::FloatAttr attr = odsAttrs.get("leakyrelu_alpha").dyn_cast_or_null<::mlir::FloatAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getFloatAttr(::mlir::Builder(odsAttrs.getContext()).getF32Type(), 0.2f);
  return attr;
}

::mlir::LogicalResult _FusedMatMulOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_transpose_a = odsAttrs.get("transpose_a");
    if (tblgen_transpose_a && !((tblgen_transpose_a.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf._FusedMatMul' op ""attribute 'transpose_a' failed to satisfy constraint: bool attribute");
  }
  {
    auto tblgen_transpose_b = odsAttrs.get("transpose_b");
    if (tblgen_transpose_b && !((tblgen_transpose_b.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf._FusedMatMul' op ""attribute 'transpose_b' failed to satisfy constraint: bool attribute");
  }
  {
    auto tblgen_fused_ops = odsAttrs.get("fused_ops");
    if (tblgen_fused_ops && !(((tblgen_fused_ops.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_fused_ops.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return (attr.isa<::mlir::StringAttr>()); }))))
      return emitError(loc, "'tf._FusedMatMul' op ""attribute 'fused_ops' failed to satisfy constraint: string array attribute");
  }
  {
    auto tblgen_epsilon = odsAttrs.get("epsilon");
    if (tblgen_epsilon && !(((tblgen_epsilon.isa<::mlir::FloatAttr>())) && ((tblgen_epsilon.cast<::mlir::FloatAttr>().getType().isF32()))))
      return emitError(loc, "'tf._FusedMatMul' op ""attribute 'epsilon' failed to satisfy constraint: 32-bit float attribute");
  }
  {
    auto tblgen_leakyrelu_alpha = odsAttrs.get("leakyrelu_alpha");
    if (tblgen_leakyrelu_alpha && !(((tblgen_leakyrelu_alpha.isa<::mlir::FloatAttr>())) && ((tblgen_leakyrelu_alpha.cast<::mlir::FloatAttr>().getType().isF32()))))
      return emitError(loc, "'tf._FusedMatMul' op ""attribute 'leakyrelu_alpha' failed to satisfy constraint: 32-bit float attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> _FusedMatMulOp::getODSOperandIndexAndLength(unsigned index) {
  bool isVariadic[] = {false, false, true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (getOperation()->getNumOperands() - 2) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::Operation::operand_range _FusedMatMulOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value _FusedMatMulOp::a() {
  return *getODSOperands(0).begin();
}

::mlir::Value _FusedMatMulOp::b() {
  return *getODSOperands(1).begin();
}

::mlir::Operation::operand_range _FusedMatMulOp::args() {
  return getODSOperands(2);
}

::mlir::MutableOperandRange _FusedMatMulOp::aMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange _FusedMatMulOp::bMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange _FusedMatMulOp::argsMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> _FusedMatMulOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range _FusedMatMulOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value _FusedMatMulOp::product() {
  return *getODSResults(0).begin();
}

::mlir::BoolAttr _FusedMatMulOp::transpose_aAttr() {
  return (*this)->getAttr(transpose_aAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool _FusedMatMulOp::transpose_a() {
  auto attr = transpose_aAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(false).getValue();
  return attr.getValue();
}

::mlir::BoolAttr _FusedMatMulOp::transpose_bAttr() {
  return (*this)->getAttr(transpose_bAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool _FusedMatMulOp::transpose_b() {
  auto attr = transpose_bAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(false).getValue();
  return attr.getValue();
}

::mlir::ArrayAttr _FusedMatMulOp::fused_opsAttr() {
  return (*this)->getAttr(fused_opsAttrName()).dyn_cast_or_null<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr _FusedMatMulOp::fused_ops() {
  auto attr = fused_opsAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStrArrayAttr({});
  return attr;
}

::mlir::FloatAttr _FusedMatMulOp::epsilonAttr() {
  return (*this)->getAttr(epsilonAttrName()).dyn_cast_or_null<::mlir::FloatAttr>();
}

::llvm::APFloat _FusedMatMulOp::epsilon() {
  auto attr = epsilonAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getFloatAttr(::mlir::Builder((*this)->getContext()).getF32Type(), 0.0001f).getValue();
  return attr.getValue();
}

::mlir::FloatAttr _FusedMatMulOp::leakyrelu_alphaAttr() {
  return (*this)->getAttr(leakyrelu_alphaAttrName()).dyn_cast_or_null<::mlir::FloatAttr>();
}

::llvm::APFloat _FusedMatMulOp::leakyrelu_alpha() {
  auto attr = leakyrelu_alphaAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getFloatAttr(::mlir::Builder((*this)->getContext()).getF32Type(), 0.2f).getValue();
  return attr.getValue();
}

size_t _FusedMatMulOp::num_args() {
  auto range = getODSOperands(2);
return std::distance(range.begin(), range.end());
}

::mlir::Type _FusedMatMulOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool _FusedMatMulOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "num_args") return true;
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr _FusedMatMulOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {num_argsAttrName(),
odsBuilder.getI64IntegerAttr(num_args())},
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void _FusedMatMulOp::transpose_aAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(transpose_aAttrName(), attr);
}

void _FusedMatMulOp::transpose_bAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(transpose_bAttrName(), attr);
}

void _FusedMatMulOp::fused_opsAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(fused_opsAttrName(), attr);
}

void _FusedMatMulOp::epsilonAttr(::mlir::FloatAttr attr) {
  (*this)->setAttr(epsilonAttrName(), attr);
}

void _FusedMatMulOp::leakyrelu_alphaAttr(::mlir::FloatAttr attr) {
  (*this)->setAttr(leakyrelu_alphaAttrName(), attr);
}

void _FusedMatMulOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type product, ::mlir::Value a, ::mlir::Value b, ::mlir::ValueRange args, ::mlir::BoolAttr transpose_a, ::mlir::BoolAttr transpose_b, ::mlir::ArrayAttr fused_ops, ::mlir::FloatAttr epsilon, ::mlir::FloatAttr leakyrelu_alpha) {
  odsState.addOperands(a);
  odsState.addOperands(b);
  odsState.addOperands(args);
  odsState.addAttribute(transpose_aAttrName(odsState.name), transpose_a);
  odsState.addAttribute(transpose_bAttrName(odsState.name), transpose_b);
  odsState.addAttribute(fused_opsAttrName(odsState.name), fused_ops);
  odsState.addAttribute(epsilonAttrName(odsState.name), epsilon);
  odsState.addAttribute(leakyrelu_alphaAttrName(odsState.name), leakyrelu_alpha);
  odsState.addTypes(product);
}

void _FusedMatMulOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value a, ::mlir::Value b, ::mlir::ValueRange args, ::mlir::BoolAttr transpose_a, ::mlir::BoolAttr transpose_b, ::mlir::ArrayAttr fused_ops, ::mlir::FloatAttr epsilon, ::mlir::FloatAttr leakyrelu_alpha) {
  odsState.addOperands(a);
  odsState.addOperands(b);
  odsState.addOperands(args);
  odsState.addAttribute(transpose_aAttrName(odsState.name), transpose_a);
  odsState.addAttribute(transpose_bAttrName(odsState.name), transpose_b);
  odsState.addAttribute(fused_opsAttrName(odsState.name), fused_ops);
  odsState.addAttribute(epsilonAttrName(odsState.name), epsilon);
  odsState.addAttribute(leakyrelu_alphaAttrName(odsState.name), leakyrelu_alpha);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void _FusedMatMulOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type product, ::mlir::Value a, ::mlir::Value b, ::mlir::ValueRange args, bool transpose_a, bool transpose_b, ::mlir::ArrayAttr fused_ops, ::llvm::APFloat epsilon, ::llvm::APFloat leakyrelu_alpha) {
  odsState.addOperands(a);
  odsState.addOperands(b);
  odsState.addOperands(args);
  odsState.addAttribute(transpose_aAttrName(odsState.name), odsBuilder.getBoolAttr(transpose_a));
  odsState.addAttribute(transpose_bAttrName(odsState.name), odsBuilder.getBoolAttr(transpose_b));
  odsState.addAttribute(fused_opsAttrName(odsState.name), fused_ops);
  odsState.addAttribute(epsilonAttrName(odsState.name), odsBuilder.getFloatAttr(odsBuilder.getF32Type(), epsilon));
  odsState.addAttribute(leakyrelu_alphaAttrName(odsState.name), odsBuilder.getFloatAttr(odsBuilder.getF32Type(), leakyrelu_alpha));
  odsState.addTypes(product);
}

void _FusedMatMulOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value a, ::mlir::Value b, ::mlir::ValueRange args, bool transpose_a, bool transpose_b, ::mlir::ArrayAttr fused_ops, ::llvm::APFloat epsilon, ::llvm::APFloat leakyrelu_alpha) {
  odsState.addOperands(a);
  odsState.addOperands(b);
  odsState.addOperands(args);
  odsState.addAttribute(transpose_aAttrName(odsState.name), odsBuilder.getBoolAttr(transpose_a));
  odsState.addAttribute(transpose_bAttrName(odsState.name), odsBuilder.getBoolAttr(transpose_b));
  odsState.addAttribute(fused_opsAttrName(odsState.name), fused_ops);
  odsState.addAttribute(epsilonAttrName(odsState.name), odsBuilder.getFloatAttr(odsBuilder.getF32Type(), epsilon));
  odsState.addAttribute(leakyrelu_alphaAttrName(odsState.name), odsBuilder.getFloatAttr(odsBuilder.getF32Type(), leakyrelu_alpha));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void _FusedMatMulOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() >= 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult _FusedMatMulOp::verify() {
  {
    auto tblgen_transpose_a = (*this)->getAttr(transpose_aAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_transpose_a, "transpose_a")))
      return ::mlir::failure();
  }
  {
    auto tblgen_transpose_b = (*this)->getAttr(transpose_bAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_transpose_b, "transpose_b")))
      return ::mlir::failure();
  }
  {
    auto tblgen_fused_ops = (*this)->getAttr(fused_opsAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops22(*this, tblgen_fused_ops, "fused_ops")))
      return ::mlir::failure();
  }
  {
    auto tblgen_epsilon = (*this)->getAttr(epsilonAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops5(*this, tblgen_epsilon, "epsilon")))
      return ::mlir::failure();
  }
  {
    auto tblgen_leakyrelu_alpha = (*this)->getAttr(leakyrelu_alphaAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops5(*this, tblgen_leakyrelu_alpha, "leakyrelu_alpha")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops41(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops41(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops41(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops41(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void _FusedMatMulOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::_FusedMatMulOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::_HostRecvOp definitions
//===----------------------------------------------------------------------===//

_HostRecvOpAdaptor::_HostRecvOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

_HostRecvOpAdaptor::_HostRecvOpAdaptor(_HostRecvOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange _HostRecvOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> _HostRecvOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange _HostRecvOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::DictionaryAttr _HostRecvOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::StringAttr _HostRecvOpAdaptor::tensor_name() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("tensor_name").cast<::mlir::StringAttr>();
  return attr;
}

::mlir::StringAttr _HostRecvOpAdaptor::send_device() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("send_device").cast<::mlir::StringAttr>();
  return attr;
}

::mlir::IntegerAttr _HostRecvOpAdaptor::send_device_incarnation() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("send_device_incarnation").cast<::mlir::IntegerAttr>();
  return attr;
}

::mlir::StringAttr _HostRecvOpAdaptor::recv_device() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("recv_device").cast<::mlir::StringAttr>();
  return attr;
}

::mlir::BoolAttr _HostRecvOpAdaptor::client_terminated() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("client_terminated").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(false);
  return attr;
}

::mlir::LogicalResult _HostRecvOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_tensor_name = odsAttrs.get("tensor_name");
    if (!tblgen_tensor_name)
      return emitError(loc, "'tf._HostRecv' op ""requires attribute 'tensor_name'");

    if (tblgen_tensor_name && !((tblgen_tensor_name.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf._HostRecv' op ""attribute 'tensor_name' failed to satisfy constraint: string attribute");
  }
  {
    auto tblgen_send_device = odsAttrs.get("send_device");
    if (!tblgen_send_device)
      return emitError(loc, "'tf._HostRecv' op ""requires attribute 'send_device'");

    if (tblgen_send_device && !((tblgen_send_device.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf._HostRecv' op ""attribute 'send_device' failed to satisfy constraint: string attribute");
  }
  {
    auto tblgen_send_device_incarnation = odsAttrs.get("send_device_incarnation");
    if (!tblgen_send_device_incarnation)
      return emitError(loc, "'tf._HostRecv' op ""requires attribute 'send_device_incarnation'");

    if (tblgen_send_device_incarnation && !(((tblgen_send_device_incarnation.isa<::mlir::IntegerAttr>())) && ((tblgen_send_device_incarnation.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf._HostRecv' op ""attribute 'send_device_incarnation' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_recv_device = odsAttrs.get("recv_device");
    if (!tblgen_recv_device)
      return emitError(loc, "'tf._HostRecv' op ""requires attribute 'recv_device'");

    if (tblgen_recv_device && !((tblgen_recv_device.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf._HostRecv' op ""attribute 'recv_device' failed to satisfy constraint: string attribute");
  }
  {
    auto tblgen_client_terminated = odsAttrs.get("client_terminated");
    if (tblgen_client_terminated && !((tblgen_client_terminated.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf._HostRecv' op ""attribute 'client_terminated' failed to satisfy constraint: bool attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> _HostRecvOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range _HostRecvOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

std::pair<unsigned, unsigned> _HostRecvOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range _HostRecvOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value _HostRecvOp::tensor() {
  return *getODSResults(0).begin();
}

::mlir::StringAttr _HostRecvOp::tensor_nameAttr() {
  return (*this)->getAttr(tensor_nameAttrName()).cast<::mlir::StringAttr>();
}

::llvm::StringRef _HostRecvOp::tensor_name() {
  auto attr = tensor_nameAttr();
  return attr.getValue();
}

::mlir::StringAttr _HostRecvOp::send_deviceAttr() {
  return (*this)->getAttr(send_deviceAttrName()).cast<::mlir::StringAttr>();
}

::llvm::StringRef _HostRecvOp::send_device() {
  auto attr = send_deviceAttr();
  return attr.getValue();
}

::mlir::IntegerAttr _HostRecvOp::send_device_incarnationAttr() {
  return (*this)->getAttr(send_device_incarnationAttrName()).cast<::mlir::IntegerAttr>();
}

uint64_t _HostRecvOp::send_device_incarnation() {
  auto attr = send_device_incarnationAttr();
  return attr.getValue().getZExtValue();
}

::mlir::StringAttr _HostRecvOp::recv_deviceAttr() {
  return (*this)->getAttr(recv_deviceAttrName()).cast<::mlir::StringAttr>();
}

::llvm::StringRef _HostRecvOp::recv_device() {
  auto attr = recv_deviceAttr();
  return attr.getValue();
}

::mlir::BoolAttr _HostRecvOp::client_terminatedAttr() {
  return (*this)->getAttr(client_terminatedAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool _HostRecvOp::client_terminated() {
  auto attr = client_terminatedAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(false).getValue();
  return attr.getValue();
}

::mlir::Type _HostRecvOp::tensor_type() {
  return mlir::getElementTypeOrSelf(*getODSResults(0).begin());
}

bool _HostRecvOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "tensor_type") return true;
 return false;
}

::mlir::DictionaryAttr _HostRecvOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {tensor_typeAttrName(),
::mlir::TypeAttr::get(tensor_type())}});
}

void _HostRecvOp::tensor_nameAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(tensor_nameAttrName(), attr);
}

void _HostRecvOp::send_deviceAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(send_deviceAttrName(), attr);
}

void _HostRecvOp::send_device_incarnationAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(send_device_incarnationAttrName(), attr);
}

void _HostRecvOp::recv_deviceAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(recv_deviceAttrName(), attr);
}

void _HostRecvOp::client_terminatedAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(client_terminatedAttrName(), attr);
}

void _HostRecvOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type tensor, ::mlir::StringAttr tensor_name, ::mlir::StringAttr send_device, ::mlir::IntegerAttr send_device_incarnation, ::mlir::StringAttr recv_device, ::mlir::BoolAttr client_terminated) {
  odsState.addAttribute(tensor_nameAttrName(odsState.name), tensor_name);
  odsState.addAttribute(send_deviceAttrName(odsState.name), send_device);
  odsState.addAttribute(send_device_incarnationAttrName(odsState.name), send_device_incarnation);
  odsState.addAttribute(recv_deviceAttrName(odsState.name), recv_device);
  odsState.addAttribute(client_terminatedAttrName(odsState.name), client_terminated);
  odsState.addTypes(tensor);
}

void _HostRecvOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::StringAttr tensor_name, ::mlir::StringAttr send_device, ::mlir::IntegerAttr send_device_incarnation, ::mlir::StringAttr recv_device, ::mlir::BoolAttr client_terminated) {
  odsState.addAttribute(tensor_nameAttrName(odsState.name), tensor_name);
  odsState.addAttribute(send_deviceAttrName(odsState.name), send_device);
  odsState.addAttribute(send_device_incarnationAttrName(odsState.name), send_device_incarnation);
  odsState.addAttribute(recv_deviceAttrName(odsState.name), recv_device);
  odsState.addAttribute(client_terminatedAttrName(odsState.name), client_terminated);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void _HostRecvOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type tensor, ::llvm::StringRef tensor_name, ::llvm::StringRef send_device, uint64_t send_device_incarnation, ::llvm::StringRef recv_device, bool client_terminated) {
  odsState.addAttribute(tensor_nameAttrName(odsState.name), odsBuilder.getStringAttr(tensor_name));
  odsState.addAttribute(send_deviceAttrName(odsState.name), odsBuilder.getStringAttr(send_device));
  odsState.addAttribute(send_device_incarnationAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), send_device_incarnation));
  odsState.addAttribute(recv_deviceAttrName(odsState.name), odsBuilder.getStringAttr(recv_device));
  odsState.addAttribute(client_terminatedAttrName(odsState.name), odsBuilder.getBoolAttr(client_terminated));
  odsState.addTypes(tensor);
}

void _HostRecvOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::llvm::StringRef tensor_name, ::llvm::StringRef send_device, uint64_t send_device_incarnation, ::llvm::StringRef recv_device, bool client_terminated) {
  odsState.addAttribute(tensor_nameAttrName(odsState.name), odsBuilder.getStringAttr(tensor_name));
  odsState.addAttribute(send_deviceAttrName(odsState.name), odsBuilder.getStringAttr(send_device));
  odsState.addAttribute(send_device_incarnationAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), send_device_incarnation));
  odsState.addAttribute(recv_deviceAttrName(odsState.name), odsBuilder.getStringAttr(recv_device));
  odsState.addAttribute(client_terminatedAttrName(odsState.name), odsBuilder.getBoolAttr(client_terminated));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void _HostRecvOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 0u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult _HostRecvOp::verify() {
  {
    auto tblgen_tensor_name = (*this)->getAttr(tensor_nameAttrName());
    if (!tblgen_tensor_name)
      return emitOpError("requires attribute 'tensor_name'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_tensor_name, "tensor_name")))
      return ::mlir::failure();
  }
  {
    auto tblgen_send_device = (*this)->getAttr(send_deviceAttrName());
    if (!tblgen_send_device)
      return emitOpError("requires attribute 'send_device'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_send_device, "send_device")))
      return ::mlir::failure();
  }
  {
    auto tblgen_send_device_incarnation = (*this)->getAttr(send_device_incarnationAttrName());
    if (!tblgen_send_device_incarnation)
      return emitOpError("requires attribute 'send_device_incarnation'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_send_device_incarnation, "send_device_incarnation")))
      return ::mlir::failure();
  }
  {
    auto tblgen_recv_device = (*this)->getAttr(recv_deviceAttrName());
    if (!tblgen_recv_device)
      return emitOpError("requires attribute 'recv_device'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_recv_device, "recv_device")))
      return ::mlir::failure();
  }
  {
    auto tblgen_client_terminated = (*this)->getAttr(client_terminatedAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_client_terminated, "client_terminated")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::_HostRecvOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::_HostSendOp definitions
//===----------------------------------------------------------------------===//

_HostSendOpAdaptor::_HostSendOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

_HostSendOpAdaptor::_HostSendOpAdaptor(_HostSendOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange _HostSendOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> _HostSendOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange _HostSendOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value _HostSendOpAdaptor::tensor() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr _HostSendOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::StringAttr _HostSendOpAdaptor::tensor_name() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("tensor_name").cast<::mlir::StringAttr>();
  return attr;
}

::mlir::StringAttr _HostSendOpAdaptor::send_device() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("send_device").cast<::mlir::StringAttr>();
  return attr;
}

::mlir::IntegerAttr _HostSendOpAdaptor::send_device_incarnation() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("send_device_incarnation").cast<::mlir::IntegerAttr>();
  return attr;
}

::mlir::StringAttr _HostSendOpAdaptor::recv_device() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("recv_device").cast<::mlir::StringAttr>();
  return attr;
}

::mlir::BoolAttr _HostSendOpAdaptor::client_terminated() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::BoolAttr attr = odsAttrs.get("client_terminated").dyn_cast_or_null<::mlir::BoolAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getBoolAttr(false);
  return attr;
}

::mlir::LogicalResult _HostSendOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_tensor_name = odsAttrs.get("tensor_name");
    if (!tblgen_tensor_name)
      return emitError(loc, "'tf._HostSend' op ""requires attribute 'tensor_name'");

    if (tblgen_tensor_name && !((tblgen_tensor_name.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf._HostSend' op ""attribute 'tensor_name' failed to satisfy constraint: string attribute");
  }
  {
    auto tblgen_send_device = odsAttrs.get("send_device");
    if (!tblgen_send_device)
      return emitError(loc, "'tf._HostSend' op ""requires attribute 'send_device'");

    if (tblgen_send_device && !((tblgen_send_device.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf._HostSend' op ""attribute 'send_device' failed to satisfy constraint: string attribute");
  }
  {
    auto tblgen_send_device_incarnation = odsAttrs.get("send_device_incarnation");
    if (!tblgen_send_device_incarnation)
      return emitError(loc, "'tf._HostSend' op ""requires attribute 'send_device_incarnation'");

    if (tblgen_send_device_incarnation && !(((tblgen_send_device_incarnation.isa<::mlir::IntegerAttr>())) && ((tblgen_send_device_incarnation.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf._HostSend' op ""attribute 'send_device_incarnation' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_recv_device = odsAttrs.get("recv_device");
    if (!tblgen_recv_device)
      return emitError(loc, "'tf._HostSend' op ""requires attribute 'recv_device'");

    if (tblgen_recv_device && !((tblgen_recv_device.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf._HostSend' op ""attribute 'recv_device' failed to satisfy constraint: string attribute");
  }
  {
    auto tblgen_client_terminated = odsAttrs.get("client_terminated");
    if (tblgen_client_terminated && !((tblgen_client_terminated.isa<::mlir::BoolAttr>())))
      return emitError(loc, "'tf._HostSend' op ""attribute 'client_terminated' failed to satisfy constraint: bool attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> _HostSendOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range _HostSendOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value _HostSendOp::tensor() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange _HostSendOp::tensorMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> _HostSendOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range _HostSendOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::StringAttr _HostSendOp::tensor_nameAttr() {
  return (*this)->getAttr(tensor_nameAttrName()).cast<::mlir::StringAttr>();
}

::llvm::StringRef _HostSendOp::tensor_name() {
  auto attr = tensor_nameAttr();
  return attr.getValue();
}

::mlir::StringAttr _HostSendOp::send_deviceAttr() {
  return (*this)->getAttr(send_deviceAttrName()).cast<::mlir::StringAttr>();
}

::llvm::StringRef _HostSendOp::send_device() {
  auto attr = send_deviceAttr();
  return attr.getValue();
}

::mlir::IntegerAttr _HostSendOp::send_device_incarnationAttr() {
  return (*this)->getAttr(send_device_incarnationAttrName()).cast<::mlir::IntegerAttr>();
}

uint64_t _HostSendOp::send_device_incarnation() {
  auto attr = send_device_incarnationAttr();
  return attr.getValue().getZExtValue();
}

::mlir::StringAttr _HostSendOp::recv_deviceAttr() {
  return (*this)->getAttr(recv_deviceAttrName()).cast<::mlir::StringAttr>();
}

::llvm::StringRef _HostSendOp::recv_device() {
  auto attr = recv_deviceAttr();
  return attr.getValue();
}

::mlir::BoolAttr _HostSendOp::client_terminatedAttr() {
  return (*this)->getAttr(client_terminatedAttrName()).dyn_cast_or_null<::mlir::BoolAttr>();
}

bool _HostSendOp::client_terminated() {
  auto attr = client_terminatedAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getBoolAttr(false).getValue();
  return attr.getValue();
}

::mlir::Type _HostSendOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool _HostSendOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr _HostSendOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void _HostSendOp::tensor_nameAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(tensor_nameAttrName(), attr);
}

void _HostSendOp::send_deviceAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(send_deviceAttrName(), attr);
}

void _HostSendOp::send_device_incarnationAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(send_device_incarnationAttrName(), attr);
}

void _HostSendOp::recv_deviceAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(recv_deviceAttrName(), attr);
}

void _HostSendOp::client_terminatedAttr(::mlir::BoolAttr attr) {
  (*this)->setAttr(client_terminatedAttrName(), attr);
}

void _HostSendOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value tensor, ::mlir::StringAttr tensor_name, ::mlir::StringAttr send_device, ::mlir::IntegerAttr send_device_incarnation, ::mlir::StringAttr recv_device, ::mlir::BoolAttr client_terminated) {
  odsState.addOperands(tensor);
  odsState.addAttribute(tensor_nameAttrName(odsState.name), tensor_name);
  odsState.addAttribute(send_deviceAttrName(odsState.name), send_device);
  odsState.addAttribute(send_device_incarnationAttrName(odsState.name), send_device_incarnation);
  odsState.addAttribute(recv_deviceAttrName(odsState.name), recv_device);
  odsState.addAttribute(client_terminatedAttrName(odsState.name), client_terminated);
}

void _HostSendOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value tensor, ::mlir::StringAttr tensor_name, ::mlir::StringAttr send_device, ::mlir::IntegerAttr send_device_incarnation, ::mlir::StringAttr recv_device, ::mlir::BoolAttr client_terminated) {
  odsState.addOperands(tensor);
  odsState.addAttribute(tensor_nameAttrName(odsState.name), tensor_name);
  odsState.addAttribute(send_deviceAttrName(odsState.name), send_device);
  odsState.addAttribute(send_device_incarnationAttrName(odsState.name), send_device_incarnation);
  odsState.addAttribute(recv_deviceAttrName(odsState.name), recv_device);
  odsState.addAttribute(client_terminatedAttrName(odsState.name), client_terminated);
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void _HostSendOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value tensor, ::llvm::StringRef tensor_name, ::llvm::StringRef send_device, uint64_t send_device_incarnation, ::llvm::StringRef recv_device, bool client_terminated) {
  odsState.addOperands(tensor);
  odsState.addAttribute(tensor_nameAttrName(odsState.name), odsBuilder.getStringAttr(tensor_name));
  odsState.addAttribute(send_deviceAttrName(odsState.name), odsBuilder.getStringAttr(send_device));
  odsState.addAttribute(send_device_incarnationAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), send_device_incarnation));
  odsState.addAttribute(recv_deviceAttrName(odsState.name), odsBuilder.getStringAttr(recv_device));
  odsState.addAttribute(client_terminatedAttrName(odsState.name), odsBuilder.getBoolAttr(client_terminated));
}

void _HostSendOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value tensor, ::llvm::StringRef tensor_name, ::llvm::StringRef send_device, uint64_t send_device_incarnation, ::llvm::StringRef recv_device, bool client_terminated) {
  odsState.addOperands(tensor);
  odsState.addAttribute(tensor_nameAttrName(odsState.name), odsBuilder.getStringAttr(tensor_name));
  odsState.addAttribute(send_deviceAttrName(odsState.name), odsBuilder.getStringAttr(send_device));
  odsState.addAttribute(send_device_incarnationAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), send_device_incarnation));
  odsState.addAttribute(recv_deviceAttrName(odsState.name), odsBuilder.getStringAttr(recv_device));
  odsState.addAttribute(client_terminatedAttrName(odsState.name), odsBuilder.getBoolAttr(client_terminated));
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void _HostSendOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 0u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult _HostSendOp::verify() {
  {
    auto tblgen_tensor_name = (*this)->getAttr(tensor_nameAttrName());
    if (!tblgen_tensor_name)
      return emitOpError("requires attribute 'tensor_name'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_tensor_name, "tensor_name")))
      return ::mlir::failure();
  }
  {
    auto tblgen_send_device = (*this)->getAttr(send_deviceAttrName());
    if (!tblgen_send_device)
      return emitOpError("requires attribute 'send_device'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_send_device, "send_device")))
      return ::mlir::failure();
  }
  {
    auto tblgen_send_device_incarnation = (*this)->getAttr(send_device_incarnationAttrName());
    if (!tblgen_send_device_incarnation)
      return emitOpError("requires attribute 'send_device_incarnation'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_send_device_incarnation, "send_device_incarnation")))
      return ::mlir::failure();
  }
  {
    auto tblgen_recv_device = (*this)->getAttr(recv_deviceAttrName());
    if (!tblgen_recv_device)
      return emitOpError("requires attribute 'recv_device'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_recv_device, "recv_device")))
      return ::mlir::failure();
  }
  {
    auto tblgen_client_terminated = (*this)->getAttr(client_terminatedAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops0(*this, tblgen_client_terminated, "client_terminated")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::_HostSendOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::_InternalTestMustExecuteTrait_ definitions
//===----------------------------------------------------------------------===//

_InternalTestMustExecuteTrait_Adaptor::_InternalTestMustExecuteTrait_Adaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

_InternalTestMustExecuteTrait_Adaptor::_InternalTestMustExecuteTrait_Adaptor(_InternalTestMustExecuteTrait_ &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange _InternalTestMustExecuteTrait_Adaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> _InternalTestMustExecuteTrait_Adaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange _InternalTestMustExecuteTrait_Adaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::DictionaryAttr _InternalTestMustExecuteTrait_Adaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult _InternalTestMustExecuteTrait_Adaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> _InternalTestMustExecuteTrait_::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range _InternalTestMustExecuteTrait_::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

std::pair<unsigned, unsigned> _InternalTestMustExecuteTrait_::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range _InternalTestMustExecuteTrait_::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

void _InternalTestMustExecuteTrait_::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState) {
}

void _InternalTestMustExecuteTrait_::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes) {
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void _InternalTestMustExecuteTrait_::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 0u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 0u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult _InternalTestMustExecuteTrait_::verify() {
  return ::mlir::success();
}

void _InternalTestMustExecuteTrait_::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  effects.emplace_back(::mlir::MemoryEffects::Write::get(), ::mlir::TF::ResourceEffects::MustExecute::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::_InternalTestMustExecuteTrait_)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::_InternalTestNonResourceValueSideEffects_ definitions
//===----------------------------------------------------------------------===//

_InternalTestNonResourceValueSideEffects_Adaptor::_InternalTestNonResourceValueSideEffects_Adaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

_InternalTestNonResourceValueSideEffects_Adaptor::_InternalTestNonResourceValueSideEffects_Adaptor(_InternalTestNonResourceValueSideEffects_ &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange _InternalTestNonResourceValueSideEffects_Adaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> _InternalTestNonResourceValueSideEffects_Adaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange _InternalTestNonResourceValueSideEffects_Adaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value _InternalTestNonResourceValueSideEffects_Adaptor::key() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr _InternalTestNonResourceValueSideEffects_Adaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult _InternalTestNonResourceValueSideEffects_Adaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> _InternalTestNonResourceValueSideEffects_::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range _InternalTestNonResourceValueSideEffects_::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value _InternalTestNonResourceValueSideEffects_::key() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange _InternalTestNonResourceValueSideEffects_::keyMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> _InternalTestNonResourceValueSideEffects_::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range _InternalTestNonResourceValueSideEffects_::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

void _InternalTestNonResourceValueSideEffects_::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value key) {
  odsState.addOperands(key);
}

void _InternalTestNonResourceValueSideEffects_::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value key) {
  odsState.addOperands(key);
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void _InternalTestNonResourceValueSideEffects_::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 0u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult _InternalTestNonResourceValueSideEffects_::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops19(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void _InternalTestNonResourceValueSideEffects_::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  for (::mlir::Value value : getODSOperands(0))
    effects.emplace_back(::mlir::MemoryEffects::Read::get(), value, ::mlir::TF::ResourceEffects::DatasetIterator::get());
  for (::mlir::Value value : getODSOperands(0))
    effects.emplace_back(::mlir::MemoryEffects::Write::get(), value, ::mlir::TF::ResourceEffects::DatasetIterator::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::_InternalTestNonResourceValueSideEffects_)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::_ListToArrayOp definitions
//===----------------------------------------------------------------------===//

_ListToArrayOpAdaptor::_ListToArrayOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

_ListToArrayOpAdaptor::_ListToArrayOpAdaptor(_ListToArrayOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange _ListToArrayOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> _ListToArrayOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  bool isVariadic[] = {true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (odsOperands.size() - 0) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::ValueRange _ListToArrayOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::ValueRange _ListToArrayOpAdaptor::input() {
  return getODSOperands(0);
}

::mlir::DictionaryAttr _ListToArrayOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult _ListToArrayOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> _ListToArrayOp::getODSOperandIndexAndLength(unsigned index) {
  bool isVariadic[] = {true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (getOperation()->getNumOperands() - 0) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::Operation::operand_range _ListToArrayOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Operation::operand_range _ListToArrayOp::input() {
  return getODSOperands(0);
}

::mlir::MutableOperandRange _ListToArrayOp::inputMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> _ListToArrayOp::getODSResultIndexAndLength(unsigned index) {
  bool isVariadic[] = {true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (getOperation()->getNumResults() - 0) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::Operation::result_range _ListToArrayOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Operation::result_range _ListToArrayOp::output() {
  return getODSResults(0);
}

mlir::OperandElementTypeRange _ListToArrayOp::Tin() {
  auto values = getODSOperands(0);
return {mlir::OperandElementTypeIterator(values.begin()), mlir::OperandElementTypeIterator(values.end())};
}

size_t _ListToArrayOp::N() {
  auto range = getODSResults(0);
return std::distance(range.begin(), range.end());
}

::mlir::Type _ListToArrayOp::T() {
  return mlir::getElementTypeOrSelf(*getODSResults(0).begin());
}

bool _ListToArrayOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "Tin") return true;
  if (name == "N") return true;
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr _ListToArrayOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TinAttrName(),
ArrayAttr::get(ctx, 
    [&]() {
      llvm::SmallVector<Attribute, 4> ret;
      for (auto t : Tin())
        ret.push_back(TypeAttr::get(t));
      return ret;
    }())},
    {NAttrName(),
odsBuilder.getI64IntegerAttr(N())},
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void _ListToArrayOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult _ListToArrayOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void _ListToArrayOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::_ListToArrayOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::_RecvTPUEmbeddingActivationsOp definitions
//===----------------------------------------------------------------------===//

_RecvTPUEmbeddingActivationsOpAdaptor::_RecvTPUEmbeddingActivationsOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

_RecvTPUEmbeddingActivationsOpAdaptor::_RecvTPUEmbeddingActivationsOpAdaptor(_RecvTPUEmbeddingActivationsOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange _RecvTPUEmbeddingActivationsOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> _RecvTPUEmbeddingActivationsOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange _RecvTPUEmbeddingActivationsOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value _RecvTPUEmbeddingActivationsOpAdaptor::deduplication_data() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr _RecvTPUEmbeddingActivationsOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::StringAttr _RecvTPUEmbeddingActivationsOpAdaptor::config() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("config").cast<::mlir::StringAttr>();
  return attr;
}

::mlir::LogicalResult _RecvTPUEmbeddingActivationsOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_config = odsAttrs.get("config");
    if (!tblgen_config)
      return emitError(loc, "'tf._RecvTPUEmbeddingActivations' op ""requires attribute 'config'");

    if (tblgen_config && !((tblgen_config.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf._RecvTPUEmbeddingActivations' op ""attribute 'config' failed to satisfy constraint: string attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> _RecvTPUEmbeddingActivationsOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range _RecvTPUEmbeddingActivationsOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value _RecvTPUEmbeddingActivationsOp::deduplication_data() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange _RecvTPUEmbeddingActivationsOp::deduplication_dataMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> _RecvTPUEmbeddingActivationsOp::getODSResultIndexAndLength(unsigned index) {
  bool isVariadic[] = {true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (getOperation()->getNumResults() - 0) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::Operation::result_range _RecvTPUEmbeddingActivationsOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Operation::result_range _RecvTPUEmbeddingActivationsOp::outputs() {
  return getODSResults(0);
}

::mlir::StringAttr _RecvTPUEmbeddingActivationsOp::configAttr() {
  return (*this)->getAttr(configAttrName()).cast<::mlir::StringAttr>();
}

::llvm::StringRef _RecvTPUEmbeddingActivationsOp::config() {
  auto attr = configAttr();
  return attr.getValue();
}

size_t _RecvTPUEmbeddingActivationsOp::num_tables() {
  auto range = getODSResults(0);
return std::distance(range.begin(), range.end());
}

bool _RecvTPUEmbeddingActivationsOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "num_tables") return true;
 return false;
}

::mlir::DictionaryAttr _RecvTPUEmbeddingActivationsOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {num_tablesAttrName(),
odsBuilder.getI64IntegerAttr(num_tables())}});
}

void _RecvTPUEmbeddingActivationsOp::configAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(configAttrName(), attr);
}

void _RecvTPUEmbeddingActivationsOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange outputs, ::mlir::Value deduplication_data, ::mlir::StringAttr config) {
  odsState.addOperands(deduplication_data);
  odsState.addAttribute(configAttrName(odsState.name), config);
  odsState.addTypes(outputs);
}

void _RecvTPUEmbeddingActivationsOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange outputs, ::mlir::Value deduplication_data, ::llvm::StringRef config) {
  odsState.addOperands(deduplication_data);
  odsState.addAttribute(configAttrName(odsState.name), odsBuilder.getStringAttr(config));
  odsState.addTypes(outputs);
}

void _RecvTPUEmbeddingActivationsOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult _RecvTPUEmbeddingActivationsOp::verify() {
  {
    auto tblgen_config = (*this)->getAttr(configAttrName());
    if (!tblgen_config)
      return emitOpError("requires attribute 'config'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_config, "config")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops15(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void _RecvTPUEmbeddingActivationsOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  effects.emplace_back(::mlir::MemoryEffects::Write::get(), ::mlir::TF::ResourceEffects::MustExecute::get());
  effects.emplace_back(::mlir::MemoryEffects::Read::get(), ::mlir::TF::ResourceEffects::TPUEmbedding::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::_RecvTPUEmbeddingActivationsOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::_RecvTPUEmbeddingDeduplicationDataOp definitions
//===----------------------------------------------------------------------===//

_RecvTPUEmbeddingDeduplicationDataOpAdaptor::_RecvTPUEmbeddingDeduplicationDataOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

_RecvTPUEmbeddingDeduplicationDataOpAdaptor::_RecvTPUEmbeddingDeduplicationDataOpAdaptor(_RecvTPUEmbeddingDeduplicationDataOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange _RecvTPUEmbeddingDeduplicationDataOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> _RecvTPUEmbeddingDeduplicationDataOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange _RecvTPUEmbeddingDeduplicationDataOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::DictionaryAttr _RecvTPUEmbeddingDeduplicationDataOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::StringAttr _RecvTPUEmbeddingDeduplicationDataOpAdaptor::config() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("config").cast<::mlir::StringAttr>();
  return attr;
}

::mlir::LogicalResult _RecvTPUEmbeddingDeduplicationDataOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_config = odsAttrs.get("config");
    if (!tblgen_config)
      return emitError(loc, "'tf._RecvTPUEmbeddingDeduplicationData' op ""requires attribute 'config'");

    if (tblgen_config && !((tblgen_config.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf._RecvTPUEmbeddingDeduplicationData' op ""attribute 'config' failed to satisfy constraint: string attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> _RecvTPUEmbeddingDeduplicationDataOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range _RecvTPUEmbeddingDeduplicationDataOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

std::pair<unsigned, unsigned> _RecvTPUEmbeddingDeduplicationDataOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range _RecvTPUEmbeddingDeduplicationDataOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value _RecvTPUEmbeddingDeduplicationDataOp::output() {
  return *getODSResults(0).begin();
}

::mlir::StringAttr _RecvTPUEmbeddingDeduplicationDataOp::configAttr() {
  return (*this)->getAttr(configAttrName()).cast<::mlir::StringAttr>();
}

::llvm::StringRef _RecvTPUEmbeddingDeduplicationDataOp::config() {
  auto attr = configAttr();
  return attr.getValue();
}

void _RecvTPUEmbeddingDeduplicationDataOp::configAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(configAttrName(), attr);
}

void _RecvTPUEmbeddingDeduplicationDataOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::mlir::StringAttr config) {
  odsState.addAttribute(configAttrName(odsState.name), config);
  odsState.addTypes(output);
}

void _RecvTPUEmbeddingDeduplicationDataOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::StringAttr config) {
  odsState.addAttribute(configAttrName(odsState.name), config);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void _RecvTPUEmbeddingDeduplicationDataOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type output, ::llvm::StringRef config) {
  odsState.addAttribute(configAttrName(odsState.name), odsBuilder.getStringAttr(config));
  odsState.addTypes(output);
}

void _RecvTPUEmbeddingDeduplicationDataOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::llvm::StringRef config) {
  odsState.addAttribute(configAttrName(odsState.name), odsBuilder.getStringAttr(config));
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void _RecvTPUEmbeddingDeduplicationDataOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 0u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult _RecvTPUEmbeddingDeduplicationDataOp::verify() {
  {
    auto tblgen_config = (*this)->getAttr(configAttrName());
    if (!tblgen_config)
      return emitOpError("requires attribute 'config'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_config, "config")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops15(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::_RecvTPUEmbeddingDeduplicationDataOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::_SendTPUEmbeddingGradientsOp definitions
//===----------------------------------------------------------------------===//

_SendTPUEmbeddingGradientsOpAdaptor::_SendTPUEmbeddingGradientsOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

_SendTPUEmbeddingGradientsOpAdaptor::_SendTPUEmbeddingGradientsOpAdaptor(_SendTPUEmbeddingGradientsOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange _SendTPUEmbeddingGradientsOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> _SendTPUEmbeddingGradientsOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  assert(odsAttrs && "missing segment size attribute for op");
  auto sizeAttr = odsAttrs.get("operand_segment_sizes").cast<::mlir::DenseIntElementsAttr>();

  const uint32_t *sizeAttrValueIt = &*sizeAttr.value_begin<uint32_t>();
  if (sizeAttr.isSplat())
    return {*sizeAttrValueIt * index, *sizeAttrValueIt};

  unsigned start = 0;
  for (unsigned i = 0; i < index; ++i)
    start += sizeAttrValueIt[i];
  return {start, sizeAttrValueIt[index]};
}

::mlir::ValueRange _SendTPUEmbeddingGradientsOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::ValueRange _SendTPUEmbeddingGradientsOpAdaptor::gradients() {
  return getODSOperands(0);
}

::mlir::ValueRange _SendTPUEmbeddingGradientsOpAdaptor::learning_rates() {
  return getODSOperands(1);
}

::mlir::Value _SendTPUEmbeddingGradientsOpAdaptor::deduplication_data() {
  return *getODSOperands(2).begin();
}

::mlir::DictionaryAttr _SendTPUEmbeddingGradientsOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::StringAttr _SendTPUEmbeddingGradientsOpAdaptor::config() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("config").cast<::mlir::StringAttr>();
  return attr;
}

::mlir::LogicalResult _SendTPUEmbeddingGradientsOpAdaptor::verify(::mlir::Location loc) {
  {
    auto sizeAttr = odsAttrs.get("operand_segment_sizes").dyn_cast<::mlir::DenseIntElementsAttr>();
    if (!sizeAttr)
      return emitError(loc, "'tf._SendTPUEmbeddingGradients' op ""missing segment sizes attribute 'operand_segment_sizes'");
    auto numElements =
        sizeAttr.getType().cast<::mlir::ShapedType>().getNumElements();
    if (numElements != 3)
      return emitError(loc, "'tf._SendTPUEmbeddingGradients' op ""'operand_segment_sizes' attribute for specifying operand segments must have 3 "
                "elements, but got ") << numElements;
  }
    {
    auto tblgen_config = odsAttrs.get("config");
    if (!tblgen_config)
      return emitError(loc, "'tf._SendTPUEmbeddingGradients' op ""requires attribute 'config'");

    if (tblgen_config && !((tblgen_config.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf._SendTPUEmbeddingGradients' op ""attribute 'config' failed to satisfy constraint: string attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> _SendTPUEmbeddingGradientsOp::getODSOperandIndexAndLength(unsigned index) {
  auto sizeAttr =
      (*this)->getAttr(operand_segment_sizesAttrName()).cast<::mlir::DenseIntElementsAttr>();

  const uint32_t *sizeAttrValueIt = &*sizeAttr.value_begin<uint32_t>();
  if (sizeAttr.isSplat())
    return {*sizeAttrValueIt * index, *sizeAttrValueIt};

  unsigned start = 0;
  for (unsigned i = 0; i < index; ++i)
    start += sizeAttrValueIt[i];
  return {start, sizeAttrValueIt[index]};
}

::mlir::Operation::operand_range _SendTPUEmbeddingGradientsOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Operation::operand_range _SendTPUEmbeddingGradientsOp::gradients() {
  return getODSOperands(0);
}

::mlir::Operation::operand_range _SendTPUEmbeddingGradientsOp::learning_rates() {
  return getODSOperands(1);
}

::mlir::Value _SendTPUEmbeddingGradientsOp::deduplication_data() {
  return *getODSOperands(2).begin();
}

::mlir::MutableOperandRange _SendTPUEmbeddingGradientsOp::gradientsMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second, ::mlir::MutableOperandRange::OperandSegment(0u, *getOperation()->getAttrDictionary().getNamed(operand_segment_sizesAttrName())));
  return mutableRange;
}

::mlir::MutableOperandRange _SendTPUEmbeddingGradientsOp::learning_ratesMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second, ::mlir::MutableOperandRange::OperandSegment(1u, *getOperation()->getAttrDictionary().getNamed(operand_segment_sizesAttrName())));
  return mutableRange;
}

::mlir::MutableOperandRange _SendTPUEmbeddingGradientsOp::deduplication_dataMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second, ::mlir::MutableOperandRange::OperandSegment(2u, *getOperation()->getAttrDictionary().getNamed(operand_segment_sizesAttrName())));
  return mutableRange;
}

std::pair<unsigned, unsigned> _SendTPUEmbeddingGradientsOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range _SendTPUEmbeddingGradientsOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::StringAttr _SendTPUEmbeddingGradientsOp::configAttr() {
  return (*this)->getAttr(configAttrName()).cast<::mlir::StringAttr>();
}

::llvm::StringRef _SendTPUEmbeddingGradientsOp::config() {
  auto attr = configAttr();
  return attr.getValue();
}

size_t _SendTPUEmbeddingGradientsOp::NumLearningRateTags() {
  auto range = getODSOperands(1);
return std::distance(range.begin(), range.end());
}

size_t _SendTPUEmbeddingGradientsOp::NumTables() {
  auto range = getODSOperands(0);
return std::distance(range.begin(), range.end());
}

bool _SendTPUEmbeddingGradientsOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "NumLearningRateTags") return true;
  if (name == "NumTables") return true;
 return false;
}

::mlir::DictionaryAttr _SendTPUEmbeddingGradientsOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {NumLearningRateTagsAttrName(),
odsBuilder.getI64IntegerAttr(NumLearningRateTags())},
    {NumTablesAttrName(),
odsBuilder.getI64IntegerAttr(NumTables())}});
}

void _SendTPUEmbeddingGradientsOp::configAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(configAttrName(), attr);
}

void _SendTPUEmbeddingGradientsOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange gradients, ::mlir::ValueRange learning_rates, ::mlir::Value deduplication_data, ::mlir::StringAttr config) {
  odsState.addOperands(gradients);
  odsState.addOperands(learning_rates);
  odsState.addOperands(deduplication_data);
  odsState.addAttribute(operand_segment_sizesAttrName(odsState.name), odsBuilder.getI32VectorAttr({static_cast<int32_t>(gradients.size()), static_cast<int32_t>(learning_rates.size()), 1}));
  odsState.addAttribute(configAttrName(odsState.name), config);
}

void _SendTPUEmbeddingGradientsOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange gradients, ::mlir::ValueRange learning_rates, ::mlir::Value deduplication_data, ::mlir::StringAttr config) {
  odsState.addOperands(gradients);
  odsState.addOperands(learning_rates);
  odsState.addOperands(deduplication_data);
  odsState.addAttribute(operand_segment_sizesAttrName(odsState.name), odsBuilder.getI32VectorAttr({static_cast<int32_t>(gradients.size()), static_cast<int32_t>(learning_rates.size()), 1}));
  odsState.addAttribute(configAttrName(odsState.name), config);
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void _SendTPUEmbeddingGradientsOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange gradients, ::mlir::ValueRange learning_rates, ::mlir::Value deduplication_data, ::llvm::StringRef config) {
  odsState.addOperands(gradients);
  odsState.addOperands(learning_rates);
  odsState.addOperands(deduplication_data);
  odsState.addAttribute(operand_segment_sizesAttrName(odsState.name), odsBuilder.getI32VectorAttr({static_cast<int32_t>(gradients.size()), static_cast<int32_t>(learning_rates.size()), 1}));
  odsState.addAttribute(configAttrName(odsState.name), odsBuilder.getStringAttr(config));
}

void _SendTPUEmbeddingGradientsOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange gradients, ::mlir::ValueRange learning_rates, ::mlir::Value deduplication_data, ::llvm::StringRef config) {
  odsState.addOperands(gradients);
  odsState.addOperands(learning_rates);
  odsState.addOperands(deduplication_data);
  odsState.addAttribute(operand_segment_sizesAttrName(odsState.name), odsBuilder.getI32VectorAttr({static_cast<int32_t>(gradients.size()), static_cast<int32_t>(learning_rates.size()), 1}));
  odsState.addAttribute(configAttrName(odsState.name), odsBuilder.getStringAttr(config));
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void _SendTPUEmbeddingGradientsOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() >= 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 0u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult _SendTPUEmbeddingGradientsOp::verify() {
  {
    auto sizeAttr = (*this)->getAttr(operand_segment_sizesAttrName()).dyn_cast<::mlir::DenseIntElementsAttr>();
    if (!sizeAttr)
      return emitOpError("missing segment sizes attribute 'operand_segment_sizes'");
    auto numElements =
        sizeAttr.getType().cast<::mlir::ShapedType>().getNumElements();
    if (numElements != 3)
      return emitOpError("'operand_segment_sizes' attribute for specifying operand segments must have 3 "
                "elements, but got ") << numElements;
  }
    {
    auto tblgen_config = (*this)->getAttr(configAttrName());
    if (!tblgen_config)
      return emitOpError("requires attribute 'config'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_config, "config")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops7(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops15(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void _SendTPUEmbeddingGradientsOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  effects.emplace_back(::mlir::MemoryEffects::Write::get(), ::mlir::TF::ResourceEffects::MustExecute::get());
  effects.emplace_back(::mlir::MemoryEffects::Read::get(), ::mlir::TF::ResourceEffects::TPUEmbedding::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::_SendTPUEmbeddingGradientsOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::_TPUCompileMlirOp definitions
//===----------------------------------------------------------------------===//

_TPUCompileMlirOpAdaptor::_TPUCompileMlirOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

_TPUCompileMlirOpAdaptor::_TPUCompileMlirOpAdaptor(_TPUCompileMlirOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange _TPUCompileMlirOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> _TPUCompileMlirOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  bool isVariadic[] = {true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (odsOperands.size() - 0) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::ValueRange _TPUCompileMlirOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::ValueRange _TPUCompileMlirOpAdaptor::dynamic_shapes() {
  return getODSOperands(0);
}

::mlir::DictionaryAttr _TPUCompileMlirOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::StringAttr _TPUCompileMlirOpAdaptor::mlir_module() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("mlir_module").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("");
  return attr;
}

::mlir::StringAttr _TPUCompileMlirOpAdaptor::metadata() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("metadata").cast<::mlir::StringAttr>();
  return attr;
}

::mlir::LogicalResult _TPUCompileMlirOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_mlir_module = odsAttrs.get("mlir_module");
    if (tblgen_mlir_module && !((tblgen_mlir_module.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf._TPUCompileMlir' op ""attribute 'mlir_module' failed to satisfy constraint: string attribute");
  }
  {
    auto tblgen_metadata = odsAttrs.get("metadata");
    if (!tblgen_metadata)
      return emitError(loc, "'tf._TPUCompileMlir' op ""requires attribute 'metadata'");

    if (tblgen_metadata && !((tblgen_metadata.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf._TPUCompileMlir' op ""attribute 'metadata' failed to satisfy constraint: string attribute");
  }
  return ::mlir::success();
}

void _TPUCompileMlirOp::getAsmResultNames(::mlir::OpAsmSetValueNameFn setNameFn) {
  auto resultGroup0 = getODSResults(0);
  if (!llvm::empty(resultGroup0))
    setNameFn(*resultGroup0.begin(), "compilation_status");
  auto resultGroup1 = getODSResults(1);
  if (!llvm::empty(resultGroup1))
    setNameFn(*resultGroup1.begin(), "program");
}

std::pair<unsigned, unsigned> _TPUCompileMlirOp::getODSOperandIndexAndLength(unsigned index) {
  bool isVariadic[] = {true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (getOperation()->getNumOperands() - 0) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::Operation::operand_range _TPUCompileMlirOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Operation::operand_range _TPUCompileMlirOp::dynamic_shapes() {
  return getODSOperands(0);
}

::mlir::MutableOperandRange _TPUCompileMlirOp::dynamic_shapesMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> _TPUCompileMlirOp::getODSResultIndexAndLength(unsigned index) {
  bool isVariadic[] = {false, true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (getOperation()->getNumResults() - 1) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::Operation::result_range _TPUCompileMlirOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value _TPUCompileMlirOp::compilation_status() {
  return *getODSResults(0).begin();
}

::mlir::Operation::result_range _TPUCompileMlirOp::program() {
  return getODSResults(1);
}

::mlir::StringAttr _TPUCompileMlirOp::mlir_moduleAttr() {
  return (*this)->getAttr(mlir_moduleAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef _TPUCompileMlirOp::mlir_module() {
  auto attr = mlir_moduleAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("").getValue();
  return attr.getValue();
}

::mlir::StringAttr _TPUCompileMlirOp::metadataAttr() {
  return (*this)->getAttr(metadataAttrName()).cast<::mlir::StringAttr>();
}

::llvm::StringRef _TPUCompileMlirOp::metadata() {
  auto attr = metadataAttr();
  return attr.getValue();
}

size_t _TPUCompileMlirOp::NumDynamicShapes() {
  auto range = getODSOperands(0);
return std::distance(range.begin(), range.end());
}

size_t _TPUCompileMlirOp::num_computations() {
  auto range = getODSResults(1);
return std::distance(range.begin(), range.end());
}

bool _TPUCompileMlirOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "NumDynamicShapes") return true;
  if (name == "num_computations") return true;
 return false;
}

::mlir::DictionaryAttr _TPUCompileMlirOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {NumDynamicShapesAttrName(),
odsBuilder.getI64IntegerAttr(NumDynamicShapes())},
    {num_computationsAttrName(),
odsBuilder.getI64IntegerAttr(num_computations())}});
}

void _TPUCompileMlirOp::mlir_moduleAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(mlir_moduleAttrName(), attr);
}

void _TPUCompileMlirOp::metadataAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(metadataAttrName(), attr);
}

void _TPUCompileMlirOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type compilation_status, ::mlir::TypeRange program, ::mlir::ValueRange dynamic_shapes, ::mlir::StringAttr mlir_module, ::mlir::StringAttr metadata) {
  odsState.addOperands(dynamic_shapes);
  odsState.addAttribute(mlir_moduleAttrName(odsState.name), mlir_module);
  odsState.addAttribute(metadataAttrName(odsState.name), metadata);
  odsState.addTypes(compilation_status);
  odsState.addTypes(program);
}

void _TPUCompileMlirOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange dynamic_shapes, ::mlir::StringAttr mlir_module, ::mlir::StringAttr metadata) {
  odsState.addOperands(dynamic_shapes);
  odsState.addAttribute(mlir_moduleAttrName(odsState.name), mlir_module);
  odsState.addAttribute(metadataAttrName(odsState.name), metadata);
  assert(resultTypes.size() >= 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void _TPUCompileMlirOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type compilation_status, ::mlir::TypeRange program, ::mlir::ValueRange dynamic_shapes, ::llvm::StringRef mlir_module, ::llvm::StringRef metadata) {
  odsState.addOperands(dynamic_shapes);
  odsState.addAttribute(mlir_moduleAttrName(odsState.name), odsBuilder.getStringAttr(mlir_module));
  odsState.addAttribute(metadataAttrName(odsState.name), odsBuilder.getStringAttr(metadata));
  odsState.addTypes(compilation_status);
  odsState.addTypes(program);
}

void _TPUCompileMlirOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange dynamic_shapes, ::llvm::StringRef mlir_module, ::llvm::StringRef metadata) {
  odsState.addOperands(dynamic_shapes);
  odsState.addAttribute(mlir_moduleAttrName(odsState.name), odsBuilder.getStringAttr(mlir_module));
  odsState.addAttribute(metadataAttrName(odsState.name), odsBuilder.getStringAttr(metadata));
  assert(resultTypes.size() >= 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void _TPUCompileMlirOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() >= 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult _TPUCompileMlirOp::verify() {
  {
    auto tblgen_mlir_module = (*this)->getAttr(mlir_moduleAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_mlir_module, "mlir_module")))
      return ::mlir::failure();
  }
  {
    auto tblgen_metadata = (*this)->getAttr(metadataAttrName());
    if (!tblgen_metadata)
      return emitOpError("requires attribute 'metadata'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_metadata, "metadata")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops16(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops19(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSResults(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops19(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void _TPUCompileMlirOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  effects.emplace_back(::mlir::MemoryEffects::Write::get(), ::mlir::TF::ResourceEffects::TPUCompileExecute::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::_TPUCompileMlirOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::_TPUCompileMlirPlaceholderProgramKeyOp definitions
//===----------------------------------------------------------------------===//

_TPUCompileMlirPlaceholderProgramKeyOpAdaptor::_TPUCompileMlirPlaceholderProgramKeyOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

_TPUCompileMlirPlaceholderProgramKeyOpAdaptor::_TPUCompileMlirPlaceholderProgramKeyOpAdaptor(_TPUCompileMlirPlaceholderProgramKeyOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange _TPUCompileMlirPlaceholderProgramKeyOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> _TPUCompileMlirPlaceholderProgramKeyOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange _TPUCompileMlirPlaceholderProgramKeyOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::DictionaryAttr _TPUCompileMlirPlaceholderProgramKeyOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult _TPUCompileMlirPlaceholderProgramKeyOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> _TPUCompileMlirPlaceholderProgramKeyOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range _TPUCompileMlirPlaceholderProgramKeyOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

std::pair<unsigned, unsigned> _TPUCompileMlirPlaceholderProgramKeyOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range _TPUCompileMlirPlaceholderProgramKeyOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value _TPUCompileMlirPlaceholderProgramKeyOp::program() {
  return *getODSResults(0).begin();
}

void _TPUCompileMlirPlaceholderProgramKeyOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type program) {
  odsState.addTypes(program);
}

void _TPUCompileMlirPlaceholderProgramKeyOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes) {
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void _TPUCompileMlirPlaceholderProgramKeyOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 0u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult _TPUCompileMlirPlaceholderProgramKeyOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops19(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void _TPUCompileMlirPlaceholderProgramKeyOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  effects.emplace_back(::mlir::MemoryEffects::Write::get(), ::mlir::TF::ResourceEffects::TPUCompileExecute::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::_TPUCompileMlirPlaceholderProgramKeyOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::_TPUDeviceOrdinalPlaceholderOp definitions
//===----------------------------------------------------------------------===//

_TPUDeviceOrdinalPlaceholderOpAdaptor::_TPUDeviceOrdinalPlaceholderOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

_TPUDeviceOrdinalPlaceholderOpAdaptor::_TPUDeviceOrdinalPlaceholderOpAdaptor(_TPUDeviceOrdinalPlaceholderOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange _TPUDeviceOrdinalPlaceholderOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> _TPUDeviceOrdinalPlaceholderOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange _TPUDeviceOrdinalPlaceholderOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::DictionaryAttr _TPUDeviceOrdinalPlaceholderOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::LogicalResult _TPUDeviceOrdinalPlaceholderOpAdaptor::verify(::mlir::Location loc) {
  return ::mlir::success();
}

std::pair<unsigned, unsigned> _TPUDeviceOrdinalPlaceholderOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range _TPUDeviceOrdinalPlaceholderOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

std::pair<unsigned, unsigned> _TPUDeviceOrdinalPlaceholderOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range _TPUDeviceOrdinalPlaceholderOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value _TPUDeviceOrdinalPlaceholderOp::device_ordinal() {
  return *getODSResults(0).begin();
}

void _TPUDeviceOrdinalPlaceholderOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type device_ordinal) {
  odsState.addTypes(device_ordinal);
}

void _TPUDeviceOrdinalPlaceholderOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes) {
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void _TPUDeviceOrdinalPlaceholderOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 0u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult _TPUDeviceOrdinalPlaceholderOp::verify() {
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops16(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void _TPUDeviceOrdinalPlaceholderOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::_TPUDeviceOrdinalPlaceholderOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::_UnaryOpsCompositionOp definitions
//===----------------------------------------------------------------------===//

_UnaryOpsCompositionOpAdaptor::_UnaryOpsCompositionOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

_UnaryOpsCompositionOpAdaptor::_UnaryOpsCompositionOpAdaptor(_UnaryOpsCompositionOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange _UnaryOpsCompositionOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> _UnaryOpsCompositionOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange _UnaryOpsCompositionOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value _UnaryOpsCompositionOpAdaptor::x() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr _UnaryOpsCompositionOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::ArrayAttr _UnaryOpsCompositionOpAdaptor::op_names() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::ArrayAttr attr = odsAttrs.get("op_names").cast<::mlir::ArrayAttr>();
  return attr;
}

::mlir::LogicalResult _UnaryOpsCompositionOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_op_names = odsAttrs.get("op_names");
    if (!tblgen_op_names)
      return emitError(loc, "'tf._UnaryOpsComposition' op ""requires attribute 'op_names'");

    if (tblgen_op_names && !(((tblgen_op_names.isa<::mlir::ArrayAttr>())) && (::llvm::all_of(tblgen_op_names.cast<::mlir::ArrayAttr>(), [&](::mlir::Attribute attr) { return (attr.isa<::mlir::StringAttr>()); }))))
      return emitError(loc, "'tf._UnaryOpsComposition' op ""attribute 'op_names' failed to satisfy constraint: string array attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> _UnaryOpsCompositionOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range _UnaryOpsCompositionOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value _UnaryOpsCompositionOp::x() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange _UnaryOpsCompositionOp::xMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> _UnaryOpsCompositionOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range _UnaryOpsCompositionOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value _UnaryOpsCompositionOp::y() {
  return *getODSResults(0).begin();
}

::mlir::ArrayAttr _UnaryOpsCompositionOp::op_namesAttr() {
  return (*this)->getAttr(op_namesAttrName()).cast<::mlir::ArrayAttr>();
}

::mlir::ArrayAttr _UnaryOpsCompositionOp::op_names() {
  auto attr = op_namesAttr();
  return attr;
}

::mlir::Type _UnaryOpsCompositionOp::T() {
  return mlir::getElementTypeOrSelf(*getODSOperands(0).begin());
}

bool _UnaryOpsCompositionOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "T") return true;
 return false;
}

::mlir::DictionaryAttr _UnaryOpsCompositionOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TAttrName(),
::mlir::TypeAttr::get(T())}});
}

void _UnaryOpsCompositionOp::op_namesAttr(::mlir::ArrayAttr attr) {
  (*this)->setAttr(op_namesAttrName(), attr);
}

void _UnaryOpsCompositionOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type y, ::mlir::Value x, ::mlir::ArrayAttr op_names) {
  odsState.addOperands(x);
  odsState.addAttribute(op_namesAttrName(odsState.name), op_names);
  odsState.addTypes(y);
}

void _UnaryOpsCompositionOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value x, ::mlir::ArrayAttr op_names) {
  odsState.addOperands(x);
  odsState.addAttribute(op_namesAttrName(odsState.name), op_names);
  assert(resultTypes.size() == 1u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void _UnaryOpsCompositionOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 1u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult _UnaryOpsCompositionOp::verify() {
  {
    auto tblgen_op_names = (*this)->getAttr(op_namesAttrName());
    if (!tblgen_op_names)
      return emitOpError("requires attribute 'op_names'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops22(*this, tblgen_op_names, "op_names")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops52(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops52(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void _UnaryOpsCompositionOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::_UnaryOpsCompositionOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::_XlaHostComputeMlirOp definitions
//===----------------------------------------------------------------------===//

_XlaHostComputeMlirOpAdaptor::_XlaHostComputeMlirOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

_XlaHostComputeMlirOpAdaptor::_XlaHostComputeMlirOpAdaptor(_XlaHostComputeMlirOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange _XlaHostComputeMlirOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> _XlaHostComputeMlirOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  bool isVariadic[] = {true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (odsOperands.size() - 0) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::ValueRange _XlaHostComputeMlirOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::ValueRange _XlaHostComputeMlirOpAdaptor::inputs() {
  return getODSOperands(0);
}

::mlir::DictionaryAttr _XlaHostComputeMlirOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::StringAttr _XlaHostComputeMlirOpAdaptor::send_key() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("send_key").cast<::mlir::StringAttr>();
  return attr;
}

::mlir::StringAttr _XlaHostComputeMlirOpAdaptor::recv_key() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("recv_key").cast<::mlir::StringAttr>();
  return attr;
}

::mlir::IntegerAttr _XlaHostComputeMlirOpAdaptor::tpu_core() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("tpu_core").dyn_cast_or_null<::mlir::IntegerAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getIntegerAttr(::mlir::Builder(odsAttrs.getContext()).getIntegerType(64), 0);
  return attr;
}

::mlir::StringAttr _XlaHostComputeMlirOpAdaptor::host_mlir_module() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("host_mlir_module").dyn_cast_or_null<::mlir::StringAttr>();
  if (!attr)
    attr = ::mlir::Builder(odsAttrs.getContext()).getStringAttr("");
  return attr;
}

::mlir::LogicalResult _XlaHostComputeMlirOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_send_key = odsAttrs.get("send_key");
    if (!tblgen_send_key)
      return emitError(loc, "'tf._XlaHostComputeMlir' op ""requires attribute 'send_key'");

    if (tblgen_send_key && !((tblgen_send_key.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf._XlaHostComputeMlir' op ""attribute 'send_key' failed to satisfy constraint: string attribute");
  }
  {
    auto tblgen_recv_key = odsAttrs.get("recv_key");
    if (!tblgen_recv_key)
      return emitError(loc, "'tf._XlaHostComputeMlir' op ""requires attribute 'recv_key'");

    if (tblgen_recv_key && !((tblgen_recv_key.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf._XlaHostComputeMlir' op ""attribute 'recv_key' failed to satisfy constraint: string attribute");
  }
  {
    auto tblgen_tpu_core = odsAttrs.get("tpu_core");
    if (tblgen_tpu_core && !(((tblgen_tpu_core.isa<::mlir::IntegerAttr>())) && ((tblgen_tpu_core.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf._XlaHostComputeMlir' op ""attribute 'tpu_core' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  {
    auto tblgen_host_mlir_module = odsAttrs.get("host_mlir_module");
    if (tblgen_host_mlir_module && !((tblgen_host_mlir_module.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf._XlaHostComputeMlir' op ""attribute 'host_mlir_module' failed to satisfy constraint: string attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> _XlaHostComputeMlirOp::getODSOperandIndexAndLength(unsigned index) {
  bool isVariadic[] = {true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (getOperation()->getNumOperands() - 0) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::Operation::operand_range _XlaHostComputeMlirOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Operation::operand_range _XlaHostComputeMlirOp::inputs() {
  return getODSOperands(0);
}

::mlir::MutableOperandRange _XlaHostComputeMlirOp::inputsMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> _XlaHostComputeMlirOp::getODSResultIndexAndLength(unsigned index) {
  bool isVariadic[] = {true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (getOperation()->getNumResults() - 0) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::Operation::result_range _XlaHostComputeMlirOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Operation::result_range _XlaHostComputeMlirOp::outputs() {
  return getODSResults(0);
}

::mlir::StringAttr _XlaHostComputeMlirOp::send_keyAttr() {
  return (*this)->getAttr(send_keyAttrName()).cast<::mlir::StringAttr>();
}

::llvm::StringRef _XlaHostComputeMlirOp::send_key() {
  auto attr = send_keyAttr();
  return attr.getValue();
}

::mlir::StringAttr _XlaHostComputeMlirOp::recv_keyAttr() {
  return (*this)->getAttr(recv_keyAttrName()).cast<::mlir::StringAttr>();
}

::llvm::StringRef _XlaHostComputeMlirOp::recv_key() {
  auto attr = recv_keyAttr();
  return attr.getValue();
}

::mlir::IntegerAttr _XlaHostComputeMlirOp::tpu_coreAttr() {
  return (*this)->getAttr(tpu_coreAttrName()).dyn_cast_or_null<::mlir::IntegerAttr>();
}

uint64_t _XlaHostComputeMlirOp::tpu_core() {
  auto attr = tpu_coreAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), 0).getValue().getZExtValue();
  return attr.getValue().getZExtValue();
}

::mlir::StringAttr _XlaHostComputeMlirOp::host_mlir_moduleAttr() {
  return (*this)->getAttr(host_mlir_moduleAttrName()).dyn_cast_or_null<::mlir::StringAttr>();
}

::llvm::StringRef _XlaHostComputeMlirOp::host_mlir_module() {
  auto attr = host_mlir_moduleAttr();
    if (!attr)
      return ::mlir::Builder((*this)->getContext()).getStringAttr("").getValue();
  return attr.getValue();
}

mlir::OperandElementTypeRange _XlaHostComputeMlirOp::Tinputs() {
  auto values = getODSOperands(0);
return {mlir::OperandElementTypeIterator(values.begin()), mlir::OperandElementTypeIterator(values.end())};
}

mlir::ResultElementTypeRange _XlaHostComputeMlirOp::Toutputs() {
  auto values = getODSResults(0);
return {mlir::ResultElementTypeIterator(values.begin()), mlir::ResultElementTypeIterator(values.end())};
}

bool _XlaHostComputeMlirOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "Tinputs") return true;
  if (name == "Toutputs") return true;
 return false;
}

::mlir::DictionaryAttr _XlaHostComputeMlirOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TinputsAttrName(),
ArrayAttr::get(ctx, 
    [&]() {
      llvm::SmallVector<Attribute, 4> ret;
      for (auto t : Tinputs())
        ret.push_back(TypeAttr::get(t));
      return ret;
    }())},
    {ToutputsAttrName(),
ArrayAttr::get(ctx, 
    [&]() {
      llvm::SmallVector<Attribute, 4> ret;
      for (auto t : Toutputs())
        ret.push_back(TypeAttr::get(t));
      return ret;
    }())}});
}

void _XlaHostComputeMlirOp::send_keyAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(send_keyAttrName(), attr);
}

void _XlaHostComputeMlirOp::recv_keyAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(recv_keyAttrName(), attr);
}

void _XlaHostComputeMlirOp::tpu_coreAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(tpu_coreAttrName(), attr);
}

void _XlaHostComputeMlirOp::host_mlir_moduleAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(host_mlir_moduleAttrName(), attr);
}

void _XlaHostComputeMlirOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange outputs, ::mlir::ValueRange inputs, ::mlir::StringAttr send_key, ::mlir::StringAttr recv_key, ::mlir::IntegerAttr tpu_core, ::mlir::StringAttr host_mlir_module) {
  odsState.addOperands(inputs);
  odsState.addAttribute(send_keyAttrName(odsState.name), send_key);
  odsState.addAttribute(recv_keyAttrName(odsState.name), recv_key);
  odsState.addAttribute(tpu_coreAttrName(odsState.name), tpu_core);
  odsState.addAttribute(host_mlir_moduleAttrName(odsState.name), host_mlir_module);
  odsState.addTypes(outputs);
}

void _XlaHostComputeMlirOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange outputs, ::mlir::ValueRange inputs, ::llvm::StringRef send_key, ::llvm::StringRef recv_key, uint64_t tpu_core, ::llvm::StringRef host_mlir_module) {
  odsState.addOperands(inputs);
  odsState.addAttribute(send_keyAttrName(odsState.name), odsBuilder.getStringAttr(send_key));
  odsState.addAttribute(recv_keyAttrName(odsState.name), odsBuilder.getStringAttr(recv_key));
  odsState.addAttribute(tpu_coreAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), tpu_core));
  odsState.addAttribute(host_mlir_moduleAttrName(odsState.name), odsBuilder.getStringAttr(host_mlir_module));
  odsState.addTypes(outputs);
}

void _XlaHostComputeMlirOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult _XlaHostComputeMlirOp::verify() {
  {
    auto tblgen_send_key = (*this)->getAttr(send_keyAttrName());
    if (!tblgen_send_key)
      return emitOpError("requires attribute 'send_key'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_send_key, "send_key")))
      return ::mlir::failure();
  }
  {
    auto tblgen_recv_key = (*this)->getAttr(recv_keyAttrName());
    if (!tblgen_recv_key)
      return emitOpError("requires attribute 'recv_key'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_recv_key, "recv_key")))
      return ::mlir::failure();
  }
  {
    auto tblgen_tpu_core = (*this)->getAttr(tpu_coreAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_tpu_core, "tpu_core")))
      return ::mlir::failure();
  }
  {
    auto tblgen_host_mlir_module = (*this)->getAttr(host_mlir_moduleAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_host_mlir_module, "host_mlir_module")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return Verify(*this);
}

void _XlaHostComputeMlirOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  effects.emplace_back(::mlir::MemoryEffects::Write::get(), ::mlir::TF::ResourceEffects::SendRecv::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::_XlaHostComputeMlirOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::_XlaRecvAtHostOp definitions
//===----------------------------------------------------------------------===//

_XlaRecvAtHostOpAdaptor::_XlaRecvAtHostOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

_XlaRecvAtHostOpAdaptor::_XlaRecvAtHostOpAdaptor(_XlaRecvAtHostOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange _XlaRecvAtHostOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> _XlaRecvAtHostOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange _XlaRecvAtHostOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value _XlaRecvAtHostOpAdaptor::dynamic_key() {
  return *getODSOperands(0).begin();
}

::mlir::DictionaryAttr _XlaRecvAtHostOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::StringAttr _XlaRecvAtHostOpAdaptor::key() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("key").cast<::mlir::StringAttr>();
  return attr;
}

::mlir::IntegerAttr _XlaRecvAtHostOpAdaptor::device_ordinal() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("device_ordinal").cast<::mlir::IntegerAttr>();
  return attr;
}

::mlir::LogicalResult _XlaRecvAtHostOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_key = odsAttrs.get("key");
    if (!tblgen_key)
      return emitError(loc, "'tf._XlaRecvAtHost' op ""requires attribute 'key'");

    if (tblgen_key && !((tblgen_key.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf._XlaRecvAtHost' op ""attribute 'key' failed to satisfy constraint: string attribute");
  }
  {
    auto tblgen_device_ordinal = odsAttrs.get("device_ordinal");
    if (!tblgen_device_ordinal)
      return emitError(loc, "'tf._XlaRecvAtHost' op ""requires attribute 'device_ordinal'");

    if (tblgen_device_ordinal && !(((tblgen_device_ordinal.isa<::mlir::IntegerAttr>())) && ((tblgen_device_ordinal.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf._XlaRecvAtHost' op ""attribute 'device_ordinal' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> _XlaRecvAtHostOp::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range _XlaRecvAtHostOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value _XlaRecvAtHostOp::dynamic_key() {
  return *getODSOperands(0).begin();
}

::mlir::MutableOperandRange _XlaRecvAtHostOp::dynamic_keyMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> _XlaRecvAtHostOp::getODSResultIndexAndLength(unsigned index) {
  bool isVariadic[] = {true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (getOperation()->getNumResults() - 0) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::Operation::result_range _XlaRecvAtHostOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Operation::result_range _XlaRecvAtHostOp::outputs() {
  return getODSResults(0);
}

::mlir::StringAttr _XlaRecvAtHostOp::keyAttr() {
  return (*this)->getAttr(keyAttrName()).cast<::mlir::StringAttr>();
}

::llvm::StringRef _XlaRecvAtHostOp::key() {
  auto attr = keyAttr();
  return attr.getValue();
}

::mlir::IntegerAttr _XlaRecvAtHostOp::device_ordinalAttr() {
  return (*this)->getAttr(device_ordinalAttrName()).cast<::mlir::IntegerAttr>();
}

uint64_t _XlaRecvAtHostOp::device_ordinal() {
  auto attr = device_ordinalAttr();
  return attr.getValue().getZExtValue();
}

mlir::ResultElementTypeRange _XlaRecvAtHostOp::Toutputs() {
  auto values = getODSResults(0);
return {mlir::ResultElementTypeIterator(values.begin()), mlir::ResultElementTypeIterator(values.end())};
}

bool _XlaRecvAtHostOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "Toutputs") return true;
 return false;
}

::mlir::DictionaryAttr _XlaRecvAtHostOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {ToutputsAttrName(),
ArrayAttr::get(ctx, 
    [&]() {
      llvm::SmallVector<Attribute, 4> ret;
      for (auto t : Toutputs())
        ret.push_back(TypeAttr::get(t));
      return ret;
    }())}});
}

void _XlaRecvAtHostOp::keyAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(keyAttrName(), attr);
}

void _XlaRecvAtHostOp::device_ordinalAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(device_ordinalAttrName(), attr);
}

void _XlaRecvAtHostOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange outputs, ::mlir::Value dynamic_key, ::mlir::StringAttr key, ::mlir::IntegerAttr device_ordinal) {
  odsState.addOperands(dynamic_key);
  odsState.addAttribute(keyAttrName(odsState.name), key);
  odsState.addAttribute(device_ordinalAttrName(odsState.name), device_ordinal);
  odsState.addTypes(outputs);
}

void _XlaRecvAtHostOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange outputs, ::mlir::Value dynamic_key, ::llvm::StringRef key, uint64_t device_ordinal) {
  odsState.addOperands(dynamic_key);
  odsState.addAttribute(keyAttrName(odsState.name), odsBuilder.getStringAttr(key));
  odsState.addAttribute(device_ordinalAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), device_ordinal));
  odsState.addTypes(outputs);
}

void _XlaRecvAtHostOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult _XlaRecvAtHostOp::verify() {
  {
    auto tblgen_key = (*this)->getAttr(keyAttrName());
    if (!tblgen_key)
      return emitOpError("requires attribute 'key'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_key, "key")))
      return ::mlir::failure();
  }
  {
    auto tblgen_device_ordinal = (*this)->getAttr(device_ordinalAttrName());
    if (!tblgen_device_ordinal)
      return emitOpError("requires attribute 'device_ordinal'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_device_ordinal, "device_ordinal")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops19(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void _XlaRecvAtHostOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  effects.emplace_back(::mlir::MemoryEffects::Write::get(), ::mlir::TF::ResourceEffects::SendRecv::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::_XlaRecvAtHostOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::_XlaRecvAtHostV2Op definitions
//===----------------------------------------------------------------------===//

_XlaRecvAtHostV2OpAdaptor::_XlaRecvAtHostV2OpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

_XlaRecvAtHostV2OpAdaptor::_XlaRecvAtHostV2OpAdaptor(_XlaRecvAtHostV2Op &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange _XlaRecvAtHostV2OpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> _XlaRecvAtHostV2OpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::ValueRange _XlaRecvAtHostV2OpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::Value _XlaRecvAtHostV2OpAdaptor::dynamic_key() {
  return *getODSOperands(0).begin();
}

::mlir::Value _XlaRecvAtHostV2OpAdaptor::device_ordinal() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr _XlaRecvAtHostV2OpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::StringAttr _XlaRecvAtHostV2OpAdaptor::key() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("key").cast<::mlir::StringAttr>();
  return attr;
}

::mlir::LogicalResult _XlaRecvAtHostV2OpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_key = odsAttrs.get("key");
    if (!tblgen_key)
      return emitError(loc, "'tf._XlaRecvAtHostV2' op ""requires attribute 'key'");

    if (tblgen_key && !((tblgen_key.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf._XlaRecvAtHostV2' op ""attribute 'key' failed to satisfy constraint: string attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> _XlaRecvAtHostV2Op::getODSOperandIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::operand_range _XlaRecvAtHostV2Op::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Value _XlaRecvAtHostV2Op::dynamic_key() {
  return *getODSOperands(0).begin();
}

::mlir::Value _XlaRecvAtHostV2Op::device_ordinal() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange _XlaRecvAtHostV2Op::dynamic_keyMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange _XlaRecvAtHostV2Op::device_ordinalMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> _XlaRecvAtHostV2Op::getODSResultIndexAndLength(unsigned index) {
  bool isVariadic[] = {true};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (getOperation()->getNumResults() - 0) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::Operation::result_range _XlaRecvAtHostV2Op::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::Operation::result_range _XlaRecvAtHostV2Op::outputs() {
  return getODSResults(0);
}

::mlir::StringAttr _XlaRecvAtHostV2Op::keyAttr() {
  return (*this)->getAttr(keyAttrName()).cast<::mlir::StringAttr>();
}

::llvm::StringRef _XlaRecvAtHostV2Op::key() {
  auto attr = keyAttr();
  return attr.getValue();
}

mlir::ResultElementTypeRange _XlaRecvAtHostV2Op::Toutputs() {
  auto values = getODSResults(0);
return {mlir::ResultElementTypeIterator(values.begin()), mlir::ResultElementTypeIterator(values.end())};
}

bool _XlaRecvAtHostV2Op::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "Toutputs") return true;
 return false;
}

::mlir::DictionaryAttr _XlaRecvAtHostV2Op::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {ToutputsAttrName(),
ArrayAttr::get(ctx, 
    [&]() {
      llvm::SmallVector<Attribute, 4> ret;
      for (auto t : Toutputs())
        ret.push_back(TypeAttr::get(t));
      return ret;
    }())}});
}

void _XlaRecvAtHostV2Op::keyAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(keyAttrName(), attr);
}

void _XlaRecvAtHostV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange outputs, ::mlir::Value dynamic_key, ::mlir::Value device_ordinal, ::mlir::StringAttr key) {
  odsState.addOperands(dynamic_key);
  odsState.addOperands(device_ordinal);
  odsState.addAttribute(keyAttrName(odsState.name), key);
  odsState.addTypes(outputs);
}

void _XlaRecvAtHostV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange outputs, ::mlir::Value dynamic_key, ::mlir::Value device_ordinal, ::llvm::StringRef key) {
  odsState.addOperands(dynamic_key);
  odsState.addOperands(device_ordinal);
  odsState.addAttribute(keyAttrName(odsState.name), odsBuilder.getStringAttr(key));
  odsState.addTypes(outputs);
}

void _XlaRecvAtHostV2Op::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() == 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult _XlaRecvAtHostV2Op::verify() {
  {
    auto tblgen_key = (*this)->getAttr(keyAttrName());
    if (!tblgen_key)
      return emitOpError("requires attribute 'key'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_key, "key")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops19(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops16(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "result", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void _XlaRecvAtHostV2Op::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  effects.emplace_back(::mlir::MemoryEffects::Write::get(), ::mlir::TF::ResourceEffects::SendRecv::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::_XlaRecvAtHostV2Op)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::_XlaSendFromHostOp definitions
//===----------------------------------------------------------------------===//

_XlaSendFromHostOpAdaptor::_XlaSendFromHostOpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

_XlaSendFromHostOpAdaptor::_XlaSendFromHostOpAdaptor(_XlaSendFromHostOp &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange _XlaSendFromHostOpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> _XlaSendFromHostOpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  bool isVariadic[] = {true, false};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (odsOperands.size() - 1) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::ValueRange _XlaSendFromHostOpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::ValueRange _XlaSendFromHostOpAdaptor::inputs() {
  return getODSOperands(0);
}

::mlir::Value _XlaSendFromHostOpAdaptor::dynamic_key() {
  return *getODSOperands(1).begin();
}

::mlir::DictionaryAttr _XlaSendFromHostOpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::StringAttr _XlaSendFromHostOpAdaptor::key() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("key").cast<::mlir::StringAttr>();
  return attr;
}

::mlir::IntegerAttr _XlaSendFromHostOpAdaptor::device_ordinal() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::IntegerAttr attr = odsAttrs.get("device_ordinal").cast<::mlir::IntegerAttr>();
  return attr;
}

::mlir::LogicalResult _XlaSendFromHostOpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_key = odsAttrs.get("key");
    if (!tblgen_key)
      return emitError(loc, "'tf._XlaSendFromHost' op ""requires attribute 'key'");

    if (tblgen_key && !((tblgen_key.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf._XlaSendFromHost' op ""attribute 'key' failed to satisfy constraint: string attribute");
  }
  {
    auto tblgen_device_ordinal = odsAttrs.get("device_ordinal");
    if (!tblgen_device_ordinal)
      return emitError(loc, "'tf._XlaSendFromHost' op ""requires attribute 'device_ordinal'");

    if (tblgen_device_ordinal && !(((tblgen_device_ordinal.isa<::mlir::IntegerAttr>())) && ((tblgen_device_ordinal.cast<::mlir::IntegerAttr>().getType().isSignlessInteger(64)))))
      return emitError(loc, "'tf._XlaSendFromHost' op ""attribute 'device_ordinal' failed to satisfy constraint: 64-bit signless integer attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> _XlaSendFromHostOp::getODSOperandIndexAndLength(unsigned index) {
  bool isVariadic[] = {true, false};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (getOperation()->getNumOperands() - 1) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::Operation::operand_range _XlaSendFromHostOp::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Operation::operand_range _XlaSendFromHostOp::inputs() {
  return getODSOperands(0);
}

::mlir::Value _XlaSendFromHostOp::dynamic_key() {
  return *getODSOperands(1).begin();
}

::mlir::MutableOperandRange _XlaSendFromHostOp::inputsMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange _XlaSendFromHostOp::dynamic_keyMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> _XlaSendFromHostOp::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range _XlaSendFromHostOp::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::StringAttr _XlaSendFromHostOp::keyAttr() {
  return (*this)->getAttr(keyAttrName()).cast<::mlir::StringAttr>();
}

::llvm::StringRef _XlaSendFromHostOp::key() {
  auto attr = keyAttr();
  return attr.getValue();
}

::mlir::IntegerAttr _XlaSendFromHostOp::device_ordinalAttr() {
  return (*this)->getAttr(device_ordinalAttrName()).cast<::mlir::IntegerAttr>();
}

uint64_t _XlaSendFromHostOp::device_ordinal() {
  auto attr = device_ordinalAttr();
  return attr.getValue().getZExtValue();
}

mlir::OperandElementTypeRange _XlaSendFromHostOp::Tinputs() {
  auto values = getODSOperands(0);
return {mlir::OperandElementTypeIterator(values.begin()), mlir::OperandElementTypeIterator(values.end())};
}

bool _XlaSendFromHostOp::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "Tinputs") return true;
 return false;
}

::mlir::DictionaryAttr _XlaSendFromHostOp::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TinputsAttrName(),
ArrayAttr::get(ctx, 
    [&]() {
      llvm::SmallVector<Attribute, 4> ret;
      for (auto t : Tinputs())
        ret.push_back(TypeAttr::get(t));
      return ret;
    }())}});
}

void _XlaSendFromHostOp::keyAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(keyAttrName(), attr);
}

void _XlaSendFromHostOp::device_ordinalAttr(::mlir::IntegerAttr attr) {
  (*this)->setAttr(device_ordinalAttrName(), attr);
}

void _XlaSendFromHostOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange inputs, ::mlir::Value dynamic_key, ::mlir::StringAttr key, ::mlir::IntegerAttr device_ordinal) {
  odsState.addOperands(inputs);
  odsState.addOperands(dynamic_key);
  odsState.addAttribute(keyAttrName(odsState.name), key);
  odsState.addAttribute(device_ordinalAttrName(odsState.name), device_ordinal);
}

void _XlaSendFromHostOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange inputs, ::mlir::Value dynamic_key, ::mlir::StringAttr key, ::mlir::IntegerAttr device_ordinal) {
  odsState.addOperands(inputs);
  odsState.addOperands(dynamic_key);
  odsState.addAttribute(keyAttrName(odsState.name), key);
  odsState.addAttribute(device_ordinalAttrName(odsState.name), device_ordinal);
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void _XlaSendFromHostOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange inputs, ::mlir::Value dynamic_key, ::llvm::StringRef key, uint64_t device_ordinal) {
  odsState.addOperands(inputs);
  odsState.addOperands(dynamic_key);
  odsState.addAttribute(keyAttrName(odsState.name), odsBuilder.getStringAttr(key));
  odsState.addAttribute(device_ordinalAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), device_ordinal));
}

void _XlaSendFromHostOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange inputs, ::mlir::Value dynamic_key, ::llvm::StringRef key, uint64_t device_ordinal) {
  odsState.addOperands(inputs);
  odsState.addOperands(dynamic_key);
  odsState.addAttribute(keyAttrName(odsState.name), odsBuilder.getStringAttr(key));
  odsState.addAttribute(device_ordinalAttrName(odsState.name), odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), device_ordinal));
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void _XlaSendFromHostOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() >= 1u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 0u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult _XlaSendFromHostOp::verify() {
  {
    auto tblgen_key = (*this)->getAttr(keyAttrName());
    if (!tblgen_key)
      return emitOpError("requires attribute 'key'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_key, "key")))
      return ::mlir::failure();
  }
  {
    auto tblgen_device_ordinal = (*this)->getAttr(device_ordinalAttrName());
    if (!tblgen_device_ordinal)
      return emitOpError("requires attribute 'device_ordinal'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops1(*this, tblgen_device_ordinal, "device_ordinal")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops19(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void _XlaSendFromHostOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  effects.emplace_back(::mlir::MemoryEffects::Write::get(), ::mlir::TF::ResourceEffects::SendRecv::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::_XlaSendFromHostOp)

namespace mlir {
namespace TF {

//===----------------------------------------------------------------------===//
// ::mlir::TF::_XlaSendFromHostV2Op definitions
//===----------------------------------------------------------------------===//

_XlaSendFromHostV2OpAdaptor::_XlaSendFromHostV2OpAdaptor(::mlir::ValueRange values, ::mlir::DictionaryAttr attrs, ::mlir::RegionRange regions) : odsOperands(values), odsAttrs(attrs), odsRegions(regions) {}

_XlaSendFromHostV2OpAdaptor::_XlaSendFromHostV2OpAdaptor(_XlaSendFromHostV2Op &op) : odsOperands(op->getOperands()), odsAttrs(op->getAttrDictionary()), odsRegions(op->getRegions()) {}

::mlir::ValueRange _XlaSendFromHostV2OpAdaptor::getOperands() {
  return odsOperands;
}

std::pair<unsigned, unsigned> _XlaSendFromHostV2OpAdaptor::getODSOperandIndexAndLength(unsigned index) {
  bool isVariadic[] = {true, false, false};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (odsOperands.size() - 2) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::ValueRange _XlaSendFromHostV2OpAdaptor::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(odsOperands.begin(), valueRange.first),
           std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}

::mlir::ValueRange _XlaSendFromHostV2OpAdaptor::inputs() {
  return getODSOperands(0);
}

::mlir::Value _XlaSendFromHostV2OpAdaptor::dynamic_key() {
  return *getODSOperands(1).begin();
}

::mlir::Value _XlaSendFromHostV2OpAdaptor::device_ordinal() {
  return *getODSOperands(2).begin();
}

::mlir::DictionaryAttr _XlaSendFromHostV2OpAdaptor::getAttributes() {
  return odsAttrs;
}

::mlir::StringAttr _XlaSendFromHostV2OpAdaptor::key() {
  assert(odsAttrs && "no attributes when constructing adapter");
  ::mlir::StringAttr attr = odsAttrs.get("key").cast<::mlir::StringAttr>();
  return attr;
}

::mlir::LogicalResult _XlaSendFromHostV2OpAdaptor::verify(::mlir::Location loc) {
  {
    auto tblgen_key = odsAttrs.get("key");
    if (!tblgen_key)
      return emitError(loc, "'tf._XlaSendFromHostV2' op ""requires attribute 'key'");

    if (tblgen_key && !((tblgen_key.isa<::mlir::StringAttr>())))
      return emitError(loc, "'tf._XlaSendFromHostV2' op ""attribute 'key' failed to satisfy constraint: string attribute");
  }
  return ::mlir::success();
}

std::pair<unsigned, unsigned> _XlaSendFromHostV2Op::getODSOperandIndexAndLength(unsigned index) {
  bool isVariadic[] = {true, false, false};
  int prevVariadicCount = 0;
  for (unsigned i = 0; i < index; ++i)
    if (isVariadic[i]) ++prevVariadicCount;

  // Calculate how many dynamic values a static variadic operand corresponds to.
  // This assumes all static variadic operands have the same dynamic value count.
  int variadicSize = (getOperation()->getNumOperands() - 2) / 1;
  // `index` passed in as the parameter is the static index which counts each
  // operand (variadic or not) as size 1. So here for each previous static variadic
  // operand, we need to offset by (variadicSize - 1) to get where the dynamic
  // value pack for this static operand starts.
  int start = index + (variadicSize - 1) * prevVariadicCount;
  int size = isVariadic[index] ? variadicSize : 1;
  return {start, size};
}

::mlir::Operation::operand_range _XlaSendFromHostV2Op::getODSOperands(unsigned index) {
  auto valueRange = getODSOperandIndexAndLength(index);
  return {std::next(getOperation()->operand_begin(), valueRange.first),
           std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}

::mlir::Operation::operand_range _XlaSendFromHostV2Op::inputs() {
  return getODSOperands(0);
}

::mlir::Value _XlaSendFromHostV2Op::dynamic_key() {
  return *getODSOperands(1).begin();
}

::mlir::Value _XlaSendFromHostV2Op::device_ordinal() {
  return *getODSOperands(2).begin();
}

::mlir::MutableOperandRange _XlaSendFromHostV2Op::inputsMutable() {
  auto range = getODSOperandIndexAndLength(0);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange _XlaSendFromHostV2Op::dynamic_keyMutable() {
  auto range = getODSOperandIndexAndLength(1);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

::mlir::MutableOperandRange _XlaSendFromHostV2Op::device_ordinalMutable() {
  auto range = getODSOperandIndexAndLength(2);
  auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
  return mutableRange;
}

std::pair<unsigned, unsigned> _XlaSendFromHostV2Op::getODSResultIndexAndLength(unsigned index) {
  return {index, 1};
}

::mlir::Operation::result_range _XlaSendFromHostV2Op::getODSResults(unsigned index) {
  auto valueRange = getODSResultIndexAndLength(index);
  return {std::next(getOperation()->result_begin(), valueRange.first),
           std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}

::mlir::StringAttr _XlaSendFromHostV2Op::keyAttr() {
  return (*this)->getAttr(keyAttrName()).cast<::mlir::StringAttr>();
}

::llvm::StringRef _XlaSendFromHostV2Op::key() {
  auto attr = keyAttr();
  return attr.getValue();
}

mlir::OperandElementTypeRange _XlaSendFromHostV2Op::Tinputs() {
  auto values = getODSOperands(0);
return {mlir::OperandElementTypeIterator(values.begin()), mlir::OperandElementTypeIterator(values.end())};
}

bool _XlaSendFromHostV2Op::isDerivedAttribute(::llvm::StringRef name) {
  if (name == "Tinputs") return true;
 return false;
}

::mlir::DictionaryAttr _XlaSendFromHostV2Op::materializeDerivedAttributes() {
  ::mlir::MLIRContext* ctx = getContext();
  ::mlir::Builder odsBuilder(ctx); (void)odsBuilder;
  return ::mlir::DictionaryAttr::get(  ctx, {
    {TinputsAttrName(),
ArrayAttr::get(ctx, 
    [&]() {
      llvm::SmallVector<Attribute, 4> ret;
      for (auto t : Tinputs())
        ret.push_back(TypeAttr::get(t));
      return ret;
    }())}});
}

void _XlaSendFromHostV2Op::keyAttr(::mlir::StringAttr attr) {
  (*this)->setAttr(keyAttrName(), attr);
}

void _XlaSendFromHostV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange inputs, ::mlir::Value dynamic_key, ::mlir::Value device_ordinal, ::mlir::StringAttr key) {
  odsState.addOperands(inputs);
  odsState.addOperands(dynamic_key);
  odsState.addOperands(device_ordinal);
  odsState.addAttribute(keyAttrName(odsState.name), key);
}

void _XlaSendFromHostV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange inputs, ::mlir::Value dynamic_key, ::mlir::Value device_ordinal, ::mlir::StringAttr key) {
  odsState.addOperands(inputs);
  odsState.addOperands(dynamic_key);
  odsState.addOperands(device_ordinal);
  odsState.addAttribute(keyAttrName(odsState.name), key);
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void _XlaSendFromHostV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange inputs, ::mlir::Value dynamic_key, ::mlir::Value device_ordinal, ::llvm::StringRef key) {
  odsState.addOperands(inputs);
  odsState.addOperands(dynamic_key);
  odsState.addOperands(device_ordinal);
  odsState.addAttribute(keyAttrName(odsState.name), odsBuilder.getStringAttr(key));
}

void _XlaSendFromHostV2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange inputs, ::mlir::Value dynamic_key, ::mlir::Value device_ordinal, ::llvm::StringRef key) {
  odsState.addOperands(inputs);
  odsState.addOperands(dynamic_key);
  odsState.addOperands(device_ordinal);
  odsState.addAttribute(keyAttrName(odsState.name), odsBuilder.getStringAttr(key));
  assert(resultTypes.size() == 0u && "mismatched number of results");
  odsState.addTypes(resultTypes);
}

void _XlaSendFromHostV2Op::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
  assert(operands.size() >= 2u && "mismatched number of parameters");
  odsState.addOperands(operands);
  odsState.addAttributes(attributes);
  assert(resultTypes.size() == 0u && "mismatched number of return types");
  odsState.addTypes(resultTypes);
}

::mlir::LogicalResult _XlaSendFromHostV2Op::verify() {
  {
    auto tblgen_key = (*this)->getAttr(keyAttrName());
    if (!tblgen_key)
      return emitOpError("requires attribute 'key'");

    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops6(*this, tblgen_key, "key")))
      return ::mlir::failure();
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSOperands(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops20(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops19(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops16(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  return ::mlir::success();
}

void _XlaSendFromHostV2Op::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
  effects.emplace_back(::mlir::MemoryEffects::Write::get(), ::mlir::TF::ResourceEffects::SendRecv::get());
}

} // namespace TF
} // namespace mlir
DEFINE_EXPLICIT_TYPE_ID(::mlir::TF::_XlaSendFromHostV2Op)


#endif  // GET_OP_CLASSES

