Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BaiXuePrincess
Paddle
提交
741811e0
P
Paddle
项目概览
BaiXuePrincess
/
Paddle
与 Fork 源项目一致
Fork自
PaddlePaddle / Paddle
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
741811e0
编写于
6月 09, 2021
作者:
L
liuyuhui
提交者:
GitHub
6月 09, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add bool type for tril api (#33402)
上级
e08fdd16
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
6 addition
and
3 deletion
+6
-3
paddle/fluid/operators/tril_triu_op.cc
paddle/fluid/operators/tril_triu_op.cc
+3
-1
paddle/fluid/operators/tril_triu_op.cu
paddle/fluid/operators/tril_triu_op.cu
+2
-1
python/paddle/tensor/creation.py
python/paddle/tensor/creation.py
+1
-1
未找到文件。
paddle/fluid/operators/tril_triu_op.cc
浏览文件 @
741811e0
...
...
@@ -105,13 +105,15 @@ REGISTER_OPERATOR(tril_triu, ops::TrilTriuOp, ops::TrilTriuOpMaker,
ops
::
TrilTriuGradOpMaker
<
paddle
::
imperative
::
OpBase
>
);
REGISTER_OPERATOR
(
tril_triu_grad
,
ops
::
TrilTriuGradOp
);
REGISTER_OP_CPU_KERNEL
(
tril_triu
,
ops
::
TrilTriuOpKernel
<
paddle
::
platform
::
CPUDeviceContext
,
float
>
,
tril_triu
,
ops
::
TrilTriuOpKernel
<
paddle
::
platform
::
CPUDeviceContext
,
bool
>
,
ops
::
TrilTriuOpKernel
<
paddle
::
platform
::
CPUDeviceContext
,
float
>
,
ops
::
TrilTriuOpKernel
<
paddle
::
platform
::
CPUDeviceContext
,
double
>
,
ops
::
TrilTriuOpKernel
<
paddle
::
platform
::
CPUDeviceContext
,
int
>
,
ops
::
TrilTriuOpKernel
<
paddle
::
platform
::
CPUDeviceContext
,
int64_t
>
,
ops
::
TrilTriuOpKernel
<
paddle
::
platform
::
CPUDeviceContext
,
plat
::
float16
>
);
REGISTER_OP_CPU_KERNEL
(
tril_triu_grad
,
ops
::
TrilTriuGradOpKernel
<
paddle
::
platform
::
CPUDeviceContext
,
bool
>
,
ops
::
TrilTriuGradOpKernel
<
paddle
::
platform
::
CPUDeviceContext
,
float
>
,
ops
::
TrilTriuGradOpKernel
<
paddle
::
platform
::
CPUDeviceContext
,
double
>
,
ops
::
TrilTriuGradOpKernel
<
paddle
::
platform
::
CPUDeviceContext
,
int
>
,
...
...
paddle/fluid/operators/tril_triu_op.cu
浏览文件 @
741811e0
...
...
@@ -18,7 +18,7 @@ namespace ops = paddle::operators;
namespace
plat
=
paddle
::
platform
;
REGISTER_OP_CUDA_KERNEL
(
tril_triu
,
tril_triu
,
ops
::
TrilTriuOpKernel
<
paddle
::
platform
::
CUDADeviceContext
,
bool
>
,
ops
::
TrilTriuOpKernel
<
paddle
::
platform
::
CUDADeviceContext
,
float
>
,
ops
::
TrilTriuOpKernel
<
paddle
::
platform
::
CUDADeviceContext
,
double
>
,
ops
::
TrilTriuOpKernel
<
paddle
::
platform
::
CUDADeviceContext
,
int
>
,
...
...
@@ -26,6 +26,7 @@ REGISTER_OP_CUDA_KERNEL(
ops
::
TrilTriuOpKernel
<
paddle
::
platform
::
CUDADeviceContext
,
plat
::
float16
>
);
REGISTER_OP_CUDA_KERNEL
(
tril_triu_grad
,
ops
::
TrilTriuGradOpKernel
<
paddle
::
platform
::
CUDADeviceContext
,
bool
>
,
ops
::
TrilTriuGradOpKernel
<
paddle
::
platform
::
CUDADeviceContext
,
float
>
,
ops
::
TrilTriuGradOpKernel
<
paddle
::
platform
::
CUDADeviceContext
,
double
>
,
ops
::
TrilTriuGradOpKernel
<
paddle
::
platform
::
CUDADeviceContext
,
int
>
,
...
...
python/paddle/tensor/creation.py
浏览文件 @
741811e0
...
...
@@ -585,7 +585,7 @@ def tril(x, diagonal=0, name=None):
Args:
x (Tensor): The input x which is a Tensor.
Support data types: ``float64``, ``float32``, ``int32``, ``int64``.
Support data types: ``
bool``, ``
float64``, ``float32``, ``int32``, ``int64``.
diagonal (int, optional): The diagonal to consider, default value is 0.
If :attr:`diagonal` = 0, all elements on and below the main diagonal are
retained. A positive value includes just as many diagonals above the main
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录