tf-encrypted / moose

Secure distributed dataflow framework for encrypted machine learning and data processing
Apache License 2.0
57 stars 15 forks source link

PyMoose: call computations as functions #1087

Closed mortendahl closed 2 years ago

mortendahl commented 2 years ago

Instead of (0)

runtime = pm.GrpcMooseRuntime({ ... })
results = runtime.evaluate_computation(my_computation)

we could do something like (1)

runtime = pm.GrpcMooseRuntime({ ... })
with runtime:
    results = my_computation()

and/or (2)

runtime = pm.GrpcMooseRuntime({ ... })
results = my_computation(runtime)

and/or (3)

runtime = pm.GrpcMooseRuntime({ ... })
runtime.set_default()
results = my_computation()

and/or (4) which is (3) with an implicit call to set_default

runtime = pm.GrpcMooseRuntime({ ... })
results = my_computation()

This issue should also make it easier to pass in arguments!