Skip to content

Commit

Permalink
Fix some compiler warnings for unused parameters
Browse files Browse the repository at this point in the history
Signed-off-by: Stefan Weil <sw@weilnetz.de>
  • Loading branch information
stweil committed Oct 30, 2021
1 parent 20203de commit 57af712
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/lstm/input.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class Input : public Network {
}
// Returns the shape output from the network given an input shape (which may
// be partially unknown ie zero).
StaticShape OutputShape(const StaticShape &input_shape) const override {
StaticShape OutputShape([[maybe_unused]] const StaticShape &input_shape) const override {
return shape_;
}
// Writes to the given file. Returns false in case of error.
Expand Down
2 changes: 1 addition & 1 deletion src/lstm/network.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ void Network::SetNetworkFlags(uint32_t flags) {

// Sets up the network for training. Initializes weights using weights of
// scale `range` picked according to the random number generator `randomizer`.
int Network::InitWeights(float range, TRand *randomizer) {
int Network::InitWeights([[maybe_unused]] float range, TRand *randomizer) {
randomizer_ = randomizer;
return 0;
}
Expand Down
8 changes: 4 additions & 4 deletions src/lstm/network.h
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ class TESS_API Network {
// output from code_map[output] where non-negative, and uses the mean (over
// all outputs) of the existing weights for all outputs with negative code_map
// entries. Returns the new number of weights.
virtual int RemapOutputs(int old_no, const std::vector<int> &code_map) {
virtual int RemapOutputs([[maybe_unused]] int old_no, [[maybe_unused]] const std::vector<int> &code_map) {
return 0;
}

Expand Down Expand Up @@ -216,7 +216,7 @@ class TESS_API Network {

// Provides the (minimum) x scale factor to the network (of interest only to
// input units) so they can determine how to scale bounding boxes.
virtual void CacheXScaleFactor(int factor) {}
virtual void CacheXScaleFactor([[maybe_unused]] int factor) {}

// Provides debug output on the weights.
virtual void DebugWeights() = 0;
Expand All @@ -231,11 +231,11 @@ class TESS_API Network {
public:
// Updates the weights using the given learning rate, momentum and adam_beta.
// num_samples is used in the adam computation iff use_adam_ is true.
virtual void Update(float learning_rate, float momentum, float adam_beta, int num_samples) {}
virtual void Update([[maybe_unused]] float learning_rate, [[maybe_unused]] float momentum, [[maybe_unused]] float adam_beta, [[maybe_unused]] int num_samples) {}
// Sums the products of weight updates in *this and other, splitting into
// positive (same direction) in *same and negative (different direction) in
// *changed.
virtual void CountAlternators(const Network &other, TFloat *same, TFloat *changed) const {}
virtual void CountAlternators([[maybe_unused]] const Network &other, [[maybe_unused]] TFloat *same, [[maybe_unused]] TFloat *changed) const {}

// Reads from the given file. Returns nullptr in case of error.
// Determines the type of the serialized class and calls its DeSerialize
Expand Down

0 comments on commit 57af712

Please sign in to comment.