mirror of
https://github.com/lordmathis/CUDANet.git
synced 2025-12-22 14:24:22 +00:00
Implement InvalidShapeException
This commit is contained in:
@@ -6,4 +6,21 @@ namespace CUDANet {
|
||||
|
||||
typedef std::vector<size_t> Shape;
|
||||
|
||||
} // namespace CUDANet
|
||||
class InvalidShapeException : public std::runtime_error {
|
||||
public:
|
||||
InvalidShapeException(
|
||||
const std::string& param_name,
|
||||
size_t expected,
|
||||
size_t actual
|
||||
)
|
||||
: std::runtime_error(
|
||||
std::format(
|
||||
"Invalid {} shape. Expected {}, actual {}",
|
||||
param_name,
|
||||
expected,
|
||||
actual
|
||||
)
|
||||
) {}
|
||||
};
|
||||
|
||||
} // namespace CUDANet
|
||||
|
||||
Reference in New Issue
Block a user