process_num_alloc_configs
Configuration processing method.
It processes the provided information about the provided configuration information, including the total number, allocation of these numbers, and the list of configurations.
For the RPN layer and RPN model, they may contain multi-head, and multi-layer. To provide more flexibility in their initialization, the tinyBIG toolkit allows users to provide the configuration information in different ways:
- provide "total number" n, "num_alloc" [1, 2, 1, ..., 1], and a list of "configs" [config1, config2, ..., confign]
- only provide "total number" n, and a list of "configs" [config1, config2, ..., confign], we will auto complete the num_alloc to be [1, 1, 1, ..., 1]
- only provide "total number" n, and only one "configs" either in a list "[config1]" or just "config1", we will auto complete the num_alloc to be [n]
- only provide "num_alloc" [1, 2, 1, 3, ...., 1], and a list of configs [config1, config2, ..., configk], we will auto complete the "total num" to be sum(num_alloc)
- other cases, we will report value errors
Therefore, this method may need to process such provided parameters to figure out the intended configurations of the RPN heads and RPN layers.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
num |
int
|
Total number of the configurations. |
None
|
num_alloc |
int | list
|
The allocation of the configuration number. |
None
|
configs |
dict | list
|
The list/dict of the configurations. |
None
|
Returns:
Type | Description |
---|---|
tuple | pair
|
The processed num, num_alloc, configs tuple. |