How to use the syft.func2plan function in syft

To help you get started, we’ve selected a few syft examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github OpenMined / PySyft / test / torch / pointers / test_pointer_protocol.py View on Github external
    @sy.func2plan(args_shape=[(1,)])
    def inc2(x):
        return x + 1
github OpenMined / PySyft / test / message / test_protocol.py View on Github external
    @sy.func2plan(args_shape=[(1,)])
    def inc3(x):
        return x + 1
github OpenMined / PySyft / test / message / test_plan.py View on Github external
        @sy.func2plan(args_shape=[(1,)], state=(th.tensor([1.0]),))
        def foo(x, state):
            (bias,) = state.read()
            x = x * 2
            return x + bias
github OpenMined / PySyft / test / message / test_plan.py View on Github external
    @sy.func2plan(args_shape=[(1,)])
    def plan_abs(data):
        return data.abs()
github OpenMined / PySyft / test / torch / pointers / test_pointer_plan.py View on Github external
    @sy.func2plan(args_shape=[(1,)], state=(th.tensor([1.0]),))
    def plan(x, state):
        (bias,) = state.read()
        return x + bias
github OpenMined / PySyft / test / message / test_protocol.py View on Github external
    @sy.func2plan(args_shape=[(1,)])
    def inc2(x):
        return x + 1
github OpenMined / PySyft / test / message / test_plan.py View on Github external
    @sy.func2plan()
    def plan_double(data):
        return -2 * data
github OpenMined / PySyft / test / message / test_plan.py View on Github external
        @sy.func2plan(args_shape=[(1, -20)])
        def _(data):
            return data  # pragma: no cover