---
title: "init(width:height:featureChannelCount:batchSize:randomInitializerType:)"
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:randominitializertype:)"
---

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

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

## Declaration

```swift
convenience init(width: Int, height: Int, featureChannelCount: Int, batchSize: Int, randomInitializerType: MLCRandomInitializerType)
```

## Parameters

- `width`: The tensor width.
- `height`: The tensor height.
- `featureChannelCount`: The number of feature channels.
- `batchSize`: The tensor batch size.
- `randomInitializerType`: The random initializer type you use to generate random 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:)](mlcompute/mlctensor/init(width:height:featurechannelcount:batchsize:data:).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)
