|
Algorithm 1 Inference Time Calculation |
| 1: procedure calculateInferenceTime(, ) |
| 2: Variables:
|
| 3: , , , : float; |
| 4: times: list; |
| 5: i: int; |
| 6: |
| 7: for do
|
| 8:
|
▹ Get the input data for the current sample |
| 9:
|
▹ Reshape the input to match the expected shape |
| 10:
|
▹ Record the start time |
| 11:
|
▹ Perform the forward pass to get the prediction |
| 12:
|
▹ Calculate the inference time |
| 13:
|
▹ Append the inference time to the list
|
| 14: end for
|
| 15:
|
▹ Calculate the mean inference time
|
| 16:
|
▹ Calculate the standard deviation of inference times
|
| 17: return ,
|
| 18: end procedure
|