MCPcopy Create free account
hub / github.com/pytorch/executorch / num_tensor_arg_nodes

Function num_tensor_arg_nodes

backends/vulkan/utils.py:278–290  ·  view source on GitHub ↗

For a given node, return the number of argument nodes that are associated with tensors.

(node: torch.fx.Node)

Source from the content-addressed store, hash-verified

276
277
278def 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
293def num_tensors_in_node(node: torch.fx.Node) -> int:

Callers

nothing calls this directly

Calls 1

is_tensor_nodeFunction · 0.85

Tested by

no test coverage detected