torch.nn.functional.torch.nn.parallel.data_parallel — PyTorch 2.7 documentation (original) (raw)

torch.nn.parallel.data_parallel(module, inputs, device_ids=None, output_device=None, dim=0, module_kwargs=None)[source][source]

Evaluate module(input) in parallel across the GPUs given in device_ids.

This is the functional version of the DataParallel module.

Parameters

Returns

a Tensor containing the result of module(input) located on output_device

Return type

Tensor