}
}
+/**
+ * @brief Make copy of ShapeInferenceData from src
+ *
+ * @note T can be ShapeInferenceData or loco::Node based class having shape
+ * attributes like TFConst, COpCall and so on
+ */
+template <class T> std::unique_ptr<ShapeInferenceData> make_shape_inference_data(const T *src)
+{
+ assert(src != nullptr);
+
+ auto shape_data = stdex::make_unique<ShapeInferenceData>();
+
+ uint32_t rank = src->rank();
+ shape_data->rank(rank);
+ for (uint32_t index = 0; index < rank; ++index)
+ {
+ if (src->dim(index).known())
+ shape_data->dim(index) = src->dim(index).value();
+ else
+ shape_data->dim(index).unset();
+ }
+
+ return std::move(shape_data);
+}
+
std::unique_ptr<ShapeInferenceData> make_shape_inference_data(const loco::NodeShape &src)
{
auto shape_data = stdex::make_unique<ShapeInferenceData>();