More robust tests (so that they pass on accelerate). (#679)

This commit is contained in:
Laurent Mazare
2023-08-30 19:10:10 +02:00
committed by GitHub
parent 9874d843f1
commit 2047d34b7c
2 changed files with 9 additions and 9 deletions

View File

@ -7,7 +7,7 @@
//! # Example
//!
//! ```rust
//! use candle::{Tensor, Device::Cpu};
//! use candle::{Tensor, Device::Cpu, test_utils::to_vec3_round};
//! use candle_nn::{LayerNorm, Module};
//! # fn main() -> candle::Result<()> {
//!
@ -20,10 +20,10 @@
//! &Cpu)?;
//! let ys = layer.forward(&xs)?;
//! assert_eq!(
//! ys.to_vec3::<f32>()?,
//! &[[[-1.2247356, 0.0, 1.2247356],
//! [-1.2247356, 0.0, 1.2247356],
//! [ 1.2247356, 0.0, -1.2247356]]]);
//! to_vec3_round(&ys, 4)?,
//! &[[[-1.2247, 0.0, 1.2247],
//! [-1.2247, 0.0, 1.2247],
//! [ 1.2247, 0.0, -1.2247]]]);
//! # Ok(()) }
//! ```
//!