Returns true if the given node produces a collection of tensor values
(node: Any)
| 230 | |
| 231 | |
| 232 | def is_tensor_collection_node(node: Any) -> bool: |
| 233 | """ |
| 234 | Returns true if the given node produces a collection of tensor values |
| 235 | """ |
| 236 | if not isinstance(node, torch.fx.Node): |
| 237 | return False |
| 238 | |
| 239 | if "val" not in node.meta: |
| 240 | return False |
| 241 | |
| 242 | if isinstance(node.meta["val"], list) or isinstance(node.meta["val"], tuple): |
| 243 | return all(isinstance(x, FakeTensor) for x in node.meta["val"]) |
| 244 | |
| 245 | return False |
| 246 | |
| 247 | |
| 248 | def is_tensor_node(node: Any) -> bool: |