NnetChainExampleStructureCompare Struct Reference

This comparator object compares just the structural aspects of the NnetChainExample without looking at the value of the features. More...

#include <nnet-chain-example.h>

Public Member Functions

bool operator() (const NnetChainExample &a, const NnetChainExample &b) const
 
bool operator() (const NnetChainExample *a, const NnetChainExample *b) const
 

Detailed Description

This comparator object compares just the structural aspects of the NnetChainExample without looking at the value of the features.

Definition at line 152 of file nnet-chain-example.h.

Member Function Documentation

◆ operator()() [1/2]

bool operator() ( const NnetChainExample a,
const NnetChainExample b 
) const

Definition at line 417 of file nnet-chain-example.cc.

References rnnlm::i, NnetChainExample::inputs, and NnetChainExample::outputs.

419  {
420  NnetIoStructureCompare io_compare;
421  if (a.inputs.size() != b.inputs.size() ||
422  a.outputs.size() != b.outputs.size())
423  return false;
424  size_t size = a.inputs.size();
425  for (size_t i = 0; i < size; i++)
426  if (!io_compare(a.inputs[i], b.inputs[i]))
427  return false;
428  size = a.outputs.size();
429  for (size_t i = 0; i < size; i++)
430  if (a.outputs[i].name != b.outputs[i].name ||
431  a.outputs[i].indexes != b.outputs[i].indexes)
432  return false;
433  return true;
434 }

◆ operator()() [2/2]

bool operator() ( const NnetChainExample a,
const NnetChainExample b 
) const
inline

Definition at line 156 of file nnet-chain-example.h.

References kaldi::nnet3::GetChainComputationRequest(), kaldi::nnet3::MergeChainExamples(), and kaldi::nnet3::ShiftChainExampleTimes().

157  {
158  return (*this)(*a, *b);
159  }

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