Skip to content

Commit b048794

Browse files
committed
lstm: Remove several unused variables
This fixes compiler warnings. Signed-off-by: Stefan Weil <[email protected]>
1 parent a8f4441 commit b048794

File tree

4 files changed

+0
-9
lines changed

4 files changed

+0
-9
lines changed

lstm/lstmrecognizer.cpp

-4
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,6 @@ bool LSTMRecognizer::RecognizeLine(const ImageData& image_data, bool invert,
280280
OutputStats(*outputs, &pos_min, &pos_mean, &pos_sd);
281281
if (invert && pos_min < 0.5) {
282282
// Run again inverted and see if it is any better.
283-
float inv_scale;
284283
NetworkIO inv_inputs, inv_outputs;
285284
inv_inputs.set_int_mode(IsIntMode());
286285
SetRandomSeed();
@@ -460,7 +459,6 @@ void LSTMRecognizer::DisplayForward(const NetworkIO& inputs,
460459
const char* window_name,
461460
ScrollView** window) {
462461
#ifndef GRAPHICS_DISABLED // do nothing if there's no graphics
463-
int x_scale = network_->XScaleFactor();
464462
Pix* input_pix = inputs.ToPix();
465463
Network::ClearWindow(false, window_name, pixGetWidth(input_pix),
466464
pixGetHeight(input_pix), window);
@@ -595,7 +593,6 @@ void LSTMRecognizer::LabelsViaThreshold(const NetworkIO& output,
595593
int width = output.Width();
596594
int t = 0;
597595
// Skip any initial non-char.
598-
int label = null_char_;
599596
while (t < width && NullIsBest(output, null_thr, null_char_, t)) {
600597
++t;
601598
}
@@ -688,7 +685,6 @@ BLOB_CHOICE_LIST* LSTMRecognizer::GetBlobChoices(
688685
int col, int row, bool debug, const NetworkIO& output,
689686
const UNICHARSET* target_unicharset, int x_start, int x_end,
690687
float score_ratio) {
691-
int width = x_end - x_start;
692688
float rating = 0.0f, certainty = 0.0f;
693689
int label = output.BestChoiceOverRange(x_start, x_end, UNICHAR_SPACE,
694690
null_char_, &rating, &certainty);

lstm/lstmtrainer.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -827,7 +827,6 @@ Trainability LSTMTrainer::PrepareForBackward(const ImageData* trainingdata,
827827
return UNENCODABLE;
828828
}
829829
targets->Resize(*fwd_outputs, network_->NumOutputs());
830-
double text_error = 100.0;
831830
LossType loss_type = OutputLossType();
832831
if (loss_type == LT_SOFTMAX) {
833832
if (!ComputeTextTargets(*fwd_outputs, truth_labels, targets)) {

lstm/networkio.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -696,7 +696,6 @@ void NetworkIO::MaxpoolTimeStep(int dest_t, const NetworkIO& src, int src_t,
696696
void NetworkIO::MaxpoolBackward(const NetworkIO& fwd,
697697
const GENERIC_2D_ARRAY<int>& maxes) {
698698
ASSERT_HOST(!int_mode_);
699-
int width = fwd.Width();
700699
Zero();
701700
StrideMap::Index index(fwd.stride_map_);
702701
do {

lstm/parallel.cpp

-3
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@ void Parallel::Forward(bool debug, const NetworkIO& input,
8989
src_transpose = &transposed_input_;
9090
}
9191
// Run each network, putting the outputs into result.
92-
int input_offset = 0;
9392
int out_offset = 0;
9493
for (int i = 0; i < stack_size; ++i) {
9594
stack_[i]->Forward(debug, input, src_transpose, scratch, result);
@@ -126,7 +125,6 @@ bool Parallel::Backward(bool debug, const NetworkIO& fwd_deltas,
126125
out_deltas.init_to_size(stack_size, NetworkScratch::IO());
127126
// Split the forward deltas for each stack element.
128127
int feature_offset = 0;
129-
int out_offset = 0;
130128
for (int i = 0; i < stack_.size(); ++i) {
131129
int num_features = stack_[i]->NumOutputs();
132130
in_deltas[i].Resize(fwd_deltas, num_features, scratch);
@@ -153,7 +151,6 @@ bool Parallel::Backward(bool debug, const NetworkIO& fwd_deltas,
153151
// back_deltas.
154152
NetworkScratch::IO out_deltas;
155153
int feature_offset = 0;
156-
int out_offset = 0;
157154
for (int i = 0; i < stack_.size(); ++i) {
158155
int num_features = stack_[i]->NumOutputs();
159156
in_deltas->CopyUnpacking(fwd_deltas, feature_offset, num_features);

0 commit comments

Comments
 (0)