docstr: Linear variant of the PyTorch backend for PCA detector.
  
  Parameters
  ----------
  n_components:
      The number of dimensions in the principal subspace.
  device
      Device type used. The default tries to use the GPU and falls back on CPU if needed.
      Can be specified by passing either ``'cuda'``, ``'gpu'``, ``'cpu'`` or an instance of
      ``torch.device``.
docstr_tok: ["Linear","variant","of","the","PyTorch","backend","for","PCA","detector",".","Parameters","--","--","--","--","--","n_components",":","The","number","of","dimensions","in","the","principal","subspace",".","device","Device","type","used",".","The","default","tries","to","use","the","GPU","and","falls","back","on","CPU","if","needed",".","Can","be","specified","by","passing","either","``","'cuda","'","``",",","``","'gpu","'","``",",","``","'cpu","'","``","or","an","instance","of","``","torch.device","``","."]
code: def __init__(
      self,
      n_components: int,
      device: TorchDeviceType = None,
  ):
      """Linear variant of the PyTorch backend for PCA detector.
  
      Parameters
      ----------
      n_components:
          The number of dimensions in the principal subspace.
      device
          Device type used. The default tries to use the GPU and falls back on CPU if needed.
          Can be specified by passing either ``'cuda'``, ``'gpu'``, ``'cpu'`` or an instance of
          ``torch.device``.
      """
      super().__init__(device=device, n_components=n_components)
  
imports: from typing import Optional, Callable
  import torch
  from alibi_detect.od.pytorch.base import TorchOutlierDetector
  from alibi_detect.utils._types import TorchDeviceType
label_desc: Use image node_id 1 to create a new LinearPCATorch object from inherited base classes: PCATorch with example: obj = LinearPCATorch(n_components, device)