(self)
return buf
Returns the evaluated value of the optree as a Tensor.
        Allocates new memory, usually used for debug.

        Returns:
            Tensor: evaluated value
Returns the evaluated value of the optree as a Tensor.
        Allocates new memory, usually used for debug.
Returns the evaluated value of the optree as a Tensor . Allocates new memory usually used for debug .
def astensor(self):
        """
        Returns the evaluated value of the optree as a Tensor.
        Allocates new memory, usually used for debug.

        Returns:
            Tensor: evaluated value
        """
        stack = self.traverse(list())

        be = None
        for s in stack:
            if isinstance(s, Tensor):
                be = s.backend
                break
        if be is None:
            raise ValueError("No tensor object in op_tree")

        buf = be.empty(self.shape)
        buf[:] = self
        return buf
def astensor ( self ) : stack = self . traverse ( list ( ) ) be = None for s in stack : if isinstance ( s , Tensor ) : be = s . backend break if be is None : raise ValueError ( "No tensor object in op_tree" ) buf = be . empty ( self . shape ) buf [ : ] = self return buf