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

Clean sequence_enumerate sequence_erase [fluid_ops] #68356

Merged
merged 2 commits into from
Sep 24, 2024

Conversation

co63oc
Copy link
Contributor

@co63oc co63oc commented Sep 22, 2024

PR Category

Operator Mechanism

PR Types

Others

Description

清理python中 sequence_enumerate sequence_erase 等调用

@paddle-bot paddle-bot bot added the contributor External developers label Sep 22, 2024
@co63oc co63oc changed the title CI测试不review [fluid_ops] sequence Clean sequence_enumerate sequence_erase [fluid_ops] Sep 23, 2024
Comment on lines 576 to 596
# remove some tokens from input and labels
if ignored_tokens is not None and len(ignored_tokens) > 0:
erased_input = helper.create_variable_for_type_inference(dtype="int64")
erased_label = helper.create_variable_for_type_inference(dtype="int64")

helper.append_op(
type="sequence_erase",
inputs={"X": [input]},
outputs={"Out": [erased_input]},
attrs={"tokens": ignored_tokens},
)
input = erased_input

helper.append_op(
type="sequence_erase",
inputs={"X": [label]},
outputs={"Out": [erased_label]},
attrs={"tokens": ignored_tokens},
)
label = erased_label

Copy link
Contributor

Choose a reason for hiding this comment

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

这里直接删怕是不合适。先改成:
if ignored_tokens is not None and len(ignored_tokens) > 0:
raise error

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

@luotao1 luotao1 added the HappyOpenSource 快乐开源活动issue与PR label Sep 23, 2024
@luotao1 luotao1 merged commit 2c26587 into PaddlePaddle:develop Sep 24, 2024
27 of 28 checks passed
@co63oc co63oc deleted the fix22 branch September 26, 2024 06:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contributor External developers HappyOpenSource 快乐开源活动issue与PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants