base.py 235 B

1234567891011121314
  1. try:
  2. import chainer
  3. except ImportError:
  4. has_chainer = False
  5. else:
  6. has_chainer = True
  7. from abc import ABC
  8. class BaseChainerMixin(ABC):
  9. def chainer_check(self):
  10. global has_chainer
  11. assert has_chainer, "Please install chainer!"