Skip to content
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

add paddle.gcd and paddle.lcm #37819

Merged
merged 5 commits into from
Dec 10, 2021
Merged

add paddle.gcd and paddle.lcm #37819

merged 5 commits into from
Dec 10, 2021

Conversation

luotao1
Copy link
Contributor

@luotao1 luotao1 commented Dec 3, 2021

PR types

New features

PR changes

APIs

Describe

@paddle-bot-old
Copy link

paddle-bot-old bot commented Dec 3, 2021

✅ This PR's description meets the template requirements!
Please wait for other CI results.

@paddle-bot-old
Copy link

paddle-bot-old bot commented Dec 3, 2021

Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

Comment on lines +194 to +195
from .math import gcd # noqa: F401
from .math import lcm # noqa: F401
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shall we add gcd and lcm in tensor_method_func below ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Copy link
Contributor

@jeff41404 jeff41404 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

gcd(0,0)=0, gcd(0, y)=|y|

Args:
x, y (Tensor): An N-D Tensor, the data type is int8,int16,int32,int64,uint8.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

x, y 各起一行写会好一点

.. code-block:: python

import paddle
import numpy as np
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里不引入 numpy

# Tensor(shape=[1], dtype=int64, place=CUDAPlace(0), stop_gradient=True,
# [4])

x3 = paddle.to_tensor(np.arange(6))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

x3 = paddle.arange(6)

lcm(0,0)=0, lcm(0, y)=0

Args:
x, y (Tensor): An N-D Tensor, the data type is int8,int16,int32,int64,uint8.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

同上

.. code-block:: python

import paddle
import numpy as np
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

同上

Copy link
Contributor

@TCChenlong TCChenlong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO:Fix API Docs

@luotao1
Copy link
Contributor Author

luotao1 commented Dec 10, 2021

好的,会在下一个PR专门修改文档

@luotao1 luotao1 merged commit 43f19cc into PaddlePaddle:develop Dec 10, 2021
@luotao1 luotao1 deleted the gcd branch December 10, 2021 03:16
@luotao1 luotao1 changed the title add paddle.gcd add paddle.gcd and paddle.lcm Dec 10, 2021
@luotao1 luotao1 mentioned this pull request Dec 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants