MCPcopy Create free account
hub / github.com/NVIDIA/TensorRT / alignData

Function alignData

samples/trtexec/profiler.py:128–145  ·  view source on GitHub ↗

Align and merge reference and target profiles

(reference, profile, threshold)

Source from the content-addressed store, hash-verified

126
127
128def alignData(reference, profile, threshold):
129 """Align and merge reference and target profiles"""
130
131 alignedData = []
132 for ref in reference:
133 prof = findAndRemove(profile, ref["name"])
134
135 if prof:
136 diff = (prof["averageMs"] / ref["averageMs"] - 1) * 100
137 if abs(diff) >= threshold:
138 alignedData.append(mergeRow(ref, prof, diff))
139 else:
140 alignedData.append(mergeRow(ref, None, None))
141
142 for prof in profile:
143 alignedData.append(mergeRow(None, prof, None))
144
145 return alignedData
146
147
148def main():

Callers 1

mainFunction · 0.85

Calls 4

findAndRemoveFunction · 0.85
mergeRowFunction · 0.85
absFunction · 0.50
appendMethod · 0.45

Tested by

no test coverage detected