def set_os_env(select_device): if select_device == 'CPU': # run on TF only ngraph_bridge.disable() else: if not ngraph_bridge.is_enabled(): ngraph_bridge.enable() assert select_device[: 7] == "NGRAPH_", "Expecting device name to start with NGRAPH_" back_end = select_device.split("NGRAPH_") os.environ['NGRAPH_TF_BACKEND'] = back_end[1]
def test_enable(self): ngraph_bridge.enable() assert ngraph_bridge.is_enabled() == 1