def make_apply(inputs, op, outputs): """ Turn a unidag job (from tompkins) into a theano apply node """ if not iterable(outputs): outputs = (outputs, ) inputs = tuple(map(lambda x: x.clone(), inputs)) outputs = tuple(map(lambda x: x.clone(), outputs)) return theano.Apply(op, inputs, outputs)
def test_iterable(): assert iterable([1, 2]) assert not iterable(3)
def test_iterable(): assert iterable([1,2]) assert not iterable(3)