---
title: BNNSLossReductionNonZeroWeightMean
framework: accelerate
role: symbol
role_heading: Global Variable
path: accelerate/bnnslossreductionnonzeroweightmean
---

# BNNSLossReductionNonZeroWeightMean

Sums the loss of all samples in the batch and divides by the number of non-zero weights.

## Declaration

```swift
var BNNSLossReductionNonZeroWeightMean: BNNSLossReductionFunction { get }
```

## Discussion

Discussion BNNSLossReductionNonZeroWeightMean sums the loss of all samples in the batch and divides by number of non-zero weights. Non-zero weighted mean reduction returns 0 in case all weights are zero.

## See Also

### Reduction Functions

- [rawValue](accelerate/bnnslossreductionfunction/rawvalue.md)
- [init(_:)](accelerate/bnnslossreductionfunction/init(_:).md)
- [init(rawValue:)](accelerate/bnnslossreductionfunction/init(rawvalue:).md)
- [BNNSLossReductionMean](accelerate/bnnslossreductionmean.md)
- [BNNSLossReductionSum](accelerate/bnnslossreductionsum.md)
- [BNNSLossReductionWeightedMean](accelerate/bnnslossreductionweightedmean.md)
- [BNNSLossReductionNone](accelerate/bnnslossreductionnone.md)
