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

Enhance LoDResetOp and add python wrapper #9204

Merged
merged 4 commits into from
Mar 19, 2018
Merged

Conversation

pkuyym
Copy link
Contributor

@pkuyym pkuyym commented Mar 19, 2018

Resolves #9171

@pkuyym pkuyym requested a review from qingqing01 March 19, 2018 09:49
then we get an 1-level LoDTensor
Out.lod = [[ 0, 4, 6 ]]
Out.data = [[1.0], [2.0], [3.0], [4.0], [5.0], [6.0]]
Out.dims = [6, 1]
Copy link
Contributor

Choose a reason for hiding this comment

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

Add example for Y.

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.

"variable inherits from.");
AddInput("Y",
"(Tensor, LoDTensor, optional) If provided, lod of Input(Y) would "
"be considered as the target lod first, otherwise data of "
Copy link
Contributor

Choose a reason for hiding this comment

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

If provided and Y is LoDTensor, ..., otherwise ?

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.

@pkuyym pkuyym changed the title [WIP] Enhance LoDResetOp and add python wrapper Enhance LoDResetOp and add python wrapper Mar 19, 2018
@@ -3292,3 +3293,98 @@ def autoincreased_step_counter(counter_name=None, begin=1, step=1):
counter.stop_gradient = True

return counter


def lod_reset(x, y, target_lod=None):
Copy link
Contributor

Choose a reason for hiding this comment

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

def lod_reset(x, y=None, target_lod=None):

Copy link
Contributor Author

Choose a reason for hiding this comment

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

y == None and target_lod == None? Seems that we prefer target lod from y.

Copy link
Contributor

@qingqing01 qingqing01 left a comment

Choose a reason for hiding this comment

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

LGTM.

@pkuyym pkuyym merged commit 484cff6 into PaddlePaddle:develop Mar 19, 2018
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.

2 participants