<!--
{
  "availability" : [
    "iOS: 14.0.0 -",
    "iPadOS: 14.0.0 -",
    "macCatalyst: 14.0.0 -",
    "macOS: 11.0.0 -",
    "tvOS: 14.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "MetalPerformanceShadersGraph",
  "identifier" : "/documentation/MetalPerformanceShadersGraph/MPSGraphShapedType/init(shape:dataType:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Metal Performance Shaders Graph"
    ],
    "preciseIdentifier" : "c:objc(cs)MPSGraphShapedType(im)initWithShape:dataType:"
  },
  "title" : "init(shape:dataType:)"
}
-->

# init(shape:dataType:)

Initializes a shaped type.

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

## Parameters

`shape`

The shape of the shaped type.

`dataType`

The dataType of the shaped type.

## Return Value

A valid MPSGraphShapedType, or nil if allocation failure.

---

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)