class_docstr: Class for importing MXNet Gluon models.
docstr: Perform prediction for a batch of inputs.
  
  :param x: Input samples.
  :param batch_size: Size of batches.
  :param training_mode: `True` for model set to training mode and `'False` for model set to evaluation mode.
  :return: Array of predictions of shape `(nb_inputs, nb_classes)`.
docstr_tok: ["Perform","prediction","for","a","batch","of","inputs",".",":","param","x",":","Input","samples",".",":","param","batch_size",":","Size","of","batches",".",":","param","training_mode",":","`","True","`","for","model","set","to","training","mode","and","`","'False","`","for","model","set","to","evaluation","mode",".",":","return",":","Array","of","predictions","of","shape","`","(","nb_inputs",",","nb_classes",")","`","."]
code: def predict(  # pylint: disable=W0221
      self,
      x: np.ndarray,
      batch_size: int = 128,
      training_mode: bool = False,
      **kwargs,
  ) -> np.ndarray:
      """
      Perform prediction for a batch of inputs.
  
      :param x: Input samples.
      :param batch_size: Size of batches.
      :param training_mode: `True` for model set to training mode and `'False` for model set to evaluation mode.
      :return: Array of predictions of shape `(nb_inputs, nb_classes)`.
      """
      import mxnet as mx
  
      # Apply preprocessing
      x_preprocessed, _ = self._apply_preprocessing(
          x, y=None, fit=False
      )
  
      # Run prediction with batch processing
      results = np.zeros(
          (x_preprocessed.shape[0], self.nb_classes), dtype=np.float32
      )
      num_batch = int(np.ceil(len(x_preprocessed) / float(batch_size)))
      for m in range(num_batch):
          # Batch indexes
          begin, end = (
              m * batch_size,
              min((m + 1) * batch_size, x_preprocessed.shape[0]),
          )
  
          # Predict
          x_batch = mx.nd.array(
              x_preprocessed[begin:end].astype(config.ART_NUMPY_DTYPE),
              ctx=self.ctx,
          )
          x_batch.attach_grad()
          with mx.autograd.record(train_mode=training_mode):
              preds = self._model(x_batch)
  
          results[begin:end] = preds.asnumpy()
  
      # Apply postprocessing
      predictions = self._apply_postprocessing(preds=results, fit=False)
  
      return predictions
  
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import logging
  import os
  from typing import List, Optional, Tuple, Union, TYPE_CHECKING
  import numpy
  import six
  from art import config
  from art.estimators.mxnet import MXEstimator
  from art.estimators.classification.classifier import ClassGradientsMixin, ClassifierMixin
  from art.utils import check_and_transform_label_format
label_desc: Use image node_id 8 for calling the MXClassifier obj's underlying member method code with example usage: obj.predict(x, batch_size, training_mode) and returns: predictions