---
title: "init(descriptor:weights:)"
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/mlcembeddinglayer/init(descriptor:weights:)"
---

# init(descriptor:weights:)

Creates an embedding layer with the descriptor and word embedding weights tensor you specify.

## Declaration

```swift
convenience init(descriptor: MLCEmbeddingDescriptor, weights: MLCTensor)
```

## Parameters

- `descriptor`: An object you use to configure the embedding layer.
- `weights`: A word embedding weights tensor.

## See Also

### Creating Embedding Layers

- [MLCEmbeddingDescriptor](mlcompute/mlcembeddingdescriptor.md)
