---
title: sign()
framework: coreml
role: symbol
role_heading: Instance Method
path: coreml/mltensor/sign()
---

# sign()

Returns the sign of the tensor’s elements.

## Declaration

```swift
func sign() -> MLTensor
```

## Discussion

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

## See Also

### Accessing the extended tensor, sign and reciprocal

- [expandingShape(at:)](coreml/mltensor/expandingshape(at:).md)
- [bandPart(lowerBandCount:upperBandCount:)](coreml/mltensor/bandpart(lowerbandcount:upperbandcount:).md)
- [tiled(multiples:)](coreml/mltensor/tiled(multiples:).md)
- [reciprocal()](coreml/mltensor/reciprocal().md)
