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

Function memory_format_enum

exir/tensor.py:266–275  ·  view source on GitHub ↗
(memory_format: torch.memory_format)

Source from the content-addressed store, hash-verified

264
265
266def memory_format_enum(memory_format: torch.memory_format) -> int:
267 internal_assert(
268 isinstance(memory_format, torch.memory_format),
269 "We only support torch.memory_format",
270 )
271 table = {
272 torch.contiguous_format: 0,
273 torch.preserve_format: 1,
274 }
275 return table[memory_format]
276
277
278scalar_type_table: Dict[torch.dtype, ScalarType] = {

Callers 1

_constant_to_evalueMethod · 0.90

Calls 1

internal_assertFunction · 0.90

Tested by

no test coverage detected