Skip to content

Commit

Permalink
more examples for set backend
Browse files Browse the repository at this point in the history
  • Loading branch information
rogerwwww committed Nov 9, 2023
1 parent a674965 commit 0c3e108
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pygmtools/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ def set_backend(new_backend: str):
>>> import pygmtools as pygm # numpy is the default backend
>>> pygm.set_backend('pytorch') # set backend to pytorch, it will through an error if torch is not installed
>>> pygm.set_backend('tf') # throw an error, provide potential matches
ValueError: Unknown backend tf. Did you mean tensorflow? Supported backends: ['numpy', 'pytorch', 'jittor', 'paddle', 'mindspore', 'tensorflow']
>>> pygm.set_backend('tensorflow') # this is the correct key and will work
"""
new_backend = new_backend.lower()
if new_backend not in pygmtools.SUPPORTED_BACKENDS:
Expand Down

0 comments on commit 0c3e108

Please sign in to comment.