class_docstr: Container for PyTorch models mirroring Sklearn regressor API.
class_docstr_tok: ["Container","for","PyTorch","models","mirroring","Sklearn","regressor","API","."]
code: def _predict(self, *inputs):
      if self._is_regression:
          output = self.model.forward(*inputs).cpu().numpy()
          if len(output.shape) == 2 and output.shape[1] > 1:
              # Multioutput regression
              return output
          else:
              return output.ravel()
      elif self._is_anomaly_detection:
          return self.model.forward(*inputs)[0].cpu().numpy().ravel()
      else:
          return self.model.forward(*inputs)[0].cpu().numpy().ravel()
  
imports: import pickle
  import os
  import numpy
  import shutil
  import torch
  import warnings
  import hummingbird
  from hummingbird.ml._utils import pandas_installed, get_device, from_strings_to_ints, dump_versions, check_dumped_versions
  from hummingbird.ml.operator_converters import constants
  from hummingbird.ml.containers._sklearn_api_containers import SklearnContainer, SklearnContainerTransformer, SklearnContainerRegression, SklearnContainerClassification, SklearnContainerAnomalyDetection
label_desc: Use image node_id 1 for calling the PyTorchSklearnContainerRegression obj's underlying member method code with example usage: obj._predict() and returns: output, output, self, self