raiseValueError('Shape mismatch: "out" should have shape starting with %s (plus %i extra dimensions), but the value produced by "perform" has shape %s'\
%(shape,self.ndim_added,rval.shape))
out[0]=rval
defgrad(self,inputs,outputs):
return[Noneforiininputs]
def_infer_ndim(ndim,shape):
"""returns int, variable pair, such that the int is the length of the variable, and the
variable is an integer or uint vector
def_infer_ndim(ndim,shape,*args):
"""
Infer the number of dimensions from the shape or the other arguments.
:rtype: (int, variable) pair, where the variable is an integer vector.
:returns: the first element returned is the inferred number of dimensions.
The second element's length is either the first element, or 0
(if the original shape was None).
In the special case where the shape argument is None, the variable
returned has a length of 0, meaning that the shape will be computed
at runtime from the shape of the other args.
"""
# Find the minimum value of ndim required by the *args