All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
DistributeComponentPrecomputedIndexes Class Reference

#include <nnet-general-component.h>

Inheritance diagram for DistributeComponentPrecomputedIndexes:
Collaboration diagram for DistributeComponentPrecomputedIndexes:

Public Member Functions

virtual ~DistributeComponentPrecomputedIndexes ()
 
virtual
ComponentPrecomputedIndexes
Copy () const
 
virtual void Write (std::ostream &ostream, bool binary) const
 
virtual void Read (std::istream &istream, bool binary)
 
virtual std::string Type () const
 
- Public Member Functions inherited from ComponentPrecomputedIndexes
virtual ~ComponentPrecomputedIndexes ()
 

Public Attributes

std::vector< std::pair< int32,
int32 > > 
pairs
 

Additional Inherited Members

- Static Public Member Functions inherited from ComponentPrecomputedIndexes
static
ComponentPrecomputedIndexes
ReadNew (std::istream &is, bool binary)
 
static
ComponentPrecomputedIndexes
NewComponentPrecomputedIndexesOfType (const std::string &cpi_type)
 

Detailed Description

Definition at line 133 of file nnet-general-component.h.

Constructor & Destructor Documentation

virtual ~DistributeComponentPrecomputedIndexes ( )
inlinevirtual

Definition at line 144 of file nnet-general-component.h.

144 { }

Member Function Documentation

virtual ComponentPrecomputedIndexes* Copy ( ) const
inlinevirtual

Implements ComponentPrecomputedIndexes.

Definition at line 146 of file nnet-general-component.h.

146  {
147  return new DistributeComponentPrecomputedIndexes(*this);
148  }
void Read ( std::istream &  istream,
bool  binary 
)
virtual

Implements ComponentPrecomputedIndexes.

Definition at line 95 of file nnet-general-component.cc.

References kaldi::nnet3::ExpectOneOrTwoTokens(), kaldi::nnet3::ExpectToken(), DistributeComponentPrecomputedIndexes::pairs, and kaldi::ReadIntegerPairVector().

95  {
96  ExpectOneOrTwoTokens(istream, binary, "<DistributeComponentPrecomputedIndexes>", "<Pairs>");
97  ReadIntegerPairVector(istream, binary, &pairs);
98  ExpectToken(istream, binary, "</DistributeComponentPrecomputedIndexes>");
99 }
void ExpectOneOrTwoTokens(std::istream &is, bool binary, const std::string &token1, const std::string &token2)
This function is like ExpectToken but for two tokens, and it will either accept token1 and then token...
Definition: nnet-parse.cc:224
void ReadIntegerPairVector(std::istream &is, bool binary, std::vector< std::pair< T, T > > *v)
Function for reading STL vector of pairs of integer types.
Definition: io-funcs-inl.h:131
static void ExpectToken(const std::string &token, const std::string &what_we_are_parsing, const std::string **next_token)
std::vector< std::pair< int32, int32 > > pairs
virtual std::string Type ( ) const
inlinevirtual

Implements ComponentPrecomputedIndexes.

Definition at line 154 of file nnet-general-component.h.

154 { return "DistributeComponentPrecomputedIndexes"; }
void Write ( std::ostream &  ostream,
bool  binary 
) const
virtual

Implements ComponentPrecomputedIndexes.

Definition at line 88 of file nnet-general-component.cc.

References DistributeComponentPrecomputedIndexes::pairs, kaldi::WriteIntegerPairVector(), and kaldi::WriteToken().

88  {
89  WriteToken(ostream, binary, "<DistributeComponentPrecomputedIndexes>");
90  WriteToken(ostream, binary, "<Pairs>");
91  WriteIntegerPairVector(ostream, binary, pairs);
92  WriteToken(ostream, binary, "</DistributeComponentPrecomputedIndexes>");
93 }
void WriteIntegerPairVector(std::ostream &os, bool binary, const std::vector< std::pair< T, T > > &v)
Function for writing STL vectors of pairs of integer types.
Definition: io-funcs-inl.h:93
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
std::vector< std::pair< int32, int32 > > pairs

Member Data Documentation


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