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

#ifdef GET_OP_LIST
#undef GET_OP_LIST

::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
#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.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_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.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_ops3(
    ::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_ops4(
    ::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_ops5(
    ::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_ops6(
    ::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_ops7(
    ::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_ops8(
    ::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_ops9(
    ::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_ops10(
    ::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_ops11(
    ::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_ops12(
    ::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_ops13(
    ::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_ops14(
    ::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_ops15(
    ::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_ops16(
    ::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_ops17(
    ::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_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.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_ops19(
    ::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_ops20(
    ::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_ops21(
    ::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_ops22(
    ::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_ops23(
    ::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_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.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_ops25(
    ::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_ops26(
    ::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_ops27(
    ::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_ops28(
    ::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_ops29(
    ::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_ops30(
    ::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_ops31(
    ::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_ops32(
    ::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_ops33(
    ::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_ops34(
    ::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_ops35(
    ::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_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.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_ops37(
    ::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_ops38(
    ::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_ops39(
    ::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_ops40(
    ::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_ops41(
    ::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_ops42(
    ::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_ops43(
    ::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_ops44(
    ::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_ops45(
    ::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_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.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_ops47(
    ::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::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_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::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_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::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_ops5(
    ::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_ops6(
    ::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_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::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_ops8(
    ::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_ops9(
    ::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_ops10(
    ::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_ops11(
    ::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_ops12(
    ::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_ops13(
    ::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_ops14(
    ::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_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::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_ops16(
    ::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_ops17(
    ::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_ops18(
    ::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_ops19(
    ::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_ops20(
    ::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_ops21(
    ::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_ops22(
    ::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_ops23(
    ::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::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_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 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_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 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_ops3(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops3(*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_ops4(*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_ops3(*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_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_ops4(*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_ops3(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops3(*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_ops4(*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_ops3(*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_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_ops4(*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_ops4(*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_ops3(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops3(*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_ops4(*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_ops3(*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_ops3(*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_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_ops4(*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_ops3(*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_ops4(*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_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_ops6(*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_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_ops4(*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_ops5(*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_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 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_ops2(*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_ops3(*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_ops4(*this, tblgen_output_shapes, "output_shapes")))
      return ::mlir::failure();
  }
  {
    auto tblgen_container = (*this)->getAttr(containerAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops5(*this, tblgen_container, "container")))
      return ::mlir::failure();
  }
  {
    auto tblgen_shared_name = (*this)->getAttr(shared_nameAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops5(*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_ops8(*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_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 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_ops3(*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_ops4(*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_ops6(*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_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();
    }
    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();
    }
  }
  {
    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 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_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_ops10(*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_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_ops5(*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_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_ops6(*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_ops10(*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_ops5(*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_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 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_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_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_ops5(*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_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_ops12(*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_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();
    }
  }
  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_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_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 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_ops2(*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_ops3(*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_ops4(*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_ops5(*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_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_ops5(*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_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_ops10(*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_ops2(*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_ops3(*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_ops4(*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_ops5(*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_ops5(*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_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_ops5(*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_ops10(*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_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_ops0(*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_ops0(*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_ops0(*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_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();
}

} // 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_ops7(*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_ops8(*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_ops8(*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_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_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_ops13(*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_ops14(*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_ops13(*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_ops14(*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_ops9(*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_ops7(*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_ops8(*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_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_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_ops11(*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_ops13(*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_ops14(*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_ops13(*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_ops14(*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_ops14(*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_ops15(*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_ops2(*this, tblgen_f, "f")))
      return ::mlir::failure();
  }
  {
    auto tblgen_config = (*this)->getAttr(configAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops5(*this, tblgen_config, "config")))
      return ::mlir::failure();
  }
  {
    auto tblgen_config_proto = (*this)->getAttr(config_protoAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops5(*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_ops5(*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_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 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_ops5(*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_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 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_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 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_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_ops17(*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_ops3(*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_ops4(*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_ops5(*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_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_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_ops10(*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_ops5(*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_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 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_ops5(*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_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();
}

} // 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_ops5(*this, tblgen_output_stream, "output_stream")))
      return ::mlir::failure();
  }
  {
    auto tblgen_end = (*this)->getAttr(endAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops5(*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_ops11(*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_ops18(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      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_ops18(*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_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();
    }
    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 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_ops10(*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_ops10(*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_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 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_ops11(*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_ops0(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops0(*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_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 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_ops0(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops0(*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_ops0(*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_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_ops0(*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_ops11(*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_ops0(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops0(*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_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 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_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_ops5(*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_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_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_ops20(*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_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_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_ops20(*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_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_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_ops20(*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_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 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_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_ops5(*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_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();
    }
    auto valueGroup1 = getODSResults(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops5(*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_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_ops12(*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 ::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_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 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_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_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();
}

} // 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_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_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();
}

} // 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_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_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 ::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_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();
}

} // 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_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_ops0(*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_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_ops12(*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_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();
}

} // 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_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_ops0(*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_ops3(*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_ops4(*this, tblgen_output_shapes, "output_shapes")))
      return ::mlir::failure();
  }
  {
    auto tblgen_metadata = (*this)->getAttr(metadataAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops5(*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_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_ops10(*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_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();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      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_ops24(*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_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_ops4(*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_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_ops5(*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_ops25(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      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 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_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_ops2(*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_ops26(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      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 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_ops5(*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_ops5(*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_ops5(*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_ops5(*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_ops5(*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_ops27(*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_ops2(*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_ops3(*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_ops12(*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_ops3(*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_ops4(*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_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_ops5(*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_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();
}

} // 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_ops5(*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_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_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_ops11(*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_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_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_ops28(*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_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_ops28(*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_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_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_ops28(*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_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 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_ops2(*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_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_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();
}

} // 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_ops3(*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_ops4(*this, tblgen_output_shapes, "output_shapes")))
      return ::mlir::failure();
  }
  {
    auto tblgen_metadata = (*this)->getAttr(metadataAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops5(*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_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_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_ops10(*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_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_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_ops5(*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_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_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 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_ops30(*this, 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_ops27(*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_ops31(*this, 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_ops31(*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_ops30(*this, 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_ops30(*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_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();
    }
    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();
    }
    auto valueGroup3 = getODSOperands(3);

    for (auto v : valueGroup3) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops18(*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_ops18(*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_ops18(*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_ops18(*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_ops18(*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_ops18(*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_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();
    }
    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();
    }
    auto valueGroup3 = getODSOperands(3);

    for (auto v : valueGroup3) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops18(*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_ops18(*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_ops18(*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_ops18(*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_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();
    }
    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();
    }
    auto valueGroup3 = getODSOperands(3);

    for (auto v : valueGroup3) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops18(*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_ops18(*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_ops18(*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_ops18(*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_ops13(*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_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();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops18(*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_ops18(*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_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();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops18(*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_ops18(*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_ops18(*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_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();
    }
    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();
    }
    auto valueGroup3 = getODSOperands(3);

    for (auto v : valueGroup3) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops18(*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_ops18(*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_ops18(*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_ops18(*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_ops18(*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_ops18(*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_ops18(*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_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();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops18(*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_ops18(*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_ops18(*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_ops18(*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_ops18(*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_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();
    }
    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();
    }
    auto valueGroup3 = getODSOperands(3);

    for (auto v : valueGroup3) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops8(*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_ops18(*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_ops18(*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_ops18(*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_ops18(*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_ops18(*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_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();
    }
    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();
    }
    auto valueGroup3 = getODSOperands(3);

    for (auto v : valueGroup3) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops18(*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_ops18(*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_ops18(*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_ops18(*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_ops18(*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_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();
    }
    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();
    }
    auto valueGroup3 = getODSOperands(3);

    for (auto v : valueGroup3) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops18(*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_ops18(*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_ops18(*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_ops18(*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_ops18(*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_ops18(*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_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_ops18(*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_ops18(*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_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();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops18(*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_ops18(*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_ops18(*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_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();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops18(*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_ops18(*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_ops18(*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_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();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops18(*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_ops18(*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_ops18(*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_ops18(*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_ops18(*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_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();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops18(*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_ops18(*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_ops18(*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_ops18(*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_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_ops18(*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_ops18(*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_ops18(*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_ops18(*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_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();
    }
    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();
    }
    auto valueGroup3 = getODSOperands(3);

    for (auto v : valueGroup3) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops18(*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_ops18(*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_ops18(*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_ops18(*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_ops18(*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_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_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_ops5(*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_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_ops12(*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_ops18(*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_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_ops12(*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_ops18(*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_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_ops12(*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_ops18(*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_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_ops12(*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_ops18(*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_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_ops12(*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_ops18(*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_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_ops12(*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_ops5(*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_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_ops12(*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_ops5(*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_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_ops12(*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_ops5(*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_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_ops12(*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_ops18(*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_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_ops12(*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_ops5(*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_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_ops12(*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_ops12(*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_ops12(*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_ops5(*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_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_ops5(*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_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_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_ops5(*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_ops5(*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_ops5(*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_ops27(*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_ops27(*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_ops27(*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_ops27(*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_ops5(*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_ops5(*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_ops27(*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_ops27(*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_ops27(*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_ops5(*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_ops5(*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_ops27(*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_ops27(*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_ops27(*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_ops27(*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_ops5(*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_ops5(*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_ops27(*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_ops27(*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_ops27(*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_ops5(*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_ops5(*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_ops27(*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_ops27(*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_ops27(*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_ops5(*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_ops5(*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_ops27(*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_ops27(*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_ops5(*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_ops5(*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_ops27(*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_ops27(*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_ops27(*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_ops27(*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_ops5(*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_ops5(*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_ops27(*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_ops27(*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_ops27(*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_ops27(*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_ops5(*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_ops5(*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_ops27(*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_ops27(*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_ops27(*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_ops5(*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_ops5(*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_ops27(*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_ops27(*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_ops27(*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_ops27(*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_ops5(*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_ops5(*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_ops27(*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_ops27(*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_ops27(*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_ops5(*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_ops5(*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_ops27(*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_ops27(*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_ops5(*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_ops5(*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_ops27(*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_ops27(*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_ops27(*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_ops5(*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_ops5(*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_ops27(*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_ops27(*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_ops5(*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_ops5(*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_ops27(*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_ops27(*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_ops27(*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_ops27(*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_ops5(*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_ops5(*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_ops27(*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_ops27(*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_ops27(*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_ops5(*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_ops5(*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_ops27(*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_ops27(*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_ops27(*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_ops27(*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_ops5(*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_ops5(*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_ops27(*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_ops27(*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_ops27(*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_ops5(*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_ops5(*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_ops27(*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_ops27(*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_ops5(*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_ops5(*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_ops27(*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_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_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_ops32(*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_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_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_ops5(*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_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_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_ops32(*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_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_ops16(*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_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 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_ops0(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      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 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_ops0(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      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 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_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_ops4(*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_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_ops13(*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_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_ops12(*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_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_ops5(*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_ops26(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      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 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_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 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_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_ops5(*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_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_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_ops5(*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_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_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_ops5(*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_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_ops5(*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_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_ops5(*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_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_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_ops28(*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_ops18(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      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_ops18(*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_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_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_ops28(*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_ops18(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      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_ops18(*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_ops18(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      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_ops18(*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_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_ops5(*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_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 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_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_ops5(*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_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 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_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();
    }
    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 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_ops0(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      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 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_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 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_ops5(*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_ops5(*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_ops5(*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_ops5(*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_ops5(*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_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();
    }
  }
  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_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_ops10(*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_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_ops5(*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_ops34(*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_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_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_ops5(*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_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_ops12(*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_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_ops12(*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_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_ops4(*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_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_ops11(*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_ops3(*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_ops4(*this, tblgen_output_shapes, "output_shapes")))
      return ::mlir::failure();
  }
  {
    auto tblgen_metadata = (*this)->getAttr(metadataAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops5(*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_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_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();
    }
    auto valueGroup3 = getODSOperands(3);

    for (auto v : valueGroup3) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops13(*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_ops13(*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_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_ops10(*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_ops3(*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_ops4(*this, tblgen_output_shapes, "output_shapes")))
      return ::mlir::failure();
  }
  {
    auto tblgen_metadata = (*this)->getAttr(metadataAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops5(*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_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_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_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_ops10(*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_ops3(*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_ops4(*this, tblgen_output_shapes, "output_shapes")))
      return ::mlir::failure();
  }
  {
    auto tblgen_metadata = (*this)->getAttr(metadataAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops5(*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_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_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();
    }
    auto valueGroup3 = getODSOperands(3);

    for (auto v : valueGroup3) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops13(*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_ops10(*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_ops6(*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_ops26(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      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 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_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 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_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 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_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 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_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_ops12(*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_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_ops12(*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_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_ops5(*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_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 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_ops0(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      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();
    }
    auto valueGroup1 = getODSResults(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops0(*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_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 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_ops0(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      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 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_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 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_ops0(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      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 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_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 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_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_ops12(*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_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_ops5(*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_ops13(*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_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_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_ops5(*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_ops13(*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_ops14(*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_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 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_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_ops18(*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_ops13(*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_ops18(*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_ops13(*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_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_ops13(*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_ops18(*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_ops13(*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_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_ops5(*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_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_ops13(*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_ops5(*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_ops6(*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_ops13(*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_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_ops27(*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_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_ops18(*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_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_ops18(*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_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();
    }
    auto valueGroup1 = getODSResults(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops13(*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_ops0(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops12(*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_ops12(*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_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_ops0(*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_ops0(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops12(*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_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_ops0(*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_ops0(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops12(*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_ops12(*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_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_ops0(*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_ops0(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops12(*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_ops12(*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_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_ops0(*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_ops0(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops12(*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_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_ops0(*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_ops0(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops12(*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_ops12(*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_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_ops0(*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_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_ops12(*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_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_ops28(*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_ops0(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      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_ops0(*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_ops0(*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_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_ops5(*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_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 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_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_ops12(*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_ops5(*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_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 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_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_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 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_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_ops12(*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_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_ops5(*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_ops26(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      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 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_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 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_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 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_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_ops36(*this, v.getType(), "operand", index++)))
        return ::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();
    }
  }
  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_ops15(*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_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 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_ops8(*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_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_ops5(*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_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_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 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_ops16(*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_ops5(*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_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_ops8(*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_ops17(*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_ops5(*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_ops5(*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_ops5(*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_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 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_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_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_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_ops0(*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_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_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_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_ops0(*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_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_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_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_ops37(*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_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_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_ops12(*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_ops37(*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();
    }
  }
  {
    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 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_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_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_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_ops0(*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_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_ops4(*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_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 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_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_ops12(*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_ops22(*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_ops22(*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_ops22(*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_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 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_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_ops12(*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_ops23(*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_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 ::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_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_ops12(*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_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 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_ops4(*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_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_ops33(*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_ops33(*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_ops4(*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_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_ops33(*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_ops33(*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_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_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_ops0(*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_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_ops33(*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_ops33(*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_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_ops0(*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_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_ops12(*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_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 ::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_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_ops37(*this, v.getType(), "operand", index++)))
        return ::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 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_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_ops33(*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_ops33(*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_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_ops37(*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_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_ops12(*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_ops12(*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_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 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_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_ops33(*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_ops33(*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_ops4(*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();
    }
    auto valueGroup5 = getODSOperands(5);

    for (auto v : valueGroup5) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops37(*this, v.getType(), "operand", index++)))
        return ::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 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_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_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_ops0(*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_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_ops33(*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_ops33(*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_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_ops0(*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_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_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_ops0(*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_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_ops33(*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_ops33(*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_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_ops0(*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_ops5(*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_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_ops6(*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_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();
    }
  }
  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_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_ops12(*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_ops12(*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_ops12(*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_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 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_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_ops12(*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_ops12(*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_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_ops5(*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_ops5(*this, tblgen_strtemplate, "strtemplate")))
      return ::mlir::failure();
  }
  {
    auto tblgen_placeholder = (*this)->getAttr(placeholderAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops5(*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_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_ops11(*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_ops5(*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_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 ::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_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 ::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_ops18(*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_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 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_ops25(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      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 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_ops18(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      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_ops18(*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_ops5(*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_ops5(*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_ops8(*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_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();
    }
    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();
    }
    auto valueGroup2 = getODSResults(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops19(*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_ops2(*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_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 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_ops11(*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_ops19(*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_ops5(*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_ops5(*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_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_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_ops5(*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_ops5(*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_ops11(*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_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_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_ops5(*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_ops9(*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_ops9(*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_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 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_ops15(*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_ops15(*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_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_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_ops5(*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_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_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_ops5(*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_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 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_ops4(*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_ops2(*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_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_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_ops5(*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_ops5(*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_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 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_ops5(*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_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 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_ops9(*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_ops5(*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_ops15(*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_ops15(*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_ops6(*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_ops6(*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_ops5(*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_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 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_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 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_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_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_ops8(*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_ops4(*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_ops3(*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_ops4(*this, tblgen_output_shapes, "output_shapes")))
      return ::mlir::failure();
  }
  {
    auto tblgen_metadata = (*this)->getAttr(metadataAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops5(*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_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_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_ops10(*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_ops2(*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_ops3(*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_ops4(*this, tblgen_output_shapes, "output_shapes")))
      return ::mlir::failure();
  }
  {
    auto tblgen_metadata = (*this)->getAttr(metadataAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops5(*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_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_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_ops10(*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_ops26(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      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 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_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 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_ops8(*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_ops20(*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_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_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_ops5(*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_ops13(*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_ops20(*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_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_ops4(*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_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_ops5(*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_ops5(*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_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_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_ops8(*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_ops27(*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_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_ops4(*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_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_ops5(*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_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_ops4(*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_ops5(*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_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 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_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_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_ops4(*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_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_ops5(*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_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 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_ops16(*this, tblgen_dtype, "dtype")))
      return ::mlir::failure();
  }
  {
    auto tblgen_element_shape = (*this)->getAttr(element_shapeAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops20(*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_ops5(*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_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_ops8(*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_ops27(*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_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_ops4(*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_ops5(*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_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 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_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_ops12(*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_ops5(*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_ops13(*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_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_ops12(*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_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_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_ops10(*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_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_ops4(*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_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_ops5(*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_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_ops4(*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_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_ops5(*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_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_ops4(*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_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_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_ops10(*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_ops5(*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_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_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_ops10(*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_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_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_ops10(*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_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_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_ops10(*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_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_ops5(*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_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_ops10(*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_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_ops4(*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_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_ops10(*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_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_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_ops5(*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_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_ops12(*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_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 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_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_ops12(*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_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 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_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_ops12(*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_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 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_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_ops12(*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_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 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_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_ops12(*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_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 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_ops4(*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_ops5(*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_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_ops10(*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_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_ops12(*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_ops12(*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_ops12(*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_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 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_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_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_ops5(*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_ops38(*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_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_ops39(*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_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();
    }
    auto valueGroup1 = getODSResults(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops4(*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_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_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_ops28(*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_ops4(*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_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();
    }
    auto valueGroup1 = getODSResults(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops4(*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_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_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_ops5(*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_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_ops40(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
  }
  {
    unsigned index = 0; (void)index;
    auto valueGroup0 = getODSResults(0);

    for (auto v : valueGroup0) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops40(*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_ops25(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      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 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_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_ops41(*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_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_ops0(*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_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_ops5(*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_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();
    }
    auto valueGroup1 = getODSResults(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops12(*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_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 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_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_ops12(*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_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_ops28(*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_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_ops12(*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_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_ops28(*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_ops18(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops12(*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_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_ops18(*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_ops18(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops12(*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_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_ops18(*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_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_ops12(*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_ops5(*this, tblgen_container, "container")))
      return ::mlir::failure();
  }
  {
    auto tblgen_shared_name = (*this)->getAttr(shared_nameAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops5(*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_ops8(*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_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_ops6(*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_ops20(*this, tblgen_shape, "shape")))
      return ::mlir::failure();
  }
  {
    auto tblgen_container = (*this)->getAttr(containerAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops5(*this, tblgen_container, "container")))
      return ::mlir::failure();
  }
  {
    auto tblgen_shared_name = (*this)->getAttr(shared_nameAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops5(*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_ops5(*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_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_ops12(*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_ops20(*this, tblgen_shape, "shape")))
      return ::mlir::failure();
  }
  {
    auto tblgen_container = (*this)->getAttr(containerAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops5(*this, tblgen_container, "container")))
      return ::mlir::failure();
  }
  {
    auto tblgen_shared_name = (*this)->getAttr(shared_nameAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops5(*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_ops5(*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_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_ops13(*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_ops17(*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_ops17(*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_ops21(*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_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();
}

} // 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_ops21(*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_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();
    }
  }
  {
    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_ops18(*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_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_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_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_ops27(*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_ops27(*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_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_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_ops11(*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_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_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_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_ops28(*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_ops18(*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_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_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_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_ops44(*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 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_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_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_ops11(*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_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_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_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_ops28(*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_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_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_ops5(*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();
    }
  }
  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_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_ops19(*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_ops22(*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_ops23(*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_ops45(*this, 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_ops45(*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_ops18(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops18(*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_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_ops18(*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_ops18(*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_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 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_ops5(*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_ops5(*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_ops18(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops18(*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_ops12(*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_ops12(*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_ops12(*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_ops12(*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_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_ops18(*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_ops5(*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_ops5(*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_ops18(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops18(*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_ops12(*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_ops12(*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_ops12(*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_ops12(*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_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_ops18(*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_ops5(*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_ops5(*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_ops18(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      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_ops18(*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_ops5(*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_ops5(*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_ops18(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      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_ops18(*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_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_ops12(*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_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_ops5(*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_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();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      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_ops5(*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_ops5(*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_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_ops46(*this, v.getType(), "operand", index++)))
        return ::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 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_ops5(*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_ops42(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops12(*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_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_ops42(*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_ops6(*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_ops7(*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_ops2(*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_ops5(*this, tblgen_key, "key")))
      return ::mlir::failure();
  }
  {
    auto tblgen_send_key = (*this)->getAttr(send_keyAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops5(*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_ops5(*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_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 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_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_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_ops28(*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_ops5(*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_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();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops12(*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_ops12(*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_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_ops5(*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_ops20(*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_ops5(*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_ops5(*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_ops15(*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_ops2(*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_ops42(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      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_ops42(*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_ops22(*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_ops45(*this, 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();
    }
    auto valueGroup2 = getODSOperands(2);

    for (auto v : valueGroup2) {
      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_ops45(*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_ops2(*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_ops42(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops42(*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_ops12(*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_ops12(*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_ops12(*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_ops12(*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_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_ops42(*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_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_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_ops5(*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_ops4(*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_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_ops33(*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_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_ops33(*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_ops37(*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_ops2(*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_ops5(*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_ops42(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops12(*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_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_ops42(*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_ops2(*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_ops2(*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_ops18(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      if (::mlir::failed(__mlir_ods_local_type_constraint_tf_ops12(*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_ops12(*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_ops12(*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_ops18(*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_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_ops18(*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_ops10(*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_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_ops18(*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_ops18(*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_ops5(*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_ops5(*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_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_ops4(*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_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_ops5(*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_ops5(*this, tblgen_sharding, "sharding")))
      return ::mlir::failure();
  }
  {
    auto tblgen__XlaSharding = (*this)->getAttr(_XlaShardingAttrName());
    if (::mlir::failed(__mlir_ods_local_attr_constraint_tf_ops5(*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_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 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_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 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_ops10(*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_ops5(*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_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_ops18(*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_ops18(*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_ops18(*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_ops15(*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_ops2(*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_ops42(*this, v.getType(), "operand", index++)))
        return ::mlir::failure();
    }
    auto valueGroup1 = getODSOperands(1);

    for (auto v : valueGroup1) {
      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_ops42(*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_ops15(*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_ops2(*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_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 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_ops2(*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_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_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_ops5(*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_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_ops19(*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_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_ops19(*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_ops47(*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_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 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_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 ZetaOp::getEffects(::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}

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


#endif  // GET_OP_CLASSES

