def __call__(self, ina, out=None): in1 = asarray(ina) if out is None: out1 = in1._clone(in1._shape) else: out1 = out _applyObjects1(self.func, in1, out1) if out is None: return _fix_rank0(out1)
def _applyObjects1(f, in1, out): """_applyObjects2() applies function 'f' elementwise to inputs 'in1' and 'in2', storing the result in 'out'.""" if isinstance(in1, ObjectArray) and len(in1._shape) > 1: for i in xrange(len(in1)): _applyObjects1(f, in1[i], out[i]) else: for i in xrange(len(in1)): out[i] = f(in1[i])