Add Primitive::name and remove Primitive::print (#2365)

This commit is contained in:
Cheng
2025-07-15 06:06:35 +09:00
committed by GitHub
parent 5201df5030
commit d34f887abc
32 changed files with 307 additions and 340 deletions

View File

@@ -354,9 +354,7 @@ struct PrimitiveFactory {
void save(Writer& os, const std::shared_ptr<Primitive>& p) {
serialize(os, p->stream());
std::ostringstream pout;
p->print(pout);
auto name = pout.str();
std::string name = p->name();
name = name.substr(0, name.find(' '));
if (auto it = name_remap.find(name); it != name_remap.end()) {
name = it->second;