Template Function sequant::opt::detail::map_leaf_objects¶
Defined in File name_recycling.hpp
Function Documentation¶
-
template<typename Visitor>
ExprPtr sequant::opt::detail::map_leaf_objects(const ExprPtr &leaf, Visitor &&visitor)¶ Invokes
visitoron every Tensor and Variable that is (or is the base of) the terminal expressionleaf. Ifvisitorreturns a non-null ExprPtr, it replaces the visited object.
An adjoint-marked tensor is visited in its bare (non-adjoint) form and the replacement is adjointed again.
- Returns:
The (potentially new) expression representing
leaf