Template Function torch::nn::parallel::replicate(const std::shared_ptr<ModuleType>&, const std::vector<Device>&)¶
Defined in File data_parallel.h
Function Documentation¶
-
template<typename ModuleType>
std::vector<std::shared_ptr<ModuleType>> torch::nn::parallel::replicate(const std::shared_ptr<ModuleType> &module, const std::vector<Device> &devices)¶ Replicates a module on the given list of devices.
A replica is created by calling
clone()
on the module. For this, the module must inherit fromnn::Cloneable
, or define its ownclone()
method, which is expected to perform a deep copy of the module.