CindexSet Class Reference

#include <nnet-computation-graph.h>

Collaboration diagram for CindexSet:

Public Member Functions

bool operator() (const Cindex &cindex) const
 Parenthesis operator; returns true if this cindex exists in the set. More...
 
 CindexSet (const ComputationGraph &graph)
 with this constructor, represents the set of all Cindexes that exist in the graph. More...
 
 CindexSet (const ComputationGraph &graph, const std::vector< ComputationGraphBuilder::CindexInfo > &info, bool treat_unknown_as_computable)
 with this constructor, represents the set of all Cindexes that exist in the graph and which are computable. More...
 

Private Attributes

const ComputationGraphgraph_
 
const std::vector< ComputationGraphBuilder::CindexInfo > * info_
 
bool treat_unknown_as_computable_
 

Detailed Description

Definition at line 297 of file nnet-computation-graph.h.

Constructor & Destructor Documentation

◆ CindexSet() [1/2]

CindexSet ( const ComputationGraph graph)

with this constructor, represents the set of all Cindexes that exist in the graph.

Definition at line 1466 of file nnet-computation-graph.cc.

1466  :
1467  graph_(graph), info_(NULL) { }
const std::vector< ComputationGraphBuilder::CindexInfo > * info_
const ComputationGraph & graph_

◆ CindexSet() [2/2]

CindexSet ( const ComputationGraph graph,
const std::vector< ComputationGraphBuilder::CindexInfo > &  info,
bool  treat_unknown_as_computable 
)

with this constructor, represents the set of all Cindexes that exist in the graph and which are computable.

If treat_unknown_as_computable is true then we consider kComputable, kUnknown and kWillNotCompute to be computable; else we consider just nodes that are kComputable to be computable.

Definition at line 1469 of file nnet-computation-graph.cc.

1471  :
1472  graph_(graph), info_(&info),
1473  treat_unknown_as_computable_(treat_unknown_as_computable) { }
const std::vector< ComputationGraphBuilder::CindexInfo > * info_
const ComputationGraph & graph_

Member Function Documentation

◆ operator()()

bool operator() ( const Cindex cindex) const

Parenthesis operator; returns true if this cindex exists in the set.

Definition at line 1476 of file nnet-computation-graph.cc.

References ComputationGraph::GetCindexId(), CindexSet::graph_, CindexSet::info_, ComputationGraphBuilder::kComputable, ComputationGraphBuilder::kUnknown, and CindexSet::treat_unknown_as_computable_.

1476  {
1477  int32 cindex_id = graph_.GetCindexId(cindex);
1478  if (cindex_id == -1) {
1479  return false;
1480  } else {
1481  if (info_ == NULL) {
1482  return true;
1483  } else {
1485  c = (*info_)[cindex_id].computable;
1486  return (c == ComputationGraphBuilder::kComputable ||
1489  }
1490  }
1491 }
const std::vector< ComputationGraphBuilder::CindexInfo > * info_
kaldi::int32 int32
int32 GetCindexId(const Cindex &cindex, bool is_input, bool *is_new)
Maps a Cindex to an integer cindex_id.
const ComputationGraph & graph_

Member Data Documentation

◆ graph_

const ComputationGraph& graph_
private

Definition at line 315 of file nnet-computation-graph.h.

Referenced by CindexSet::operator()().

◆ info_

const std::vector<ComputationGraphBuilder::CindexInfo>* info_
private

Definition at line 316 of file nnet-computation-graph.h.

Referenced by CindexSet::operator()().

◆ treat_unknown_as_computable_

bool treat_unknown_as_computable_
private

Definition at line 317 of file nnet-computation-graph.h.

Referenced by CindexSet::operator()().


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