For a given node, return the number of argument nodes that are associated with tensors.
(node: torch.fx.Node)
| 276 | |
| 277 | |
| 278 | def num_tensor_arg_nodes(node: torch.fx.Node) -> int: |
| 279 | """ |
| 280 | For a given node, return the number of argument nodes that are associated with |
| 281 | tensors. |
| 282 | """ |
| 283 | count = 0 |
| 284 | for arg_node in node.args: |
| 285 | if not isinstance(arg_node, torch.fx.Node): |
| 286 | continue |
| 287 | if is_tensor_node(arg_node): |
| 288 | count += 1 |
| 289 | |
| 290 | return count |
| 291 | |
| 292 | |
| 293 | def num_tensors_in_node(node: torch.fx.Node) -> int: |
nothing calls this directly
no test coverage detected