NnetComputation::MatrixDebugInfo Struct Reference

#include <nnet-computation.h>

Collaboration diagram for NnetComputation::MatrixDebugInfo:

Public Member Functions

 MatrixDebugInfo ()
void Swap (MatrixDebugInfo *other)
void Read (std::istream &istream, bool binary)
void Write (std::ostream &ostream, bool binary) const

Public Attributes

bool is_deriv
std::vector< Cindexcindexes

Detailed Description

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

Constructor & Destructor Documentation

◆ MatrixDebugInfo()

MatrixDebugInfo ( )

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

Member Function Documentation

◆ Read()

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

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

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

181  {
182  ExpectToken(is, binary, "<MatrixDebugInfo>");
183  ExpectToken(is, binary, "<IsDeriv>");
184  ReadBasicType(is, binary, &is_deriv);
185  ExpectToken(is, binary, "<Cindexes>");
186  ReadCindexVector(is, binary, &cindexes);
187  ExpectToken(is, binary, "</MatrixDebugInfo>");
188 }
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
void ReadCindexVector(std::istream &is, bool binary, std::vector< Cindex > *vec)
Definition: nnet-common.cc:309
static void ExpectToken(const std::string &token, const std::string &what_we_are_parsing, const std::string **next_token)

◆ Swap()

void Swap ( NnetComputation::MatrixDebugInfo other)

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

References NnetComputation::MatrixDebugInfo::cindexes, NnetComputation::MatrixDebugInfo::is_deriv, and kaldi::swap().

176  {
177  std::swap(is_deriv, other->is_deriv);
178  cindexes.swap(other->cindexes);
179 }
void swap(basic_filebuf< CharT, Traits > &x, basic_filebuf< CharT, Traits > &y)

◆ Write()

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

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

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

190  {
191  WriteToken(os, binary, "<MatrixDebugInfo>");
192  if (!binary) os << std::endl;
193  WriteToken(os, binary, "<IsDeriv>");
194  WriteBasicType(os, binary, is_deriv);
195  if (!binary) os << std::endl;
196  WriteToken(os, binary, "<Cindexes>");
197  WriteCindexVector(os, binary, cindexes);
198  if (!binary) os << std::endl;
199  WriteToken(os, binary, "</MatrixDebugInfo>");
200  if (!binary) os << std::endl;
201 }
void WriteCindexVector(std::ostream &os, bool binary, const std::vector< Cindex > &vec)
Definition: nnet-common.cc:282
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

◆ cindexes

◆ is_deriv

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