Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
4c925242
P
Paddle
项目概览
PaddlePaddle
/
Paddle
大约 2 年 前同步成功
通知
2325
Star
20933
Fork
5424
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1423
列表
看板
标记
里程碑
合并请求
543
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1,423
Issue
1,423
列表
看板
标记
里程碑
合并请求
543
合并请求
543
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
4c925242
编写于
10月 20, 2022
作者:
J
JingZhuangzhuang
提交者:
GitHub
10月 20, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add _get_phi_kernel_name interface (#47033)
上级
c74bf018
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
13 addition
and
4 deletion
+13
-4
paddle/fluid/pybind/inference_api.cc
paddle/fluid/pybind/inference_api.cc
+7
-0
python/paddle/fluid/core.py
python/paddle/fluid/core.py
+1
-0
python/paddle/fluid/inference/__init__.py
python/paddle/fluid/inference/__init__.py
+1
-1
python/paddle/inference/__init__.py
python/paddle/inference/__init__.py
+4
-3
未找到文件。
paddle/fluid/pybind/inference_api.cc
浏览文件 @
4c925242
...
...
@@ -35,6 +35,7 @@
#include "paddle/fluid/inference/api/paddle_inference_api.h"
#include "paddle/fluid/inference/api/paddle_pass_builder.h"
#include "paddle/fluid/inference/utils/io_utils.h"
#include "paddle/phi/core/compat/convert_utils.h"
#if defined(PADDLE_WITH_CUDA) || defined(PADDLE_WITH_HIP)
#include "paddle/phi/core/cuda_stream.h"
...
...
@@ -401,6 +402,12 @@ void BindInferenceApi(py::module *m) {
new
paddle_infer
::
Predictor
(
config
));
return
pred
;
});
m
->
def
(
"_get_phi_kernel_name"
,
[](
const
std
::
string
&
fluid_op_name
)
{
return
phi
::
TransToPhiKernelName
(
fluid_op_name
);
},
py
::
return_value_policy
::
reference
);
m
->
def
(
"copy_tensor"
,
&
CopyPaddleInferTensor
);
m
->
def
(
"paddle_dtype_size"
,
&
paddle
::
PaddleDtypeSize
);
m
->
def
(
"paddle_tensor_to_bytes"
,
&
SerializePDTensorToBytes
);
...
...
python/paddle/fluid/core.py
浏览文件 @
4c925242
...
...
@@ -282,6 +282,7 @@ try:
from
.libpaddle
import
_get_current_stream
from
.libpaddle
import
_Profiler
,
_ProfilerResult
,
_RecordEvent
from
.libpaddle
import
_set_current_stream
from
.libpaddle
import
_get_phi_kernel_name
if
sys
.
platform
!=
'win32'
:
from
.libpaddle
import
_set_process_pids
from
.libpaddle
import
_erase_process_pids
...
...
python/paddle/fluid/inference/__init__.py
浏览文件 @
4c925242
...
...
@@ -15,4 +15,4 @@
from
.wrapper
import
Config
,
DataType
,
PlaceType
,
PrecisionType
,
Tensor
,
Predictor
from
.wrapper
import
convert_to_mixed_precision
from
..core
import
create_predictor
,
get_version
,
get_num_bytes_of_data_type
,
PredictorPool
,
get_trt_compile_version
,
get_trt_runtime_version
from
..core
import
create_predictor
,
get_version
,
_get_phi_kernel_name
,
get_num_bytes_of_data_type
,
PredictorPool
,
get_trt_compile_version
,
get_trt_runtime_version
python/paddle/inference/__init__.py
浏览文件 @
4c925242
...
...
@@ -19,6 +19,7 @@ from ..fluid.inference import PrecisionType # noqa: F401
from
..fluid.inference
import
Tensor
# noqa: F401
from
..fluid.inference
import
Predictor
# noqa: F401
from
..fluid.inference
import
create_predictor
# noqa: F401
from
..fluid.inference
import
_get_phi_kernel_name
from
..fluid.inference
import
get_version
# noqa: F401
from
..fluid.inference
import
get_trt_compile_version
# noqa: F401
from
..fluid.inference
import
get_trt_runtime_version
# noqa: F401
...
...
@@ -28,7 +29,7 @@ from ..fluid.inference import PredictorPool # noqa: F401
__all__
=
[
# noqa
'Config'
,
'DataType'
,
'PlaceType'
,
'PrecisionType'
,
'Tensor'
,
'Predictor'
,
'create_predictor'
,
'get_version'
,
'
get_trt_compile_version
'
,
'
convert_to_mixed_precision'
,
'get_trt_runtime_ver
sion'
,
'get_num_bytes_of_data_type'
,
'PredictorPool'
'create_predictor'
,
'get_version'
,
'
_get_phi_kernel_name
'
,
'
get_trt_compile_version'
,
'convert_to_mixed_preci
sion'
,
'get_
trt_runtime_version'
,
'get_
num_bytes_of_data_type'
,
'PredictorPool'
]
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录