From d575b30696ebd6bb76e55a6b8bd7acce8b51e335 Mon Sep 17 00:00:00 2001 From: hhakim <hakim.hadj-djilani@inria.fr> Date: Thu, 19 Nov 2020 10:59:39 +0100 Subject: [PATCH] Add inplace pyfaust.Faust ops: +=, -=, *=, @=. --- wrapper/python/pyfaust.py | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/wrapper/python/pyfaust.py b/wrapper/python/pyfaust.py index 774788b53..cf0f1b346 100644 --- a/wrapper/python/pyfaust.py +++ b/wrapper/python/pyfaust.py @@ -631,6 +631,38 @@ class Faust: F = F/s return F + def __imatmul__(F, A): + """ + Inplace operator. + F = F @ A + """ + F = F@A + return F + + def __imul__(F, A): + """ + Inplace operator. + F = F * A + """ + F = F*A + return F + + def __iadd__(F, A): + """ + Inplace operator. + F = F + A + """ + F = F+A + return F + + def __isub__(F, A): + """ + Inplace operator. + F = F - A + """ + F = F-A + return F + def __matmul__(F, A): """ Multiplies F by A which is a dense numpy.matrix/numpy.ndarray or a Faust object. -- GitLab