-
Notifications
You must be signed in to change notification settings - Fork 360
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix/feat: Add Dynamo-only converter registry (#1944)
- Loading branch information
Showing
6 changed files
with
408 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import torch | ||
|
||
|
||
def dynamic_unsupported(node: torch.fx.Node) -> bool: | ||
# Validate that none of the inputs to the node have Dynamic shapes | ||
assert isinstance( | ||
node, torch.fx.Node | ||
), "Inputs to validator functions must be FX Nodes" | ||
|
||
# Check node value itself | ||
if getattr(node.meta["val"], "_has_symbolic_sizes_strides", False): | ||
return False | ||
|
||
# Check node arguments individually | ||
if any( | ||
getattr(arg.meta["val"], "_has_symbolic_sizes_strides", False) | ||
for arg in node.args | ||
if isinstance(arg, torch.fx.Node) | ||
): | ||
return False | ||
|
||
# Check node keyword arguments individually | ||
if any( | ||
getattr(kwarg.meta["val"], "_has_symbolic_sizes_strides", False) | ||
for kwarg in node.kwargs.values() | ||
if isinstance(kwarg, torch.fx.Node) | ||
): | ||
return False | ||
|
||
return True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.