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

Function is_single_tensor_node

backends/vulkan/utils.py:219–229  ·  view source on GitHub ↗

Returns true if the given node produces a single tensor value

(node: torch.fx.Node)

Source from the content-addressed store, hash-verified

217
218
219def is_single_tensor_node(node: torch.fx.Node) -> bool:
220 """
221 Returns true if the given node produces a single tensor value
222 """
223 if "val" not in node.meta:
224 return False
225
226 if isinstance(node.meta["val"], FakeTensor):
227 return True
228
229 return False
230
231
232def is_tensor_collection_node(node: Any) -> bool:

Callers 4

ndim_ofFunction · 0.85
is_unsqueezed_vectorFunction · 0.85
get_node_val_strFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected