Skip to content

Commit

Permalink
remove legacy verbosity code
Browse files Browse the repository at this point in the history
  • Loading branch information
Sam-Armstrong committed Sep 18, 2024
1 parent 27a70c0 commit 18e6d4f
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 27 deletions.
10 changes: 0 additions & 10 deletions docs/overview/design/building_blocks.rst
Original file line number Diff line number Diff line change
Expand Up @@ -354,15 +354,11 @@ The contents of this function are as follows:
# if a global backend has been set with set_backend then this will be returned
if backend_stack:
f = backend_stack[-1]
if verbosity.level > 0:
verbosity.cprint(f"Using backend from stack: {f}")
return f
# if no global backend exists, we try to infer the backend from the arguments
f = _determine_backend_from_args(list(args) + list(kwargs.values()))
if f is not None:
if verbosity.level > 0:
verbosity.cprint(f"Using backend from type: {f}")
implicit_backend = f.current_backend_str()
return f
return importlib.import_module(_backend_dict[implicit_backend])
Expand Down Expand Up @@ -396,12 +392,6 @@ The following is a slightly simplified version of this code for illustration, wh
# update global ivy.__dict__ with this method
ivy.__dict__[k] = backend.__dict__[k]
# maybe log to the terminal
if verbosity.level > 0:
verbosity.cprint(
f'Backend stack: {backend_stack}'
)
The functions implemented by the backend-specific backend such as :code:`ivy.functional.backends.torch` only constitute a subset of the full Ivy API.
This is because many higher level functions are written as a composition of lower level Ivy functions.
These functions therefore do not need to be written independently for each backend framework.
Expand Down
10 changes: 1 addition & 9 deletions ivy/utils/backend/handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import functools
import numpy as np
import gc
from ivy.utils import _importlib, verbosity
from ivy.utils import _importlib

# local
from ivy.func_wrapper import _wrap_function
Expand Down Expand Up @@ -181,16 +181,12 @@ def current_backend(*args, **kwargs):
# set_backend then this will be returned
if backend_stack:
f = backend_stack[-1]
if verbosity.level > 0:
verbosity.cprint(f"Using backend from stack: {f}")
return f

# if no global backend exists, we try to infer
# the backend from the arguments
f = _determine_backend_from_args(list(args) + list(kwargs.values()))
if f is not None:
if verbosity.level > 0:
verbosity.cprint(f"Using backend from type: {f}")
implicit_backend = f.current_backend_str()
return f
return importlib.import_module(_backend_dict[implicit_backend])
Expand Down Expand Up @@ -383,8 +379,6 @@ def set_backend(backend: str, dynamic: bool = False):
dynamic_backend_converter(backend_stack)
for sub_backend in ivy.available_sub_backends:
ivy.set_sub_backend(sub_backend)
if verbosity.level > 0:
verbosity.cprint(f"backend stack: {backend_stack}")
_handle_inplace_mode()
return ivy

Expand Down Expand Up @@ -500,8 +494,6 @@ def previous_backend():
ivy.__dict__[k] = v
if k in ivy.functional.__dict__ and not k.startswith("__"):
ivy.functional.__dict__[k] = v
if verbosity.level > 0:
verbosity.cprint(f"backend stack: {backend_stack}")
_handle_inplace_mode()
return backend

Expand Down
8 changes: 0 additions & 8 deletions ivy/utils/verbosity.py

This file was deleted.

0 comments on commit 18e6d4f

Please sign in to comment.