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

Dev user op set default is_dynamic #5223

Merged
merged 7 commits into from
Jun 17, 2021
11 changes: 9 additions & 2 deletions oneflow/core/operator/user_op.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,18 @@ namespace {
BlobDesc* FindValidBlobDescOfBnsInOp(
std::function<BlobDesc*(const std::string&)> GetBlobDesc4BnInOp,
const PbRpf<std::string>& bn_in_ops) {
BlobDesc* valid = nullptr;
for (const std::string& bn_in_op : bn_in_ops) {
BlobDesc* blob_desc = GetBlobDesc4BnInOp(bn_in_op);
if (blob_desc) { return blob_desc; }
if (blob_desc) {
const bool is_dynamic = blob_desc->is_dynamic();
if (valid == nullptr || is_dynamic) {
valid = blob_desc;
if (is_dynamic) { break; }
}
}
}
return nullptr;
return valid;
}

user_op::NaiveTensorDesc GenTensorDescFromBlobDesc(const BlobDesc* blob_desc) {
Expand Down