Calculate mean and variance in single API call Parameters - `input` is the input Array - `weights` Array has the weights to be used during the stat computation - `bias` is type of bias used for variance calculation - `dim` is dimension along which the current stat has to be computed Return Values A tuple of Arrays, whose size is equal to input except along the dimension which the stat operatio
(
input: &Array<T>,
weights: &Array<W>,
bias: VarianceBias,
dim: i64,
)
| 514 | /// - First Array contains mean values |
| 515 | /// - Second Array contains variance values |
| 516 | pub fn meanvar<T, W>( |
| 517 | input: &Array<T>, |
| 518 | weights: &Array<W>, |
| 519 | bias: VarianceBias, |
| 520 | dim: i64, |
| 521 | ) -> (Array<T::MeanOutType>, Array<T::MeanOutType>) |
| 522 | where |
| 523 | T: HasAfEnum, |
| 524 | T::MeanOutType: HasAfEnum, |
| 525 | W: HasAfEnum + RealFloating, |
| 526 | { |
| 527 | unsafe { |
| 528 | let mut mean: af_array = std::ptr::null_mut(); |
| 529 | let mut var: af_array = std::ptr::null_mut(); |
| 530 | let err_val = af_meanvar( |
| 531 | &mut mean as *mut af_array, |
| 532 | &mut var as *mut af_array, |
| 533 | input.get(), |
| 534 | weights.get(), |
| 535 | bias as c_uint, |
| 536 | dim, |
| 537 | ); |
| 538 | HANDLE_ERROR(AfError::from(err_val)); |
| 539 | (mean.into(), var.into()) |
| 540 | } |
| 541 | } |
| 542 | |
| 543 | /// Standard deviation along given axis |
| 544 | /// |
nothing calls this directly
no test coverage detected