---
title: classCount
framework: ML Compute
role: symbol
role_heading: Instance Property
platforms: [iOS 14.0+, iPadOS 14.0+, Mac Catalyst 14.0+, macOS 11.0+, tvOS 14.0+]
path: mlcompute/mlclossdescriptor/classcount
---

# classCount

The number of classes.

## Declaration

```swift
var classCount: Int { get }
```

## Discussion

Discussion The default value is 1. note: This is only valid for the loss function type MLCLossType.softmaxCrossEntropy.

## See Also

### Inspecting Loss Descriptors

- [lossType](mlcompute/mlclossdescriptor/losstype.md)
- [reductionType](mlcompute/mlclossdescriptor/reductiontype.md)
- [weight](mlcompute/mlclossdescriptor/weight.md)
- [labelSmoothing](mlcompute/mlclossdescriptor/labelsmoothing.md)
- [epsilon](mlcompute/mlclossdescriptor/epsilon.md)
- [delta](mlcompute/mlclossdescriptor/delta.md)
