示例#1
0
文件: graph.py 项目: atbrox/blaze
    def __init__(self, op, operands):
        self.op = op
        self.children = operands
        self.operands = operands
        self._opaque = False

        # If all the operands to the expression are simple
        # numeric types then go ahead and determine what the
        # datashape of this operator is before we hit eval().

        # Examples:
        #    IntNode, IntNode
        #    IntNode, FloatNode

        # minor hack until we get graph level numbering of
        # expression objects
        self.uuid = str(uuid4())

        # Make sure the graph makes sense given the signature of
        # the function. Does naive type checking and inference.

        # TODO: type inference on the aterm graph
        self.datashape = coretypes.broadcast(*operands)
示例#2
0
文件: graph.py 项目: garfee/blaze
    def __init__(self, op, operands):
        self.op = op
        self.children = operands
        self.operands = operands
        self._opaque = False

        # If all the operands to the expression are simple
        # numeric types then go ahead and determine what the
        # datashape of this operator is before we hit eval().

        # Examples:
        #    IntNode, IntNode
        #    IntNode, FloatNode

        # minor hack until we get graph level numbering of
        # expression objects
        self.uuid = str(uuid4())

        # Make sure the graph makes sense given the signature of
        # the function. Does naive type checking and inference.

        # TODO: type inference on the aterm graph
        self.datashape = coretypes.broadcast(*operands)
示例#3
0
def test_broadcast():
    x = NDArray([1,2,3])
    y = NDArray([1,2,3])
    res = broadcast(x,y)
示例#4
0
def test_broadcast():
    x = NDArray([1, 2, 3])
    y = NDArray([1, 2, 3])
    res = broadcast(x, y)