()
| 44 | prox = proxy.Proxy("127.0.0.1", web_port=web_port) |
| 45 | |
| 46 | def check(): |
| 47 | if not tvm.runtime.enabled("rpc"): |
| 48 | return |
| 49 | |
| 50 | server = multiprocessing.Process( |
| 51 | target=proxy.websocket_proxy_server, args=(f"ws://localhost:{web_port}/ws", "x1") |
| 52 | ) |
| 53 | # Need to make sure that the connection start after proxy comes up |
| 54 | time.sleep(0.1) |
| 55 | server.deamon = True |
| 56 | server.start() |
| 57 | client = rpc.connect(prox.host, prox.port, key="x1") |
| 58 | f1 = client.get_function("testing.echo") |
| 59 | assert f1(10) == 10 |
| 60 | assert f1("xyz") == "xyz" |
| 61 | |
| 62 | check() |
| 63 | except ImportError: |
no test coverage detected
searching dependent graphs…