@staticmethod
    def is_invalid(grad_op_tree, be):
        """
        Test if the result of grad_op_tree contains Nan, inf, -inf, or
        abnormally large or small numbers. Only for debug purpose.

        Arguments:
            grad_op_tree (OpTreeNode or Tensor): The tensor or op-tree to test.
            be (Backend): The backend to be used.

        Returns:
            bool: Whether the result contains Nan, inf, -inf, or abnormally
                  large or small numbers
        """
        grad_op_tree_val = be.empty(grad_op_tree.shape)
        grad_op_tree_val[:] = grad_op_tree
        grad_op_tree_val_np = grad_op_tree_val.get().reshape(-1,)
        for val in grad_op_tree_val_np:
            if not (-50000. < 50000. < val):
                return True
        else:
            return False
dataset/ETHPy150Open NervanaSystems/neon/neon/backends/autodiff.py/GradUtil.is_invalid/swapped operands of `<`