---
title: MTLTensorError.Code
framework: metal
role: symbol
role_heading: Enumeration
path: metal/mtltensorerror-swift.struct/code
---

# MTLTensorError.Code

The error codes that Metal can raise when you create a tensor.

## Declaration

```swift
enum Code
```

## Topics

### Enumeration Cases

- [MTLTensorError.Code.internalError](metal/mtltensorerror-swift.struct/code/internalerror.md)
- [MTLTensorError.Code.invalidDescriptor](metal/mtltensorerror-swift.struct/code/invaliddescriptor.md)
- [MTLTensorError.Code.none](metal/mtltensorerror-swift.struct/code/none.md)

### Initializers

- [init(rawValue:)](metal/mtltensorerror-swift.struct/code/init(rawvalue:).md)

## Relationships

### Conforms To

- [BitwiseCopyable](swift/bitwisecopyable.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [RawRepresentable](swift/rawrepresentable.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### Enumerations

- [MTLArgumentBuffersTier](metal/mtlargumentbufferstier.md)
- [MTLLogStateError](metal/mtllogstateerror.md)
- [MTLMathFloatingPointFunctions](metal/mtlmathfloatingpointfunctions.md)
- [MTLMathMode](metal/mtlmathmode.md)
- [MTLMatrixLayout](metal/mtlmatrixlayout.md)
- [MTLReadWriteTextureTier](metal/mtlreadwritetexturetier.md)
- [MTLShaderValidation](metal/mtlshadervalidation.md)
- [MTLTransformType](metal/mtltransformtype.md)
