multiple_models
MultipleModels
¶
Bases: torch.nn.Module
Wraps a list of models, and returns their outputs as a list of tensors
Source code in pytorch_adapt\layers\multiple_models.py
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
|
__init__(*models)
¶
Parameters:
Name | Type | Description | Default |
---|---|---|---|
*models |
torch.nn.Module
|
The models to be wrapped. |
()
|
Source code in pytorch_adapt\layers\multiple_models.py
11 12 13 14 15 16 17 |
|
forward(x)
¶
Parameters:
Name | Type | Description | Default |
---|---|---|---|
x |
torch.Tensor
|
the input to each model |
required |
Returns:
Type | Description |
---|---|
List[Any]
|
A list containing the output of each model. |
Source code in pytorch_adapt\layers\multiple_models.py
19 20 21 22 23 24 25 26 27 28 29 |
|