18 #ifndef TESSERACT_LSTM_STRIDEMAP_H_ 19 #define TESSERACT_LSTM_STRIDEMAP_H_ 52 : stride_map_(&stride_map) {
59 int t()
const {
return t_; }
63 memset(indices_, 0,
sizeof(indices_));
89 void InitToLastOfBatch(
int batch);
91 void SetTFromIndices();
102 memset(shape_, 0,
sizeof(shape_));
103 memset(t_increments_, 0,
sizeof(t_increments_));
108 void SetStride(
const std::vector<std::pair<int, int>>& h_w_pairs);
110 void ScaleXY(
int x_factor,
int y_factor);
122 void ComputeTIncrements();
130 std::vector<int> heights_;
132 std::vector<int> widths_;
137 #endif // TESSERACT_LSTM_STRIDEMAP_H_
Index(const StrideMap &stride_map, int batch, int y, int x)
void SetStride(const std::vector< std::pair< int, int >> &h_w_pairs)
Index(const StrideMap &stride_map)
bool AddOffset(int offset, FlexDimensions dimension)
bool IsLast(FlexDimensions dimension) const
int MaxIndexOfDim(FlexDimensions dim) const
int Size(FlexDimensions dimension) const
int index(FlexDimensions dimension) const
void ScaleXY(int x_factor, int y_factor)