def _pow(self, o): if not isinstance(o, _valid_types): return NotImplemented if o == 2 and self.ufl_shape: return Inner(self, self) return Power(self, o)
def _rpow(self, o): if not isinstance(o, _valid_types): return NotImplemented return Power(o, self)
def _pow(self, o): if not isinstance(o, _valid_types): return NotImplemented if self.shape() and o == 2: return Inner(self, self) return Power(self, o)