class_docstr: A node in grad_tree. A GradNode contains the op_optree and the grad_op_tree
  at this location of the grad_tree, and it also has pointers to the left and
  right child in the grad_tree.
class_docstr_tok: ["A","node","in","grad_tree",".","A","GradNode","contains","the","op_optree","and","the","grad_op_tree","at","this","location","of","the","grad_tree",",","and","it","also","has","pointers","to","the","left","and","right","child","in","the","grad_tree","."]
docstr: Actually back-propagate the gradient.
docstr_tok: ["Actually","back-propagate","the","gradient","."]
code: def build_grad(self):
      """
      Actually back-propagate the gradient.
      """
      # self.grad_op_tree shall be set by ad or parent grad_node
      assert self.grad_op_tree is not None
  
      if type(self.op_tree) == OpTreeNode:
          # get increment
          (left_increment, right_increment) = GradUtil.get_grad_back(
              self
          )
  
          # left increment
          if self.left.grad_op_tree is None:
              self.left.grad_op_tree = left_increment
          else:
              self.left.grad_op_tree = (
                  self.left.grad_op_tree + left_increment
              )
  
          # left recursive
          self.left.build_grad()
  
          # check if right increment
          if right_increment is None:
              return
  
          # right increment
          if self.right.grad_op_tree is None:
              self.right.grad_op_tree = right_increment
          else:
              self.right.grad_op_tree = (
                  self.right.grad_op_tree + right_increment
              )
  
          # right recursive
          self.right.build_grad()
  
      elif isinstance(self.op_tree, Tensor):
          self.ad.map_tensor_grad_op_tree[
              self.op_tree._original_base
          ] = self.grad_op_tree
  
imports: from __future__ import division
  from builtins import object, zip
  from neon.backends.backend import OpTreeNode, Tensor
  import numpy
  from functools import wraps
label_desc: Use image node_id 4 for calling the GradNode obj's underlying member method code with example usage: obj.build_grad() without return types