src/lstm/plumbing.cpp
bool Plumbing::SetupNeedsBackprop(bool needs_backprop) {
  if (IsTraining()) {
    needs_to_backprop_ = needs_backprop;
    bool retval = needs_backprop;
    for (auto &i : stack_) {
      if (i->SetupNeedsBackprop(needs_backprop)) {
        retval = true;
      }
    }
    return retval;
  }
  // Frozen networks don't do backprop.
  needs_to_backprop_ = false;
  return false;
}
// Sets needs_to_backprop_ to needs_backprop and calls on sub-network
// according to needs_backprop || any weights in this network.
Sets needs_to_backprop_ to needs_backprop and calls on sub-network
according to needs_backprop || any weights in this network.
Sets needs_to_backprop_ to needs_backprop and calls on sub - network according to needs_backprop || any weights in this network .
bool Plumbing::SetupNeedsBackprop(bool needs_backprop) {
  if (IsTraining()) {
    needs_to_backprop_ = needs_backprop;
    bool retval = needs_backprop;
    for (auto &i : stack_) {
      if (i->SetupNeedsBackprop(needs_backprop)) {
        retval = true;
      }
    }
    return retval;
  }
  needs_to_backprop_ = false;
  return false;
}
bool Plumbing :: SetupNeedsBackprop ( bool needs_backprop ) { if ( IsTraining ( ) ) { needs_to_backprop_ = needs_backprop ; bool retval = needs_backprop ; for ( auto & i : stack_ ) { if ( i -> SetupNeedsBackprop ( needs_backprop ) ) { retval = true ; } } return retval ; } needs_to_backprop_ = false ; return false ; }
Sets needs_to_backprop_ to needs_backprop and calls on sub-network
according to needs_backprop || any weights in this network.
Sets needs_to_backprop_ to needs_backprop and calls on sub - network according to needs_backprop || any weights in this network .
// Frozen networks don't do backprop.