Migrate concat layer

This commit is contained in:
2025-11-21 23:52:58 +01:00
parent fd4775faa4
commit aeb1739c46
9 changed files with 90 additions and 96 deletions

View File

@@ -21,6 +21,30 @@ class InvalidShapeException : public std::runtime_error {
actual
)
) {}
InvalidShapeException(
const std::string& message,
const Shape& shape_a,
const Shape& shape_b
)
: std::runtime_error(
std::format(
"{}. Shape A: [{}], Shape B: [{}]",
message,
format_shape(shape_a),
format_shape(shape_b)
)
) {}
private:
static std::string format_shape(const Shape& shape) {
std::string result;
for (size_t i = 0; i < shape.size(); ++i) {
if (i > 0) result += ", ";
result += std::to_string(shape[i]);
}
return result;
}
};
} // namespace CUDANet