(memory_format: torch.memory_format)
| 264 | |
| 265 | |
| 266 | def 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 | |
| 278 | scalar_type_table: Dict[torch.dtype, ScalarType] = { |
no test coverage detected