Using torch rpc with a function defined remotely

I would like to use rpc to run a function remotely. All the examples in the documentation have a method that is defined with in the same script or is from torch. I was wondering if its possible to use rpc.rpc_sync with some sort of a proxy func. For example, with xmlrpc it is possible to do the following:

import xmlrpc.client

with xmlrpc.client.ServerProxy("http://localhost:8000/") as proxy:
    print("3 is even: %s" % str(proxy.is_even(3)))
    print("100 is even: %s" % str(proxy.is_even(100)))

Note that is_even is not defined in this client script.

The function needs to be defined in both scripts. The function name and arguments are pickled and then communicated across ranks, so the each rank needs to have the same function definition.