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 masked select module #5356

Merged
merged 26 commits into from Jul 3, 2021
Merged

Add masked select module #5356

merged 26 commits into from Jul 3, 2021

Conversation

BBuf
Copy link
Contributor

@BBuf BBuf commented Jun 30, 2021

添加masked_select module:

doctest:

图片

docstring:

图片

单测:

图片

broadcast_like_tensor = flow.experimental.zeros(
tuple(broadcast_like_shape), dtype=flow.float32
)
broadcast_like_tensor = broadcast_like_tensor.to(x.device.type)
Copy link
Contributor

Choose a reason for hiding this comment

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

这一步可以在flow.experimental.zeros里完成

Copy link
Contributor Author

Choose a reason for hiding this comment

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

好的


>>> x = flow.Tensor(np.array([[-0.4620, 0.3139], [0.3898, -0.7197], [0.0478, -0.1657]]), dtype=flow.float32)
>>> mask = x.gt(0.05)
>>> of_out = flow.masked_select(x, mask)
Copy link
Contributor

Choose a reason for hiding this comment

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

of_out怪怪的,用y或者out就行

Copy link
Contributor Author

Choose a reason for hiding this comment

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

好的

@BBuf BBuf requested review from oneflow-ci-bot and removed request for oneflow-ci-bot July 1, 2021 05:36
@oneflow-ci-bot oneflow-ci-bot removed their request for review July 1, 2021 07:29
@BBuf BBuf added the automerge label Jul 1, 2021
@BBuf BBuf requested a review from oneflow-ci-bot July 1, 2021 09:10
@oneflow-ci-bot oneflow-ci-bot removed their request for review July 1, 2021 09:15
@oneflow-ci-bot oneflow-ci-bot requested review from oneflow-ci-bot and removed request for oneflow-ci-bot July 1, 2021 22:50
@BBuf BBuf added the automerge label Jul 2, 2021
@BBuf BBuf requested a review from oneflow-ci-bot July 2, 2021 06:20
@oneflow-ci-bot oneflow-ci-bot requested review from oneflow-ci-bot and removed request for oneflow-ci-bot July 2, 2021 06:24
@oneflow-ci-bot oneflow-ci-bot requested review from oneflow-ci-bot and removed request for oneflow-ci-bot July 2, 2021 07:40
@oneflow-ci-bot oneflow-ci-bot requested review from oneflow-ci-bot and removed request for oneflow-ci-bot July 2, 2021 09:37
@oneflow-ci-bot oneflow-ci-bot requested review from oneflow-ci-bot and removed request for oneflow-ci-bot July 2, 2021 11:10
@BBuf BBuf requested a review from oneflow-ci-bot July 3, 2021 03:15
@BBuf BBuf added the automerge label Jul 3, 2021
@oneflow-ci-bot oneflow-ci-bot requested review from oneflow-ci-bot and removed request for oneflow-ci-bot July 3, 2021 04:32
@oneflow-ci-bot oneflow-ci-bot merged commit 2e821ee into master Jul 3, 2021
@oneflow-ci-bot oneflow-ci-bot deleted the add_masked_select_module branch July 3, 2021 05:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants