Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
机器未来
Paddle
提交
23036031
P
Paddle
项目概览
机器未来
/
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看板
未验证
提交
23036031
编写于
6月 24, 2022
作者:
Z
zyfncg
提交者:
GitHub
6月 24, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add comment for kernel of api in api.yaml (#43799)
上级
73e3fc96
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
65 addition
and
2 deletion
+65
-2
paddle/phi/api/lib/CMakeLists.txt
paddle/phi/api/lib/CMakeLists.txt
+2
-2
paddle/phi/kernels/bernoulli_kernel.h
paddle/phi/kernels/bernoulli_kernel.h
+8
-0
paddle/phi/kernels/erf_kernel.h
paddle/phi/kernels/erf_kernel.h
+13
-0
paddle/phi/kernels/mv_kernel.h
paddle/phi/kernels/mv_kernel.h
+8
-0
paddle/phi/kernels/poisson_kernel.h
paddle/phi/kernels/poisson_kernel.h
+7
-0
paddle/phi/kernels/trace_kernel.h
paddle/phi/kernels/trace_kernel.h
+19
-0
paddle/phi/kernels/trunc_kernel.h
paddle/phi/kernels/trunc_kernel.h
+6
-0
python/paddle/utils/code_gen/templates/operator_utils.c.j2
python/paddle/utils/code_gen/templates/operator_utils.c.j2
+2
-0
未找到文件。
paddle/phi/api/lib/CMakeLists.txt
浏览文件 @
23036031
...
...
@@ -135,8 +135,8 @@ endforeach()
# validation of api yamls
message
(
"validate api yaml:
-
${
parsed_api_dir
}
/
new_
api.parsed.yaml
-
${
parsed_api_dir
}
/
new_
backward_api.parsed.yaml"
)
-
${
parsed_api_dir
}
/api.parsed.yaml
-
${
parsed_api_dir
}
/backward_api.parsed.yaml"
)
execute_process
(
WORKING_DIRECTORY
${
CMAKE_SOURCE_DIR
}
/python/paddle/utils/code_gen
COMMAND
...
...
paddle/phi/kernels/bernoulli_kernel.h
浏览文件 @
23036031
...
...
@@ -19,6 +19,14 @@
namespace
phi
{
/**
* @brief This Kernel returns a Tensor filled with random binary(0 or 1) number
* from a Bernoulli distribution.
* @param ctx device context
* @param x A tensor with probabilities for generating the random binary
* number
* @param out A Tensor filled with random binary number
*/
template
<
typename
T
,
typename
Context
>
void
BernoulliKernel
(
const
Context
&
ctx
,
const
DenseTensor
&
x
,
...
...
paddle/phi/kernels/erf_kernel.h
浏览文件 @
23036031
...
...
@@ -18,6 +18,19 @@ limitations under the License. */
namespace
phi
{
/**
* @brief Erf Kernel.
* The equation is:
* $$
* f(x) = \frac{2}{\sqrt{\pi}} \int_{0}^{x}e^{- \eta^{2}}d\eta
* $$
*
* The input `x` can carry the LoD (Level of Details) information,
* or not. And the output shares the LoD information with input `x`.
* @param ctx device context
* @param x The input tensor of erf kernel
* @param out The output tensor of erf kernel
*/
template
<
typename
T
,
typename
Context
>
void
ErfKernel
(
const
Context
&
dev_ctx
,
const
DenseTensor
&
x
,
DenseTensor
*
out
);
...
...
paddle/phi/kernels/mv_kernel.h
浏览文件 @
23036031
...
...
@@ -18,6 +18,14 @@
namespace
phi
{
/**
* @brief This kernel is used to perform matrix vector multiplication
* of the input tensors `X` and `Vec`
* @param ctx device context
* @param x The matrix input of mv
* @param vec The vector input of mv
* @param out The output of mv
*/
template
<
typename
T
,
typename
Context
>
void
MvKernel
(
const
Context
&
ctx
,
const
DenseTensor
&
x
,
...
...
paddle/phi/kernels/poisson_kernel.h
浏览文件 @
23036031
...
...
@@ -18,6 +18,13 @@
namespace
phi
{
/**
* @brief This kernel generate random value that obey poisson distribution.
* @param ctx device context
* @param x The input tensor of poisson kernel
* @param out The output tensor of poisson kernel, it has the same shape and
* dtype with input. Each element corresponds to input tensor
*/
template
<
typename
T
,
typename
Context
>
void
PoissonKernel
(
const
Context
&
ctx
,
const
DenseTensor
&
x
,
DenseTensor
*
out
);
...
...
paddle/phi/kernels/trace_kernel.h
浏览文件 @
23036031
...
...
@@ -18,6 +18,25 @@
namespace
phi
{
/**
* @brief Trace Kernel.
* Return the sum along diagonals of the input tensor.
* The behavior of this operator is similar to how `numpy.trace` works.
*
* If Input is 2-D, returns the sum of diagonal.
* If Input has larger dimensions, then returns an tensor of diagonals
* sum, diagonals be taken from the 2-D planes specified by dim1 and
* dim2.
* @param ctx device context
* @param x The input tensor, from which the diagonals are taken
* @param offset offset of the diagonal from the main diagonal.
* Can be bothpositive and negative.
* @param axis1 the first axis of the 2-D planes from which the diagonals
* should be taken. Can be either positive or negative
* @param axis2 the second axis of the 2-D planes from which the diagonals
* should be taken. Can be either positive or negative
* @param out the sum along diagonals of the input tensor
*/
template
<
typename
T
,
typename
Context
>
void
TraceKernel
(
const
Context
&
ctx
,
const
DenseTensor
&
x
,
...
...
paddle/phi/kernels/trunc_kernel.h
浏览文件 @
23036031
...
...
@@ -18,6 +18,12 @@
namespace
phi
{
/**
* @brief Returns a new tensor with the truncated integer values of input.
* @param ctx device context
* @param x The input tensor of trunc kernel
* @param out The output tensor of trunc kernel
*/
template
<
typename
T
,
typename
Context
>
void
TruncKernel
(
const
Context
&
dev_ctx
,
const
DenseTensor
&
x
,
...
...
python/paddle/utils/code_gen/templates/operator_utils.c.j2
浏览文件 @
23036031
...
...
@@ -128,7 +128,9 @@ PD_REGISTER_ARG_MAPPING_FN({{api["name"]}}, phi::{{api["name"] | to_pascal_case}
{% macro get_input_list(inputs, kernel_args) %}{# inline #}
paddle::small_vector<const char*> inputs {
{%- for input in inputs %}
{%- if input["name"] in kernel_args %}
{{input["name"] | to_opmaker_name_cstr}}{{", " if not loop.last}}
{%- endif %}
{%- endfor %}
}
{%- endmacro %}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录