-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
【Infer Symbolic Shape No.120】[BUAA] affine_grid #67364
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
const int64_t output_shape_size = | ||
static_cast<int64_t>(output_shape_or_data.data().value().size()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
output_shape_or_data.shape().size()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
修改后再重新review吧
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
const int64_t output_shape_size = | ||
static_cast<int64_t>(output_shape_or_data.data().value().size()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
修改后再重新review吧
infer_context->GetShapeOrDataForValue(op->operand_source(0)); | ||
std::vector<symbol::DimExpr> input_dims = input_shape_or_data.shape(); | ||
|
||
const auto &output_shape_or_data = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
output_shape 是IntArray类型有可能从attribute传过来,加一个逻辑判断
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
infer_context->GetShapeOrDataForValue(op->operand_source(1)); | ||
|
||
const int64_t output_shape_size = | ||
static_cast<int64_t>(output_shape_or_data.shape().size()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
非必要cast,为啥不直接用int接收
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
if (output_shape_size == 4) { | ||
// N * H * W * 2 | ||
output_dims.push_back(infer_context->GetNextSymName()); // H | ||
output_dims.push_back(infer_context->GetNextSymName()); // W | ||
output_dims.push_back(symbol::DimExpr(2)); // 2 | ||
} else { | ||
// N * D * H * W * 3 | ||
output_dims.push_back(infer_context->GetNextSymName()); // D | ||
output_dims.push_back(infer_context->GetNextSymName()); // H | ||
output_dims.push_back(infer_context->GetNextSymName()); // W | ||
output_dims.push_back(symbol::DimExpr(3)); // 3 | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
D, H, W可以从output_shape中得到,再确认下吧
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
|
||
output_shape_data = output_shape_or_data.shape(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里应该是取data,可以用details::GetOrCreateExprVecFromData(output_shape_or_data, infer_context)
PR Category
CINNPR Types
OthersDescription
add affine_grid op
check_pir已经打开,本地测试通过