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

Function _make_tensor_info

devtools/pte_tool/diff_pte.py:307–322  ·  view source on GitHub ↗
(
    evalue_idx: int,
    tensor: Tensor,
    op_map: Dict[int, List[OperatorUsage]],
)

Source from the content-addressed store, hash-verified

305
306
307def _make_tensor_info(
308 evalue_idx: int,
309 tensor: Tensor,
310 op_map: Dict[int, List[OperatorUsage]],
311) -> TensorInfo:
312 fqn = None
313 if tensor.extra_tensor_info and tensor.extra_tensor_info.fully_qualified_name:
314 fqn = tensor.extra_tensor_info.fully_qualified_name
315 return TensorInfo(
316 evalue_index=evalue_idx,
317 scalar_type=tensor.scalar_type,
318 sizes=list(tensor.sizes),
319 fqn=fqn,
320 data_buffer_idx=tensor.data_buffer_idx,
321 operator_usages=op_map.get(evalue_idx, []),
322 )
323
324
325def _diff_tensor_metadata(tensor_a: Tensor, tensor_b: Tensor) -> List[FieldDiff]:

Callers 2

_diff_tensorsFunction · 0.85
_diff_execution_planFunction · 0.85

Calls 2

TensorInfoClass · 0.85
getMethod · 0.45

Tested by

no test coverage detected