Files
pytorch/torch/_streambase.py
Xuehai Pan 93e249969b [BE] enable ruff rule RSE and remove useless parentheses in raise statements (#124261)
Remove useless parentheses in `raise` statements if the exception type is raised with no argument.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/124261
Approved by: https://github.com/albanD
2024-04-17 19:29:34 +00:00

46 lines
1009 B
Python

from abc import ABC, abstractmethod
class _StreamBase(ABC):
r"""Base stream class abstraction for multi backends Stream to herit from"""
@abstractmethod
def wait_event(self, event):
raise NotImplementedError
@abstractmethod
def wait_stream(self, stream):
raise NotImplementedError
@abstractmethod
def record_event(self, event=None):
raise NotImplementedError
@abstractmethod
def query(self):
raise NotImplementedError
@abstractmethod
def synchronize(self):
raise NotImplementedError
@abstractmethod
def __eq__(self, stream):
raise NotImplementedError
class _EventBase(ABC):
r"""Base Event class abstraction for multi backends Event to herit from"""
@abstractmethod
def wait(self, stream=None):
raise NotImplementedError
@abstractmethod
def query(self):
raise NotImplementedError
@abstractmethod
def synchronize(self):
raise NotImplementedError