#ifndef __NEURUN_GRAPH_OPERAND_LAYOUT_H__
#define __NEURUN_GRAPH_OPERAND_LAYOUT_H__
+#include <functional>
+
namespace neurun
{
namespace graph
} // namespace graph
} // namespace neurun
+namespace std
+{
+
+template <> struct hash<::neurun::graph::operand::Layout>
+{
+ size_t operator()(const ::neurun::graph::operand::Layout &value) const noexcept
+ {
+ using type = typename std::underlying_type<::neurun::graph::operand::Layout>::type;
+ return hash<type>()(static_cast<type>(value));
+ }
+};
+
+} // namespace std
+
#endif // __NEURUN_GRAPH_OPERAND_LAYOUT_H__
--- /dev/null
+#ifndef __NEURUN_GRAPH_OPERAND_LAYOUT_SET_H__
+#define __NEURUN_GRAPH_OPERAND_LAYOUT_SET_H__
+
+#include <initializer_list>
+#include <unordered_set>
+
+#include "Layout.h"
+
+namespace neurun
+{
+namespace graph
+{
+namespace operand
+{
+
+class LayoutSet
+{
+public:
+ LayoutSet() = default;
+ LayoutSet(std::initializer_list<Layout> layouts);
+
+public:
+ void add(const Layout &layout) { _set.insert(layout); }
+ void remove(const Layout &layout) { _set.erase(layout); }
+
+public:
+ std::unordered_set<Layout>::const_iterator begin() const { return _set.begin(); }
+ std::unordered_set<Layout>::const_iterator end() const { return _set.end(); }
+
+private:
+ std::unordered_set<Layout> _set;
+};
+
+} // namespace operand
+} // namespace graph
+} // namespace neurun
+
+#endif // __NEURUN_GRAPH_OPERAND_LAYOUT_SET_H__