torch.fx.experimental.unification.utils.reverse_dict#
- torch.fx.experimental.unification.utils.reverse_dict(d)[source]#
Reverses direction of dependence dict.
>>> d = {"a": (1, 2), "b": (2, 3), "c": ()} >>> reverse_dict(d) {1: ('a',), 2: ('a', 'b'), 3: ('b',)}
Note
dict order is not deterministic. As we iterate on the input dict, it makes the output of this function depend on the dict order. So this function output order should be considered as nondeterministic.