---
title: "shapeOf(_:name:)"
framework: metalperformanceshadersgraph
role: symbol
role_heading: Instance Method
path: "metalperformanceshadersgraph/mpsgraph/shapeof(_:name:)"
---

# shapeOf(_:name:)

Creates a shape-of operation and returns the result tensor.

## Declaration

```swift
func shapeOf(_ tensor: MPSGraphTensor, name: String?) -> MPSGraphTensor
```

## Parameters

- `tensor`: The input tensor.
- `name`: The name for the operation.

## Return Value

Return Value A valid MPSGraphTensor object.

## Discussion

Discussion Returns a rank-1 tensor of type MPSDataTypeInt32 with the values of the static shape of the input tensor.
