TdnnComponent::PrecomputedIndexes Class Reference

#include <nnet-convolutional-component-temp.h>

Inheritance diagram for TdnnComponent::PrecomputedIndexes:
Collaboration diagram for TdnnComponent::PrecomputedIndexes:

Public Member Functions

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

Public Attributes

int32 row_stride
 
std::vector< int32row_offsets
 

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 527 of file nnet-convolutional-component-temp.h.

Constructor & Destructor Documentation

◆ PrecomputedIndexes() [1/4]

PrecomputedIndexes ( )
inline

Definition at line 529 of file nnet-convolutional-component-temp.h.

529 { }

◆ PrecomputedIndexes() [2/4]

◆ ~PrecomputedIndexes() [1/2]

virtual ~PrecomputedIndexes ( )
inlinevirtual

Definition at line 538 of file nnet-convolutional-component-temp.h.

538 { }

◆ PrecomputedIndexes() [3/4]

PrecomputedIndexes ( )
inline

Definition at line 529 of file nnet-convolutional-component.h.

529 { }

◆ PrecomputedIndexes() [4/4]

◆ ~PrecomputedIndexes() [2/2]

virtual ~PrecomputedIndexes ( )
inlinevirtual

Definition at line 538 of file nnet-convolutional-component.h.

538 { }

Member Function Documentation

◆ Copy() [1/2]

TdnnComponent::PrecomputedIndexes * Copy ( ) const
virtual

◆ Copy() [2/2]

virtual PrecomputedIndexes* Copy ( ) const
virtual

◆ Read() [1/2]

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

◆ Read() [2/2]

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

Implements ComponentPrecomputedIndexes.

Definition at line 689 of file nnet-tdnn-component.cc.

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

690  {
691  ExpectOneOrTwoTokens(is, binary,
692  "<TdnnComponentPrecomputedIndexes>",
693  "<RowStride>");
694  ReadBasicType(is, binary, &row_stride);
695  ExpectToken(is, binary, "<RowOffsets>");
696  ReadIntegerVector(is, binary, &row_offsets);
697  ExpectToken(is, binary, "</TdnnComponentPrecomputedIndexes>");
698 }
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 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() [1/2]

virtual std::string Type ( ) const
inlinevirtual

Implements ComponentPrecomputedIndexes.

Definition at line 535 of file nnet-convolutional-component-temp.h.

535  {
536  return "TdnnComponentPrecomputedIndexes";
537  }

◆ Type() [2/2]

virtual std::string Type ( ) const
inlinevirtual

Implements ComponentPrecomputedIndexes.

Definition at line 535 of file nnet-convolutional-component.h.

535  {
536  return "TdnnComponentPrecomputedIndexes";
537  }

◆ Write() [1/2]

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

◆ Write() [2/2]

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

Implements ComponentPrecomputedIndexes.

Definition at line 679 of file nnet-tdnn-component.cc.

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

680  {
681  WriteToken(os, binary, "<TdnnComponentPrecomputedIndexes>");
682  WriteToken(os, binary, "<RowStride>");
683  WriteBasicType(os, binary, row_stride);
684  WriteToken(os, binary, "<RowOffsets>");
685  WriteIntegerVector(os, binary, row_offsets);
686  WriteToken(os, binary, "</TdnnComponentPrecomputedIndexes>");
687 }
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

◆ row_offsets

◆ row_stride


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