from __future__ import annotations

from typing import Any

from paddle.distributed import fleet as fleet
from paddle.fluid.optimizer import Optimizer as Optimizer

registerd_op: Any
global_cnt: int
global_input_cnt: int

class AscendHelper:
    dtype2ge_map: Any = ...
    dtype2np_map: Any = ...
    dtype2paddle_inv_map: Any = ...
    def __init__(self) -> None: ...
    def dtype2ge(self, dtype: Any): ...
    def dtype2np(self, index: Any): ...

class AscendParserFactory:
    graph: Any = ...
    var2geop: Any = ...
    def __init__(self, graph: Any, var2geop: Any) -> None: ...
    def create_parse(self, parser_class: Any): ...

class AscendParserBase:
    graph: Any = ...
    var2geop: Any = ...
    op: Any = ...
    ascend_helper: Any = ...
    def __init__(self, graph: Any, var2geop: Any) -> None: ...
    def update_output(self, geop_list: Any, index_list: Any) -> None: ...
    def apply(self, op: Any) -> None: ...

class AddParser(AscendParserBase):
    parser_name: str = ...
    def __init__(self, graph: Any, var2geop: Any) -> None: ...

class DotSubParser(AscendParserBase):
    parser_name: str = ...
    def __init__(self, graph: Any, var2geop: Any) -> None: ...

class DotMulParser(AscendParserBase):
    parser_name: str = ...
    def __init__(self, graph: Any, var2geop: Any) -> None: ...

class DotDivParser(AscendParserBase):
    parser_name: str = ...
    def __init__(self, graph: Any, var2geop: Any) -> None: ...

class DotPowParser(AscendParserBase):
    parser_name: str = ...
    def __init__(self, graph: Any, var2geop: Any) -> None: ...

class LessParser(AscendParserBase):
    parser_name: str = ...
    def __init__(self, graph: Any, var2geop: Any) -> None: ...

class MaxParser(AscendParserBase):
    parser_name: str = ...
    def __init__(self, graph: Any, var2geop: Any) -> None: ...

class MinParser(AscendParserBase):
    parser_name: str = ...
    def __init__(self, graph: Any, var2geop: Any) -> None: ...

class LogParser(AscendParserBase):
    parser_name: str = ...
    def __init__(self, graph: Any, var2geop: Any) -> None: ...

class SqrtParser(AscendParserBase):
    parser_name: str = ...
    def __init__(self, graph: Any, var2geop: Any) -> None: ...

class PowParser(AscendParserBase):
    parser_name: str = ...
    def __init__(self, graph: Any, var2geop: Any) -> None: ...

class SquareParser(AscendParserBase):
    parser_name: str = ...
    def __init__(self, graph: Any, var2geop: Any) -> None: ...

class SumParser(AscendParserBase):
    parser_name: str = ...
    def __init__(self, graph: Any, var2geop: Any) -> None: ...

class LogicalNotParser(AscendParserBase):
    parser_name: str = ...
    def __init__(self, graph: Any, var2geop: Any) -> None: ...

class MeanParser(AscendParserBase):
    parser_name: str = ...
    def __init__(self, graph: Any, var2geop: Any) -> None: ...

class ReduceSumParser(AscendParserBase):
    parser_name: str = ...
    def __init__(self, graph: Any, var2geop: Any) -> None: ...

class MatMulParser(AscendParserBase):
    parser_name: str = ...
    def __init__(self, graph: Any, var2geop: Any) -> None: ...

class MulParser(AscendParserBase):
    parser_name: str = ...
    def __init__(self, graph: Any, var2geop: Any) -> None: ...

class LayerNormParser(AscendParserBase):
    parser_name: str = ...
    def __init__(self, graph: Any, var2geop: Any) -> None: ...

class ReluParser(AscendParserBase):
    parser_name: str = ...
    def __init__(self, graph: Any, var2geop: Any) -> None: ...

class GeluParser(AscendParserBase):
    parser_name: str = ...
    def __init__(self, graph: Any, var2geop: Any) -> None: ...

