NnetComputation::SubMatrixInfo Struct Reference

#include <nnet-computation.h>

Collaboration diagram for NnetComputation::SubMatrixInfo:

Public Member Functions

 SubMatrixInfo ()
 
 SubMatrixInfo (int32 matrix_index, int32 row_offset, int32 num_rows, int32 col_offset, int32 num_cols)
 
void Read (std::istream &istream, bool binary)
 
void Write (std::ostream &ostream, bool binary) const
 
bool operator== (const SubMatrixInfo &other) const
 

Public Attributes

int32 matrix_index
 
int32 row_offset
 
int32 num_rows
 
int32 col_offset
 
int32 num_cols
 

Detailed Description

Definition at line 323 of file nnet-computation.h.

Constructor & Destructor Documentation

◆ SubMatrixInfo() [1/2]

SubMatrixInfo ( )
inline

Definition at line 329 of file nnet-computation.h.

329 { }

◆ SubMatrixInfo() [2/2]

Member Function Documentation

◆ operator==()

◆ Read()

void Read ( std::istream &  istream,
bool  binary 
)

Definition at line 203 of file nnet-computation.cc.

References kaldi::nnet3::ExpectToken(), and kaldi::ReadBasicType().

203  {
204  ExpectToken(is, binary, "<SubMatrixInfo>");
205  ExpectToken(is, binary, "<MatrixIndex>");
206  ReadBasicType(is, binary, &matrix_index);
207  ExpectToken(is, binary, "<RowOffset>");
208  ReadBasicType(is, binary, &row_offset);
209  ExpectToken(is, binary, "<NumRows>");
210  ReadBasicType(is, binary, &num_rows);
211  ExpectToken(is, binary, "<ColOffset>");
212  ReadBasicType(is, binary, &col_offset);
213  ExpectToken(is, binary, "<NumCols>");
214  ReadBasicType(is, binary, &num_cols);
215  ExpectToken(is, binary, "</SubMatrixInfo>");
216 }
void ReadBasicType(std::istream &is, bool binary, T *t)
ReadBasicType is the name of the read function for bool, integer types, and floating-point types...
Definition: io-funcs-inl.h:55
static void ExpectToken(const std::string &token, const std::string &what_we_are_parsing, const std::string **next_token)

◆ Write()

void Write ( std::ostream &  ostream,
bool  binary 
) const

Definition at line 218 of file nnet-computation.cc.

References kaldi::WriteBasicType(), and kaldi::WriteToken().

218  {
219  WriteToken(os, binary, "<SubMatrixInfo>");
220  if (!binary) os << std::endl;
221  WriteToken(os, binary, "<MatrixIndex>");
222  WriteBasicType(os, binary, matrix_index);
223  WriteToken(os, binary, "<RowOffset>");
224  WriteBasicType(os, binary, row_offset);
225  WriteToken(os, binary, "<NumRows>");
226  WriteBasicType(os, binary, num_rows);
227  WriteToken(os, binary, "<ColOffset>");
228  WriteBasicType(os, binary, col_offset);
229  WriteToken(os, binary, "<NumCols>");
230  WriteBasicType(os, binary, num_cols);
231  if (!binary) os << std::endl;
232  WriteToken(os, binary, "</SubMatrixInfo>");
233  if (!binary) os << std::endl;
234 }
void WriteToken(std::ostream &os, bool binary, const char *token)
The WriteToken functions are for writing nonempty sequences of non-space characters.
Definition: io-funcs.cc:134
void WriteBasicType(std::ostream &os, bool binary, T t)
WriteBasicType is the name of the write function for bool, integer types, and floating-point types...
Definition: io-funcs-inl.h:34

Member Data Documentation

◆ col_offset

◆ matrix_index

◆ num_cols

◆ num_rows

◆ row_offset


The documentation for this struct was generated from the following files: