17#ifndef TESSERACT_LSTM_STRIDEMAP_H_
18#define TESSERACT_LSTM_STRIDEMAP_H_
50 : stride_map_(&stride_map) {
57 int t()
const {
return t_; }
61 memset(indices_, 0,
sizeof(indices_));
87 void InitToLastOfBatch(
int batch);
89 void SetTFromIndices();
100 memset(shape_, 0,
sizeof(shape_));
101 memset(t_increments_, 0,
sizeof(t_increments_));
106 void SetStride(
const std::vector<std::pair<int, int>>& h_w_pairs);
108 void ScaleXY(
int x_factor,
int y_factor);
120 void ComputeTIncrements();
128 std::vector<int> heights_;
130 std::vector<int> widths_;
int Size(FlexDimensions dimension) const
void ScaleXY(int x_factor, int y_factor)
void SetStride(const std::vector< std::pair< int, int > > &h_w_pairs)
int index(FlexDimensions dimension) const
bool AddOffset(int offset, FlexDimensions dimension)
bool IsLast(FlexDimensions dimension) const
Index(const StrideMap &stride_map, int batch, int y, int x)
int MaxIndexOfDim(FlexDimensions dim) const
Index(const StrideMap &stride_map)