예제 #1
0
def test_framework_versions(docker_image, processor, required_versions):
    with Container(docker_image, processor) as c:
        output = c.execute_command(['pip', 'freeze'])
        lines = output.splitlines()
        result = sorted([v for v in lines if v in required_versions])

        assert required_versions == result
예제 #2
0
def test_gpu_devices_availability(docker_image, processor):
    script = os.path.join(SCRIPT_PATH, '../resources/gpu_device_placement.py')

    try:
        with Container(docker_image, processor) as c:
            c.copy(script, '/')
            c.execute_command(['python', '/gpu_device_placement.py'])
    except ValueError:
        pytest.fail(
            "Can not access GPUs from GPU image.\n" +
            "Verify that image has tensorflow-gpu installed and runs on GPU instance."
        )