示例#1
0
文件: graph.py 项目: pelson/blaze
    def simple_type(self):
        # If the operator is a simple type return then the App of
        # it is also has simple_type, or it raises NotSimple.

        ty = self.operator.simple_type()
        if coretypes.is_simple(ty):
            return ty
        else:
            raise NotSimple()
示例#2
0
文件: graph.py 项目: garfee/blaze
    def simple_type(self):
        # If the operator is a simple type return then the App of
        # it is also has simple_type, or it raises NotSimple.

        ty = self.operator.simple_type()
        if coretypes.is_simple(ty):
            return ty
        else:
            raise NotSimple()
示例#3
0
文件: graph.py 项目: pelson/blaze
    def simple_type(self):
        """ If possible determine the datashape before we even
        hit eval(). This is possible only for simple types.

        Possible::

            2, 2, int32

        Example Not Possible::
            X, 2, int32

        """
        # Get the the simple types for each of the operands.
        if not all(coretypes.is_simple(op.simple_type()) for op in self.operands if op is not None):
            raise NotSimple()
        else:
            return coretypes.promote(*self.operands)
示例#4
0
文件: graph.py 项目: garfee/blaze
    def simple_type(self):
        """ If possible determine the datashape before we even
        hit eval(). This is possible only for simple types.

        Possible::

            2, 2, int32

        Example Not Possible::
            X, 2, int32

        """
        # Get the the simple types for each of the operands.
        if not all(
                coretypes.is_simple(op.simple_type())
                for op in self.operands if op is not None):
            raise NotSimple()
        else:
            return coretypes.promote(*self.operands)