class TanhParser(AscendParserBase):
    parser_name: str = ...
    def __init__(self, graph: Any, var2geop: Any) -> None: ...

class SoftmaxWithCrossEntropyParser(AscendParserBase):
    parser_name: str = ...
    def __init__(self, graph: Any, var2geop: Any) -> None: ...

class SoftMaxParser(AscendParserBase):
    parser_name: str = ...
    def __init__(self, graph: Any, var2geop: Any) -> None: ...

class ShapeParser(AscendParserBase):
    parser_name: str = ...
    def __init__(self, graph: Any, var2geop: Any) -> None: ...

class FillConstantParser(AscendParserBase):
    parser_name: str = ...
    def __init__(self, graph: Any, var2geop: Any) -> None: ...

class TruncatedNormalParser(AscendParserBase):
    parser_name: str = ...
    def __init__(self, graph: Any, var2geop: Any) -> None: ...

class GatherParser(AscendParserBase):
    parser_name: str = ...
    def __init__(self, graph: Any, var2geop: Any) -> None: ...

class ScatterParser(AscendParserBase):
    parser_name: str = ...
    def __init__(self, graph: Any, var2geop: Any) -> None: ...

class CastParser(AscendParserBase):
    parser_name: str = ...
    def __init__(self, graph: Any, var2geop: Any) -> None: ...

class AssignParser(AscendParserBase):
    parser_name: str = ...
    def __init__(self, graph: Any, var2geop: Any) -> None: ...

class ScaleParser(AscendParserBase):
    parser_name: str = ...
    def __init__(self, graph: Any, var2geop: Any) -> None: ...

class SliceParser(AscendParserBase):
    parser_name: str = ...
    def __init__(self, graph: Any, var2geop: Any) -> None: ...

class ReshapeParser(AscendParserBase):
    parser_name: str = ...
    def __init__(self, graph: Any, var2geop: Any) -> None: ...

class TransposeParser(AscendParserBase):
    parser_name: str = ...
    def __init__(self, graph: Any, var2geop: Any) -> None: ...

class AccuracyParser(AscendParserBase):
    parser_name: str = ...
    def __init__(self, graph: Any, var2geop: Any) -> None: ...

class TopkParser(AscendParserBase):
    parser_name: str = ...
    def __init__(self, graph: Any, var2geop: Any) -> None: ...

class LookupTableParser(AscendParserBase):
    parser_name: str = ...
    def __init__(self, graph: Any, var2geop: Any) -> None: ...

class StackParser(AscendParserBase):
    parser_name: str = ...
    def __init__(self, graph: Any, var2geop: Any) -> None: ...

class UnSqueezeParser(AscendParserBase):
    parser_name: str = ...
    def __init__(self, graph: Any, var2geop: Any) -> None: ...

class AllGatherParser(AscendParserBase):
    parser_name: str = ...
    def __init__(self, graph: Any, var2geop: Any) -> None: ...

class AllReduceParser(AscendParserBase):
    parser_name: Any = ...
    reduction: Any = ...
    def __init__(self, graph: Any, var2geop: Any, reduction: Any) -> None: ...

class AllReduceSumParser(AllReduceParser):
    def __init__(self, graph: Any, var2geop: Any) -> None: ...

class AllReduceMaxParser(AllReduceParser):
    def __init__(self, graph: Any, var2geop: Any) -> None: ...

class BroadcastParser(AscendParserBase):
    parser_name: str = ...
    def __init__(self, graph: Any, var2geop: Any) -> None: ...

class ReduceScatterParser(AscendParserBase):
    parser_name: str = ...
    def __init__(self, graph: Any, var2geop: Any) -> None: ...

class SendParser(AscendParserBase):
    parser_name: str = ...
    def __init__(self, graph: Any, var2geop: Any) -> None: ...

class ReceiveParser(AscendParserBase):
    parser_name: str = ...
    def __init__(self, graph: Any, var2geop: Any) -> None: ...

class RangeParser(AscendParserBase):
    parser_name: str = ...
    def __init__(self, graph: Any, var2geop: Any) -> None: ...

