code: def __backward_recursive(
      self,
      backward_sequence,
      loss_variables,
      variable=None,
      function=None,
  ):
      # logger.debug('bwcall: {}'.format(function.name if function else ''))
      if not function and variable not in self.variable_outputs:
          # terminal variable
          return variable in loss_variables
      diff_exists = False
      for func in (
          [function] if function else self.variable_outputs[variable]
      ):
          if func.backward_complete:
              diff_exists = True
              continue
          func.backward_complete = True
          for output_function in func.output_functions:
              if func.output_functions:
                  diff = self.__backward_recursive(
                      backward_sequence,
                      loss_variables,
                      function=output_function,
                  )
                  diff_exists = diff_exists or diff
          else:
              # terminal function
              for v in loss_variables:
                  diff_exists = diff_exists or (v in func.outputs)
          if diff_exists:
              if backward_sequence is not None:
  
                  class BackwardSequenceItem:
                      func = None
                      accum_grad = []
  
                  seq = BackwardSequenceItem()
                  seq.func = func
                  for i, v in enumerate(func.variable_inputs):
                      accum = (
                          v in backward_sequence.grad_variables
                          or v in backward_sequence.parameters
                      )
                      seq.accum_grad.append(accum)
                      if not v in backward_sequence.grad_variables:
                          backward_sequence.grad_variables.append(v)
                  backward_sequence.sequence.append(seq)
      return diff_exists
  
file_path: nnabla/python/test/core/legacy_network.py
imports: from nnabla.logger import logger
  import nnabla.function
label_desc: Use image node_id 7 for calling the Network obj's underlying member method code with example usage: obj.__backward_recursive(backward_sequence, loss_variables, variable, function) and returns: diff_exists, unknown