class_docstr: Accelerator for XLA devices, normally TPUs.
  
  .. warning::  Use of this accelerator beyond import and instantiation is experimental.
class_docstr_tok: ["Accelerator","for","XLA","devices",",","normally","TPUs",".","..","warning",":",":","Use","of","this","accelerator","beyond","import","and","instantiation","is","experimental","."]
docstr: Get the devices when set to auto.
docstr_tok: ["Get","the","devices","when","set","to","auto","."]
code: def auto_device_count() -> int:
      """Get the devices when set to auto."""
      if not _XLA_AVAILABLE:
          return 0
      if _XLA_GREATER_EQUAL_2_1:
          from torch_xla._internal import tpu
  
          return tpu.num_available_devices()
      from torch_xla.experimental import tpu
  
      device_count_on_version = {2: 8, 3: 8, 4: 4}
      return device_count_on_version.get(tpu.version(), 8)
  
imports: import functools
  from typing import Any, List, Union
  import torch
  from lightning_utilities.core.imports import RequirementCache
  from typing_extensions import override
  from lightning.fabric.accelerators.accelerator import Accelerator
  from lightning.fabric.accelerators.registry import _AcceleratorRegistry
  from lightning.fabric.utilities.device_parser import _check_data_type
label_desc: Use image node_id 6 for calling the XLAAccelerator obj's underlying member method code with example usage: obj.auto_device_count() and returns: device_count_on_version, int, tpu