[OperatorImpl] Python OperatorImpl
Compare changes
Files
9@@ -102,5 +102,30 @@ class test_operator_binding(unittest.TestCase):
Operator.setImpl
methodimport aidge_core
class PythonReluImpl(aidge_core.OperatorImpl):
def __init__(self, op):
aidge_core.OperatorImpl.__init__(self) # Recquired to avoid type error !
def forward(self):
print("Forward defined in Python !")
custom_relu = aidge_core.GenericOperator("Relu", 1, 1, 1, name="myReLu")
custom_relu_op = custom_relu.get_operator()
custom_relu_op.forward()
custom_relu_op.set_impl(PythonReluImpl(custom_relu_op))
custom_relu_op.forward()
Copyright © Eclipse Foundation, Inc. All Rights Reserved. Privacy Policy | Terms of Use | Copyright Agent