---
title: "init(width:height:featureChannelCount:batchSize:data:)"
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/mlctensor/init(width:height:featurechannelcount:batchsize:data:)"
---

# init(width:height:featureChannelCount:batchSize:data:)

Creates a tensor with the sizes, number of feature channels, and data you specify.

## Declaration

```swift
convenience init(width: Int, height: Int, featureChannelCount: Int, batchSize: Int, data: MLCTensorData)
```

## Parameters

- `width`: The tensor width.
- `height`: The tensor height.
- `featureChannelCount`: The number of feature channels.
- `batchSize`: The tensor batch size.
- `data`: The tensor data.

## See Also

### Creating Tensors by Specifying Shape

- [init(shape:)](mlcompute/mlctensor/init(shape:).md)
- [init(shape:dataType:)](mlcompute/mlctensor/init(shape:datatype:).md)
- [init(shape:data:dataType:)](mlcompute/mlctensor/init(shape:data:datatype:).md)
- [init(shape:fillWithData:dataType:)](mlcompute/mlctensor/init(shape:fillwithdata:datatype:).md)
- [init(shape:randomInitializerType:)](mlcompute/mlctensor/init(shape:randominitializertype:).md)
- [init(width:height:featureChannelCount:batchSize:)](mlcompute/mlctensor/init(width:height:featurechannelcount:batchsize:).md)
- [init(width:height:featureChannelCount:batchSize:data:dataType:)](mlcompute/mlctensor/init(width:height:featurechannelcount:batchsize:data:datatype:).md)
- [init(width:height:featureChannelCount:batchSize:fillWithData:dataType:)](mlcompute/mlctensor/init(width:height:featurechannelcount:batchsize:fillwithdata:datatype:).md)
- [init(width:height:featureChannelCount:batchSize:randomInitializerType:)](mlcompute/mlctensor/init(width:height:featurechannelcount:batchsize:randominitializertype:).md)
