---
title: MLCTensorDescriptor
framework: ML Compute
role: symbol
role_heading: Class
platforms: [iOS 14.0+, iPadOS 14.0+, Mac Catalyst 14.0+, macOS 11.0+, tvOS 14.0+]
path: mlcompute/mlctensordescriptor
---

# MLCTensorDescriptor

A configuration object you use to create a tensor.

## Declaration

```swift
class MLCTensorDescriptor
```

## Overview

Overview This class contains the mathematical properties of a tensor, such as data type and shape. It also includes initializers that help you create a tensor descriptor for common use cases, such as convolutional neural networks and recurrent neural networks.

## Topics

### Creating Tensor Descriptors

- [init(shape:dataType:)](mlcompute/mlctensordescriptor/init(shape:datatype:).md)
- [init(shape:sequenceLengths:sortedSequences:dataType:)](mlcompute/mlctensordescriptor/init(shape:sequencelengths:sortedsequences:datatype:).md)
- [init(width:height:featureChannelCount:batchSize:)](mlcompute/mlctensordescriptor/init(width:height:featurechannelcount:batchsize:).md)
- [init(width:height:featureChannelCount:batchSize:dataType:)](mlcompute/mlctensordescriptor/init(width:height:featurechannelcount:batchsize:datatype:).md)
- [init(convolutionWeightsWithInputFeatureChannelCount:outputFeatureChannelCount:dataType:)](mlcompute/mlctensordescriptor/init(convolutionweightswithinputfeaturechannelcount:outputfeaturechannelcount:datatype:).md)
- [init(convolutionWeightsWithWidth:height:inputFeatureChannelCount:outputFeatureChannelCount:dataType:)](mlcompute/mlctensordescriptor/init(convolutionweightswithwidth:height:inputfeaturechannelcount:outputfeaturechannelcount:datatype:).md)
- [init(convolutionBiasesWithFeatureChannelCount:dataType:)](mlcompute/mlctensordescriptor/init(convolutionbiaseswithfeaturechannelcount:datatype:).md)
- [maxTensorDimensions](mlcompute/mlctensordescriptor/maxtensordimensions.md)

### Inspecting Tensor Descriptors

- [dataType](mlcompute/mlctensordescriptor/datatype.md)
- [dimensionCount](mlcompute/mlctensordescriptor/dimensioncount.md)
- [shape](mlcompute/mlctensordescriptor/shape-7i1rw.md)
- [stride](mlcompute/mlctensordescriptor/stride-5mzlt.md)
- [tensorAllocationSizeInBytes](mlcompute/mlctensordescriptor/tensorallocationsizeinbytes.md)
- [sequenceLengths](mlcompute/mlctensordescriptor/sequencelengths-3jdab.md)
- [sortedSequences](mlcompute/mlctensordescriptor/sortedsequences.md)
- [batchSizePerSequenceStep](mlcompute/mlctensordescriptor/batchsizepersequencestep-6iz59.md)

## Relationships

### Inherits From

- [NSObject](objectivec/nsobject-swift.class.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSCopying](foundation/nscopying.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)

## See Also

### Creating Tensors with Descriptors

- [init(descriptor:)](mlcompute/mlctensor/init(descriptor:).md)
- [init(descriptor:data:)](mlcompute/mlctensor/init(descriptor:data:).md)
- [init(descriptor:fillWithData:)](mlcompute/mlctensor/init(descriptor:fillwithdata:).md)
- [init(descriptor:randomInitializerType:)](mlcompute/mlctensor/init(descriptor:randominitializertype:).md)
- [MLCDataType](mlcompute/mlcdatatype.md)
- [MLCTensorData](mlcompute/mlctensordata.md)
- [MLCRandomInitializerType](mlcompute/mlcrandominitializertype.md)
