class_docstr: Intel Habana(HPU) accelerators.
class_docstr_tok: ["Intel","Habana","(","HPU",")","accelerators","."]
docstr: Attempt to detect the number of HPUs on this machine.
  Returns:
      The number of HPUs if any were detected, otherwise 0.
docstr_tok: ["Attempt","to","detect","the","number","of","HPUs","on","this","machine",".","Returns",":","The","number","of","HPUs","if","any","were","detected",",","otherwise","0","."]
code: def get_current_node_num_accelerators() -> int:
      """Attempt to detect the number of HPUs on this machine.
      Returns:
          The number of HPUs if any were detected, otherwise 0.
      """
      if HPU_PACKAGE_AVAILABLE:
          import habana_frameworks.torch.hpu as torch_hpu
  
          if torch_hpu.is_available():
              return torch_hpu.device_count()
          else:
              logging.info("HPU devices not available")
              return 0
      else:
          return 0
  
file_path: ray/python/ray/_private/accelerators/hpu.py
imports: import os
  import logging
  from typing import Optional, List, Tuple
  from functools import lru_cache
  from importlib.util import find_spec
  from ray._private.accelerators.accelerator import AcceleratorManager
label_desc: Use image node_id 4 for calling the HPUAcceleratorManager obj's underlying member method code with example usage: obj.get_current_node_num_accelerators() and returns: int, torch_hpu, int