Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
wzpei9
Paddle
提交
97636a9f
P
Paddle
项目概览
wzpei9
/
Paddle
与 Fork 源项目一致
Fork自
PaddlePaddle / Paddle
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
97636a9f
编写于
9月 24, 2018
作者:
D
dzhwinter
提交者:
GitHub
9月 24, 2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
"fix link error" (#13545)
上级
efc2ac95
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
47 addition
and
17 deletion
+47
-17
paddle/fluid/framework/eigen.h
paddle/fluid/framework/eigen.h
+15
-6
paddle/fluid/framework/op_registry.h
paddle/fluid/framework/op_registry.h
+13
-10
paddle/fluid/framework/operator.cc
paddle/fluid/framework/operator.cc
+3
-0
paddle/fluid/framework/operator.h
paddle/fluid/framework/operator.h
+2
-0
paddle/fluid/inference/api/api_impl.h
paddle/fluid/inference/api/api_impl.h
+8
-1
paddle/fluid/platform/cudnn_helper_test.cc
paddle/fluid/platform/cudnn_helper_test.cc
+3
-0
paddle/fluid/platform/init.h
paddle/fluid/platform/init.h
+3
-0
未找到文件。
paddle/fluid/framework/eigen.h
浏览文件 @
97636a9f
...
...
@@ -13,6 +13,11 @@ See the License for the specific language governing permissions and
limitations under the License. */
#pragma once
// logging.h and windows.h conflict
#define GLOG_NO_ABBREVIATED_SEVERITIES
// solve static linking error in windows
// https://github.com/google/glog/issues/301
#define GOOGLE_GLOG_DLL_DECL
#include "paddle/fluid/framework/tensor.h"
#include "unsupported/Eigen/CXX11/Tensor"
...
...
@@ -46,11 +51,13 @@ struct EigenTensor {
using
ConstType
=
Eigen
::
TensorMap
<
Eigen
::
Tensor
<
const
T
,
D
,
MajorType
,
IndexType
>>
;
static
Type
From
(
Tensor
&
tensor
,
DDim
dims
)
{
static
Type
From
(
Tensor
&
tensor
,
DDim
dims
)
{
// NOLINT
return
Type
(
tensor
.
data
<
T
>
(),
EigenDim
<
D
>::
From
(
dims
));
}
static
Type
From
(
Tensor
&
tensor
)
{
return
From
(
tensor
,
tensor
.
dims_
);
}
static
Type
From
(
Tensor
&
tensor
)
{
// NOLINT
return
From
(
tensor
,
tensor
.
dims_
);
}
// NOLINT
static
ConstType
From
(
const
Tensor
&
tensor
,
DDim
dims
)
{
return
ConstType
(
tensor
.
data
<
T
>
(),
EigenDim
<
D
>::
From
(
dims
));
...
...
@@ -64,7 +71,8 @@ struct EigenTensor {
template
<
typename
T
,
int
MajorType
=
Eigen
::
RowMajor
,
typename
IndexType
=
Eigen
::
DenseIndex
>
struct
EigenMatrix
:
public
EigenTensor
<
T
,
2
,
MajorType
,
IndexType
>
{
static
typename
EigenMatrix
::
Type
Reshape
(
Tensor
&
tensor
,
int
num_col_dims
)
{
static
typename
EigenMatrix
::
Type
Reshape
(
Tensor
&
tensor
,
// NOLINT
int
num_col_dims
)
{
int
rank
=
tensor
.
dims_
.
size
();
PADDLE_ENFORCE
(
num_col_dims
>
0
&&
num_col_dims
<
rank
,
"`num_col_dims` must be between (0, rank_of_tensor)."
);
...
...
@@ -86,11 +94,12 @@ template <typename T, int MajorType = Eigen::RowMajor,
typename
IndexType
=
Eigen
::
DenseIndex
>
struct
EigenVector
:
public
EigenTensor
<
T
,
1
,
MajorType
,
IndexType
>
{
// Flatten reshapes a Tensor into an EigenVector.
static
typename
EigenVector
::
Type
Flatten
(
Tensor
&
tensor
)
{
static
typename
EigenVector
::
Type
Flatten
(
Tensor
&
tensor
)
{
// NOLINT
return
EigenVector
::
From
(
tensor
,
{
product
(
tensor
.
dims_
)});
}
static
typename
EigenVector
::
ConstType
Flatten
(
const
Tensor
&
tensor
)
{
static
typename
EigenVector
::
ConstType
Flatten
(
const
Tensor
&
tensor
)
{
// NOLINT
return
EigenVector
::
From
(
tensor
,
{
product
(
tensor
.
dims_
)});
}
};
...
...
@@ -104,7 +113,7 @@ struct EigenScalar {
using
ConstType
=
Eigen
::
TensorMap
<
Eigen
::
TensorFixedSize
<
const
T
,
Eigen
::
Sizes
<>
,
MajorType
,
IndexType
>>
;
static
Type
From
(
Tensor
&
tensor
)
{
return
Type
(
tensor
.
data
<
T
>
());
}
static
Type
From
(
Tensor
&
tensor
)
{
return
Type
(
tensor
.
data
<
T
>
());
}
// NOLINT
static
ConstType
From
(
const
Tensor
&
tensor
)
{
return
ConstType
(
tensor
.
data
<
T
>
());
...
...
paddle/fluid/framework/op_registry.h
浏览文件 @
97636a9f
...
...
@@ -23,6 +23,11 @@ limitations under the License. */
#include <unordered_map>
#include <unordered_set>
#if defined(_WIN32)
#define GLOG_NO_ABBREVIATED_SEVERITIES // msvc conflict logging with windows.h
#define GOOGLE_GLOG_DLL_DECL
#endif
#include "glog/logging.h" // For VLOG()
#include "paddle/fluid/framework/attribute.h"
#include "paddle/fluid/framework/details/op_registry.h"
...
...
@@ -241,22 +246,20 @@ struct OpKernelRegistrarFunctorEx<PlaceType, false, I,
* we will use and tell the compiler to
* link them into target.
*/
#define USE_OP_ITSELF(op_type) \
STATIC_ASSERT_GLOBAL_NAMESPACE( \
__use_op_itself_##op_type, \
"USE_OP_ITSELF must be called in global namespace"); \
extern int TouchOpRegistrar_##op_type(); \
static int use_op_itself_##op_type##_ __attribute__((unused)) = \
TouchOpRegistrar_##op_type()
#define USE_OP_ITSELF(op_type) \
STATIC_ASSERT_GLOBAL_NAMESPACE( \
__use_op_itself_##op_type, \
"USE_OP_ITSELF must be called in global namespace"); \
extern int TouchOpRegistrar_##op_type(); \
UNUSED static int use_op_itself_##op_type##_ = TouchOpRegistrar_##op_type()
#define USE_OP_DEVICE_KERNEL(op_type, LIBRARY_TYPE) \
STATIC_ASSERT_GLOBAL_NAMESPACE( \
__use_op_kernel_##op_type##_##LIBRARY_TYPE##__, \
"USE_OP_DEVICE_KERNEL must be in global namespace"); \
extern int TouchOpKernelRegistrar_##op_type##_##LIBRARY_TYPE(); \
static int use_op_kernel_##op_type##_##LIBRARY_TYPE##_ \
__attribute__((unused)) = \
TouchOpKernelRegistrar_##op_type##_##LIBRARY_TYPE()
UNUSED static int use_op_kernel_##op_type##_##LIBRARY_TYPE##_ = \
TouchOpKernelRegistrar_##op_type##_##LIBRARY_TYPE()
// TODO(fengjiayi): The following macros
// seems ugly, do we have better method?
...
...
paddle/fluid/framework/operator.cc
浏览文件 @
97636a9f
...
...
@@ -11,6 +11,9 @@ 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. */
#define GLOG_NO_ABBREVIATED_SEVERITIES
#define GOOGLE_GLOG_DLL_DECL
#include <gflags/gflags.h>
#include <glog/logging.h>
...
...
paddle/fluid/framework/operator.h
浏览文件 @
97636a9f
...
...
@@ -20,6 +20,8 @@ limitations under the License. */
#include <tuple>
#include <unordered_map>
#include <vector>
#define GLOG_NO_ABBREVIATED_SEVERITIES
#define GOOGLE_GLOG_DLL_DECL
#include "glog/logging.h" // For VLOG
#include "paddle/fluid/framework/attribute.h"
...
...
paddle/fluid/inference/api/api_impl.h
浏览文件 @
97636a9f
...
...
@@ -14,15 +14,22 @@
#pragma once
// logging.h and windows.h conflict
#define GLOG_NO_ABBREVIATED_SEVERITIES
// solve static linking error in windows
// https://github.com/google/glog/issues/301
#define GOOGLE_GLOG_DLL_DECL
#include <glog/logging.h>
#include <map>
#include <memory>
#include <string>
#include <vector>
#include "paddle/fluid/inference/api/paddle_inference_api.h"
#include "paddle/fluid/framework/ddim.h"
#include "paddle/fluid/framework/lod_tensor.h"
#include "paddle/fluid/inference/api/paddle_inference_api.h"
#include "paddle/fluid/inference/io.h"
#include "paddle/fluid/platform/init.h"
#include "paddle/fluid/platform/profiler.h"
...
...
paddle/fluid/platform/cudnn_helper_test.cc
浏览文件 @
97636a9f
...
...
@@ -12,6 +12,9 @@ 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. */
#define GLOG_NO_ABBREVIATED_SEVERITIES
#define GOOGLE_GLOG_DLL_DECL
#include "paddle/fluid/platform/cudnn_helper.h"
#include <gtest/gtest.h>
...
...
paddle/fluid/platform/init.h
浏览文件 @
97636a9f
...
...
@@ -16,6 +16,9 @@ limitations under the License. */
#include <string>
#include <vector>
#define GLOG_NO_ABBREVIATED_SEVERITIES
#define GOOGLE_GLOG_DLL_DECL
#include "gflags/gflags.h"
#include "glog/logging.h"
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录