---
title: "init(shape:dataType:)"
framework: ML Compute
role: symbol
role_heading: Initializer
platforms: [iOS 14.0+, iPadOS 14.0+, Mac Catalyst 14.0+, macOS 11.0+, tvOS 14.0+]
path: "mlcompute/mlctensordescriptor/init(shape:datatype:)"
---

# init(shape:dataType:)

Creates a tensor descriptor with the shape and data type you specify.

## Declaration

```swift
convenience init?(shape: [Int], dataType: MLCDataType)
```

## Parameters

- `shape`: The tensor shape.
- `dataType`: The tensor data type.

## See Also

### Creating Tensor Descriptors

- [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)
