Skip to content

Commit

Permalink
fix: rename base classes
Browse files Browse the repository at this point in the history
  • Loading branch information
nan-wang committed May 5, 2020
1 parent 67cf25f commit 9e3c897
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions jina/executors/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ def __init__(self, *args, **kwargs):
self._last_snapshot_ts = datetime.now()
self._drivers = {} # type: Dict[str, List['BaseDriver']]
self._attached_pea = None
self._backend = 'tensorflow'
self._backend = None

def _post_init_wrapper(self, _metas: Dict = None, _requests: Dict = None, fill_in_metas: bool = True):
with TimeContext('post initiating, this may take some time', self.logger):
Expand Down Expand Up @@ -560,7 +560,7 @@ def __call__(self, req_type, *args, **kwargs):
raise NoDriverForRequest(req_type)


class _BaseFramewordExecutor(BaseExecutor):
class BaseFramewordExecutor(BaseExecutor):
def post_init(self):
super().post_init()
self.build_model()
Expand All @@ -573,7 +573,7 @@ def set_device(self):
raise NotImplementedError


class BaseTorchExecutor(_BaseFramewordExecutor):
class BaseTorchExecutor(BaseFramewordExecutor):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self._backend = 'pytorch'
Expand All @@ -591,7 +591,7 @@ def set_device(self):
self.model.set_providers(self._device)


class BaseTfExecutor(_BaseFramewordExecutor):
class BaseTfExecutor(BaseFramewordExecutor):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self._backend = 'tensorflow'
Expand All @@ -601,7 +601,7 @@ def set_device(self):
tf.config.experimental.set_visible_devices(self._device)


class BasePaddleExecutor(_BaseFramewordExecutor):
class BasePaddleExecutor(BaseFramewordExecutor):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self._backend = 'paddlepaddle'
Expand Down
4 changes: 2 additions & 2 deletions jina/executors/encoders/nlp/transformer.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
from .. import BaseTextEncoder
from ..helper import reduce_mean, reduce_max, reduce_min, reduce_cls
from ...decorators import batching, as_ndarray
from ... import _BaseFramewordExecutor, BaseTfExecutor, BaseTorchExecutor
from ... import BaseFramewordExecutor, BaseTfExecutor, BaseTorchExecutor


class BaseTransformerEncoder(_BaseFramewordExecutor):
class BaseTransformerEncoder(BaseFramewordExecutor):
"""
:class:`TransformerTextEncoder` encodes data from an array of string in size `B` into an ndarray in size `B x D`.
"""
Expand Down

0 comments on commit 9e3c897

Please sign in to comment.