Returns true if a given node contains a tensor with more than 4 dimensions
(node: torch.fx.Node)
| 716 | |
| 717 | |
| 718 | def tensor_node_is_high_dim(node: torch.fx.Node) -> bool: |
| 719 | """ |
| 720 | Returns true if a given node contains a tensor with more than 4 dimensions |
| 721 | """ |
| 722 | if isinstance(node.meta["val"], FakeTensor): |
| 723 | return len(node.meta["val"].shape) > 4 |
| 724 | if isinstance(node.meta["val"], list) or isinstance(node.meta["val"], tuple): |
| 725 | for fake_tensor in node.meta["val"]: |
| 726 | if isinstance(fake_tensor, FakeTensor): |
| 727 | if len(fake_tensor.shape) > 4: |
| 728 | return True |
| 729 | return False |
| 730 | |
| 731 | |
| 732 | def required_image_extents(sizes: torch.Size, layout: VkMemoryLayout) -> ImageExtents: |
no outgoing calls
no test coverage detected