Skip to content

Commit

Permalink
fix enum operator override error
Browse files Browse the repository at this point in the history
  • Loading branch information
chenwhql committed Oct 22, 2021
1 parent 1685b67 commit 7b7e988
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 23 deletions.
6 changes: 0 additions & 6 deletions paddle/pten/common/data_type.h
Original file line number Diff line number Diff line change
Expand Up @@ -169,12 +169,6 @@ inline std::ostream& operator<<(std::ostream& os, DataType dtype) {
return os;
}

inline DataType& operator++(DataType& dtype, int) {
dtype =
DataType(static_cast<std::underlying_type<DataType>::type>(dtype) + 1);
return dtype;
}

} // namespace experimental
} // namespace paddle

Expand Down
6 changes: 0 additions & 6 deletions paddle/pten/common/layout.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,6 @@ inline std::ostream& operator<<(std::ostream& os, DataLayout layout) {
return os;
}

inline DataLayout& operator++(DataLayout& layout, int) {
layout = DataLayout(
static_cast<std::underlying_type<DataLayout>::type>(layout) + 1);
return layout;
}

} // namespace experimental
} // namespace paddle

Expand Down
14 changes: 8 additions & 6 deletions paddle/pten/core/kernel_registry.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,22 +107,24 @@ struct KernelRegistrar {
KernelArgsDefFn args_def_fn,
KernelFn kernel_fn) {
if (layout == DataLayout::ANY) {
for (DataLayout layout_iter = DataLayout::NHWC;
layout_iter != DataLayout::NUM_DATA_LAYOUTS;
for (size_t layout_iter = static_cast<size_t>(DataLayout::NHWC);
layout_iter != static_cast<size_t>(DataLayout::NUM_DATA_LAYOUTS);
layout_iter++) {
for (DataType dtype = DataType::BOOL; dtype != DataType::NUM_DATA_TYPES;
for (size_t dtype = static_cast<size_t>(DataType::BOOL);
dtype != static_cast<size_t>(DataType::NUM_DATA_TYPES);
dtype++) {
ConstructKernel(kernel_name_cstr,
backend,
layout_iter,
dtype,
static_cast<DataLayout>(layout_iter),
static_cast<DataType>(dtype),
args_parse_fn,
args_def_fn,
kernel_fn);
}
}
} else {
for (DataType dtype = DataType::BOOL; dtype != DataType::NUM_DATA_TYPES;
for (size_t dtype = static_cast<size_t>(DataType::BOOL);
dtype != static_cast<size_t>(DataType::NUM_DATA_TYPES);
dtype++) {
ConstructKernel(kernel_name_cstr,
backend,
Expand Down
5 changes: 0 additions & 5 deletions paddle/pten/hapi/include/linalg.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,5 @@ namespace experimental {

Tensor dot(const Tensor& x, const Tensor& y);

Tensor matmul(const Tensor& x,
const Tensor& y,
bool transpose_x,
bool transpose_y);

} // namespace experimental
} // namespace paddle

1 comment on commit 7b7e988

@paddle-bot-old
Copy link

@paddle-bot-old paddle-bot-old bot commented on 7b7e988 Oct 22, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🕵️ CI failures summary

🔍 PR: #34425 Commit ID: 7b7e988 contains failed CI.

🔹 Failed: PR-CI-APPROVAL

approve_failed
2021-10-22 17:37:48 正在保存至: “bk.txt”
2021-10-22 17:37:48 0K 100% 2.84M=0s
2021-10-22 17:37:48 2021-10-22 17:37:48 (2.84 MB/s) - 已保存 “bk.txt” [5/5])
2021-10-22 17:37:56 ****************
2021-10-22 17:37:56 0. You must have one RD (lanxianghit (Recommend), phlrain or luotao1) approval for changing the FLAGS, which manages the environment variables.
2021-10-22 17:37:56 1. You must have Dianhai approval for change 20+ files or add than 1000+ lines of content.
2021-10-22 17:37:56 2. You must have one RD (XiaoguangHu01,chenwhql,zhiqiu,Xreki,luotao1) approval for paddle/fluid/framework/operator.h, which manages the underlying code for fluid.
2021-10-22 17:37:56 3. You must have one RD (zhiqiu (Recommend) , phlrain) approval for the changes of paddle/fluid/pybind/op_function_generator.cc, which manages the logic of automatic generating op functions for dygraph.
2021-10-22 17:37:56 4. You must have one RD (XiaoguangHu01,chenwhql,zhiqiu,Xreki,luotao1) approval for the usage of const_cast.
2021-10-22 17:37:56 5. You must have one RD (Avin0323(Recommend) or zhouwei25 or wanghuancoder or luotao1) approval for modifying unity_build_rule.cmake which the rules of Unity Build.
2021-10-22 17:37:56 There are 6 approved errors.
2021-10-22 17:37:56 ****************
2021-10-22 17:37:56 + EXCODE=6
2021-10-22 17:37:56 + echo 'EXCODE: 6'
2021-10-22 17:37:56 EXCODE: 6
2021-10-22 17:37:56 + echo 'ipipe_log_param_EXCODE: 6'
2021-10-22 17:37:56 ipipe_log_param_EXCODE: 6
2021-10-22 17:37:56 + exit 6

🔹 Failed: PR-CI-OP-benchmark

Unknown Failed
2021-10-22 19:48:05 + echo '[tools/test_ci_op_benchmark.sh:271] [ERROR] Missing test script of "mean"(paddle/fluid/operators/mean_op.cu) in benchmark.'
2021-10-22 19:48:05 [tools/test_ci_op_benchmark.sh:271] [ERROR] Missing test script of "mean"(paddle/fluid/operators/mean_op.cu) in benchmark.
2021-10-22 19:48:05 + for op_name in '${!CHANGE_OP_MAP[@]}'
2021-10-22 19:48:05 + '[' -z '' ']'
2021-10-22 19:48:05 + exit_code=8
2021-10-22 19:48:05 + LOG '[ERROR] Missing test script of "fill_any_like"(paddle/fluid/operators/fill_any_like_op.cu) in benchmark.'
2021-10-22 19:48:05 + echo '[tools/test_ci_op_benchmark.sh:271] [ERROR] Missing test script of "fill_any_like"(paddle/fluid/operators/fill_any_like_op.cu) in benchmark.'
2021-10-22 19:48:05 [tools/test_ci_op_benchmark.sh:271] [ERROR] Missing test script of "fill_any_like"(paddle/fluid/operators/fill_any_like_op.cu) in benchmark.
2021-10-22 19:48:05 + for op_name in '${!CHANGE_OP_MAP[@]}'
2021-10-22 19:48:05 + '[' -z matmul,matmul,matmul.json,True ']'
2021-10-22 19:48:05 + '[' 8 -ne 0 ']'
2021-10-22 19:48:05 + LOG '[INFO] See https://github.com/PaddlePaddle/Paddle/wiki/PR-CI-OP-benchmark-Manual for details.'
2021-10-22 19:48:05 + echo '[tools/test_ci_op_benchmark.sh:275] [INFO] See https://github.com/PaddlePaddle/Paddle/wiki/PR-CI-OP-benchmark-Manual for details.'
2021-10-22 19:48:05 [tools/test_ci_op_benchmark.sh:275] [INFO] See https://github.com/PaddlePaddle/Paddle/wiki/PR-CI-OP-benchmark-Manual for details.
2021-10-22 19:48:05 + LOG '[INFO] Or you can apply for one RD (Avin0323(Recommend), Xreki, luotao1) approval to pass this PR.'
2021-10-22 19:48:05 + echo '[tools/test_ci_op_benchmark.sh:276] [INFO] Or you can apply for one RD (Avin0323(Recommend), Xreki, luotao1) approval to pass this PR.'
2021-10-22 19:48:05 [tools/test_ci_op_benchmark.sh:276] [INFO] Or you can apply for one RD (Avin0323(Recommend), Xreki, luotao1) approval to pass this PR.
2021-10-22 19:48:05 + exit 8
2021-10-22 19:48:05 {build code state=8}

🔹 Failed: PR-CI-Coverage

coverage_failed
2021-10-22 20:57:13 + CURL_OPTS='-s --connect-timeout 600 --retry 10 --retry-delay 10'
2021-10-22 20:57:13 ++ uuid
2021-10-22 20:57:13 ++ curl -s --connect-timeout 600 --retry 10 --retry-delay 10 -u paddle:915eedab953b6f51151f50eb https://xly.bce.baidu.com/ipipe/ipipe-report/uuid
2021-10-22 20:57:14 + UPLOAD_FILE=/tmp/upload-da03395e-ef20-46f8-85aa-cae9ce00e22d.tar.gz
2021-10-22 20:57:14 + echo Archiving
2021-10-22 20:57:14 Archiving
2021-10-22 20:57:14 + tar -czvf /tmp/upload-da03395e-ef20-46f8-85aa-cae9ce00e22d.tar.gz .
2021-10-22 20:57:14 ./
2021-10-22 20:57:14 + du -hs /tmp/upload-da03395e-ef20-46f8-85aa-cae9ce00e22d.tar.gz
2021-10-22 20:57:14 4.0K /tmp/upload-da03395e-ef20-46f8-85aa-cae9ce00e22d.tar.gz
2021-10-22 20:57:14 + curl -s --connect-timeout 600 --retry 10 --retry-delay 10 -u paddle:915eedab953b6f51151f50eb -F buildId=8551935 -F path=python-coverage -F file=@/tmp/upload-da03395e-ef20-46f8-85aa-cae9ce00e22d.tar.gz https://xly.bce.baidu.com/ipipe/ipipe-report/upload
2021-10-22 20:57:14 + rm -f /tmp/upload-da03395e-ef20-46f8-85aa-cae9ce00e22d.tar.gz
2021-10-22 20:57:14 report uploaded
2021-10-22 20:57:14 9
2021-10-22 20:57:14 ipipe_log_param_EXCODE: 9
2021-10-22 20:57:14 Sorry, coverage check failed.
2021-10-22 20:57:14 + exit 9
2021-10-22 20:57:14 {build code state=9}
2021-10-22 20:57:24 kill agent BUILD_CODE_FAIL

🔹 Failed: PR-CI-iScan-Python

Unknown Failed
Unknown Failed

🔹 Failed: PR-CI-Windows

test_failed
2021-10-22 22:19:29 The following tests FAILED:
2021-10-22 22:19:29 1166 - test_jacobian (Failed)
2021-10-22 22:19:29 Errors while running CTest
2021-10-22 22:19:30 =========================================
2021-10-22 22:19:30 There are more than 10 failed unit tests, so no unit test retry!!!
2021-10-22 22:19:30 =========================================
2021-10-22 22:19:30 1166 - test_jacobian (Failed)
2021-10-22 22:19:30 36 - lodtensor_printer_test (Timeout)
2021-10-22 22:19:30 49 - data_type_test (Timeout)
2021-10-22 22:19:30 53 - eigen_test (Timeout)
2021-10-22 22:19:30 66 - program_desc_test (Timeout)
2021-10-22 22:19:30 67 - op_version_registry_test (Timeout)
2021-10-22 22:19:30 79 - selected_rows_test (Timeout)
2021-10-22 22:19:30 118 - test_conv_activation_mkldnn_fuse_pass (Timeout)
2021-10-22 22:19:30 128 - test_cpu_quantize_pass (Timeout)
2021-10-22 22:19:30 657 - test_inference_api (Timeout)
2021-10-22 22:19:30 666 - test_input_spec (Timeout)
2021-10-22 22:19:30 670 - test_io_save_load (Timeout)
2021-10-22 22:19:30 369 - test_complex_simplenet (Timeout)
2021-10-22 22:19:30 630 - test_imperative_layers (Timeout)
2021-10-22 22:19:30 651 - test_imperative_using_non_zero_gpu (Timeout)

Please sign in to comment.