コード例 #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)