parameters: (runner: "Runner", img, cnt)
docstring: get tensor
docstring_summary: get tensor
docstring_tokens: get tensor
function: def runResnet50(runner: "Runner", img, cnt):
      """get tensor"""
      inputTensors = runner.get_input_tensors()
      outputTensors = runner.get_output_tensors()
      input_ndim = tuple(inputTensors[0].dims)
      pre_output_size = int(outputTensors[0].get_data_size() / input_ndim[0])
  
      output_ndim = tuple(outputTensors[0].dims)
      output_fixpos = outputTensors[0].get_attr("fix_point")
      output_scale = 1 / (2**output_fixpos)
      n_of_images = len(img)
      count = 0
      while count < cnt:
          runSize = input_ndim[0]
          """prepare batch input/output """
          inputData = [np.empty(input_ndim, dtype=np.int8, order="C")]
          outputData = [np.empty(output_ndim, dtype=np.int8, order="C")]
          """init input image to input buffer """
          for j in range(runSize):
              imageRun = inputData[0]
              imageRun[j, ...] = img[(count + j) % n_of_images].reshape(input_ndim[1:])
          """run with batch """
          job_id = runner.execute_async(inputData, outputData)
          runner.wait(job_id)
          """softmax&TopK calculate with batch """
          """Benchmark DPU FPS performance over Vitis AI APIs execute_async() and wait() """
          """Uncomment the following code snippet to include softmax calculation for model’s end-to-end FPS evaluation """
          #for j in range(runSize):
          #    softmax = CPUCalcSoftmax(outputData[0][j], pre_output_size, output_scale)
          #    TopK(softmax, pre_output_size, "./words.txt")
  
          count = count + runSize
function_tokens: def runResnet50 ( runner : "Runner" , img , cnt ) : inputTensors = runner . get_input_tensors ( ) outputTensors = runner . get_output_tensors ( ) input_ndim = tuple ( inputTensors [ 0 ] . dims ) pre_output_size = int ( outputTensors [ 0 ] . get_data_size ( ) / input_ndim [ 0 ] ) output_ndim = tuple ( outputTensors [ 0 ] . dims ) output_fixpos = outputTensors [ 0 ] . get_attr ( "fix_point" ) output_scale = 1 / ( 2 ** output_fixpos ) n_of_images = len ( img ) count = 0 while count < cnt : runSize = input_ndim [ 0 ] """prepare batch input/output """ inputData = [ np . empty ( input_ndim , dtype = np . int8 , order = "C" ) ] outputData = [ np . empty ( output_ndim , dtype = np . int8 , order = "C" ) ] """init input image to input buffer """ for j in range ( runSize ) : imageRun = inputData [ 0 ] imageRun [ j , ... ] = img [ ( count + j ) % n_of_images ] . reshape ( input_ndim [ 1 : ] ) """run with batch """ job_id = runner . execute_async ( inputData , outputData ) runner . wait ( job_id ) """softmax&TopK calculate with batch """ """Benchmark DPU FPS performance over Vitis AI APIs execute_async() and wait() """ """Uncomment the following code snippet to include softmax calculation for model’s end-to-end FPS evaluation """ #for j in range(runSize): #    softmax = CPUCalcSoftmax(outputData[0][j], pre_output_size, output_scale) #    TopK(softmax, pre_output_size, "./words.txt") count = count + runSize