SpecAugmentTimeMaskComponentPrecomputedIndexes Class Reference

#include <nnet-general-component.h>

Inheritance diagram for SpecAugmentTimeMaskComponentPrecomputedIndexes:
Collaboration diagram for SpecAugmentTimeMaskComponentPrecomputedIndexes:

Public Member Functions

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

Public Attributes

std::vector< std::vector< int32 > > indexes
 
int32 tot_size
 

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 1084 of file nnet-general-component.h.

Constructor & Destructor Documentation

◆ ~SpecAugmentTimeMaskComponentPrecomputedIndexes()

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

1099 { }

Member Function Documentation

◆ Copy()

ComponentPrecomputedIndexes* Copy ( ) const
inlinevirtual

Implements ComponentPrecomputedIndexes.

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

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

1101  {
1102  return new SpecAugmentTimeMaskComponentPrecomputedIndexes(*this);
1103  }

◆ Read()

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

Implements ComponentPrecomputedIndexes.

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

References kaldi::ExpectOneOrTwoTokens(), kaldi::nnet3::ExpectToken(), rnnlm::i, kaldi::ReadBasicType(), and kaldi::ReadIntegerVector().

2109  {
2110  ExpectOneOrTwoTokens(is, binary,
2111  "<SpecAugmentTimeMaskComponentPrecomputedIndexes>",
2112  "<Indexes>");
2113  int32 size;
2114  ReadBasicType(is, binary, &size);
2115  indexes.clear();
2116  indexes.resize(size);
2117  for (int32 i = 0; i < size; i++)
2118  ReadIntegerVector(is, binary, &(indexes[i]));
2119  ExpectToken(is, binary,
2120  "</SpecAugmentTimeMaskComponentPrecomputedIndexes>");
2121  tot_size = 0;
2122  for (auto v : indexes) tot_size += v.size();
2123 }
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
kaldi::int32 int32
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
void ReadIntegerVector(std::istream &is, bool binary, std::vector< T > *v)
Function for reading STL vector of integer types.
Definition: io-funcs-inl.h:232
static void ExpectToken(const std::string &token, const std::string &what_we_are_parsing, const std::string **next_token)

◆ Type()

virtual std::string Type ( ) const
inlinevirtual

Implements ComponentPrecomputedIndexes.

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

1109  {
1110  return "SpecAugmentTimeMaskComponentPrecomputedIndexes";
1111  }

◆ Write()

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

Implements ComponentPrecomputedIndexes.

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

References rnnlm::i, kaldi::WriteBasicType(), kaldi::WriteIntegerVector(), and kaldi::WriteToken().

2095  {
2096  WriteToken(os, binary,
2097  "<SpecAugmentTimeMaskComponentPrecomputedIndexes>");
2098  WriteToken(os, binary, "<Indexes>");
2099  int32 size = indexes.size();
2100  WriteBasicType(os, binary, size);
2101  for (int32 i = 0; i < size; i++) {
2102  WriteIntegerVector(os, binary, indexes[i]);
2103  }
2104  WriteToken(os, binary,
2105  "</SpecAugmentTimeMaskComponentPrecomputedIndexes>");
2106 }
kaldi::int32 int32
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 WriteIntegerVector(std::ostream &os, bool binary, const std::vector< T > &v)
Function for writing STL vectors of integer types.
Definition: io-funcs-inl.h:198
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

◆ indexes

std::vector<std::vector<int32> > indexes

◆ tot_size


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