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

Function _spec

extension/pytree/test/test.py:25–28  ·  view source on GitHub ↗
(o: Any)

Source from the content-addressed store, hash-verified

23
24# pyre-fixme[11]: Annotation `TreeSpec` is not defined as a type.
25def _spec(o: Any) -> TreeSpec:
26 # pyre-fixme[16]: Module `pytree` has no attribute `tree_flatten`.
27 _, spec = tree_flatten(o)
28 return spec
29
30
31# Constructs string representation of pytree spec of type specified by type_char (can be 'T' for tuple, 'L' for List) argument, that contains n children, each with single leaf.

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected