1
0
Fork 0
mirror of https://github.com/deepfakes/faceswap synced 2025-06-08 20:13:52 -04:00
faceswap/tests/startup_test.py
torzdf 815c843f63
Simple backend unit tests (#1020)
* Add simple backend tests for lib.model
* Document lib.model
* Fix GMSD Loss for AMD
* Remove obsolete code from lib.model
2020-05-12 23:46:04 +01:00

18 lines
606 B
Python

#!/usr/bin/env python3
""" Sanity checks for Faceswap. """
import inspect
import pytest
from keras import backend as K
from lib.utils import get_backend
@pytest.mark.parametrize('dummy', [None], ids=[get_backend().upper()])
def test_backend(dummy): # pylint:disable=unused-argument
""" Sanity check to ensure that Keras backend is returning the correct object type. """
backend = get_backend()
test_var = K.variable((1, 1, 4, 4))
lib = inspect.getmodule(test_var).__name__.split(".")[0]
assert (backend == "cpu" and lib == "tensorflow") or (backend == "amd" and lib == "plaidml")