pytorch

Форк
0
/
_streambase.py 
46 строк · 1.1 Кб
1
# mypy: allow-untyped-defs
2
from abc import ABC, abstractmethod
3

4

5
class _StreamBase(ABC):
6
    r"""Base stream class abstraction for multi backends Stream to herit from"""
7

8
    @abstractmethod
9
    def wait_event(self, event) -> None:
10
        raise NotImplementedError
11

12
    @abstractmethod
13
    def wait_stream(self, stream) -> None:
14
        raise NotImplementedError
15

16
    @abstractmethod
17
    def record_event(self, event=None) -> None:
18
        raise NotImplementedError
19

20
    @abstractmethod
21
    def query(self) -> bool:
22
        raise NotImplementedError
23

24
    @abstractmethod
25
    def synchronize(self) -> None:
26
        raise NotImplementedError
27

28
    @abstractmethod
29
    def __eq__(self, stream) -> bool:
30
        raise NotImplementedError
31

32

33
class _EventBase(ABC):
34
    r"""Base Event class abstraction for multi backends Event to herit from"""
35

36
    @abstractmethod
37
    def wait(self, stream=None) -> None:
38
        raise NotImplementedError
39

40
    @abstractmethod
41
    def query(self) -> bool:
42
        raise NotImplementedError
43

44
    @abstractmethod
45
    def synchronize(self) -> None:
46
        raise NotImplementedError
47

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.