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)
def test_broadcast(): x = NDArray([1,2,3]) y = NDArray([1,2,3]) res = broadcast(x,y)
def test_broadcast(): x = NDArray([1, 2, 3]) y = NDArray([1, 2, 3]) res = broadcast(x, y)