Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
00efdf84
P
Paddle
项目概览
PaddlePaddle
/
Paddle
1 年多 前同步成功
通知
2305
Star
20932
Fork
5423
代码
文件
提交
分支
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看板
未验证
提交
00efdf84
编写于
4月 18, 2023
作者:
Z
zhangyuqin1998
提交者:
GitHub
4月 18, 2023
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
reorder MatrixRank (#52925)
* reorder MatrixRank * fix * fix * fix * fix * fix
上级
069bb2d9
变更
11
隐藏空白更改
内联
并排
Showing
11 changed file
with
12 addition
and
12 deletion
+12
-12
paddle/phi/api/yaml/legacy_ops.yaml
paddle/phi/api/yaml/legacy_ops.yaml
+2
-2
paddle/phi/api/yaml/static_ops.yaml
paddle/phi/api/yaml/static_ops.yaml
+1
-1
paddle/phi/infermeta/binary.cc
paddle/phi/infermeta/binary.cc
+1
-1
paddle/phi/infermeta/unary.cc
paddle/phi/infermeta/unary.cc
+1
-1
paddle/phi/infermeta/unary.h
paddle/phi/infermeta/unary.h
+1
-1
paddle/phi/kernels/cpu/matrix_rank_kernel.cc
paddle/phi/kernels/cpu/matrix_rank_kernel.cc
+1
-1
paddle/phi/kernels/gpu/matrix_rank_kernel.cu
paddle/phi/kernels/gpu/matrix_rank_kernel.cu
+1
-1
paddle/phi/kernels/matrix_rank_kernel.h
paddle/phi/kernels/matrix_rank_kernel.h
+1
-1
paddle/phi/ops/compat/matrix_rank_sig.cc
paddle/phi/ops/compat/matrix_rank_sig.cc
+1
-1
python/paddle/fluid/tests/unittests/test_matrix_rank_op.py
python/paddle/fluid/tests/unittests/test_matrix_rank_op.py
+1
-1
python/paddle/tensor/linalg.py
python/paddle/tensor/linalg.py
+1
-1
未找到文件。
paddle/phi/api/yaml/legacy_ops.yaml
浏览文件 @
00efdf84
...
...
@@ -755,11 +755,11 @@
backward
:
matmul_grad
-
op
:
matrix_rank
args
:
(Tensor x, float tol, bool
hermitian=false, bool use_default_tol=tru
e)
args
:
(Tensor x, float tol, bool
use_default_tol=true, bool hermitian=fals
e)
output
:
Tensor(out)
infer_meta
:
func
:
MatrixRankInferMeta
param
:
[
x
,
hermitian
,
use_default_tol
]
param
:
[
x
,
use_default_tol
,
hermitian
]
kernel
:
func
:
matrix_rank
...
...
paddle/phi/api/yaml/static_ops.yaml
浏览文件 @
00efdf84
...
...
@@ -222,7 +222,7 @@
output
:
Tensor(out)
infer_meta
:
func
:
MatrixRankStaticInferMeta
param
:
[
x
,
tol_tensor
,
hermitian
,
use_default_tol
]
param
:
[
x
,
tol_tensor
,
use_default_tol
,
hermitian
]
optional
:
tol_tensor
kernel
:
func
:
matrix_rank {dense -> dense},
...
...
paddle/phi/infermeta/binary.cc
浏览文件 @
00efdf84
...
...
@@ -2207,7 +2207,7 @@ void MatrixRankStaticInferMeta(const MetaTensor& x,
if
(
atol_tensor
)
{
MatrixRankTolInferMeta
(
x
,
atol_tensor
,
use_default_tol
,
hermitian
,
out
);
}
else
{
MatrixRankInferMeta
(
x
,
hermitian
,
use_default_tol
,
out
);
MatrixRankInferMeta
(
x
,
use_default_tol
,
hermitian
,
out
);
}
}
...
...
paddle/phi/infermeta/unary.cc
浏览文件 @
00efdf84
...
...
@@ -2006,8 +2006,8 @@ void LUInferMeta(const MetaTensor& x,
}
void
MatrixRankInferMeta
(
const
MetaTensor
&
x
,
bool
hermitian
,
bool
use_default_tol
,
bool
hermitian
,
MetaTensor
*
out
)
{
auto
dim_x
=
x
.
dims
();
PADDLE_ENFORCE_GE
(
dim_x
.
size
(),
...
...
paddle/phi/infermeta/unary.h
浏览文件 @
00efdf84
...
...
@@ -272,8 +272,8 @@ void LUInferMeta(const MetaTensor& x,
void
MatrixPowerInferMeta
(
const
MetaTensor
&
x
,
int
n
,
MetaTensor
*
out
);
void
MatrixRankInferMeta
(
const
MetaTensor
&
x
,
bool
hermitian
,
bool
use_default_tol
,
bool
hermitian
,
MetaTensor
*
out
);
void
MaxOutInferMeta
(
const
MetaTensor
&
x
,
...
...
paddle/phi/kernels/cpu/matrix_rank_kernel.cc
浏览文件 @
00efdf84
...
...
@@ -24,8 +24,8 @@ template <typename T, typename Context>
void
MatrixRankKernel
(
const
Context
&
dev_ctx
,
const
DenseTensor
&
x
,
float
tol
,
bool
hermitian
,
bool
use_default_tol
,
bool
hermitian
,
DenseTensor
*
out
)
{
DenseTensor
atol_tensor
;
if
(
use_default_tol
)
{
...
...
paddle/phi/kernels/gpu/matrix_rank_kernel.cu
浏览文件 @
00efdf84
...
...
@@ -27,8 +27,8 @@ template <typename T, typename Context>
void
MatrixRankKernel
(
const
Context
&
dev_ctx
,
const
DenseTensor
&
x
,
float
tol
,
bool
hermitian
,
bool
use_default_tol
,
bool
hermitian
,
DenseTensor
*
out
)
{
DenseTensor
atol_tensor
;
if
(
use_default_tol
)
{
...
...
paddle/phi/kernels/matrix_rank_kernel.h
浏览文件 @
00efdf84
...
...
@@ -22,8 +22,8 @@ template <typename T, typename Context>
void
MatrixRankKernel
(
const
Context
&
dev_ctx
,
const
DenseTensor
&
x
,
float
tol
,
bool
hermitian
,
bool
use_default_tol
,
bool
hermitian
,
DenseTensor
*
out
);
}
// namespace phi
paddle/phi/ops/compat/matrix_rank_sig.cc
浏览文件 @
00efdf84
...
...
@@ -34,8 +34,8 @@ KernelSignature MatrixRankOpArgumentMapping(const ArgumentMappingContext& ctx) {
{
"X"
},
{
"tol"
,
"hermitian"
,
"use_default_tol"
,
"hermitian"
,
},
{
"Out"
});
}
...
...
python/paddle/fluid/tests/unittests/test_matrix_rank_op.py
浏览文件 @
00efdf84
...
...
@@ -26,7 +26,7 @@ SEED = 2049
np
.
random
.
seed
(
SEED
)
def
matrix_rank_wraper
(
x
,
tol
=
None
,
hermitian
=
False
,
use_default_tol
=
Tru
e
):
def
matrix_rank_wraper
(
x
,
tol
=
None
,
use_default_tol
=
True
,
hermitian
=
Fals
e
):
return
paddle
.
linalg
.
matrix_rank
(
x
,
tol
,
hermitian
)
...
...
python/paddle/tensor/linalg.py
浏览文件 @
00efdf84
...
...
@@ -1505,7 +1505,7 @@ def matrix_rank(x, tol=None, hermitian=False, name=None):
else
:
tol_attr
=
float
(
tol
)
use_default_tol
=
False
return
_C_ops
.
matrix_rank
(
x
,
tol_attr
,
hermitian
,
use_default_tol
)
return
_C_ops
.
matrix_rank
(
x
,
tol_attr
,
use_default_tol
,
hermitian
)
else
:
inputs
=
{}
attrs
=
{}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录