---
title: Reshaper
framework: createmlcomponents
role: symbol
role_heading: Structure
path: createmlcomponents/reshaper
---

# Reshaper

A transformer that reshapes a shaped array.

## Declaration

```swift
struct Reshaper<Scalar> where Scalar : MLShapedArrayScalar, Scalar : Decodable, Scalar : Encodable
```

## Topics

### Creating a transformer

- [init(shape:)](createmlcomponents/reshaper/init(shape:).md)

### Getting the shape

- [shape](createmlcomponents/reshaper/shape.md)

### Performing the transformation

- [applied(_:eventHandler:)](createmlcomponents/reshaper/applied(_:eventhandler:).md)
- [applied(to:eventHandler:)](createmlcomponents/reshaper/applied(to:eventhandler:).md)

## Relationships

### Conforms To

- [Copyable](swift/copyable.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [Decodable](swift/decodable.md)
- [Encodable](swift/encodable.md)
- [Equatable](swift/equatable.md)
- [Escapable](swift/escapable.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)
- [Transformer](createmlcomponents/transformer.md)

## See Also

### Preprocessors

- [LinearTransformer](createmlcomponents/lineartransformer.md)
- [ImputeTransformer](createmlcomponents/imputetransformer.md)
- [OneHotEncoder](createmlcomponents/onehotencoder.md)
- [OrdinalEncoder](createmlcomponents/ordinalencoder.md)
- [NumericImputer](createmlcomponents/numericimputer.md)
- [CategoricalImputer](createmlcomponents/categoricalimputer.md)
- [OptionalUnwrapper](createmlcomponents/optionalunwrapper.md)
