---
title: "imaginaryPartOfTensor(tensor:name:)"
framework: metalperformanceshadersgraph
role: symbol
role_heading: Instance Method
path: "metalperformanceshadersgraph/mpsgraph/imaginarypartoftensor(tensor:name:)"
---

# imaginaryPartOfTensor(tensor:name:)

Returns the imaginary part of a tensor.

## Declaration

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

## Parameters

- `tensor`: The input tensor.
- `name`: An optional string which serves as an identifier for the operation..

## Return Value

Return Value A valid MPSGraphTensor object containing the elementwise result of the applied operation.
