jactorch.parallel.data_parallel#
Classes
Class JacDataParallel
- class JacDataParallel[source]#
Bases:
DataParallel
- __init__(module, device_ids=None, output_device=None, dim=0, allow_replication_callback=True, user_scattered=False, use_scatter_stream=True, scatter_func=None, use_dict_gather=True, dict_gather_layout=None, persistent=False, copy_parameters=False, copy_buffers=True)[source]#
Initialize internal Module state, shared by both nn.Module and ScriptModule.
- forward(*inputs, **kwargs)[source]#
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.
- parallel_apply(replicas, inputs, kwargs)#
Class UserScatteredJacDataParallel
- class UserScatteredJacDataParallel[source]#
Bases:
JacDataParallel
- __init__(*args, **kwargs)[source]#
Initialize internal Module state, shared by both nn.Module and ScriptModule.
- 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.
- gather(outputs, output_device)#
- parallel_apply(replicas, inputs, kwargs)#
- replicate(module, device_ids)#
- scatter(inputs, kwargs, device_ids)#