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

[Phi] Migrate InferShape of multiplex, qr, tril_triu #40102

Merged
merged 5 commits into from
Mar 24, 2022

Conversation

Caozhou1995
Copy link
Contributor

@Caozhou1995 Caozhou1995 commented Mar 3, 2022

PR types

Others

PR changes

Others

Describe

This pr migrates InferShape of multiplex, qr, tril_triu op to phi.

@paddle-bot-old
Copy link

paddle-bot-old bot commented Mar 3, 2022

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

@paddle-bot-old
Copy link

Sorry to inform you that d04b195's CIs have passed for more than 7 days. To prevent PR conflicts, you need to re-run all CIs manually.

@Caozhou1995 Caozhou1995 force-pushed the migrate_infer_shape branch 3 times, most recently from c33adf0 to 279a462 Compare March 22, 2022 06:55
phi::errors::PreconditionNotMet(
"All the candidate tensors must have the same size."));
}
out->set_dims(in_dim);
Copy link
Contributor

Choose a reason for hiding this comment

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

out还需要set_dtype

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thx, done

@@ -104,6 +104,9 @@ void BatchNormInferInferMeta(const MetaTensor& x,
MetaTensor* mean_out,
MetaTensor* variance_out,
MetaConfig config = MetaConfig());
void MultiplexInferMeta(const std::vector<MetaTensor*>& ins,
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 Author

Choose a reason for hiding this comment

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

thx, done

@@ -81,6 +81,16 @@ void EighInferMeta(const MetaTensor& x,
MetaTensor* out_w,
MetaTensor* out_v);

void TrilTriuInferMeta(const MetaTensor& x,
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 Author

Choose a reason for hiding this comment

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

thx, done

Comment on lines 141 to 156
void TrilTriuInferMeta(const MetaTensor& x,
int diagonal,
bool lower,
MetaTensor* out) {
const auto& x_dims = x.dims();
PADDLE_ENFORCE_GE(x_dims.size(),
2,
phi::errors::InvalidArgument(
"Input(X)'s rank must be at least 2 in TrilTriuOp."));
out->set_dims(x.dims());
out->share_lod(x);
out->set_dtype(x.dtype());
}

void QrInferMeta(const MetaTensor& x,
const std::string& mode,
Copy link
Contributor

Choose a reason for hiding this comment

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

InferMeta函数按照字母序放置

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thx, done

@Caozhou1995 Caozhou1995 reopened this Mar 24, 2022
@@ -1112,6 +1113,44 @@ void RealAndImagInferMeta(const MetaTensor& x, MetaTensor* out) {
out->set_layout(x.layout());
}

void QrInferMeta(const MetaTensor& x,
Copy link
Contributor

Choose a reason for hiding this comment

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

QrInferMeta应该是在RealAndImagInferMeta前面

@@ -1769,6 +1808,20 @@ void UnbindInferMeta(const MetaTensor& x,
}
}

void TrilTriuInferMeta(const MetaTensor& x,
Copy link
Contributor

Choose a reason for hiding this comment

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

TrilTriuInferMeta按字母序也需要放在前面

@chenwhql chenwhql merged commit 2e73653 into PaddlePaddle:develop Mar 24, 2022
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.

4 participants