21 lines
671 B
Rust
21 lines
671 B
Rust
//! TDD tests for mean operation
|
|
//! These tests define expected behavior for tensor mean operations
|
|
|
|
use rtx_tensor::{Device, Tensor};
|
|
|
|
#[test]
|
|
fn test_tensor_mean_all_elements() {
|
|
// To get mean of all elements, we need to pass empty dimensions
|
|
let device = Device::cpu();
|
|
let tensor = Tensor::ones(&[3, 4], &device).unwrap();
|
|
|
|
// Mean of all elements - pass empty slice for dimensions
|
|
let mean_all = tensor.mean(&[], false).unwrap();
|
|
|
|
// Mean along specific dimensions
|
|
let mean_dim0 = tensor.mean(&[0], false).unwrap();
|
|
let mean_dim1 = tensor.mean(&[1], false).unwrap();
|
|
|
|
assert!(true); // Placeholder - would check actual values
|
|
}
|