<!--
{
  "availability" : [
    "iOS: 16.0.0 -",
    "iPadOS: 16.0.0 -",
    "macCatalyst: 16.0.0 -",
    "macOS: 13.0.0 -",
    "tvOS: 16.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 11.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CreateMLComponents",
  "identifier" : "/documentation/CreateMLComponents/TemporalTransformer",
  "metadataVersion" : "0.1.0",
  "role" : "Protocol",
  "symbol" : {
    "kind" : "Protocol",
    "modules" : [
      "Create ML Components"
    ],
    "preciseIdentifier" : "s:18CreateMLComponents19TemporalTransformerP"
  },
  "title" : "TemporalTransformer"
}
-->

# TemporalTransformer

A transformer that takes an asynchronous input sequence of temporal features and produces an asynchronous output  sequence.

```
protocol TemporalTransformer<Input, Output>
```

## Overview

A temporal transformer, unlike a regular transformer, can accumulate multiple inputs before producing an output.
For example, an audio transformer can accumulate audio buffers until the desired length is reached before producing
an output.

## Topics

### Applying and adapting

[`func applied<S>(to: S, eventHandler: EventHandler?) async throws -> Self.OutputSequence`](/documentation/CreateMLComponents/TemporalTransformer/applied(to:eventHandler:))

Performs the transformation on an input sequence.

[`func adaptedAsEstimator() -> TemporalTransformerToEstimatorAdaptor<Self>`](/documentation/CreateMLComponents/TemporalTransformer/adaptedAsEstimator())

Exposes this temporal transformer as a trivial temporal estimator.

[`func adaptedAsUpdatableEstimator() -> TemporalTransformerToUpdatableEstimatorAdaptor<Self>`](/documentation/CreateMLComponents/TemporalTransformer/adaptedAsUpdatableEstimator())

Exposes this temporal transformer as a trivial temporal estimator.

[`associatedtype Input`](/documentation/CreateMLComponents/TemporalTransformer/Input)

The input type.

[`associatedtype Output`](/documentation/CreateMLComponents/TemporalTransformer/Output)

The output type.

[`associatedtype OutputSequence : TemporalSequence`](/documentation/CreateMLComponents/TemporalTransformer/OutputSequence)

The output async sequence type.

### Appending

[`func appending(_:)`](/documentation/CreateMLComponents/TemporalTransformer/appending(_:))

Composes this temporal transformer with another temporal transformer.

### Transforming and predicting

[`func callAsFunction<S>(S, eventHandler: EventHandler?) async throws -> Self.OutputSequence`](/documentation/CreateMLComponents/TemporalTransformer/callAsFunction(_:eventHandler:))

Performs the transformation on an input sequence.

[`func callAsFunction<S>(to: S, eventHandler: EventHandler?) async throws -> [Self.OutputSequence]`](/documentation/CreateMLComponents/TemporalTransformer/callAsFunction(to:eventHandler:))

Performs the transformation on a sequence of inputs.

[`func prediction<S, Label>(from: S) async throws -> Self.OutputSequence`](/documentation/CreateMLComponents/TemporalTransformer/prediction(from:))

Performs a prediction on a single input.

### Exporting

[`func export(to: URL) throws`](/documentation/CreateMLComponents/TemporalTransformer/export(to:))

Exports this temporal transformer as a CoreML model.

[`func export(to: URL, metadata: ModelMetadata) throws`](/documentation/CreateMLComponents/TemporalTransformer/export(to:metadata:))

Exports this temporal transformer as a CoreML model with user-supplied metadata.

## Relationships

### Conforming Types

[`TransformerToTemporalAdaptor`](/documentation/CreateMLComponents/TransformerToTemporalAdaptor)

[`SlidingWindowTransformer`](/documentation/CreateMLComponents/SlidingWindowTransformer)

[`Model`](/documentation/CreateMLComponents/TimeSeriesClassifier/Model)

[`ComposedTemporalTransformer`](/documentation/CreateMLComponents/ComposedTemporalTransformer)

[`AudioFeaturePrint`](/documentation/CreateMLComponents/AudioFeaturePrint)

[`Model`](/documentation/CreateMLComponents/LinearTimeSeriesForecaster/Model)

[`TemporalAdaptor`](/documentation/CreateMLComponents/TemporalAdaptor)

[`Downsampler`](/documentation/CreateMLComponents/Downsampler)

[`HumanBodyActionCounter`](/documentation/CreateMLComponents/HumanBodyActionCounter)

---

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)