CARVIEW |
Navigation Menu
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
【Hackathon 6th No.9】Add cartesian_prod API to Paddle -part #65605
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
python/paddle/tensor/math.py
Outdated
[2, 5], | ||
[2, 6], | ||
[3, 5], | ||
[3, 6]]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
可以多加两个例子
- 只输入 1 个 tensor
- shape 中有 0 的情况;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
好的
paddle/phi/kernels/reshape_kernel.cc
Outdated
} | ||
// if (x.numel() == 0) { | ||
// return; | ||
// } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里注释的原因?是解决什么bug呢?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里是测试case中静态图的时候发现如果输入的 x 中有 zero-size tensor,静态图最终会返回 None,然后排查了一下应该是 reshape op 在静态图下输入是 zero-size tensor 的话会返回 None。(如果输入的 x 中有 zero-size tensor,静态图下 coordinates = paddle.stack(paddle.meshgrid(x), axis=-1)
这一步有返回结果,且coordinates也会是 zero-size tensor,最后一步 reshape 返回了 None)
如果注释掉 kernel 这里的直接 return,静态图就返回的是 []
,动态图没有影响,不知道这样改对不对。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
单独提个PR修一下,然后加个reshape的单侧
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
好的
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
可以提交中文文档 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
||
Args: | ||
x (list[Tensor]|tuple[Tensor]): Any number of 1-D input Tensors. Supported data types: bfloat16, float16, float32, float64, int32, int64, complex64 or complex128. | ||
name (str, optional): Name for the operation (optional, default is None). For more information, please refer to :ref:`api_guide_Name`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
name (str, optional): Name for the operation (optional, default is None). For more information, please refer to :ref:`api_guide_Name`. | |
name (str|None, optional): Name for the operation (optional, default is None). For more information, please refer to :ref:`api_guide_Name`. |
这个不重要,可以在之后哪个 PR 顺手改一下就可以~
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
好的~
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM for docs
PR Category
User Experience
PR Types
New features
Description
Add paddle.cartesian_prod
rfc: PaddlePaddle/community#914