diff --git a/ci/check/run_license_format.py b/ci/check/run_license_format.py index 6fcf851f321db9f4d11de515552557ab73d8bd70..0842328f1809a22dcfca44ffc1d75bf3b2306337 100644 --- a/ci/check/run_license_format.py +++ b/ci/check/run_license_format.py @@ -35,29 +35,33 @@ def check_file(path): with open(path) as f: content = f.read() txt = get_txt(path) + if content.count("The OneFlow Authors. All rights reserved.") > 1: + return ("duplicated", content) if content.startswith(txt) or (not content): - return (True, content) + return ("ok", content) else: - return (False, content) + return ("absent", content) def format_file(path): txt = get_txt(path) with open(path, "r", encoding="utf-8") as r: content = r.read() - is_formatted, content = check_file(path) - if is_formatted: + format_status, content = check_file(path) + if format_status == "ok": return True - else: + elif format_status == "absent": with open(path, "w") as w: new_content = txt + content w.write(new_content) return False + else: + raise ValueError(f"license {format_status} {path}") def do_check(x): - is_formatted, _ = check_file(x) - return (x, is_formatted) + format_status, _ = check_file(x) + return (x, format_status) def do_format(x): @@ -91,13 +95,16 @@ if __name__ == "__main__": with Pool(10) as p: if args.check: any_absence = False - for (p, is_formatted) in p.map(do_check, files): - if is_formatted == False: - print("license absent:", p) + for (p, format_status) in p.map(do_check, files): + if format_status != "ok": + print(f"license {format_status}:", p) any_absence = True if any_absence: exit(1) if args.fix: - for (p, is_formatted) in p.map(do_format, files): - if is_formatted == False: - print("license added:", p) + for (p, format_result) in p.map(do_format, files): + if format_result == True: + if args.verbose: + print("license already added:", p) + else: + print("license just added:", p) diff --git a/oneflow/core/graph/stream_index_getter_registry.cpp b/oneflow/core/graph/stream_index_getter_registry.cpp index 099d1f36d83108e9bd3fe20f55156acebe49496b..67f5659acf81a1a6d35535fd798dcb4f3f512f99 100644 --- a/oneflow/core/graph/stream_index_getter_registry.cpp +++ b/oneflow/core/graph/stream_index_getter_registry.cpp @@ -13,30 +13,6 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -/* -Copyright 2020 The OneFlow Authors. All rights reserved. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -/* -Copyright 2020 The OneFlow Authors. All rights reserved. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ #include "oneflow/core/graph/stream_index_getter_registry.h" #include "oneflow/core/graph/compute_task_node.h" #include "oneflow/core/graph/stream_index_getter_registry_manager.h" diff --git a/oneflow/core/graph/stream_index_getter_registry.h b/oneflow/core/graph/stream_index_getter_registry.h index ff2206893da5a596b31f86fdaf24e7d3c01f7fa9..f11778ab44fec3438a07d2d2c5ed23ecf0353b69 100644 --- a/oneflow/core/graph/stream_index_getter_registry.h +++ b/oneflow/core/graph/stream_index_getter_registry.h @@ -13,18 +13,6 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -/* -Copyright 2020 The OneFlow Authors. All rights reserved. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ #ifndef ONEFLOW_CORE_GRAPH_STREAM_INDEX_GETTER_REGISTRY_H_ #define ONEFLOW_CORE_GRAPH_STREAM_INDEX_GETTER_REGISTRY_H_ diff --git a/oneflow/core/graph/stream_index_getter_registry_manager.cpp b/oneflow/core/graph/stream_index_getter_registry_manager.cpp index ccac17082a89d3894eff29931cd2b5cb7434bf18..5183541448d272b2d824e5a3064d7d1d46857e1f 100644 --- a/oneflow/core/graph/stream_index_getter_registry_manager.cpp +++ b/oneflow/core/graph/stream_index_getter_registry_manager.cpp @@ -13,30 +13,6 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -/* -Copyright 2020 The OneFlow Authors. All rights reserved. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -/* -Copyright 2020 The OneFlow Authors. All rights reserved. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ #include "oneflow/core/graph/stream_index_getter_registry_manager.h" namespace oneflow { diff --git a/oneflow/core/graph/stream_index_getter_registry_manager.h b/oneflow/core/graph/stream_index_getter_registry_manager.h index ee3a144d2e96a66506a608c120f7f50e3ee1ba69..8fd6f0cb5d31db6d32770b4d610a581425b1980d 100644 --- a/oneflow/core/graph/stream_index_getter_registry_manager.h +++ b/oneflow/core/graph/stream_index_getter_registry_manager.h @@ -13,18 +13,6 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -/* -Copyright 2020 The OneFlow Authors. All rights reserved. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ #ifndef ONEFLOW_CORE_GRAPH_STREAM_INDEX_GETTER_REGISTRY_MANAGER_H_ #define ONEFLOW_CORE_GRAPH_STREAM_INDEX_GETTER_REGISTRY_MANAGER_H_ diff --git a/oneflow/python/nn/modules/dataset.py b/oneflow/python/nn/modules/dataset.py index 5337e5e062c71263c86f1552da629a9a2a1b5345..3f64424277a5c636c4c39df36a01f4db4efc5eed 100644 --- a/oneflow/python/nn/modules/dataset.py +++ b/oneflow/python/nn/modules/dataset.py @@ -13,18 +13,6 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ -""" -Copyright 2020 The OneFlow Authors. All rights reserved. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -""" import oneflow as flow from oneflow.python.oneflow_export import oneflow_export, experimental_api diff --git a/oneflow/python/test/modules/test_dropout.py b/oneflow/python/test/modules/test_dropout.py index 2cbd66a7108efddd68530fb35d893313eb8e5b67..635b208738953a6d59a6c42adff3107fa7eb321e 100644 --- a/oneflow/python/test/modules/test_dropout.py +++ b/oneflow/python/test/modules/test_dropout.py @@ -13,18 +13,6 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ -""" -Copyright 2020 The OneFlow Authors. All rights reserved. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -""" import unittest from collections import OrderedDict diff --git a/oneflow/python/test/ops/test_logsoftmax.py b/oneflow/python/test/ops/test_logsoftmax.py index 3df36be6705026d4965fc74afdac689094cc04e7..2279a5619f865cc8e435bd1e6f251bafded39749 100644 --- a/oneflow/python/test/ops/test_logsoftmax.py +++ b/oneflow/python/test/ops/test_logsoftmax.py @@ -13,18 +13,6 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ -""" -Copyright 2020 The OneFlow Authors. All rights reserved. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -""" import oneflow as flow import numpy as np import oneflow.typing as tp diff --git a/oneflow/user/kernels/pad2d_kernels.cpp b/oneflow/user/kernels/pad2d_kernels.cpp index 5360f019b2ce350edeb1441ce27daf0ba330081e..ea801d00fe5ec2d5696d4d96a6c4d141cbea35a6 100644 --- a/oneflow/user/kernels/pad2d_kernels.cpp +++ b/oneflow/user/kernels/pad2d_kernels.cpp @@ -13,18 +13,6 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -/* -Copyright 2020 The OneFlow Authors. All rights reserved. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ #include "oneflow/core/common/nd_index_offset_helper.h" #include "oneflow/core/device/memory_copier.h" #include "oneflow/core/framework/framework.h"