#[derive(Debug)]
pub enum RopeStdError {
InvalidShape,
}
impl From<native_neural_network::rope::RopeError> for RopeStdError {
fn from(e: native_neural_network::rope::RopeError) -> Self {
match e {
native_neural_network::rope::RopeError::InvalidShape => RopeStdError::InvalidShape,
}
}
}
pub fn apply_rope_in_place(x: &mut [f32], position: usize, theta: f32) -> Result<(), RopeStdError> {
native_neural_network::rope::apply_rope_in_place(x, position, theta).map_err(|e| e.into())
}
impl core::fmt::Display for RopeStdError {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "RopeStdError::{:?}", self)
}
}
impl std::error::Error for RopeStdError {}