From: Zeming Lin Date: Tue, 4 Dec 2018 21:42:11 +0000 (-0800) Subject: c10d doesn't work with torch namespace (#14042) X-Git-Tag: accepted/tizen/6.5/unified/20211028.231830~2484 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=374b7975692e2bb0e2ea673453c24eb7075848b9;p=platform%2Fupstream%2Fpytorch.git c10d doesn't work with torch namespace (#14042) Summary: If both `Utils.hpp` and the `torch` namespace is included in the same file, the compiler won't know which fmap to use. I believe this is because of ADL. This change fixes that issue for me. Pull Request resolved: https://github.com/pytorch/pytorch/pull/14042 Reviewed By: ezyang Differential Revision: D13283810 Pulled By: ebetica fbshipit-source-id: b68233336518230ba730e83ddac1226a66896533 --- diff --git a/torch/lib/c10d/Utils.hpp b/torch/lib/c10d/Utils.hpp index 752d8e4..1756ebf 100644 --- a/torch/lib/c10d/Utils.hpp +++ b/torch/lib/c10d/Utils.hpp @@ -215,7 +215,7 @@ inline at::Tensor flattenDenseTensors(at::TensorList tensors) { if (tensors.size() == 1) { return flatten(tensors[0]); } - return at::cat(fmap(tensors, flatten)); + return at::cat(::c10d::fmap(tensors, flatten)); } inline at::Tensor newLikeFlat(