def getShape(self): shape = [] for arg in self.args: s = expressions.getShape(arg) if s is None: return None shape.append(s[0]) return shape
def getShape(self): s = expressions.LazyFunction.getShape(self) if s is None: return None newshape = [] for n,l in zip(expressions.LazyFunction.getDimensions(self),s): if n not in self.kwargs: newshape.append(l) else: argshape = expressions.getShape(self.kwargs[n]) assert argshape is not None and len(argshape)<=1,'Interpolation locations must be 0d scalars or 1d arrays' if not argshape: newshape.append(1) else: newshape.append(argshape[0]) return newshape
def __init__(self,data,coords=None): expressions.LazyFunction.__init__(self,self.__class__.__name__,None,data,coords=coords) self.shape = expressions.getShape(self.args[0]) self.var = common.Variable(None)