From 44a0a4adccec9348a5ed325062e2ca3106480c56 Mon Sep 17 00:00:00 2001 From: Chen Weihang Date: Thu, 14 Nov 2019 16:37:49 +0800 Subject: [PATCH] add paddle enforce count sh, test=develop, test=document_fix (#21178) --- tools/count_invalid_enforce.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 tools/count_invalid_enforce.sh diff --git a/tools/count_invalid_enforce.sh b/tools/count_invalid_enforce.sh new file mode 100644 index 00000000000..46feadd5667 --- /dev/null +++ b/tools/count_invalid_enforce.sh @@ -0,0 +1,11 @@ +#!/bin/bash +ALL_PADDLE_CHECK=`grep -r -zoE "(PADDLE_ENFORCE[A-Z_]{0,9}|PADDLE_THROW)\(.[^,\);]*.[^;]*\);\s" ../paddle/fluid || true` +ALL_PADDLE_CHECK_CNT=`echo "$ALL_PADDLE_CHECK" | grep -cE "(PADDLE_ENFORCE|PADDLE_THROW)" || true` +VALID_PADDLE_CHECK_CNT=`echo "$ALL_PADDLE_CHECK" | grep -zoE '(PADDLE_ENFORCE[A-Z_]{0,9}|PADDLE_THROW)\((.[^,;]+,)*.[^";]*(errors::).[^"]*".[^";]{20,}.[^;]*\);\s' | grep -cE "(PADDLE_ENFORCE|PADDLE_THROW)" || true` + +echo "----------------------------" +echo "PADDLE ENFORCE & THROW COUNT" +echo "----------------------------" +echo "All PADDLE_ENFORCE{_**} & PADDLE_THROW Count: ${ALL_PADDLE_CHECK_CNT}" +echo "Valid PADDLE_ENFORCE{_**} & PADDLE_THROW Count: ${VALID_PADDLE_CHECK_CNT}" +echo "Invalid PADDLE_ENFORCE{_**} & PADDLE_THROW Count: $(($ALL_PADDLE_CHECK_CNT-$VALID_PADDLE_CHECK_CNT))" -- GitLab