diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index dd0c408fd05..bbb2d26bd1b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -18,6 +18,11 @@ repos: types: [text] - id: remove-tabs types: [text] + - repo: https://github.com/PFCCLab/typos-pre-commit-mirror.git + rev: v1.38.1 + hooks: + - id: typos + args: [--force-exclude] # Document hooks - repo: https://github.com/PFCCLab/dochooks rev: v0.6.0 diff --git a/_typos.toml b/_typos.toml new file mode 100644 index 00000000000..f5146d2073a --- /dev/null +++ b/_typos.toml @@ -0,0 +1,282 @@ +[files] +# The following files will be excluded from spell check during commits +extend-exclude = [] + +[default] +# Ignore 1-3 letter words, refer to https://github.com/crate-ci/typos/issues/1079 +extend-ignore-words-re = ["^[a-zA-Z]{1,3}$"] +# refer to https://github.com/crate-ci/typos/blob/master/docs/reference.md#example-configurations +extend-ignore-re = [ + # Ignore lines by `# typos: disable-line` + "(?Rm)^.*(#|//)\\s*typos:\\s*disable-line$", + # Ignore block by `# typos: off` and `# typos: on` + "(?s)(#|//)\\s*typos:\\s*off.*?\\n\\s*(#|//)\\s*typos:\\s*on" +] + +[default.extend-words] +# PaddlePaddle specific words +CANN = "CANN" +Clas = "Clas" +arange = "arange" + +# These words need to be fixed +Accuray = "Accuray" +Adventages = "Adventages" +Archetecture = "Archetecture" +Asynchoronous = "Asynchoronous" +Attrbute = "Attrbute" +Attribtue = "Attribtue" +Bounary = "Bounary" +Classfication = "Classfication" +Comparision = "Comparision" +Contructing = "Contructing" +Creenshot = "Creenshot" +DELCARE = "DELCARE" +Dateset = "Dateset" +Discription = "Discription" +Distrbuted = "Distrbuted" +Driect = "Driect" +Embeddding = "Embeddding" +Embeding = "Embeding" +Engish = "Engish" +Fasle = "Fasle" +Flase = "Flase" +Generater = "Generater" +Gloabal = "Gloabal" +Imporvement = "Imporvement" +Interfce = "Interfce" +Kernal = "Kernal" +Learing = "Learing" +Moible = "Moible" +Nervana = "Nervana" +Numberic = "Numberic" +Operaton = "Operaton" +Optimizaing = "Optimizaing" +Optimzier = "Optimzier" +Paremeter = "Paremeter" +Pipline = "Pipline" +Porgram = "Porgram" +Prallel = "Prallel" +Propegation = "Propegation" +Propogation = "Propogation" +Protocal = "Protocal" +Pyhton = "Pyhton" +REGISTE = "REGISTE" +Reivew = "Reivew" +Reuqest = "Reuqest" +Setment = "Setment" +Similarily = "Similarily" +Simle = "Simle" +Sovler = "Sovler" +Successed = "Successed" +Tansformer = "Tansformer" +Tenosr = "Tenosr" +Traning = "Traning" +Transfomed = "Transfomed" +Tthe = "Tthe" +Ture = "Ture" +Useage = "Useage" +Varialble = "Varialble" +Varible = "Varible" +Varient = "Varient" +Wether = "Wether" +accordding = "accordding" +accoustic = "accoustic" +accpetance = "accpetance" +accracy = "accracy" +acutal = "acutal" +apporach = "apporach" +apporaches = "apporaches" +arguements = "arguements" +arguemnts = "arguemnts" +assgin = "assgin" +assginment = "assginment" +auxilary = "auxilary" +avaiable = "avaiable" +baisc = "baisc" +basci = "basci" +beacuse = "beacuse" +bechmark = "bechmark" +benckmark = "benckmark" +boradcast = "boradcast" +brodcast = "brodcast" +caculate = "caculate" +cantains = "cantains" +choosen = "choosen" +classfication = "classfication" +classfy = "classfy" +cliping = "cliping" +colunms = "colunms" +commmit = "commmit" +complie = "complie" +condtional = "condtional" +conjuction = "conjuction" +containg = "containg" +contruct = "contruct" +contructed = "contructed" +contruction = "contruction" +contxt = "contxt" +convertion = "convertion" +convinience = "convinience" +correponding = "correponding" +corresonding = "corresonding" +correspoinding = "correspoinding" +corss = "corss" +creatation = "creatation" +creats = "creats" +dafault = "dafault" +datas = "datas" +decribe = "decribe" +decribes = "decribes" +deocder = "deocder" +desgin = "desgin" +desginated = "desginated" +desigin = "desigin" +determinated = "determinated" +diffcult = "diffcult" +dimention = "dimention" +dimentions = "dimentions" +dirrectories = "dirrectories" +disucssion = "disucssion" +egde = "egde" +enviornment = "enviornment" +erros = "erros" +evalute = "evalute" +exampels = "exampels" +exection = "exection" +exlusive = "exlusive" +exmaple = "exmaple" +exsits = "exsits" +feeded = "feeded" +flaot = "flaot" +fliters = "fliters" +follwing = "follwing" +formated = "formated" +formater = "formater" +forword = "forword" +foward = "foward" +functinal = "functinal" +fundemental = "fundemental" +funtion = "funtion" +gard = "gard" +generaly = "generaly" +gloabl = "gloabl" +heigh = "heigh" +ilter = "ilter" +imge = "imge" +implememted = "implememted" +indeces = "indeces" +indentical = "indentical" +indicies = "indicies" +indx = "indx" +infered = "infered" +inferface = "inferface" +infor = "infor" +ingore = "ingore" +instert = "instert" +instrinsics = "instrinsics" +interchangable = "interchangable" +intializers = "intializers" +intput = "intput" +lable = "lable" +learing = "learing" +legth = "legth" +lengthes = "lengthes" +lenth = "lenth" +leran = "leran" +libary = "libary" +likey = "likey" +mantained = "mantained" +matrics = "matrics" +mdule = "mdule" +mechnism = "mechnism" +memeory = "memeory" +memroy = "memroy" +messege = "messege" +metaphore = "metaphore" +metrices = "metrices" +muliply = "muliply" +mulitplying = "mulitplying" +mutbale = "mutbale" +neeeded = "neeeded" +nessesary = "nessesary" +numberic = "numberic" +occurence = "occurence" +opeartor = "opeartor" +opeartors = "opeartors" +operaters = "operaters" +optmization = "optmization" +outpu = "outpu" +outpus = "outpus" +overrided = "overrided" +overwrited = "overwrited" +palce = "palce" +parammeters = "parammeters" +poniter = "poniter" +porcess = "porcess" +processer = "processer" +promot = "promot" +propegation = "propegation" +provicded = "provicded" +recevied = "recevied" +recomment = "recomment" +registerd = "registerd" +registring = "registring" +reivew = "reivew" +relase = "relase" +requirments = "requirments" +resut = "resut" +resuts = "resuts" +sacle = "sacle" +samle = "samle" +satifies = "satifies" +schedual = "schedual" +secenarios = "secenarios" +sematic = "sematic" +seperator = "seperator" +setted = "setted" +shoule = "shoule" +similary = "similary" +simplier = "simplier" +skiped = "skiped" +softwares = "softwares" +sould = "sould" +specail = "specail" +sperated = "sperated" +splited = "splited" +splitted = "splitted" +stirng = "stirng" +stradegy = "stradegy" +subract = "subract" +sucess = "sucess" +sucessor = "sucessor" +sucessors = "sucessors" +szie = "szie" +tempory = "tempory" +tenosr = "tenosr" +thier = "thier" +traget = "traget" +traing = "traing" +trainning = "trainning" +traning = "traning" +transfered = "transfered" +trasformed = "trasformed" +treshold = "treshold" +trian = "trian" +unqiue = "unqiue" +unsupport = "unsupport" +updte = "updte" +utill = "utill" +varialbes = "varialbes" +varibale = "varibale" +varibales = "varibales" +varience = "varience" +varient = "varient" +visting = "visting" +warpped = "warpped" +wether = "wether" +wiht = "wiht" +wirte = "wirte" +workign = "workign" +wraper = "wraper" +writter = "writter" diff --git a/docs/api/gen_doc.py b/docs/api/gen_doc.py index 566cde3bcd9..cdade62f415 100755 --- a/docs/api/gen_doc.py +++ b/docs/api/gen_doc.py @@ -696,15 +696,15 @@ def check_cn_en_match(path="./paddle", diff_file="en_cn_files_diff"): """ osp_join = os.path.join osp_exists = os.path.exists - with open(diff_file, "w") as fo: + with open(diff_file, "w") as f: tmpl = "{}\t{}\n" - fo.write(tmpl.format("exist", "not_exits")) + f.write(tmpl.format("exist", "not_exits")) for root, dirs, files in os.walk(path): for file in files: if file.endswith(en_suffix): cf = file.replace(en_suffix, cn_suffix) if not osp_exists(osp_join(root, cf)): - fo.write( + f.write( tmpl.format( osp_join(root, file), osp_join(root, cf) ) @@ -712,7 +712,7 @@ def check_cn_en_match(path="./paddle", diff_file="en_cn_files_diff"): elif file.endswith(cn_suffix): ef = file.replace(cn_suffix, en_suffix) if not osp_exists(osp_join(root, ef)): - fo.write( + f.write( tmpl.format( osp_join(root, file), osp_join(root, ef) ) diff --git a/docs/design/concurrent/select_op.md b/docs/design/concurrent/select_op.md index 918dfebfb17..4e8a86e125e 100644 --- a/docs/design/concurrent/select_op.md +++ b/docs/design/concurrent/select_op.md @@ -161,7 +161,7 @@ blocks { idx: 1 parent_idx: 0 ... - // Fill a tensor with the case index (ie: 0,1,2,3,ect.) + // Fill a tensor with the case index (ie: 0,1,2,3,etc.) ops { outputs { parameter: "Out" diff --git a/docs/dev_guides/custom_device_docs/custom_kernel_docs/tensor_api_en.md b/docs/dev_guides/custom_device_docs/custom_kernel_docs/tensor_api_en.md index 444c4793f7e..6c9033ab314 100644 --- a/docs/dev_guides/custom_device_docs/custom_kernel_docs/tensor_api_en.md +++ b/docs/dev_guides/custom_device_docs/custom_kernel_docs/tensor_api_en.md @@ -62,7 +62,7 @@ All element data of `DenseTensor` are stored in contiguous memory, and you can r // Return:int64_t categorical variable int64_t numel() const override; - // Acquire the dims of tbe tensor + // Acquire the dims of the tensor // Parameter:None // Return:DDim object const DDim& dims() const noexcept override; diff --git a/docs/dev_guides/op_optimization/kernel_primitive_api/io_api_en.md b/docs/dev_guides/op_optimization/kernel_primitive_api/io_api_en.md index a5b5cc9e391..96ad9094936 100644 --- a/docs/dev_guides/op_optimization/kernel_primitive_api/io_api_en.md +++ b/docs/dev_guides/op_optimization/kernel_primitive_api/io_api_en.md @@ -122,7 +122,7 @@ The data processing process is as follows:
> T: Element type.
> NX: Each thread reads NX columns data continuously.
-> NY: Each thread reads NY rows data, Ony NY = 1 was supported.
+> NY: Each thread reads NY rows data, Only NY = 1 was supported.
> BlockSize: Device attribute, which identifies the current device thread indexing method. For GPU, threadIdx.x is used as the thread index, this parameter is not currently supported.
> Rank: The dimension of the original output data.
> IsBoundary: Identifies whether to fetch memory boundary judgment. When the total number of data processed by the Block is less than NX * NY * blockDim.x, boundary judgment is required to avoid memory access crossing the boundary.
diff --git a/docs/templates/common_docs.py b/docs/templates/common_docs.py index 6d0941a831d..93d0c09deae 100644 --- a/docs/templates/common_docs.py +++ b/docs/templates/common_docs.py @@ -31,7 +31,7 @@ grad_clip (GradientClipBase, optional): Gradient cliping strategy, it's an instance of some derived class of ``GradientClipBase`` . There are three cliping strategies ( :ref:`api_fluid_clip_GradientClipByGlobalNorm` , :ref:`api_fluid_clip_GradientClipByNorm` , :ref:`api_fluid_clip_GradientClipByValue` ). Default is None, meaning there is no gradient clipping. num_filters (int): The number of filter. It is as same as the output channals numbers. dim (int, optional): A dimension along which to operate. Default is 0. - is_sparse (bool, optional): Whether use sparse updating. For more information, please refer to :ref:`api_guide_sparse_update_en` . If it's True, it will ues sparse updating. + is_sparse (bool, optional): Whether use sparse updating. For more information, please refer to :ref:`api_guide_sparse_update_en` . If it's True, it will use sparse updating. place (paddle.CPUPlace()|paddle.CUDAPlace(N)|None): This parameter represents which device the executor runs on, and N means the GPU's id. When this parameter is None, PaddlePaddle will set the default device according to its installation version. If Paddle is CPU version, the default device would be set to CPUPlace(). If Paddle is GPU version, the default device would be set to CUDAPlace(0). Default is None. num_filters (int): the number of convolution kernels, is also the number of output channels. """