parameters: (self, dy)
docstring: Args:
              dy (CTensor): the gradient tensor from upper operations
          Returns:
              a tuple for (*dx), dx is data for dL / dx.
docstring_summary: Args:
              dy (CTensor): the gradient tensor from upper operations
          Returns:
              a tuple for (*dx), dx is data for dL / dx.
docstring_tokens: Args : dy ( CTensor ) : the gradient tensor from upper operations Returns : a tuple for ( * dx ) dx is data for dL / dx .
function: def backward(self, dy):
          """
          Args:
              dy (CTensor): the gradient tensor from upper operations
          Returns:
              a tuple for (*dx), dx is data for dL / dx.
          """
          if self.l == 1:
              return self.masks[0][0]
          else:
              ret = []
              cumulation = None
              for mask0, mask1 in self.masks[::-1]:
                  if not cumulation:
                      ret.insert(0, mask1)
                      cumulation = mask0
                  else:
                      ret.insert(0, singa.__mul__(cumulation, mask1))
                      cumulation = singa.__mul__(cumulation, mask0)
              ret.insert(0, cumulation)
              return tuple(ret)
function_tokens: def backward ( self , dy ) : if self . l == 1 : return self . masks [ 0 ] [ 0 ] else : ret = [ ] cumulation = None for mask0 , mask1 in self . masks [ : : - 1 ] : if not cumulation : ret . insert ( 0 , mask1 ) cumulation = mask0 else : ret . insert ( 0 , singa . __mul__ ( cumulation , mask1 ) ) cumulation = singa . __mul__ ( cumulation , mask0 ) ret . insert ( 0 , cumulation ) return tuple ( ret )