Compare commits
111 Commits
fix_impera
...
develop
| Author | SHA1 | Date |
|---|---|---|
|
|
587d99ae44 | 5 years ago |
|
|
b09c1ce09a | 5 years ago |
|
|
393b3bd6b7 | 5 years ago |
|
|
3a95a0bc26 | 5 years ago |
|
|
52b05baca3 | 5 years ago |
|
|
5394194e3a | 5 years ago |
|
|
ef8323d49e | 5 years ago |
|
|
95f808c878 | 5 years ago |
|
|
57d4288ad4 | 5 years ago |
|
|
0fa6c8a35c | 5 years ago |
|
|
98e803e04f | 5 years ago |
|
|
a37a7f67e1 | 5 years ago |
|
|
6dca7a1de7 | 5 years ago |
|
|
14b7e3cf06 | 5 years ago |
|
|
245252b86e | 5 years ago |
|
|
e1f931610e | 5 years ago |
|
|
e50bc2c2a6 | 5 years ago |
|
|
04a49b097e | 5 years ago |
|
|
fe2848686b | 5 years ago |
|
|
73a6fa3ed0 | 5 years ago |
|
|
8084b7594b | 5 years ago |
|
|
64ee255ffd | 5 years ago |
|
|
c4b60efabd | 5 years ago |
|
|
17030ff28b | 5 years ago |
|
|
a71d72d921 | 5 years ago |
|
|
8829a309fe | 5 years ago |
|
|
b48841ba2e | 5 years ago |
|
|
525c32e33c | 5 years ago |
|
|
123949eb48 | 5 years ago |
|
|
61805d8f0a | 5 years ago |
|
|
51eb29de18 | 5 years ago |
|
|
e3a38d790a | 5 years ago |
|
|
bfb5cf5567 | 5 years ago |
|
|
b47478efc2 | 5 years ago |
|
|
c3974d0e2a | 5 years ago |
|
|
01aa252624 | 5 years ago |
|
|
70b67f1029 | 5 years ago |
|
|
e804f08559 | 5 years ago |
|
|
f58cb01864 | 5 years ago |
|
|
bf09dcb346 | 5 years ago |
|
|
27f2d8df8e | 5 years ago |
|
|
511e204e62 | 5 years ago |
|
|
6472d62093 | 5 years ago |
|
|
e7f28d6c0d | 5 years ago |
|
|
5d89ec36dc | 5 years ago |
|
|
649868ffb2 | 5 years ago |
|
|
e5f7a834d4 | 5 years ago |
|
|
f2cfc0f46d | 5 years ago |
|
|
84a551380e | 5 years ago |
|
|
68497e7b39 | 5 years ago |
|
|
270699e647 | 5 years ago |
|
|
1eb927f935 | 5 years ago |
|
|
3f66e7deab | 5 years ago |
|
|
4046f1303a | 5 years ago |
|
|
a70de87d76 | 5 years ago |
|
|
f4d9212de2 | 5 years ago |
|
|
372ac08a17 | 5 years ago |
|
|
814b38e30f | 5 years ago |
|
|
513641e153 | 5 years ago |
|
|
9d04ef7369 | 5 years ago |
|
|
46dd1d4aad | 5 years ago |
|
|
f72d197ec5 | 5 years ago |
|
|
032de0bfd0 | 5 years ago |
|
|
bfced39eb6 | 5 years ago |
|
|
7ccf6b6030 | 5 years ago |
|
|
a501a7b0ca | 5 years ago |
|
|
ed7956a816 | 5 years ago |
|
|
8c19d7aa2f | 5 years ago |
|
|
a45c8ca69d | 5 years ago |
|
|
25fc2a1fdb | 5 years ago |
|
|
878e117b6d | 5 years ago |
|
|
c9e1d9dc31 | 5 years ago |
|
|
1c67cf0c98 | 5 years ago |
|
|
e429deb0c4 | 5 years ago |
|
|
a4a2b77def | 5 years ago |
|
|
c86e771e94 | 5 years ago |
|
|
50cafa0b0c | 5 years ago |
|
|
1d197f6c97 | 5 years ago |
|
|
420527f0d9 | 5 years ago |
|
|
87852616aa | 5 years ago |
|
|
fe241fd02f | 5 years ago |
|
|
4ea3427865 | 5 years ago |
|
|
d4282ea97e | 5 years ago |
|
|
09482ddec4 | 5 years ago |
|
|
740359edaf | 5 years ago |
|
|
7f50bb7ec1 | 5 years ago |
|
|
402288ad65 | 5 years ago |
|
|
2fbe9b097a | 5 years ago |
|
|
19592d2b71 | 5 years ago |
|
|
4c0c55bba1 | 5 years ago |
|
|
cdc5a55ac1 | 5 years ago |
|
|
d9b50f664f | 5 years ago |
|
|
1a6e3b04cd | 5 years ago |
|
|
41e9ecfd1f | 5 years ago |
|
|
c1b1ccfbf5 | 5 years ago |
|
|
9c624b16d5 | 5 years ago |
|
|
580442ceba | 5 years ago |
|
|
da10c5cf8b | 5 years ago |
|
|
75433126df | 5 years ago |
|
|
c3634c6b0a | 5 years ago |
|
|
027b574a0e | 5 years ago |
|
|
9066b74f58 | 5 years ago |
|
|
a32e8bf1e7 | 5 years ago |
|
|
30a627aaf3 | 5 years ago |
|
|
cac9635a67 | 5 years ago |
|
|
50ac7dbfd0 | 5 years ago |
|
|
ef0dd3efed | 5 years ago |
|
|
da9dda5c9b | 5 years ago |
|
|
99dcd66508 | 5 years ago |
|
|
3d5aa9d10a | 5 years ago |
|
|
f302bb4f8b | 5 years ago |
File diff suppressed because it is too large
Load Diff
@ -1,53 +0,0 @@
|
||||
/* Copyright (c) 2019 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 "paddle/fluid/framework/c/c_api.h"
|
||||
|
||||
#include "paddle/fluid/framework/op_info.h"
|
||||
#include "paddle/fluid/platform/device_context.h"
|
||||
#include "paddle/fluid/platform/enforce.h"
|
||||
|
||||
extern "C" {
|
||||
|
||||
paddle::framework::OpInfoMap &PD_GetOpInfoMap() {
|
||||
return paddle::framework::OpInfoMap::Instance();
|
||||
}
|
||||
|
||||
void PD_InitDevicesPool(paddle::platform::DeviceContextPool *pool) {
|
||||
paddle::platform::DeviceContextPool::SetPool(pool);
|
||||
}
|
||||
|
||||
std::vector<std::string> PD_GetGradOpDescStrs(
|
||||
const paddle::framework::OpDesc &op_desc,
|
||||
const std::unordered_set<std::string> &no_grad_set,
|
||||
std::unordered_map<std::string, std::string> *grad_to_var,
|
||||
const std::vector<paddle::framework::BlockDesc *> &grad_block) {
|
||||
auto &op_info = PD_GetOpInfoMap().Get(op_desc.Type());
|
||||
std::vector<std::string> ret;
|
||||
if (op_info.grad_op_maker_) {
|
||||
auto grad_op_descs =
|
||||
op_info.grad_op_maker_(op_desc, no_grad_set, grad_to_var, grad_block);
|
||||
size_t op_num = grad_op_descs.size();
|
||||
ret.resize(op_num);
|
||||
for (size_t i = 0; i < op_num; ++i) {
|
||||
PADDLE_ENFORCE_EQ(
|
||||
grad_op_descs[i]->Proto()->SerializePartialToString(&ret[i]), true,
|
||||
paddle::platform::errors::Unavailable(
|
||||
"Cannot serialize operator desc message."));
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
} // end extern "C"
|
||||
@ -1,55 +0,0 @@
|
||||
/* copyright (c) 2019 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. */
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include <unordered_map>
|
||||
#include <unordered_set>
|
||||
#include <vector>
|
||||
|
||||
#include "paddle/fluid/framework/block_desc.h"
|
||||
#include "paddle/fluid/framework/op_desc.h"
|
||||
#include "paddle/fluid/framework/op_info.h"
|
||||
#include "paddle/fluid/platform/device_context.h"
|
||||
|
||||
namespace paddle {
|
||||
namespace framework {
|
||||
class OpInfoMap;
|
||||
} // namespace framework
|
||||
namespace platform {
|
||||
class DeviceContextPool;
|
||||
} // namespace platform
|
||||
} // namespace paddle
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
// C-API to get global OpInfo map.
|
||||
paddle::framework::OpInfoMap &PD_GetOpInfoMap();
|
||||
|
||||
// C-API to init global DeviceContextPool from outside.
|
||||
void PD_InitDevicesPool(paddle::platform::DeviceContextPool *pool);
|
||||
|
||||
// C-API to serialize the grad op protocol message to a binary string.
|
||||
std::vector<std::string> PD_GetGradOpDescStrs(
|
||||
const paddle::framework::OpDesc &op_desc,
|
||||
const std::unordered_set<std::string> &no_grad_set,
|
||||
std::unordered_map<std::string, std::string> *grad_to_var,
|
||||
const std::vector<paddle::framework::BlockDesc *> &grad_block);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue