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

Function _format_tensor_info

devtools/pte_tool/diff_pte.py:705–710  ·  view source on GitHub ↗
(info: TensorInfo)

Source from the content-addressed store, hash-verified

703
704
705def _format_tensor_info(info: TensorInfo) -> str:
706 kind = "CT" if info.data_buffer_idx > 0 else "T"
707 dtype = _SCALAR_TYPE_NAMES.get(info.scalar_type, str(info.scalar_type))
708 sizes_str = ",".join(str(s) for s in info.sizes)
709 fqn_str = f' "{info.fqn}"' if info.fqn else ""
710 return f"[idx={info.evalue_index}] {kind} {dtype}[{sizes_str}]{fqn_str}"
711
712
713def format_diff_result( # noqa: C901

Callers 1

format_diff_resultFunction · 0.85

Calls 1

getMethod · 0.45

Tested by

no test coverage detected