DistributeComponentPrecomputedIndexes Class Reference

#include <nnet-general-component.h>

Inheritance diagram for DistributeComponentPrecomputedIndexes:
Collaboration diagram for DistributeComponentPrecomputedIndexes:

Public Member Functions

virtual ~DistributeComponentPrecomputedIndexes ()
 
virtual ComponentPrecomputedIndexesCopy () 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 ComponentPrecomputedIndexesReadNew (std::istream &is, bool binary)
 
static ComponentPrecomputedIndexesNewComponentPrecomputedIndexesOfType (const std::string &cpi_type)
 

Detailed Description

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

Constructor & Destructor Documentation

◆ ~DistributeComponentPrecomputedIndexes()

virtual ~DistributeComponentPrecomputedIndexes ( )
inlinevirtual

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

144 { }

Member Function Documentation

◆ Copy()

virtual ComponentPrecomputedIndexes* Copy ( ) const
inlinevirtual

Implements ComponentPrecomputedIndexes.

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

References DistributeComponent::Read(), and DistributeComponent::Write().

146  {
147  return new DistributeComponentPrecomputedIndexes(*this);
148  }

◆ Read()

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

Implements ComponentPrecomputedIndexes.

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

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

95  {
96  ExpectOneOrTwoTokens(istream, binary, "<DistributeComponentPrecomputedIndexes>", "<Pairs>");
97  ReadIntegerPairVector(istream, binary, &pairs);
98  ExpectToken(istream, binary, "</DistributeComponentPrecomputedIndexes>");
99 }
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
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: text-utils.cc:536
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

◆ Type()

virtual std::string Type ( ) const
inlinevirtual

Implements ComponentPrecomputedIndexes.

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

154 { return "DistributeComponentPrecomputedIndexes"; }

◆ Write()

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

Implements ComponentPrecomputedIndexes.

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

References 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

◆ pairs

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

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