code: def _predict_mps(pred_model, data_iter):
      data_iter.reset()
  
      output_list = []
  
      for batch in data_iter:
          input_data = batch.data
          pad = batch.pad
  
          # Feed the input into the model, converting to and from the
          # 4-dimensional NHWC shape that MPS expects.
          raw_output = pred_model.predict(
              _np.expand_dims(input_data, 1)
          )
          output = _np.squeeze(raw_output.asnumpy(), axis=1)
  
          trimmed_output = output[0 : output.shape[0] - pad].copy()
          output_list.append(trimmed_output)
  
      prediction_output = _np.concatenate(
          [output for output in output_list]
      )
  
      return prediction_output
  
file_path: turicreate/src/python/turicreate/toolkits/activity_classifier/_mps_model_architecture.py
imports: from __future__ import print_function
  from __future__ import division
  from __future__ import absolute_import
  import numpy
  from .._mps_utils import MpsLowLevelAPI, MpsLowLevelNetworkType, MpsLowLevelMode
label_desc: Use image node_id 4 for calling a global function with example usage: _predict_mps(pred_model, data_iter) and returns: prediction_output