Raise an exception in the rope op if input is integer (#1884)

This commit is contained in:
Angelos Katharopoulos
2025-02-19 14:43:39 -08:00
committed by GitHub
parent 1a2cb72030
commit 78ba24c37d
2 changed files with 15 additions and 0 deletions

View File

@@ -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()