---
title: "init(shape:dataType:)"
framework: metalperformanceshadersgraph
role: symbol
role_heading: Initializer
path: "metalperformanceshadersgraph/mpsgraphshapedtype/init(shape:datatype:)"
---

# init(shape:dataType:)

Initializes a shaped type.

## Declaration

```swift
init(shape: [NSNumber]?, dataType: MPSDataType)
```

## Parameters

- `shape`: The shape of the shaped type.
- `dataType`: The dataType of the shaped type.

## Return Value

Return Value A valid MPSGraphShapedType, or nil if allocation failure.
