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

Function ndim_of

backends/vulkan/utils.py:442–449  ·  view source on GitHub ↗

Returns the number of dimensions of the tensor produced by the given node

(node: Any)

Source from the content-addressed store, hash-verified

440
441
442def ndim_of(node: Any) -> Optional[int]:
443 """
444 Returns the number of dimensions of the tensor produced by the given node
445 """
446 if not is_single_tensor_node(node):
447 return None
448
449 return node.meta["val"].ndim
450
451
452def is_unsqueezed_vector(node: torch.fx.Node) -> bool:

Callers

nothing calls this directly

Calls 1

is_single_tensor_nodeFunction · 0.85

Tested by

no test coverage detected