Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion mobile_cv/common/misc/cache_counter.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def get_stat_str(cls, counter):
return ret


class CacheCounter(object):
class CacheCounter:
def __init__(
self,
name,
Expand Down
4 changes: 2 additions & 2 deletions mobile_cv/common/misc/iter_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from typing import Any, Callable, List, Optional, Tuple, Union


class ValueKeepingGenerator(object):
class ValueKeepingGenerator:
def __init__(self, g):
self.gen = g
self.value = None
Expand Down Expand Up @@ -233,7 +233,7 @@ def create_pair(lhs, rhs):


@dataclass
class Pair(object):
class Pair:
lhs: Any
rhs: Any

Expand Down
6 changes: 3 additions & 3 deletions mobile_cv/common/misc/local_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import diskcache


class Timer(object):
class Timer:
def __init__(self):
self.reset()

Expand Down Expand Up @@ -42,7 +42,7 @@ def reset(self):
self.diff = 0.0


class TimerDict(object):
class TimerDict:
def __init__(self):
self.timers = {}

Expand All @@ -67,7 +67,7 @@ def print(self):
print(f"{name}: {item.average_time} ({item.total_time}, {item.calls})")


class LocalCache(object):
class LocalCache:
@classmethod
def Create(cls, prefix, num_shards, use_timer=False):
tmp_dir = tempfile.gettempdir()
Expand Down
2 changes: 1 addition & 1 deletion mobile_cv/common/misc/py.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ def new_func(*args, **kwargs):


# Copied from detectron2/utils/serialize.py
class PicklableWrapper(object):
class PicklableWrapper:
"""
Wrap an object to make it more picklable, note that it uses
heavy weight serialization libraries that are slower than pickle.
Expand Down
2 changes: 1 addition & 1 deletion mobile_cv/common/misc/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from mobile_cv.common.misc.oss_utils import fb_overwritable


class SubPackageInitFileTestMixin(object):
class SubPackageInitFileTestMixin:
"""
A helper for creating test to check every subpackage has an __init__.py file.

Expand Down
10 changes: 5 additions & 5 deletions mobile_cv/common/tests/test_iter_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,11 +203,11 @@ def test_linearize_remap(self):
to the original structure"""

@dataclass
class Type1(object):
class Type1:
name: str

@dataclass
class Type2(object):
class Type2:
name: str

adict = {
Expand Down Expand Up @@ -262,21 +262,21 @@ def test_linearize_remap_nested(self):
to the original structure"""

@dataclass
class Type1(object):
class Type1:
name: str

def process(self, _):
return self.name + "_t1"

@dataclass
class Type2(object):
class Type2:
name: str

def process(self, _):
return self.name + "_t2"

@dataclass
class TypeChoice(object):
class TypeChoice:
name: str
data: List[Any]

Expand Down