Skip to content

Commit 8f992e6

Browse files
committed
code comments NFC
1 parent d35326e commit 8f992e6

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

tools/lh-run

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ if __name__ == "__main__":
145145
print(optimized_module)
146146

147147
# Initialize the device data
148+
# TODO: Allow automatic inspection of the payload module if the user doesn't provide input shapes.
148149
buffers = []
149150
for shape in args.input_shape:
150151
for sub_shape in shape.split(","):
@@ -153,9 +154,8 @@ if __name__ == "__main__":
153154
np.random.rand(*shape).astype(_get_input_type(args.input_type))
154155
)
155156

156-
# Create the runner and execute the module.
157+
# Create the runner and execute/benchmark the module.
157158
runner = Runner(optimized_module, opt_level=args.O)
158-
159159
if args.benchmark:
160160
time_array = runner.benchmark(host_input_buffers=buffers)
161161
print(f"{len(time_array)} runs: {np.mean(time_array)} seconds")
@@ -165,6 +165,7 @@ if __name__ == "__main__":
165165
host_input_buffers=buffers,
166166
)
167167

168+
# Optionally print the output tensor after execution.
168169
if args.print_tensor > 0:
169170
idx = args.print_tensor - 1
170171
print(f"Output: {buffers[idx]}")

0 commit comments

Comments
 (0)