With torch models

from concrete import fhe

@fhe.module()
class Counter:
    @fhe.function({"x": "encrypted"})
    def inc(x):
        return (x + 1) % 20

    @fhe.function({"x": "encrypted"})
    def dec(x):
        return (x - 1) % 20

Can these be used with compile torch model to fhe( combining a pytorch MLP with a custom function)? Can you give an example?

It’s not possible to do this easily for now. But a workaround is maybe doable. Check out this PR:

in the _developement.py file there is a

class DFApiV2:

which is a Concrete module that includes a forward function for a CML model.

1 Like

Thankyou @andrei-stoian-zama for your answer