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

Function fill_tensor_info

examples/qualcomm/util_scripts/cli.py:84–100  ·  view source on GitHub ↗
(info, qnn_tensors, category)

Source from the content-addressed store, hash-verified

82 dtype_map.setdefault(v, k)
83
84 def fill_tensor_info(info, qnn_tensors, category):
85 for tensor in qnn_tensors:
86 encoding = tensor.GetEncodings()
87 quantization_info = {
88 "scale": encoding.data["scale"].tolist(),
89 "offset": encoding.data["offset"].tolist(),
90 "axis": encoding.axis,
91 }
92
93 info[category].append(
94 {
95 "name": tensor.GetName(),
96 "shape": tensor.GetDims().tolist(),
97 "dtype": dtype_map[tensor.GetDataType()],
98 "encoding": quantization_info,
99 }
100 )
101
102 in_key, out_key = "inputs", "outputs"
103 tensor_info = {in_key: [], out_key: []}

Callers 1

get_io_infoFunction · 0.70

Calls 1

appendMethod · 0.45

Tested by

no test coverage detected