Revert "Dynamo, FX, Inductor Progress Bars (#88384)"

This reverts commit db0ce4acf3c84d54e468154ead6d773539a2b597.

Reverted https://github.com/pytorch/pytorch/pull/88384 on behalf of https://github.com/malfet due to Broke test_public_bindings across the board
This commit is contained in:
PyTorch MergeBot
2022-12-09 16:32:25 +00:00
parent eeb3f8aa54
commit 6581063583
12 changed files with 39 additions and 111 deletions

View File

@ -16,42 +16,44 @@ from urllib.request import urlopen, Request
from urllib.parse import urlparse # noqa: F401
from torch.serialization import MAP_LOCATION
class Faketqdm(object): # type: ignore[no-redef]
def __init__(self, total=None, disable=False,
unit=None, *args, **kwargs):
self.total = total
self.disable = disable
self.n = 0
# Ignore all extra *args and **kwargs lest you want to reinvent tqdm
def update(self, n):
if self.disable:
return
self.n += n
if self.total is None:
sys.stderr.write("\r{0:.1f} bytes".format(self.n))
else:
sys.stderr.write("\r{0:.1f}%".format(100 * self.n / float(self.total)))
sys.stderr.flush()
def close(self):
self.disable = True
def __enter__(self):
return self
def __exit__(self, exc_type, exc_val, exc_tb):
if self.disable:
return
sys.stderr.write('\n')
try:
from tqdm import tqdm # If tqdm is installed use it, otherwise use the fake wrapper
from tqdm.auto import tqdm # automatically select proper tqdm submodule if available
except ImportError:
tqdm = Faketqdm
try:
from tqdm import tqdm
except ImportError:
# fake tqdm if it's not installed
class tqdm(object): # type: ignore[no-redef]
def __init__(self, total=None, disable=False,
unit=None, unit_scale=None, unit_divisor=None):
self.total = total
self.disable = disable
self.n = 0
# ignore unit, unit_scale, unit_divisor; they're just for real tqdm
def update(self, n):
if self.disable:
return
self.n += n
if self.total is None:
sys.stderr.write("\r{0:.1f} bytes".format(self.n))
else:
sys.stderr.write("\r{0:.1f}%".format(100 * self.n / float(self.total)))
sys.stderr.flush()
def close(self):
self.disable = True
def __enter__(self):
return self
def __exit__(self, exc_type, exc_val, exc_tb):
if self.disable:
return
sys.stderr.write('\n')
__all__ = [
'download_url_to_file',