class_docstr: Base class for torch backend outlier detection algorithms.
class_docstr_tok: ["Base","class","for","torch","backend","outlier","detection","algorithms","."]
docstr: Converts input to frontend data format.
  
  This is an interface method that ensures that the output of the outlier detector is in a common format for
  different backends. Mostly this means converting `torch.tensors` to `np.ndarray`. If `arg` is a
  `TorchOutlierDetectorOutput` object, we call its `to_frontend_dtype` method. Otherwise, if `arg` is a
  `torch.Tensor`, we convert it to a `numpy` array.
  
  Parameters
  ----------
  x
      Data to convert.
  
  Returns
  -------
  `np.ndarray` or dictionary of containing `numpy` arrays
docstr_tok: ["Converts","input","to","frontend","data","format",".","This","is","an","interface","method","that","ensures","that","the","output","of","the","outlier","detector","is","in","a","common","format","for","different","backends",".","Mostly","this","means","converting","`","torch.tensors","`","to","`","np.ndarray","`",".","If","`","arg","`","is","a","`","TorchOutlierDetectorOutput","`","object",",","we","call","its","`","to_frontend_dtype","`","method",".","Otherwise",",","if","`","arg","`","is","a","`","torch.Tensor","`",",","we","convert","it","to","a","`","numpy","`","array",".","Parameters","--","--","--","--","--","x","Data","to","convert",".","Returns","--","--","--","-","`","np.ndarray","`","or","dictionary","of","containing","`","numpy","`","arrays"]
code: def _to_frontend_dtype(
      arg: Union[torch.Tensor, TorchOutlierDetectorOutput]
  ) -> Union[np.ndarray, Dict[str, np.ndarray]]:
      """Converts input to frontend data format.
  
      This is an interface method that ensures that the output of the outlier detector is in a common format for
      different backends. Mostly this means converting `torch.tensors` to `np.ndarray`. If `arg` is a
      `TorchOutlierDetectorOutput` object, we call its `to_frontend_dtype` method. Otherwise, if `arg` is a
      `torch.Tensor`, we convert it to a `numpy` array.
  
      Parameters
      ----------
      x
          Data to convert.
  
      Returns
      -------
      `np.ndarray` or dictionary of containing `numpy` arrays
      """
      return to_frontend_dtype(arg)
  
imports: from typing import List, Union, Optional, Dict
  from dataclasses import dataclass, fields
  from abc import ABC, abstractmethod
  import numpy
  import torch
  from alibi_detect.od.pytorch.ensemble import FitMixinTorch
  from alibi_detect.utils.pytorch.misc import get_device
  from alibi_detect.exceptions import ThresholdNotInferredError
  from alibi_detect.utils._types import TorchDeviceType
label_desc: Use image node_id 4 for calling the TorchOutlierDetector obj's underlying member method code with example usage: obj._to_frontend_dtype(arg) and returns: to_frontend_dtype