Summary:
Applies new import merging and sorting from µsort v1.0.
When merging imports, µsort will make a best-effort to move associated
comments to match merged elements, but there are known limitations due to
the diynamic nature of Python and developer tooling. These changes should
not produce any dangerous runtime changes, but may require touch-ups to
satisfy linters and other tooling.
Note that µsort uses case-insensitive, lexicographical sorting, which
results in a different ordering compared to isort. This provides a more
consistent sorting order, matching the case-insensitive order used when
sorting import statements by module name, and ensures that "frog", "FROG",
and "Frog" always sort next to each other.
For details on µsort's sorting and merging semantics, see the user guide:
https://usort.readthedocs.io/en/stable/guide.html#sorting
Test Plan: S271899
Reviewed By: lisroach
Differential Revision: D36402110
Pull Request resolved: https://github.com/pytorch/pytorch/pull/78973
Approved by: https://github.com/osalpekar
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/74998
this is a cleaned-up version of a util that I commonly use to figure out where new transitive (surprise!) dependencies come from when a model breaks, since it can be difficult in large models to tell exactly what code change indirectly added the depdendency. I tried to keep the opinionated bits out of OSS as much as possible.
Reviewed By: PaliC
Differential Revision: D35265017
fbshipit-source-id: e126e03aa113db6ab79d32d86a69bcbba844875e
(cherry picked from commit ffa0f4b0a294cbcf7413b176d0d2fa0a605b3b9e)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/61146
Track predecessors of nodes in DiGraph in order to enable cleaner dependency visualization code.
Test Plan: Imported from OSS
Reviewed By: suo
Differential Revision: D29559682
Pulled By: Lilyjjo
fbshipit-source-id: 06f51b1108423aece5bdd72a7b82ab736e5e4f94
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/57337
Add a really simple graph data sturcutre for tracking dependencies. API
based on networkx, but I didn't want to require the dependency.
Differential Revision: D28114186
Test Plan: Imported from OSS
Reviewed By: VitalyFedyunin
Pulled By: suo
fbshipit-source-id: 802fd067017e493a48d6672538080e61d249accd