csarofeen / pytorch

Tensors and Dynamic neural networks in Python with strong GPU acceleration
http://pytorch.org
Other
26 stars 7 forks source link

Make return values of iter_visitor functions deterministic #769

Open naoyam opened 3 years ago

naoyam commented 3 years ago

Some of the functions in iter_visitor.h return std::unordered_set. Consider changing them to return deterministically ordered vectors instead.

While using unodered_set should not have any correctness problem, it can be a source of non-determinism, which we want to avoid.

getAllValsBetween was changed to return std::vector at #729.

naoyam commented 2 years ago

[ ] static std::unordered_set<Val*> getAllOutputsOf(const std::unordered_set<Val*>& of) [ ] static std::unordered_set<Val*> getAllDependentVals(const std::unordered_set<Val*>& of);