tf-encrypted / moose

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

Arithmetic sugar for Expression #1109

Closed jvmncs closed 2 years ago

jvmncs commented 2 years ago

Closes #1104

Adds syntactic sugar in the edsl for the following python operators and builtins: a + b, a - b, a * b, a / b, a @ b, a += b, a -= b, a *= b, a /= b, a @= b, abs(a), -a, a < b, and a > b

Some noteworthy python operators/builtins that are not included: a // b, a == b, a != b, a <= b, a >= b, a & b, a ^ b, ~a, a | b, a ** b, a << b, a >> b, a % b, not a, +a, bool(a)

There are also some slicing/assignment/deletion operators that don't really make sense in the current context of the edsl (other than the existing Expression.__getitem__ used for slicing). The full list of python operators/builtins can be found here.