From c3ba02801a5d6308b923dc599800ee62e1b27697 Mon Sep 17 00:00:00 2001 From: Megvii Engine Team Date: Tue, 19 Jan 2021 18:21:41 +0800 Subject: [PATCH] chore(mge): correct license headers GitOrigin-RevId: 2dd4438f90b6ea19a213e316e068d0cc3372ad58 --- imperative/src/impl/event_pool.cpp | 11 ++++++ imperative/src/impl/event_pool.h | 11 ++++++ imperative/src/impl/proxy_graph/common.h | 11 ++++++ imperative/src/impl/proxy_graph/mini_graph.h | 11 ++++++ .../src/impl/proxy_graph/proxy_graph.cpp | 39 +++++++++++++------ .../src/impl/proxy_graph/proxy_graph_base.h | 11 ++++++ imperative/src/impl/tensor_sanity_check.cpp | 10 +++-- .../megbrain/imperative/tensor_sanity_check.h | 10 +++-- 8 files changed, 95 insertions(+), 19 deletions(-) diff --git a/imperative/src/impl/event_pool.cpp b/imperative/src/impl/event_pool.cpp index a5509d492..4f27fa0e2 100644 --- a/imperative/src/impl/event_pool.cpp +++ b/imperative/src/impl/event_pool.cpp @@ -1,3 +1,14 @@ +/** + * \file imperative/src/impl/event_pool.cpp + * MegEngine is Licensed under the Apache License, Version 2.0 (the "License") + * + * Copyright (c) 2014-2021 Megvii Inc. All rights reserved. + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT ARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + */ + #include "./event_pool.h" namespace mgb { diff --git a/imperative/src/impl/event_pool.h b/imperative/src/impl/event_pool.h index 6263b0104..4d6df0bb6 100644 --- a/imperative/src/impl/event_pool.h +++ b/imperative/src/impl/event_pool.h @@ -1,3 +1,14 @@ +/** + * \file imperative/src/impl/event_pool.h + * MegEngine is Licensed under the Apache License, Version 2.0 (the "License") + * + * Copyright (c) 2014-2021 Megvii Inc. All rights reserved. + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT ARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + */ + #pragma once #include "megbrain/comp_node.h" diff --git a/imperative/src/impl/proxy_graph/common.h b/imperative/src/impl/proxy_graph/common.h index 846279a3c..39f4cb88d 100644 --- a/imperative/src/impl/proxy_graph/common.h +++ b/imperative/src/impl/proxy_graph/common.h @@ -1,3 +1,14 @@ +/** + * \file imperative/src/impl/proxy_graph/common.h + * MegEngine is Licensed under the Apache License, Version 2.0 (the "License") + * + * Copyright (c) 2014-2021 Megvii Inc. All rights reserved. + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT ARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + */ + namespace mgb::imperative::proxy_graph { // a "namespace" struct to simplify friend declaration, diff --git a/imperative/src/impl/proxy_graph/mini_graph.h b/imperative/src/impl/proxy_graph/mini_graph.h index 52aa55679..adf0a7a74 100644 --- a/imperative/src/impl/proxy_graph/mini_graph.h +++ b/imperative/src/impl/proxy_graph/mini_graph.h @@ -1,3 +1,14 @@ +/** + * \file imperative/src/impl/proxy_graph/mini_graph.h + * MegEngine is Licensed under the Apache License, Version 2.0 (the "License") + * + * Copyright (c) 2014-2021 Megvii Inc. All rights reserved. + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT ARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + */ + #include "megbrain/graph/operator_node.h" #include "megbrain/imperative/physical_tensor.h" #include "megbrain/imperative/op_def.h" diff --git a/imperative/src/impl/proxy_graph/proxy_graph.cpp b/imperative/src/impl/proxy_graph/proxy_graph.cpp index 5185e0a65..ef2f6dac6 100644 --- a/imperative/src/impl/proxy_graph/proxy_graph.cpp +++ b/imperative/src/impl/proxy_graph/proxy_graph.cpp @@ -1,5 +1,20 @@ +/** + * \file imperative/src/impl/proxy_graph/proxy_graph.cpp + * MegEngine is Licensed under the Apache License, Version 2.0 (the "License") + * + * Copyright (c) 2014-2021 Megvii Inc. All rights reserved. + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT ARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + */ + #include "./mini_graph.h" -// #include "../proxy_graph.h" +#if 0 +// ../proxy_graph.h is deprecated, leave here for debug purpose +// uncomment #if 0 macro to debug +#include "../proxy_graph.h" +#endif namespace mgb::imperative::proxy_graph { MGB_DYN_TYPE_OBJ_FINAL_IMPL(ProxyGraph::InputPlaceholder); @@ -8,19 +23,21 @@ namespace mgb::imperative::proxy_graph { } // namespace mgb::imperative::proxy_graph namespace mgb::imperative::proxy_graph_detail { - std::tuple, bool> infer_output_attrs_fallible(const OpDef& def, const SmallVector& inputs) { auto ret = proxy_graph::ProxyGraphTypeI::inst().infer_output_attrs_fallible(def, inputs); - // auto ref = ProxyGraph::get_default_graph()->infer_output_attrs_fallible(def, inputs); - // auto& [a, _1] = ret; - // auto& [b, _2] = ref; - // if (a.size() != b.size()) mgb_trap(); - // for (size_t i = 0; i < a.size(); ++i) { - // if (a[i].layout.dtype != b[i].layout.dtype) mgb_trap(); - // if (a[i].comp_node != b[i].comp_node) mgb_trap(); - // if (!a[i].layout.eq_shape(b[i].layout)) mgb_trap(); - // } +#if 0 + // delete me after the new implementation is stable + auto ref = ProxyGraph::get_default_graph()->infer_output_attrs_fallible(def, inputs); + auto& [a, _1] = ret; + auto& [b, _2] = ref; + if (a.size() != b.size()) mgb_trap(); + for (size_t i = 0; i < a.size(); ++i) { + if (a[i].layout.dtype != b[i].layout.dtype) mgb_trap(); + if (a[i].comp_node != b[i].comp_node) mgb_trap(); + if (!a[i].layout.eq_shape(b[i].layout)) mgb_trap(); + } +#endif return ret; } diff --git a/imperative/src/impl/proxy_graph/proxy_graph_base.h b/imperative/src/impl/proxy_graph/proxy_graph_base.h index 54b83eead..c9e9c8342 100644 --- a/imperative/src/impl/proxy_graph/proxy_graph_base.h +++ b/imperative/src/impl/proxy_graph/proxy_graph_base.h @@ -1,3 +1,14 @@ +/** + * \file imperative/src/impl/proxy_graph/proxy_graph_base.h + * MegEngine is Licensed under the Apache License, Version 2.0 (the "License") + * + * Copyright (c) 2014-2021 Megvii Inc. All rights reserved. + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT ARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + */ + #include "megbrain/graph/cg.h" namespace mgb::imperative::proxy_graph { diff --git a/imperative/src/impl/tensor_sanity_check.cpp b/imperative/src/impl/tensor_sanity_check.cpp index 23425124b..af6c90567 100644 --- a/imperative/src/impl/tensor_sanity_check.cpp +++ b/imperative/src/impl/tensor_sanity_check.cpp @@ -1,10 +1,12 @@ /** * \file src/core/impl/imperative/tensor_sanity_check.cpp + * MegEngine is Licensed under the Apache License, Version 2.0 (the "License") * - * This file is part of MegBrain, a deep learning framework developed by Megvii. - * - * \copyright Copyright (c) 2014-2021 Megvii Inc. All rights reserved. + * Copyright (c) 2014-2021 Megvii Inc. All rights reserved. * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT ARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */ #include "megbrain/imperative/tensor_sanity_check.h" @@ -127,4 +129,4 @@ std::string TensorSanityCheck::print_op(const OpDef& def){ } } // namespace imperative -} // namespace mgb \ No newline at end of file +} // namespace mgb diff --git a/imperative/src/include/megbrain/imperative/tensor_sanity_check.h b/imperative/src/include/megbrain/imperative/tensor_sanity_check.h index f26a5b34b..af924d9ec 100644 --- a/imperative/src/include/megbrain/imperative/tensor_sanity_check.h +++ b/imperative/src/include/megbrain/imperative/tensor_sanity_check.h @@ -1,10 +1,12 @@ /** * \file src/core/include/megbrain/tensor_sanity_check.h + * MegEngine is Licensed under the Apache License, Version 2.0 (the "License") * - * This file is part of MegBrain, a deep learning framework developed by Megvii. - * - * \copyright Copyright (c) 2014-2021 Megvii Inc. All rights reserved. + * Copyright (c) 2014-2021 Megvii Inc. All rights reserved. * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT ARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */ #include "megbrain/comp_node_env.h" @@ -47,4 +49,4 @@ private: } // namespace imperative -} // namespace mgb \ No newline at end of file +} // namespace mgb -- GitLab