boundlab.diff.topk_pruning#

boundlab.diff.topk_pruning(scores, data, k, dim=-1)[source]#

Mock top-k pruning: network 2 keeps the k highest-scoring positions.

Eagerly this evaluates the pruned network, topk_mask(scores) * data.