src/lstm/lstm.cpp
bool LSTM::Serialize(TFile *fp) const {
  if (!Network::Serialize(fp)) {
    return false;
  }
  if (!fp->Serialize(&na_)) {
    return false;
  }
  for (int w = 0; w < WT_COUNT; ++w) {
    if (w == GFS && !Is2D()) {
      continue;
    }
    if (!gate_weights_[w].Serialize(IsTraining(), fp)) {
      return false;
    }
  }
  if (softmax_ != nullptr && !softmax_->Serialize(fp)) {
    return false;
  }
  return true;
}
// Writes to the given file. Returns false in case of error.
Writes to the given file. Returns false in case of error.
Writes to the given file . Returns false in case of error .
bool LSTM::Serialize(TFile *fp) const {
  if (!Network::Serialize(fp)) {
    return false;
  }
  if (!fp->Serialize(&na_)) {
    return false;
  }
  for (int w = 0; w < WT_COUNT; ++w) {
    if (w == GFS && !Is2D()) {
      continue;
    }
    if (!gate_weights_[w].Serialize(IsTraining(), fp)) {
      return false;
    }
  }
  if (softmax_ != nullptr && !softmax_->Serialize(fp)) {
    return false;
  }
  return true;
}
bool LSTM :: Serialize ( TFile * fp ) const { if ( ! Network :: Serialize ( fp ) ) { return false ; } if ( ! fp -> Serialize ( & na_ ) ) { return false ; } for ( int w = 0 ; w < WT_COUNT ; ++ w ) { if ( w == GFS && ! Is2D ( ) ) { continue ; } if ( ! gate_weights_ [ w ] . Serialize ( IsTraining ( ) , fp ) ) { return false ; } } if ( softmax_ != nullptr && ! softmax_ -> Serialize ( fp ) ) { return false ; } return true ; }
Writes to the given file.
Writes to the given file .