class_docstr: This class implements a regressor with the PyTorch framework.
class_docstr_tok: ["This","class","implements","a","regressor","with","the","PyTorch","framework","."]
docstr: Perform prediction for a batch of inputs.
  
  :param x: Sample input with shape as expected by the model.
  :param y: Target values (class labels) one-hot-encoded of shape `(nb_samples, nb_classes)` or indices of shape
            `(nb_samples,)`.
  :return: Tensor of predictions of shape `(nb_inputs, nb_classes)`.
docstr_tok: ["Perform","prediction","for","a","batch","of","inputs",".",":","param","x",":","Sample","input","with","shape","as","expected","by","the","model",".",":","param","y",":","Target","values","(","class","labels",")","one-hot-encoded","of","shape","`","(","nb_samples",",","nb_classes",")","`","or","indices","of","shape","`","(","nb_samples",",",")","`",".",":","return",":","Tensor","of","predictions","of","shape","`","(","nb_inputs",",","nb_classes",")","`","."]
code: def _predict_framework(
      self, x: "torch.Tensor", y: Optional["torch.Tensor"] = None
  ) -> Tuple["torch.Tensor", Optional["torch.Tensor"]]:
      """
      Perform prediction for a batch of inputs.
  
      :param x: Sample input with shape as expected by the model.
      :param y: Target values (class labels) one-hot-encoded of shape `(nb_samples, nb_classes)` or indices of shape
                `(nb_samples,)`.
      :return: Tensor of predictions of shape `(nb_inputs, nb_classes)`.
      """
      # Apply preprocessing
      x_preprocessed, y_preprocessed = self._apply_preprocessing(
          x, y=y, fit=False, no_grad=False
      )
  
      # Put the model in the eval mode
      self._model.eval()
  
      model_outputs = self._model(x_preprocessed)
      output = model_outputs[-1]
  
      return output, y_preprocessed
  
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import copy
  import logging
  import os
  import time
  from typing import Any, Dict, List, Optional, Tuple, Union, TYPE_CHECKING
  import numpy
  import six
  from art import config
  from art.estimators.regression.regressor import RegressorMixin
  from art.estimators.pytorch import PyTorchEstimator
label_desc: Use image node_id 11 for calling the PyTorchRegressor obj's underlying member method code with example usage: obj._predict_framework(x, y) and returns: output,  y_preprocessed