Function sequant::opt::detail::leaf_volatile_mask

Function Documentation

inline std::size_t sequant::opt::detail::leaf_volatile_mask(TensorNetwork const &network, std::function<bool(Tensor const&)> const &is_volatile_leaf)

Bitmask of volatile leaf tensors in network.

Bit i is set if tensor i (in network.tensors() order) satisfies is_volatile_leaf. Returns 0 when the predicate is empty (no tensor is volatile, weighting disabled).

Parameters:
  • network – The TensorNetwork.

  • is_volatile_leaf – Predicate identifying volatile leaf tensors; may be empty.

Returns:

Bitmask with bit i set iff tensor i is a volatile leaf.