GeneralDropoutComponentPrecomputedIndexes Class Reference

#include <nnet-general-component.h>

Inheritance diagram for GeneralDropoutComponentPrecomputedIndexes:
Collaboration diagram for GeneralDropoutComponentPrecomputedIndexes:

Public Member Functions

virtual ~GeneralDropoutComponentPrecomputedIndexes ()
 
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

int32 num_mask_rows
 
CuArray< int32indexes
 

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

Constructor & Destructor Documentation

◆ ~GeneralDropoutComponentPrecomputedIndexes()

virtual ~GeneralDropoutComponentPrecomputedIndexes ( )
inlinevirtual

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

980 { }

Member Function Documentation

◆ Copy()

ComponentPrecomputedIndexes* Copy ( ) const
inlinevirtual

Implements ComponentPrecomputedIndexes.

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

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

982  {
983  return new GeneralDropoutComponentPrecomputedIndexes(*this);
984  }

◆ Read()

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

Implements ComponentPrecomputedIndexes.

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

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

1878  {
1879  ExpectOneOrTwoTokens(is, binary,
1880  "<GeneralDropoutComponentPrecomputedIndexes>",
1881  "<NumMaskRows>");
1882  ReadBasicType(is, binary, &num_mask_rows);
1883  ExpectToken(is, binary, "<Indexes>");
1884  indexes.Read(is, binary);
1885  ExpectToken(is, binary,
1886  "</GeneralDropoutComponentPrecomputedIndexes>");
1887 }
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
static void ExpectToken(const std::string &token, const std::string &what_we_are_parsing, const std::string **next_token)
void Read(std::istream &is, bool binary)
I/O.
Definition: cu-array-inl.h:300

◆ Type()

virtual std::string Type ( ) const
inlinevirtual

Implements ComponentPrecomputedIndexes.

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

990  {
991  return "GeneralDropoutComponentPrecomputedIndexes";
992  }

◆ Write()

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

Implements ComponentPrecomputedIndexes.

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

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

1866  {
1867  WriteToken(os, binary,
1868  "<GeneralDropoutComponentPrecomputedIndexes>");
1869  WriteToken(os, binary, "<NumMaskRows>");
1870  WriteBasicType(os, binary, num_mask_rows);
1871  WriteToken(os, binary, "<Indexes>");
1872  indexes.Write(os, binary);
1873  WriteToken(os, binary,
1874  "</GeneralDropoutComponentPrecomputedIndexes>");
1875 }
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 Write(std::ostream &is, bool binary) const
Definition: cu-array-inl.h:307
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

◆ num_mask_rows


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