Introduce `iterate` method for `codegen::operand::Context`.
Signed-off-by: Hanjoung Lee <hanjoung.lee@samsung.com>
return (*this);
}
+void Context::iterate(const std::function<void(int, backend::operand::IObject &)> &fn)
+{
+ for (auto &e : _objects)
+ {
+ fn(e.first, *e.second);
+ }
+}
+
} // namespace operand
} // namespace codegen
} // namespace neurun
return _objects.at(ind.asInt());
}
+ void iterate(const std::function<void(int, backend::operand::IObject &)> &fn);
+
private:
std::map<int, std::shared_ptr<backend::operand::IObject>> _objects;
};