mirror of
https://github.com/huggingface/candle.git
synced 2025-06-19 03:54:56 +00:00
More robust tests (so that they pass on accelerate). (#679)
This commit is contained in:
@ -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(()) }
|
||||
//! ```
|
||||
//!
|
||||
|
Reference in New Issue
Block a user