def getOperationInplaceAddShape(self, right_shape): """ Inplace add operation shape, for overload. """ if self.iadd_shapes: result = self.iadd_shapes.get(right_shape) if result is not None: return result else: right_shape_type = type(right_shape) if right_shape_type is ShapeLoopCompleteAlternative: return right_shape.getOperationBinaryAddLShape(self) if right_shape_type is ShapeLoopInitialAlternative: return operation_result_unknown onMissingOperation("IAdd", self, right_shape) return operation_result_unknown else: # By default, inplace add is the same as plain add, the # only exception known right now is list, which extend # from all iterables, but don't add with them. return self.getOperationBinaryAddShape(right_shape)
def _getComparisonLtShapeGeneric(cls, right_shape): if type(right_shape) is ShapeLoopCompleteAlternative: return right_shape.getComparisonLtLShape(cls) if type(right_shape) is ShapeLoopInitialAlternative: return operation_result_unknown onMissingOperation("Lt", cls, right_shape) return operation_result_unknown
def _getOperationBinaryAddShapeGeneric(cls, right_shape): if type(right_shape) is ShapeLoopCompleteAlternative: return right_shape.getOperationBinaryAddLShape(cls) if type(right_shape) is ShapeLoopInitialAlternative: return operation_result_unknown onMissingOperation("Add", cls, right_shape) return operation_result_unknown
def _getComparisonLtShapeGeneric(cls, right_shape): if type(right_shape) is ShapeLoopCompleteAlternative: return right_shape.getComparisonLtLShape(cls) if type(right_shape) is ShapeLoopInitialAlternative: return operation_result_unknown onMissingOperation("Lt", cls, right_shape) return operation_result_unknown
def _getOperationBinaryAddShapeGeneric(cls, right_shape): if type(right_shape) is ShapeLoopCompleteAlternative: return right_shape.getOperationBinaryAddLShape(cls) if type(right_shape) is ShapeLoopInitialAlternative: return operation_result_unknown onMissingOperation("Add", cls, right_shape) return operation_result_unknown
def getOperationBinaryMatMultShape(self, right_shape): result = self.matmult_shapes.get(right_shape) if result is not None: return result else: right_shape_type = type(right_shape) if right_shape_type is ShapeLoopCompleteAlternative: return right_shape.getOperationBinaryBitMatMultLShape(self) if right_shape_type is ShapeLoopInitialAlternative: return operation_result_unknown onMissingOperation("MatMult", self, right_shape) return operation_result_unknown
def getOperationBinaryDivmodShape(self, right_shape): result = self.divmod_shapes.get(right_shape) if result is not None: return result else: right_shape_type = type(right_shape) if right_shape_type is ShapeLoopCompleteAlternative: return right_shape.getOperationBinaryDivmodLShape(self) if right_shape_type is ShapeLoopInitialAlternative: return operation_result_unknown onMissingOperation("Divmod", self, right_shape) return operation_result_unknown
def getOperationBinaryAddShape(cls, right_shape): result = cls.add_shapes.get(right_shape) if result is not None: return result else: right_shape_type = type(right_shape) if right_shape_type is ShapeLoopCompleteAlternative: return right_shape.getOperationBinaryAddLShape(cls) if right_shape_type is ShapeLoopInitialAlternative: return operation_result_unknown onMissingOperation("Add", cls, right_shape) return operation_result_unknown
def getComparisonLtShape(self, right_shape): onMissingOperation("Lt", self, right_shape) return operation_result_unknown
def getComparisonLtShape(cls, right_shape): onMissingOperation("Lt", cls, right_shape) return ShapeUnknown, ControlFlowDescriptionFullEscape
def getOperationBinaryAddShape(cls, right_shape): onMissingOperation("Add", cls, right_shape) return ShapeUnknown, ControlFlowDescriptionFullEscape