Skip to content

Commit

Permalink
Remove get_available_gpus() which was unused (#295)
Browse files Browse the repository at this point in the history
  • Loading branch information
Pastafarianist authored and araffin committed May 8, 2019
1 parent fbd9f35 commit bea2eed
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 12 deletions.
1 change: 1 addition & 0 deletions docs/misc/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Release 2.5.2a0 (WIP)
--------------------

- Bugfix for ``VecEnvWrapper.__getattr__`` which enables access to class attributes inherited from parent classes.
- Removed ``get_available_gpus`` function which hadn't been used anywhere (@Pastafarianist)


Release 2.5.1 (2019-05-04)
Expand Down
12 changes: 0 additions & 12 deletions stable_baselines/common/tf_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -437,18 +437,6 @@ def display_var_info(_vars):
logger.info("Total model parameters: %0.2f million" % (count_params * 1e-6))


def get_available_gpus():
"""
Return a list of all the available GPUs
:return: ([str]) the GPUs available
"""
# recipe from here:
# https://stackoverflow.com/questions/38559755/how-to-get-current-available-gpus-in-tensorflow?utm_medium=organic&utm_source=google_rich_qa&utm_campaign=google_rich_qa
local_device_protos = device_lib.list_local_devices()
return [x.name for x in local_device_protos if x.device_type == 'GPU']


# ================================================================
# Saving variables
# ================================================================
Expand Down

0 comments on commit bea2eed

Please sign in to comment.