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

Function layout_enum

exir/tensor.py:320–326  ·  view source on GitHub ↗
(layout: torch.layout)

Source from the content-addressed store, hash-verified

318
319
320def layout_enum(layout: torch.layout) -> int:
321 # TODO single source of truth.
322 table = {
323 torch.strided: 0,
324 torch.sparse_coo: 1,
325 }
326 return table[layout]
327
328
329def make_allocation_info(mem_id: int, mem_offset: int) -> schema.AllocationDetails:

Callers 3

_constant_to_evalueMethod · 0.90
_emit_prim_gettersMethod · 0.90
make_tensor_valueFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected