(grad_node)
return (left_increment, right_increment)
Get left and right gradient increments from back-propagation.

        Arguments:
            grad_node (GradNode): The GradNode to perform gradient
                                  back-propagation on.
Get left and right gradient increments from back-propagation.
Get left and right gradient increments from back - propagation .
def get_grad_back(grad_node):
        """
        Get left and right gradient increments from back-propagation.

        Arguments:
            grad_node (GradNode): The GradNode to perform gradient
                                  back-propagation on.
        """
        if not grad_node:
            return None
        # dissemble node
        x = grad_node.left.op_tree if grad_node.left else None
        y = grad_node.right.op_tree if grad_node.right else None
        z = grad_node.op_tree
        dz = grad_node.grad_op_tree
        op_dict = z[0]
        be = grad_node.ad.be
        # get element-wise gradient increments
        op = grad_node.op_tree[0]['op']
        grad_increments = grad_map[op](x, y, z, dz, op_dict, be)
        # unbroacat to input dimensions
        left_increment = GradUtil._unbroadcast(grad_increments[0], x, be)
        right_increment = GradUtil._unbroadcast(grad_increments[1], y, be)

        return (left_increment, right_increment)
def get_grad_back ( grad_node ) : if not grad_node : return None # dissemble node x = grad_node . left . op_tree if grad_node . left else None y = grad_node . right . op_tree if grad_node . right else None z = grad_node . op_tree dz = grad_node . grad_op_tree op_dict = z [ 0 ] be = grad_node . ad . be # get element-wise gradient increments op = grad_node . op_tree [ 0 ] [ 'op' ] grad_increments = grad_map [ op ] ( x , y , z , dz , op_dict , be ) # unbroacat to input dimensions left_increment = GradUtil . _unbroadcast ( grad_increments [ 0 ] , x , be ) right_increment = GradUtil . _unbroadcast ( grad_increments [ 1 ] , y , be ) return ( left_increment , right_increment )