code: def _build_fixed_multi_output(
      averaged_outs,
      last_outs,
      outputs,
      batch_positions,
      varying_rows,
      num_varying_rows,
      link,
      linearizing_weights,
  ):
      # here we can assume that the outputs will always be the same size, and we need
      # to carry over evaluation outputs
      sample_count = last_outs.shape[0]
      for i in range(0, len(averaged_outs)):
          if batch_positions[i] < batch_positions[i + 1]:
              if num_varying_rows[i] == sample_count:
                  last_outs[:] = outputs[
                      batch_positions[i] : batch_positions[i + 1]
                  ]
              else:
                  last_outs[varying_rows[i]] = outputs[
                      batch_positions[i] : batch_positions[i + 1]
                  ]
              # averaged_outs[i] = link(np.mean(last_outs))
              if linearizing_weights is not None:
                  for j in range(last_outs.shape[-1]):
                      averaged_outs[i, j] = np.mean(
                          linearizing_weights[:, j]
                          * link(last_outs[:, j])
                      )
              else:
                  for j in range(
                      last_outs.shape[-1]
                  ):  # using -1 is important
                      averaged_outs[i, j] = link(
                          np.mean(last_outs[:, j])
                      )  # we can't just do np.mean(last_outs, 0) because that fails to numba compile
          else:
              averaged_outs[i] = averaged_outs[i - 1]
  
imports: import copy
  import numpy
  import scipy.sparse
  from numba import njit
  from ..None import links
label_desc: Use image node_id 6 for calling a global function with example usage: _build_fixed_multi_output(averaged_outs, last_outs, outputs, batch_positions, varying_rows, num_varying_rows, link, linearizing_weights) without return types