CARVIEW |
Navigation Menu
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
【Complex op】add complex support for assign_value #59536
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
【Complex op】add complex support for assign_value #59536
Conversation
…ort_complex_assign_value
…ort_complex_assign_value
…ort_complex_assign_value
…ort_complex_assign_value
@@ -46,6 +46,10 @@ std::pair<bool, std::unordered_map<std::string, uint32_t>> DetectLegacyOps( | |||
paddle::framework::compatible::get_op_version_map()) { | |||
current_op_versions.insert( | |||
std::make_pair(pair.first, pair.second.version_id())); | |||
if (pair.first == "assign_value") { | |||
VLOG(6) << "get_op_version_map----------------------------------" |
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.
这个日志格式不规范
@@ -232,6 +316,13 @@ void ConvertProgram(ProgramDesc* program) { | |||
for (size_t j = 0; j < num_ops; j++) { | |||
OpDesc* op = block->Op(static_cast<int>(j)); | |||
const std::string op_type = op->Type(); | |||
if (op_type == "assign_value") { |
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.
这里legacy_op_versions 问题看起来是绕过去的,并不是合理的解决问题的办法
return new Complex64AttributeStorage(key); | ||
} | ||
static std::size_t HashValue(const ParamKey &key) { | ||
return std::hash<float>{}(key.real + key.imag); |
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.
这个问题还是没有解决,这个仍然会碰撞,完全可以把复数先转换成字符串(1.0+2.0j -> "1.0 + 2.0j"),再取hash
return new Complex128AttributeStorage(key); | ||
} | ||
static std::size_t HashValue(const ParamKey &key) { | ||
return std::hash<double>{}(key.real + key.imag); |
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.
同上
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.
LGTM
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.
LGTM
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.
LGTM for api change
* support_complex_for_assign_value * add test complex test for test_program_converter * add complex test for assign_value xpu * solve conflict * fix timeout * fix CE infer bug * fix program convert bug * fix program convert bug for assign_value --------- Co-authored-by: zyt1024 <1522064645@qq.com>
PR types
New features
PR changes
OPs
Description
add complex support for assign value