Template Function sequant::opt::cse::count_tensors_if_persistent¶
Defined in File common_subexpression_elimination.hpp
Function Documentation¶
-
template<typename TreeNode>
bool sequant::opt::cse::count_tensors_if_persistent(const TreeNode &node, const std::function<bool(const TreeNode&)> &is_volatile_leaf, std::size_t &num_tensors)¶ Adds the number of tensor leaves of
nodetonum_tensorsand returns whether none of its leaves satisfiesis_volatile_leaf. Note that the traversal stops at the first volatile leaf.