HashEmbeddingBagCollection
Function
Creates a single-server table object with pooling and hash mapping.
Prototype
1 2 | class HashEmbeddingBagCollection: def __init__(**kwargs): |
Parameters
Parameter |
Data Type |
Mandatory/Optional |
Description |
|---|---|---|---|
tables |
List[HashEmbeddingBagConfig | EmbeddingBagConfig] |
Mandatory |
List of sparse table configuration files. The value range of the list length is [1, 10000]. For details about the value range, see that of HashEmbeddingBagConfig. |
is_weighted |
bool |
Optional |
Only the default value False is supported. |
device |
str or torch.device |
Optional |
Device of a sparse table. The default value is torch.device("cpu").
|
Example
1 | ebc = HashEmbeddingBagCollection(device="npu", tables=table_configs) |
See Also
For details about the API call sequence and example, see Porting and Training.