probly.utils.torch.torch_collect_outputs¶
- probly.utils.torch.torch_collect_outputs(model: Module, loader: DataLoader, device: device) tuple[Tensor, Tensor][source]¶
Collect outputs and targets from a model for a given data loader.
- Parameters:
model – Model to collect outputs from.
loader – Data loader to collect outputs from.
device – Device to move data to.
- Returns:
outputs: Model outputs of shape (n_instances, n_classes).
targets: Target labels of shape (n_instances,).
- Return type:
A tuple containing