RestrictedAttentionComponent::PrecomputedIndexes Class Reference

#include <nnet-attention-component.h>

Inheritance diagram for RestrictedAttentionComponent::PrecomputedIndexes:
Collaboration diagram for RestrictedAttentionComponent::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 ()
- Public Member Functions inherited from ComponentPrecomputedIndexes
virtual ~ComponentPrecomputedIndexes ()

Public Attributes

time_height_convolution::ConvolutionComputationIo io

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 185 of file nnet-attention-component.h.

Constructor & Destructor Documentation

◆ PrecomputedIndexes() [1/2]

PrecomputedIndexes ( )

Definition at line 187 of file nnet-attention-component.h.

187 { }

◆ PrecomputedIndexes() [2/2]

◆ ~PrecomputedIndexes()

virtual ~PrecomputedIndexes ( )

Definition at line 196 of file nnet-attention-component.h.

196 { }

Member Function Documentation

◆ Copy()

◆ Read()

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

Implements ComponentPrecomputedIndexes.

Definition at line 661 of file

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

Referenced by RestrictedAttentionComponent::PrecomputedIndexes::PrecomputedIndexes().

662  {
663  ExpectOneOrTwoTokens(is, binary,
664  "<RestrictedAttentionComponentPrecomputedIndexes>",
665  "<Io>");
666  io.Read(is, binary);
667  ExpectToken(is, binary, "</RestrictedAttentionComponentPrecomputedIndexes>");
668 }
time_height_convolution::ConvolutionComputationIo io
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...
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

Implements ComponentPrecomputedIndexes.

Definition at line 193 of file nnet-attention-component.h.

193  {
194  return "RestrictedAttentionComponentPrecomputedIndexes";
195  }

◆ Write()

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

Implements ComponentPrecomputedIndexes.

Definition at line 653 of file

References kaldi::WriteToken().

Referenced by RestrictedAttentionComponent::PrecomputedIndexes::PrecomputedIndexes().

654  {
655  WriteToken(os, binary, "<RestrictedAttentionComponentPrecomputedIndexes>");
656  WriteToken(os, binary, "<Io>");
657  io.Write(os, binary);
658  WriteToken(os, binary, "</RestrictedAttentionComponentPrecomputedIndexes>");
659 }
time_height_convolution::ConvolutionComputationIo io
void WriteToken(std::ostream &os, bool binary, const char *token)
The WriteToken functions are for writing nonempty sequences of non-space characters.

Member Data Documentation

◆ io

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