<!--
{
  "availability" : [
    "iOS: 14.0.0 - 17.4.0",
    "iPadOS: 14.0.0 - 17.4.0",
    "macCatalyst: 14.0.0 - 17.4.0",
    "macOS: 11.0.0 - 14.3.0",
    "tvOS: 14.0.0 - 17.4.0"
  ],
  "documentType" : "symbol",
  "framework" : "MLCompute",
  "identifier" : "/documentation/MLCompute/MLCTensorDescriptor/init(width:height:featureChannelCount:batchSize:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "ML Compute"
    ],
    "preciseIdentifier" : "c:objc(cs)MLCTensorDescriptor(cm)descriptorWithWidth:height:featureChannelCount:batchSize:"
  },
  "title" : "init(width:height:featureChannelCount:batchSize:)"
}
-->

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

Creates a tensor descriptor with the width and height, number of feature channels, and batch size you specify.

```
convenience init?(width: Int, height: Int, featureChannelCount featureChannels: Int, batchSize: Int)
```

## Parameters

`width`

The tensor width.

`height`

The tensor height.

`featureChannels`

The number of feature channels.

`batchSize`

The tensor batch size.

## Discussion

This initializer provides a convenient way for you to configure NCHW tensors used by convolutional layers. The tensor data type is [`MLCDataType.float32`](/documentation/MLCompute/MLCDataType/float32).

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)