---
title: "sign(with:name:)"
framework: metalperformanceshadersgraph
role: symbol
role_heading: Instance Method
path: "metalperformanceshadersgraph/mpsgraph/sign(with:name:)"
---

# sign(with:name:)

Returns the sign of the input tensor elements.

## Declaration

```swift
func sign(with 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.

## Discussion

Discussion This operation returns 1.0 if the correspnding input element is greater than 0, -1.0 if it is lesser than 0, -0.0 if it is equal to -0.0, and +0.0 if it is equal to +0.0.
