mirror of
https://github.com/ml-explore/mlx.git
synced 2025-09-17 09:18:12 +08:00
Raise an exception in the rope op if input is integer (#1884)
This commit is contained in:

committed by
GitHub

parent
1a2cb72030
commit
78ba24c37d
@@ -348,6 +348,11 @@ array rope(
|
||||
<< x.ndim() << " dimensions.";
|
||||
throw std::invalid_argument(msg.str());
|
||||
}
|
||||
if (!issubdtype(x.dtype(), floating)) {
|
||||
std::ostringstream msg;
|
||||
msg << "[rope] Input must be a floating type but got " << x.dtype() << ".";
|
||||
throw std::invalid_argument(msg.str());
|
||||
}
|
||||
if (offset.size() != 1) {
|
||||
std::ostringstream msg;
|
||||
msg << "[rope] offset must be a scalar but has shape " << offset.shape()
|
||||
|
Reference in New Issue
Block a user