From a5afd25edbc21bb64870e253daf87a621aab31ac Mon Sep 17 00:00:00 2001 From: allonli Date: Wed, 23 May 2018 17:31:12 +0800 Subject: [PATCH] add copyright hook --- src/framework/framework.pb.cpp | 14 ++++++++++++++ src/framework/framework.pb.h | 14 ++++++++++++++ src/framework/op_desc.cpp | 23 +++++++++++++++++------ src/framework/program_desc.cpp | 16 +++++++++++++++- src/framework/scope.cc | 19 +++++++++++++++++-- tools/pre-commit.hooks/copyright.hook | 5 ++++- 6 files changed, 81 insertions(+), 10 deletions(-) diff --git a/src/framework/framework.pb.cpp b/src/framework/framework.pb.cpp index 636b0ad182..ae4016e8b1 100644 --- a/src/framework/framework.pb.cpp +++ b/src/framework/framework.pb.cpp @@ -1,3 +1,17 @@ +/* Copyright (c) 2018 PaddlePaddle 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. */ + // Generated by the protocol buffer compiler. DO NOT EDIT! // source: framework.proto diff --git a/src/framework/framework.pb.h b/src/framework/framework.pb.h index 25f3dcb0b4..fa75a92e57 100644 --- a/src/framework/framework.pb.h +++ b/src/framework/framework.pb.h @@ -1,3 +1,17 @@ +/* Copyright (c) 2018 PaddlePaddle 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. */ + // Generated by the protocol buffer compiler. DO NOT EDIT! // source: framework.proto diff --git a/src/framework/op_desc.cpp b/src/framework/op_desc.cpp index d7b946424e..73037ecf30 100644 --- a/src/framework/op_desc.cpp +++ b/src/framework/op_desc.cpp @@ -1,8 +1,23 @@ +/* Copyright (c) 2018 PaddlePaddle 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. */ + // // Created by liuRuiLong on 2018/5/4. // - -#include "op_desc.h" +#include "framework/op_desc.h" +#include +#include namespace paddle_mobile { namespace framework { @@ -30,10 +45,6 @@ OpDesc::OpDesc(const proto::OpDesc &desc) : desc_(desc) { std::string attr_name = attr.name(); if (attr.type() != proto::AttrType::BLOCK) { attrs_[attr_name] = Attribute::GetAttrValue(attr); - // if (attr.type() == proto::AttrType::INT){ - // std::cout << " attrName " << attr_name << " " << - // attrs_[attr_name].Get() << std::endl; - // } } } } diff --git a/src/framework/program_desc.cpp b/src/framework/program_desc.cpp index 4f6a4699bd..5537dacdeb 100644 --- a/src/framework/program_desc.cpp +++ b/src/framework/program_desc.cpp @@ -1,8 +1,22 @@ +/* Copyright (c) 2018 PaddlePaddle 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. */ + // // Created by liuRuiLong on 2018/5/4. // -#include "program_desc.h" +#include "framework/program_desc.h" namespace paddle_mobile { namespace framework { diff --git a/src/framework/scope.cc b/src/framework/scope.cc index b7f3926a8f..ba5da674a4 100644 --- a/src/framework/scope.cc +++ b/src/framework/scope.cc @@ -1,6 +1,21 @@ +/* Copyright (c) 2018 PaddlePaddle 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 "framework/scope.h" -#include "scope.h" #include +#include #include namespace paddle_mobile { @@ -16,7 +31,7 @@ Variable *Scope::Var(const std::string &name) { auto *pvar = FindVarLocally(name); if (pvar != nullptr) { return pvar; - }; + } pvar = new Variable; vars_[name] = pvar; pvar->name_ = &(vars_.find(name)->first); diff --git a/tools/pre-commit.hooks/copyright.hook b/tools/pre-commit.hooks/copyright.hook index 7b7ff728f9..8fc0028059 100644 --- a/tools/pre-commit.hooks/copyright.hook +++ b/tools/pre-commit.hooks/copyright.hook @@ -10,10 +10,13 @@ import subprocess COPYRIGHT = ''' Copyright (c) 2016 PaddlePaddle 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 + + 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. -- GitLab