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

Function is_tensor_collection_node

backends/vulkan/utils.py:232–245  ·  view source on GitHub ↗

Returns true if the given node produces a collection of tensor values

(node: Any)

Source from the content-addressed store, hash-verified

230
231
232def 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
248def is_tensor_node(node: Any) -> bool:

Callers 1

get_node_val_strFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected