~magnusmorton/delayrepay

f51bdaf0308c1ff814fefdf2f83e47bd745db144 — Magnus Morton 5 months ago e717043
added run and fallback etc.
1 files changed, 8 insertions(+), 0 deletions(-)

M delayrepay/cpu.py
M delayrepay/cpu.py => delayrepay/cpu.py +8 -0
@@ 1,5 1,8 @@
import numpy
from .visitor import Visitor

np = numpy
fallback = numpy

class CpuVisitor(Visitor):
    def visit_NPArray(self, node):


@@ 16,3 19,8 @@ class CpuVisitor(Visitor):

    def visit_BinaryNumpyEx(self, node):
        return node.func(*self.visit(node.children))


def run(ex):
    visitor = CpuVisitor()
    return visitor.visit(ex)