jactorch.parallel.dict_gather#

Classes

DictGatherDataParallel

Add support for modules that return dicts.

Functions

data_parallel_dict_gather(data_parallel, ...)

dict_gather_v1(outputs, target_device[, dim])

Gathers variables from different GPUs on a specified device (-1 means the CPU), with dictionary support.

dict_gather_v2(outputs, target_device[, ...])

patch_dict_gathering(data_parallel)

Class DictGatherDataParallel

class DictGatherDataParallel[source]#

Bases: DataParallel

Add support for modules that return dicts.

__init__(module, device_ids=None, output_device=None, dim=0)#

Initialize internal Module state, shared by both nn.Module and ScriptModule.

Parameters:
Return type:

None

forward(*inputs, **kwargs)#

Define the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

Parameters:
Return type:

Any

gather(outputs, output_device)[source]#
parallel_apply(replicas, inputs, kwargs)#
Parameters:
Return type:

List[Any]

replicate(module, device_ids)#
Parameters:
Return type:

List[T]

scatter(inputs, kwargs, device_ids)#
Parameters:
Return type:

Any

Functions

data_parallel_dict_gather(data_parallel, outputs, output_device, layout=None)[source]#
dict_gather_v1(outputs, target_device, dim=0)[source]#

Gathers variables from different GPUs on a specified device (-1 means the CPU), with dictionary support.

dict_gather_v2(outputs, target_device, layout=None, dim=0)[source]#
patch_dict_gathering(data_parallel)[source]#