class UniformRandomParser(AscendParserBase):
    parser_name: str = ...
    def __init__(self, graph: Any, var2geop: Any) -> None: ...

class EqualParser(AscendParserBase):
    parser_name: str = ...
    def __init__(self, graph: Any, var2geop: Any) -> None: ...

class ExpandParser(AscendParserBase):
    parser_name: str = ...
    def __init__(self, graph: Any, var2geop: Any) -> None: ...

class SqueezeParser(AscendParserBase):
    parser_name: str = ...
    def __init__(self, graph: Any, var2geop: Any) -> None: ...

class ReduceSumGradParser(AscendParserBase):
    parser_name: str = ...
    def __init__(self, graph: Any, var2geop: Any) -> None: ...

class MatMulGradParser(AscendParserBase):
    parser_name: str = ...
    def __init__(self, graph: Any, var2geop: Any) -> None: ...

class MulGradParser(AscendParserBase):
    parser_name: str = ...
    def __init__(self, graph: Any, var2geop: Any) -> None: ...

class ReluGradParser(AscendParserBase):
    parser_name: str = ...
    def __init__(self, graph: Any, var2geop: Any) -> None: ...

class SoftmaxWithCrossEntropyGradParser(AscendParserBase):
    parser_name: str = ...
    def __init__(self, graph: Any, var2geop: Any) -> None: ...

class DotMulGradParser(AscendParserBase):
    parser_name: str = ...
    def __init__(self, graph: Any, var2geop: Any) -> None: ...

class DotAddGradParser(AscendParserBase):
    parser_name: str = ...
    def __init__(self, graph: Any, var2geop: Any) -> None: ...

class DotDivGradParser(AscendParserBase):
    parser_name: str = ...
    def __init__(self, graph: Any, var2geop: Any) -> None: ...

class SoftmaxGradParser(AscendParserBase):
    parser_name: str = ...
    def __init__(self, graph: Any, var2geop: Any) -> None: ...

class ReshapeGradParser(AscendParserBase):
    parser_name: str = ...
    def __init__(self, graph: Any, var2geop: Any) -> None: ...

class GatherGradParser(AscendParserBase):
    parser_name: str = ...
    def __init__(self, graph: Any, var2geop: Any) -> None: ...

class TransposeGradParser(AscendParserBase):
    parser_name: str = ...
    def __init__(self, graph: Any, var2geop: Any) -> None: ...

class LayerNormGradParser(AscendParserBase):
    parser_name: str = ...
    def __init__(self, graph: Any, var2geop: Any) -> None: ...

class TanhGradParser(AscendParserBase):
    parser_name: str = ...
    def __init__(self, graph: Any, var2geop: Any) -> None: ...

class LogGradParser(AscendParserBase):
    parser_name: str = ...
    def __init__(self, graph: Any, var2geop: Any) -> None: ...

class SqrtGradParser(AscendParserBase):
    parser_name: str = ...
    def __init__(self, graph: Any, var2geop: Any) -> None: ...

class PowGradParser(AscendParserBase):
    parser_name: str = ...
    def __init__(self, graph: Any, var2geop: Any) -> None: ...

class GeluGradParser(AscendParserBase):
    parser_name: str = ...
    def __init__(self, graph: Any, var2geop: Any) -> None: ...

class MeanGradParser(AscendParserBase):
    parser_name: str = ...
    def __init__(self, graph: Any, var2geop: Any) -> None: ...

class SliceGradParser(AscendParserBase):
    parser_name: str = ...
    def __init__(self, graph: Any, var2geop: Any) -> None: ...

class LookUpTableGradParser(AscendParserBase):
    parser_name: str = ...
    def __init__(self, graph: Any, var2geop: Any) -> None: ...

class SGDParser(AscendParserBase):
    parser_name: str = ...
    def __init__(self, graph: Any, var2geop: Any) -> None: ...

class AdamParser(AscendParserBase):
    parser_name: str = ...
    def __init__(self, graph: Any, var2geop: Any) -> None: ...
