Add some epsilon tolerance to grad tests so that they work on cuda / mkl. (#213)

This commit is contained in:
Laurent Mazare
2023-07-21 13:45:14 +02:00
committed by GitHub
parent 410654525f
commit b02229ce92
3 changed files with 30 additions and 8 deletions

View File

@ -482,6 +482,11 @@ impl Tensor {
}
}
/// An alias for `to_scalar`.
pub fn to_vec0<S: crate::WithDType>(&self) -> Result<S> {
self.to_scalar::<S>()
}
/// This operation multiplies the input tensor by `mul` then adds `add` and return the result.
/// The input values `mul` and `add` are casted to the appropriate type so some rounding might
/// be performed.