@@ -1,5 +1,5 @@ | |||||
#!/bin/bash | #!/bin/bash | ||||
# Copyright 2019 Huawei Technologies Co., Ltd | |||||
# Copyright 2019-2020 Huawei Technologies Co., Ltd | |||||
# | # | ||||
# Licensed under the Apache License, Version 2.0 (the "License"); | # Licensed under the Apache License, Version 2.0 (the "License"); | ||||
# you may not use this file except in compliance with the License. | # you may not use this file except in compliance with the License. | ||||
@@ -90,11 +90,9 @@ if [ "X${mode}" == "Xall" ]; then | |||||
find inc -type f -name "*" | grep "\.h$\|\.cc$" >> "${CHECK_LIST_FILE}" || true | find inc -type f -name "*" | grep "\.h$\|\.cc$" >> "${CHECK_LIST_FILE}" || true | ||||
elif [ "X${mode}" == "Xchanged" ]; then | elif [ "X${mode}" == "Xchanged" ]; then | ||||
# --diff-filter=ACMRTUXB will ignore deleted files in commit | # --diff-filter=ACMRTUXB will ignore deleted files in commit | ||||
git diff --diff-filter=ACMRTUXB --name-only | grep "src" | grep "\.h$\|\.cc$" > "${CHECK_LIST_FILE}" || true | |||||
git diff --diff-filter=ACMRTUXB --name-only | grep "inc" | grep "\.h$\|\.cc$" >> "${CHECK_LIST_FILE}" || true | |||||
git diff --diff-filter=ACMRTUXB --name-only | grep "^inc\|^src" | grep "\.h$\|\.cc$" > "${CHECK_LIST_FILE}" || true | |||||
else # "X${mode}" == "Xlastcommit" | else # "X${mode}" == "Xlastcommit" | ||||
git diff --diff-filter=ACMRTUXB --name-only HEAD~ HEAD | grep "src" | grep "\.h$\|\.cc$" > "${CHECK_LIST_FILE}" || true | |||||
git diff --diff-filter=ACMRTUXB --name-only HEAD~ HEAD | grep "inc" | grep "\.h$\|\.cc$" >> "${CHECK_LIST_FILE}" || true | |||||
git diff --diff-filter=ACMRTUXB --name-only HEAD~ HEAD | grep "^inc\|^src" | grep "\.h$\|\.cc$" > "${CHECK_LIST_FILE}" || true | |||||
fi | fi | ||||
CHECK_RESULT_FILE=__code_format_check_result__ | CHECK_RESULT_FILE=__code_format_check_result__ | ||||
@@ -1,5 +1,5 @@ | |||||
#!/bin/bash | #!/bin/bash | ||||
# Copyright 2019 Huawei Technologies Co., Ltd | |||||
# Copyright 2019-2020 Huawei Technologies Co., Ltd | |||||
# | # | ||||
# Licensed under the Apache License, Version 2.0 (the "License"); | # Licensed under the Apache License, Version 2.0 (the "License"); | ||||
# you may not use this file except in compliance with the License. | # you may not use this file except in compliance with the License. | ||||
@@ -89,11 +89,10 @@ if [[ "X${mode}" == "Xall" ]]; then | |||||
find src -type f -name "*" | grep "\.h$\|\.cc$" > "${FMT_FILE_LIST}" || true | find src -type f -name "*" | grep "\.h$\|\.cc$" > "${FMT_FILE_LIST}" || true | ||||
find inc -type f -name "*" | grep "\.h$\|\.cc$" >> "${FMT_FILE_LIST}" || true | find inc -type f -name "*" | grep "\.h$\|\.cc$" >> "${FMT_FILE_LIST}" || true | ||||
elif [[ "X${mode}" == "Xchanged" ]]; then | elif [[ "X${mode}" == "Xchanged" ]]; then | ||||
git diff --name-only | grep "src" | grep "\.h$\|\.cc$" > "${FMT_FILE_LIST}" || true | |||||
git diff --name-only | grep "inc" | grep "\.h$\|\.cc$" >> "${FMT_FILE_LIST}" || true | |||||
# --diff-filter=ACMRTUXB will ignore deleted files in commit | |||||
git diff --diff-filter=ACMRTUXB --name-only | grep "^inc\|^src" | grep "\.h$\|\.cc$" >> "${FMT_FILE_LIST}" || true | |||||
else # "X${mode}" == "Xlastcommit" | else # "X${mode}" == "Xlastcommit" | ||||
git diff --name-only HEAD~ HEAD | grep "src" | grep "\.h$\|\.cc$" > "${FMT_FILE_LIST}" || true | |||||
git diff --name-only HEAD~ HEAD | grep "inc" | grep "\.h$\|\.cc$" >> "${FMT_FILE_LIST}" || true | |||||
git diff --diff-filter=ACMRTUXB --name-only HEAD~ HEAD | grep "^inc\|^src" | grep "\.h$\|\.cc$" > "${FMT_FILE_LIST}" || true | |||||
fi | fi | ||||
while read line; do | while read line; do | ||||
@@ -124,9 +124,9 @@ REG_OP(Relu6) | |||||
* z: A Tensor of type RealNumberType. | * z: A Tensor of type RealNumberType. | ||||
*/ | */ | ||||
REG_OP(Relu6Grad) | REG_OP(Relu6Grad) | ||||
.INPUT(y, TensorType::RealNumberType()) | |||||
.INPUT(dy, TensorType::RealNumberType()) | |||||
.OUTPUT(z, TensorType::RealNumberType()) | |||||
.INPUT(gradients, TensorType::RealNumberType()) | |||||
.INPUT(features, TensorType::RealNumberType()) | |||||
.OUTPUT(backprops, TensorType::RealNumberType()) | |||||
.OP_END_FACTORY_REG(Relu6Grad) | .OP_END_FACTORY_REG(Relu6Grad) | ||||
/** | /** | ||||