<!--
{
  "availability" : [
    "iOS: 12.0.0 -",
    "iPadOS: 12.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.14.0 -",
    "tvOS: 12.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 5.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreML",
  "identifier" : "/documentation/CoreML/MLBatchProvider",
  "metadataVersion" : "0.1.0",
  "role" : "Protocol",
  "symbol" : {
    "kind" : "Protocol",
    "modules" : [
      "Core ML"
    ],
    "preciseIdentifier" : "c:objc(pl)MLBatchProvider"
  },
  "title" : "MLBatchProvider"
}
-->

# MLBatchProvider

An interface that represents a collection of feature providers.

```
protocol MLBatchProvider
```

## Overview

Similar to the [`MLFeatureProvider`](/documentation/CoreML/MLFeatureProvider), this interface allows you to define your own batch provider. If you collect your data asynchronously or it is memory intensive, implement this protocol on your data structure to optimize performance with batch processing.

## Topics

### Accessing values

[`features(at:)`](/documentation/CoreML/MLBatchProvider/features(at:))

Returns the feature provider at the given index.

[`count`](/documentation/CoreML/MLBatchProvider/count)

The number of feature providers in this batch.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)