File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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 ]} " )
You can’t perform that action at this time.
0 commit comments